-
Notifications
You must be signed in to change notification settings - Fork 87
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, core, conductor): pass oracle data to rollup via execution API #1840
Conversation
…or third injected tx
…tendedCommitInfoWithCurrencyPairMapping
@@ -458,7 +461,8 @@ impl Executor { | |||
))] | |||
async fn execute_firm(&mut self, block: ReconstructedBlock) -> eyre::Result<()> { | |||
let celestia_height = block.celestia_height; | |||
let executable_block = ExecutableBlock::from_reconstructed(block); | |||
let executable_block = ExecutableBlock::from_reconstructed(block) | |||
.wrap_err("failed to construct executable block")?; |
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 should not fail. Reconstructed blocks should be completely valid blocks. Nothing that reaches the execution task should be invalid.
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.
updated to be infallible - no oracle data is added to the txs if it can't be constructed.
@@ -697,23 +701,44 @@ struct ExecutableBlock { | |||
} | |||
|
|||
impl ExecutableBlock { | |||
fn from_reconstructed(block: ReconstructedBlock) -> Self { | |||
fn from_reconstructed(block: ReconstructedBlock) -> eyre::Result<Self> { |
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 should not be fallible.
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.
same as above
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.
One tiny nitpick, otherwise LGTM.
votes: vec![], | ||
} | ||
.into(); | ||
let extended_commit_info_with_mapping = astria_core::generated::protocol::connect::v1::ExtendedCommitInfoWithCurrencyPairMapping { |
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 think the formatting is off here due to the line length. Maybe you could import astria_core::generated::protocol::connect::v1::ExtendedCommitInfoWithCurrencyPairMapping
to fix this?
Summary
update conductor to pass oracle data to rollup via execution API.
Background
this is the final change needed within the astria monorepo for the oracle integration, as the oracle data is now fully passed up the stack. handling the oracle data is now left up to each rollup.
Changes
OracleData
variant to theRollupData
enum, which contains aVec<Price>
, where eachPrice
contains the relevant oracle data for a currency pair for that blockExtendedCommitInfoWithCurrencyPairMapping
such that the id->currency pair mapping also contains the decimals for that currency pair's price; this is necessary information that I overlooked in the previous PR creating that typeFilteredSequencerBlock
SequencerBlock
,FilteredSequencerBlock
andSubmittedMetadata
constructors such that the extended commit info bytes must be a valid encoded protobufExtendedCommitInfoWithCurrencyPairMapping
RollupData::OracleData
to the rollup via the execution APITesting
unit tests
Related Issues
closes #1818