-
Notifications
You must be signed in to change notification settings - Fork 82
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): add market map actions #1882
base: feat/oracle
Are you sure you want to change the base?
Conversation
crates/astria-core/src/protocol/transaction/v1/action/group/mod.rs
Outdated
Show resolved
Hide resolved
crates/astria-sequencer/src/action_handler/impls/remove_markets.rs
Outdated
Show resolved
Hide resolved
crates/astria-sequencer/src/action_handler/impls/update_params.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, only a few minor comments!
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.
Reviewed only the protos so far.
…kets'. Removed upsert markets
…ons' into eoroshiba/market_map_actions
@@ -40,28 +56,19 @@ impl ActionHandler for PriceFeed { | |||
} | |||
|
|||
async fn check_and_execute<S: StateWrite>(&self, state: S) -> Result<()> { | |||
// TODO: should we use the market map admin here, or a different admin? |
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.
Noting that this needed to be moved into the enum variants' check_and_execute
functions, since ChangeMarkets
validates against Params.market_authorities
and UpdateMarketMapParams
against sudo
.
Summary
Added select market map actions here to the sequencer.
Background
These actions were needed for support for keeping a
MarketMap
in state and making changes to it as part of the oracle feature. They follow Skip's logic and apply it to our state machine.ChangeMarkets
Takes a list of markets and either creates, updates, or removes them depending on its variant. Must be signed by an address included in the market map params'
market_authorities
.Ticker.currency_pair
). If no market map is found, or any market is missing a counterpart in the map, this action will err.UpdateParams
Updates the market map
Params
, which contains the market authority addresses as well as an admin address. This will execute whether there are params in the state already or not. Must be signed by the sequencer network authority sudo address.Changes
ChangeMarkets
andUpdateParams
toPriceFeed
action in proto, core, and sequencer.Testing
Breaking Changelist
ALICE_ADDRESS
to market authorities in testinggenesis
, breaking two more snapshots.