regen-ledger icon indicating copy to clipboard operation
regen-ledger copied to clipboard

Use of target in MsgBridge and support for multiple chains

Open ryanchristo opened this issue 2 years ago • 0 comments

Summary

In the initial implementation of bridge functionality, we only support bridging credits from polygon to regen, and only credits that have been bridged to regen from polygon can be bridged back to polygon. A credit batch on regen has a 1-to-1 relationship with a contract on polygon through the use of the BatchContract table, which stores the contract provided in OriginTx when calling MsgBridgeReceive, and from which contract is retrieved when calling MsgBridge.

When we removed contract from MsgBridge (no longer requiring the user to know the destination contract and ensuring the credits are bridged back to the same contract), we decided to keep target (even though the only supported target at this time is polygon) because of unknowns around future support for bridging credits to and from multiple chains and because requiring the user to explicitly set target helps in preventing a potential user input error when providing a recipient address.

No changes are necessary at this time but we should be tracking the use of target in MsgBridge when working on the next iteration of features and improvements for bridge functionality, specifically when working on features and functionality that would allow credits to be bridged to regen from one source and then to a new target.


For Admin Use

  • [ ] Not duplicate issue
  • [ ] Appropriate labels applied
  • [ ] Appropriate contributors tagged
  • [ ] Contributor assigned/self-assigned

ryanchristo avatar Jul 28 '22 18:07 ryanchristo