Skip to content

Execution API should use the RollupId primitive #1287

@SuperFluffy

Description

@SuperFluffy

The primitives protobuf spec defines a type astria.primitives.v1.RollupId which is used in most other protobuf specs. However,
astria.execution.v1alpha2.GenesisInfo.rollup_id was overlooked and it is still of type bytes. astria.execution.v1alpha2.GenesisInfo should be updated in terms of it, as well as its corresponding domain type constructor, astria_core::execution::v1alpha2::RollupId::try_from_raw_raw.

Note that this will likely also affect https://github.com/astriaorg/astria-geth in its GenesisInfo constructor.

Links into the monorepo



fn try_from_raw_ref(raw: &Self::Raw) -> Result<Self, Self::Error> {
let raw::GenesisInfo {
rollup_id,
sequencer_genesis_block_height,
celestia_block_variance,
} = raw;
let rollup_id =
RollupId::try_from_slice(rollup_id).map_err(Self::Error::incorrect_rollup_id_length)?;
Ok(Self {
rollup_id,
sequencer_genesis_block_height: (*sequencer_genesis_block_height).into(),
celestia_block_variance: *celestia_block_variance,
})

Corresponding line in astria-geth

https://github.com/astriaorg/astria-geth/blob/e89845ec26ef5bdb2de51603fc3caabe081acf6a/grpc/execution/server.go#L162-L166

Metadata

Metadata

Assignees

Labels

good-first-issueGood for newcomersprotopertaining to the Astria Protobuf spec

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions