-
Notifications
You must be signed in to change notification settings - Fork 75
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): store currency pair id mapping along with committed extended commit info #1832
base: feat/oracle
Are you sure you want to change the base?
Conversation
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 looks correct to me, but I'd like to see a test for the new validation functionality provided by validate_id_to_currency_pair_mapping
. However, as discussed offline, this is probably best done on top of the noot/more-tests
branch where there are a bunch of other fixes and additional tests, so I'm fine to merge this, then prioritise adding the test into that branch and opening a PR.
let extended_commit_info = ExtendedCommitInfo::try_from( | ||
<astria_vendored::tendermint::abci::ExtendedCommitInfo as Into< | ||
tendermint_proto::abci::ExtendedCommitInfo, | ||
>>::into(extended_commit_info), | ||
) |
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.
let extended_commit_info = ExtendedCommitInfo::try_from( | |
<astria_vendored::tendermint::abci::ExtendedCommitInfo as Into< | |
tendermint_proto::abci::ExtendedCommitInfo, | |
>>::into(extended_commit_info), | |
) | |
let extended_commit_info = ExtendedCommitInfo::try_from( | |
tendermint_proto::abci::ExtendedCommitInfo::from(extended_commit_info), | |
) |
#[must_use] | ||
pub fn extended_commit_info(&self) -> &ExtendedCommitInfo { | ||
&self.extended_commit_info | ||
} | ||
|
||
#[must_use] | ||
pub fn id_to_currency_pair(&self) -> &IndexMap<CurrencyPairId, CurrencyPair> { | ||
&self.id_to_currency_pair | ||
} |
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'd remove these two getters as the struct's fields are public.
Summary
the price data posted by validators is of the form currency pair ID -> price, however when this is sent to a rollup there is then no way to determine the ID -> actual currency pair without referencing the sequencer state. this is non ideal as we don't want to have to perform lookups using a sequencer node for the oracle data.
Background
see above
Changes
ExtendedCommitInfoWithCurrencyPairMapping
type which containsExtendedCommitInfo
(as previous) as well as the ID->currency pair mapping for the price data inside thatExtendedCommitInfo
ExtendedCommitInfoWithCurrencyPairMapping
is then used as the third injected tx in the block, whereas before it was justExtendedCommitInfo
process_proposal
Testing
unit tests + CI tests
Related Issues
required for #1818