Skip to content
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

Open
wants to merge 4 commits into
base: feat/oracle
Choose a base branch
from

Conversation

ethanoroshiba
Copy link
Contributor

@ethanoroshiba ethanoroshiba commented Dec 18, 2024

Summary

Added 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.

UpsertMarkets

Takes a list of markets and either updates them if they are already in the market map, or creates them if they are not. If no market map is found, one will be created. Must be signed by an address included in the market map params' market_authorities.

CreateMarkets

Takes a list of markets and creates them in the market map. If any already exist, this will err. If no market map is found, one will be created. Must be signed by an address included in the market map params' market_authorities.

UpdateMarkets

Takes a list of markets and updates them in the market map (matching based on Ticker.currency_pair). If no market map is found, or any market is missing a counterpart in the map, this will err. Must be signed by an address included in the market map params' market_authorities.

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.

RemoveMarketAuthorities

Takes a list of addresses and removes them from the market authorities. If an address does not exist in market_authorities, it will be ignored. Must be signed by the market map admin (as defined in the market map Params).

RemoveMarkets

Takes a list of markets and removes them from the market map. If a market is not found in the map, it will be ignored. Must be signed by an address included in the market map params' market_authorities.

Changes

  • Added UpsertMarkets, CreateMarkets, UpdateMarkets, UpdateParams, RemoveMarketAuthorities, and RemoveMarkets to proto, core, and sequencer.

Testing

  • Added fairly exhaustive unit tests to each action's implementation module.
  • Added app execution test for each action for more high-level testing.
  • Added each action to all action snapshot.

Breaking Changelist

  • Added new actions which break app hash due to adding new information to state.
  • Added ALICE_ADDRESS to market authorities in testing genesis, breaking two more snapshots.

@github-actions github-actions bot added proto pertaining to the Astria Protobuf spec sequencer pertaining to the astria-sequencer crate labels Dec 18, 2024
@ethanoroshiba ethanoroshiba marked this pull request as ready for review December 18, 2024 15:30
@ethanoroshiba ethanoroshiba requested review from a team and joroshiba as code owners December 18, 2024 15:30
Copy link
Collaborator

@noot noot left a 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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
proto pertaining to the Astria Protobuf spec sequencer pertaining to the astria-sequencer crate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants