feat(sequencer)!: allow configuring base address prefix#1201
feat(sequencer)!: allow configuring base address prefix#1201SuperFluffy merged 41 commits intomainfrom
Conversation
5efa37c to
3c67150
Compare
| Ok(Action::BridgeUnlock(action)) | ||
| } | ||
|
|
||
| // FIXME: Get this to work for now, but replace this with a builder. |
There was a problem hiding this comment.
i'm refactoring/removing this function in my next PR, so this is fine to leave
crates/astria-bridge-withdrawer/src/bridge_withdrawer/submitter/signer.rs
Outdated
Show resolved
Hide resolved
joroshiba
left a comment
There was a problem hiding this comment.
A general note on composer & withdrawer is that we could get the prefix from genesis fetch.
Some nits through out but mostly looks good, didn't comment on each repeat but the stateless checks all just say "invalid" when they are specifically invalid because of wrong prefix.
Note that the ibc name stuff seems unrelated, is that artifact from other work?
...quencer/src/accounts/snapshots/astria_sequencer__accounts__state_ext__test__snapshots-2.snap
Show resolved
Hide resolved
crates/astria-sequencer/src/bridge/bridge_sudo_change_action.rs
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
This and the other snapshots have changed because the base prefix is now written to app storage.
| # NOTE - the following address matches the privKey that funds the sequencer-faucet | ||
| - address: 00d75b270542084a54fcf0d0f6eab0402982d156 | ||
| balance: "333333333333333333" | ||
| - address: 1c0c490f1b5528d8173c5de46d131160e4b2c0c3 |
There was a problem hiding this comment.
just to confirm - does the genesis support both hex and bech32 now?
There was a problem hiding this comment.
So the chart is indifferent, when you run in dev mode it builds the old genesis that is intended to work with the latest release. When you run in dev mode it builds the new genesis which works on this PR and latest after this is merged.
There was a problem hiding this comment.
Yeah to chime in: this is only for CI. The sequencer genesis itself only supports proper bech32m addresses.
| Ok(()) | ||
| } | ||
|
|
||
| #[cfg(not(test))] |
There was a problem hiding this comment.
Can we get a follow up issue?
|
@joroshiba #1208 for a follow-up for the |
Updates chart to use a helper and use single value instead of double value setup.
cf7437d to
435c9ac
Compare
Summary
This patch allows configuring the base address prefix in sequencer's genesis file and enforces this prefix in all actions.
Similar to the native fee, the base prefix is set once during
init-chainand is then available globally and never changed.Background
#1124 changed astria addresses from opaque bytes to bech32m addresses, which themselves are encoded as strings on the wire. Where previously sequencer implicitly assumed that all addresses were
"astria"prefixed bech32m addresses, this is now enforced.Changes
GenesisStateto use the canonical serde implementation of allastria-coretypes..address_prefixes.baseto theGenesisState.GenesisStateare consistenst with the prefix.astria.primitive.v1.core.Address(this is done viaAppHandler::check_stateless). These are specifically:TransferActionSudoAddressChangeActionBridgeLockActionBridgeSudoChangeActionBridgeUnlockActionInitBridgeAccountActionIbcRelayerChangeActionaccounts::state_ext,bridge::state_ext,ibc::state_ext)ASTRIA_BRIDGE_WITHDRAWER_SEQUENCER_ADDRESS_PREFIXASTRIA_COMPOSER_SEQUENCER_ADDRESS_PREFIXastria-clicommands to take a configurable prefix.Testing
Breaking Changelist
This change is breaking at the network level requiring sequencer re-genesis. Non-bech32m addresses in actions are now rejected, as well as addresses that have a prefix other then the one set at genesis. In addition, the storage key for all collections involving an address have changed.