-
Notifications
You must be signed in to change notification settings - Fork 86
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
feat(sequencer)!: allow configuring base address prefix #1201
Conversation
5efa37c
to
3c67150
Compare
@@ -119,6 +122,8 @@ fn event_to_bridge_unlock( | |||
Ok(Action::BridgeUnlock(action)) | |||
} | |||
|
|||
// FIXME: Get this to work for now, but replace this with a builder. |
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.
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
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.
looks good to me!
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.
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
Outdated
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just to confirm - does the genesis support both hex and bech32 now?
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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-chain
and 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
GenesisState
to use the canonical serde implementation of allastria-core
types..address_prefixes.base
to theGenesisState
.GenesisState
are consistenst with the prefix.astria.primitive.v1.core.Address
(this is done viaAppHandler::check_stateless
). These are specifically:TransferAction
SudoAddressChangeAction
BridgeLockAction
BridgeSudoChangeAction
BridgeUnlockAction
InitBridgeAccountAction
IbcRelayerChangeAction
accounts::state_ext
,bridge::state_ext
,ibc::state_ext
)ASTRIA_BRIDGE_WITHDRAWER_SEQUENCER_ADDRESS_PREFIX
ASTRIA_COMPOSER_SEQUENCER_ADDRESS_PREFIX
astria-cli
commands 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.