-
Notifications
You must be signed in to change notification settings - Fork 343
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support cosmos contract byte lengths other than 32 #3147
Conversation
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🙏
Co-authored-by: Daniel Savu <[email protected]>
…-network/abacus-monorepo into trevor/add-contract-address-bytes
… trevor/add-contract-address-bytes
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #3147 +/- ##
=======================================
Coverage 67.18% 67.18%
=======================================
Files 101 101
Lines 1021 1021
Branches 106 106
=======================================
Hits 686 686
Misses 291 291
Partials 44 44
|
… trevor/add-contract-address-bytes
### Description fixes hyperlane-xyz#3143 Initially went down a path that would use protocol-specific types for addresses as suggested by hyperlane-xyz#3143. I had made a `HyperlaneConnectionConf` enum with protocol-specific variants whose values were `addresses: CoreContractAddresses<ProtocolSpecificAddressType>` and `connection: ProtocolSpecificConnectionConf`. This worked pretty well until I hit the ISM logic. Because hyperlane-core is where the Mailbox trait is defined, the return type of `recipient_ism` in the trait cannot involve protocol specific types. It can't be moved to hyperlane-base because hyperlane-base imports the chain crates, so we'd have a cyclic dependency. I experimented with moving away from H256 to something like a Vec<u8> or string, but this felt a bit weird. In the end we decided to keep H256s as the global representation for contract addresses for now, with the intent of eventually changing this, and to support the varying length situation in a cosmos config ### Drive-by changes - Added some cosmos specific agent configurations into the sdk - Moved to bech32_prefix in the agents for consistency with what the SDK's chain metadata already does - I guess no one's ran cargo test in a while so vectors/message.json got a new v3 message lol ### Related issues Fixes hyperlane-xyz#3143 ### Backward compatibility Changes prefix to bech32_prefix in the agent config, and now requires `contractAddressBytes` ### Testing Tested merged with hyperlane-xyz#3144 and all worked --------- Co-authored-by: Daniel Savu <[email protected]>
Description
fixes #3143
Initially went down a path that would use protocol-specific types for addresses as suggested by #3143. I had made a
HyperlaneConnectionConf
enum with protocol-specific variants whose values wereaddresses: CoreContractAddresses<ProtocolSpecificAddressType>
andconnection: ProtocolSpecificConnectionConf
. This worked pretty well until I hit the ISM logic.Because hyperlane-core is where the Mailbox trait is defined, the return type of
recipient_ism
in the trait cannot involve protocol specific types. It can't be moved to hyperlane-base because hyperlane-base imports the chain crates, so we'd have a cyclic dependency. I experimented with moving away from H256 to something like a Vec or string, but this felt a bit weird.In the end we decided to keep H256s as the global representation for contract addresses for now, with the intent of eventually changing this, and to support the varying length situation in a cosmos config
Drive-by changes
Related issues
Fixes #3143
Backward compatibility
Changes prefix to bech32_prefix in the agent config, and now requires
contractAddressBytes
Testing
Tested merged with #3144 and all worked