-
Notifications
You must be signed in to change notification settings - Fork 75
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(proto, core, sequencer)!: permit bech32 compatible addresses (#1425
) ## Summary Enables bech32 compatible addresses when necessary. ## Background Some IBC enabled chains enforce that ics20 transfer packets must contain bech32 compatible only (see #1407 for more background). This patch adds a `ibc_compat` prefix to sequencer's genesis and a new field `bool Ics20Withdrawal.use_compat_address` to the withdrawal action to request a bech32 compatible address format when interacting with such chains. ## Changes - Add field `astria.protocol.transactions.v1alpha1.Ics20Withdrawal.use_compat_address` - Add field `astria.protocol.genesis.v1alpha1.AddressPrefixes.ibc_compat` - Rewrite the `Address` domain type to be generic over the format; this allows bech32 and bech32m addresses when parsing and formatting - Note that all Astria domain types containing addresses now require `Address<Bech32m>` with `Bech32m` also being set as the default type is the parameter is absent - this now enforces that all Astria addresses in Astria's domain types *must* be bech32m compatible (this was not enforced before because `bech32::decode` does not enforce either checksum as of `[email protected]`). - When executing an `astria.protocol.transactions.v1alpha1.Ics20Withdrawal` with field `use_compat_address == true`, sequencer will now construct a bech32 compatible address using the value stored at `prefixes/ibc-compat` in its state. - When refunding a rollup due to a failed withdrawal, sequencer will now attempt to parse the sender as either a standard (non-compat) bech32m address, or a compat bech32 address. - If a compat bech32 address was found during a refund, sequencer will convert it to a bech32m address with its base prefix for further processing. This ensures that the compat addresses are only ever constructed for outgoing and incoming fungible token packets. ## Testing + Updated sequencer tests for ics20 refunds for both compat and base/non-compat senders. + Updated all snapshot tests + Added a snapshot test for `Address<Bech32>` + Added unit tests for address parsing (to ensure that bech32 addresses cannot be parsaed as bech32m and vice versa) + Updated chart sequencer genesis to run smoke tests + IBC tests for noble are still work in progress and outside the scope of this PR. ## Breaking Changelist - Sequencer gained a new genesis value (the ibc compat prefix), changing the app hash ## Related Issues Closes #1407
- Loading branch information
1 parent
e9d5f0f
commit 0ed3c19
Showing
35 changed files
with
846 additions
and
332 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
crates/astria-core/src/generated/astria.protocol.genesis.v1alpha1.rs
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
18 changes: 18 additions & 0 deletions
18
crates/astria-core/src/generated/astria.protocol.genesis.v1alpha1.serde.rs
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
5 changes: 5 additions & 0 deletions
5
crates/astria-core/src/generated/astria.protocol.transactions.v1alpha1.rs
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
18 changes: 18 additions & 0 deletions
18
crates/astria-core/src/generated/astria.protocol.transactions.v1alpha1.serde.rs
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.