-
Notifications
You must be signed in to change notification settings - Fork 97
fix(proto)!: Change execution API to use primitive RollupId #1291
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
Changes from all commits
6091b7b
d0aae63
a9ab197
73c4852
91421dd
a0b23c5
9f0e164
cbfe459
7190743
ec206b6
0b19858
294466f
91af5b4
8b77110
4e70f49
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -19,12 +19,18 @@ impl GenesisInfoError { | |
| fn incorrect_rollup_id_length(inner: IncorrectRollupIdLength) -> Self { | ||
| Self(GenesisInfoErrorKind::IncorrectRollupIdLength(inner)) | ||
| } | ||
|
|
||
| fn no_rollup_id() -> Self { | ||
| Self(GenesisInfoErrorKind::NoRollupId) | ||
| } | ||
| } | ||
|
|
||
| #[derive(Debug, thiserror::Error)] | ||
| enum GenesisInfoErrorKind { | ||
| #[error("`rollup_id` field did not contain a valid rollup ID")] | ||
| #[error("`rollup_id` field contained an invalid rollup ID")] | ||
| IncorrectRollupIdLength(IncorrectRollupIdLength), | ||
| #[error("`rollup_id` was not set")] | ||
| NoRollupId, | ||
| } | ||
|
|
||
| /// Genesis Info required from a rollup to start an execution client. | ||
|
|
@@ -81,8 +87,11 @@ impl Protobuf for GenesisInfo { | |
| sequencer_genesis_block_height, | ||
| celestia_block_variance, | ||
| } = raw; | ||
| let Some(rollup_id) = rollup_id else { | ||
| return Err(Self::Error::no_rollup_id()); | ||
| }; | ||
| let rollup_id = | ||
| RollupId::try_from_slice(rollup_id).map_err(Self::Error::incorrect_rollup_id_length)?; | ||
| RollupId::try_from_raw(rollup_id).map_err(Self::Error::incorrect_rollup_id_length)?; | ||
|
|
||
| Ok(Self { | ||
| rollup_id, | ||
|
|
@@ -104,7 +113,7 @@ impl Protobuf for GenesisInfo { | |
| under the hood", | ||
| ); | ||
| Self::Raw { | ||
| rollup_id: Bytes::copy_from_slice(rollup_id.as_ref()), | ||
| rollup_id: Some(rollup_id.to_raw()), | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Note that there is also
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Got it! So for future reference if something is not a shared object then
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'll note that this is within a |
||
| sequencer_genesis_block_height, | ||
| celestia_block_variance: *celestia_block_variance, | ||
| } | ||
|
|
||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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 double-checking -- is this tag for all of development intentional?
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.
Was intentional since this PR is dependent on
astria-geth#38. @joroshiba suggested waiting until this PR merges, updating geth PR with latest protos and merging, then making a monorepo cleanup PR to updatedevTagtolatest.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, because we have proto changes here that needs geth update, it gets a little weird here:
A bit of chicken/egg problem here. My preference is to keep astria-geth main from relying on non-main protos. We should wait to submit PR here until pr-38 is reviewed and approved though so we don't end up out of sync.