From 50ffab0a706c9fafba03ccc19d4f0f9a09b1533d Mon Sep 17 00:00:00 2001 From: Richard Janis Goldschmidt Date: Wed, 8 May 2024 12:40:55 +0200 Subject: [PATCH] replace Celestia*Blob nomenclature by Submitted* --- crates/astria-conductor/src/block_cache.rs | 4 +- .../src/celestia/block_verifier.rs | 6 +- .../astria-conductor/src/celestia/convert.rs | 76 +- .../src/celestia/reconstruct.rs | 14 +- .../astria-conductor/src/celestia/verify.rs | 16 +- .../tests/blackbox/helpers/mod.rs | 20 +- .../astria.sequencerblock.v1alpha1.rs | 63 +- .../astria.sequencerblock.v1alpha1.serde.rs | 1274 ++++++++--------- .../src/sequencerblock/v1alpha1/block.rs | 10 +- .../src/sequencerblock/v1alpha1/celestia.rs | 173 ++- .../src/sequencerblock/v1alpha1/mod.rs | 4 +- .../src/relayer/write/conversion.rs | 49 +- .../sequencerblock/v1alpha1/celestia.proto | 49 +- 13 files changed, 886 insertions(+), 872 deletions(-) diff --git a/crates/astria-conductor/src/block_cache.rs b/crates/astria-conductor/src/block_cache.rs index 14477c5f0c..ead4d7fc0a 100644 --- a/crates/astria-conductor/src/block_cache.rs +++ b/crates/astria-conductor/src/block_cache.rs @@ -6,7 +6,7 @@ use std::{ use astria_core::sequencerblock::v1alpha1::{ block::FilteredSequencerBlock, - CelestiaHeader, + SubmittedMetadata, }; use pin_project_lite::pin_project; use sequencer_client::tendermint::block::Height; @@ -21,7 +21,7 @@ impl GetSequencerHeight for FilteredSequencerBlock { } } -impl GetSequencerHeight for CelestiaHeader { +impl GetSequencerHeight for SubmittedMetadata { fn get_height(&self) -> Height { self.height() } diff --git a/crates/astria-conductor/src/celestia/block_verifier.rs b/crates/astria-conductor/src/celestia/block_verifier.rs index d4711b5a38..aebf592b2d 100644 --- a/crates/astria-conductor/src/celestia/block_verifier.rs +++ b/crates/astria-conductor/src/celestia/block_verifier.rs @@ -225,7 +225,7 @@ mod test { primitive::v1::RollupId, sequencerblock::v1alpha1::{ block::SequencerBlockHeader, - celestia::UncheckedCelestiaSequencerBlob, + celestia::UncheckedSubmittedMetadata, }, }; use prost::Message as _; @@ -343,7 +343,7 @@ mod test { }; let header = SequencerBlockHeader::try_from_raw(header).unwrap(); - let sequencer_blob = UncheckedCelestiaSequencerBlob { + let sequencer_blob = UncheckedSubmittedMetadata { block_hash: [0u8; 32], header, rollup_ids: vec![], @@ -388,7 +388,7 @@ mod test { }; let header = SequencerBlockHeader::try_from_raw(header).unwrap(); - let sequencer_blob = UncheckedCelestiaSequencerBlob { + let sequencer_blob = UncheckedSubmittedMetadata { block_hash: [0u8; 32], header, rollup_ids: vec![rollup_id], diff --git a/crates/astria-conductor/src/celestia/convert.rs b/crates/astria-conductor/src/celestia/convert.rs index 8b6a39184f..6ffe387e38 100644 --- a/crates/astria-conductor/src/celestia/convert.rs +++ b/crates/astria-conductor/src/celestia/convert.rs @@ -1,16 +1,16 @@ use astria_core::{ brotli::decompress_bytes, generated::sequencerblock::v1alpha1::{ - CelestiaHeaderList, - CelestiaRollupDataList, + SubmittedMetadataList, + SubmittedRollupDataList, }, sequencerblock::v1alpha1::{ celestia::{ - CelestiaRollupBlobError, - CelestiaSequencerBlobError, + SubmittedMetadataError, + SubmittedRollupDataError, }, - CelestiaHeader, - CelestiaRollupData, + SubmittedMetadata, + SubmittedRollupData, }, }; use celestia_types::{ @@ -69,76 +69,76 @@ pub(super) fn decode_raw_blobs( converted_blobs } -/// An unsorted [`CelestiaSequencerBlob`] and [`CelestiaRollupBlob`]. +/// An unsorted [`SubmittedMetadata`] and [`SubmittedRollupData`]. pub(super) struct ConvertedBlobs { celestia_height: u64, - headers: Vec, - rollup_data_entries: Vec, + metadata: Vec, + rollup_data: Vec, } impl ConvertedBlobs { pub(super) fn len_headers(&self) -> usize { - self.headers.len() + self.metadata.len() } pub(super) fn len_rollup_data_entries(&self) -> usize { - self.rollup_data_entries.len() + self.rollup_data.len() } - pub(super) fn into_parts(self) -> (u64, Vec, Vec) { - (self.celestia_height, self.headers, self.rollup_data_entries) + pub(super) fn into_parts(self) -> (u64, Vec, Vec) { + (self.celestia_height, self.metadata, self.rollup_data) } fn new(celestia_height: u64) -> Self { Self { celestia_height, - headers: Vec::new(), - rollup_data_entries: Vec::new(), + metadata: Vec::new(), + rollup_data: Vec::new(), } } - fn push_header(&mut self, header: CelestiaHeader) { - self.headers.push(header); + fn push_header(&mut self, header: SubmittedMetadata) { + self.metadata.push(header); } - fn push_rollup_data(&mut self, rollup: CelestiaRollupData) { - self.rollup_data_entries.push(rollup); + fn push_rollup_data(&mut self, rollup: SubmittedRollupData) { + self.rollup_data.push(rollup); } - fn extend_from_header_list_if_well_formed(&mut self, list: CelestiaHeaderList) { - let initial_len = self.headers.len(); - if let Err(err) = list.headers.into_iter().try_for_each(|raw| { - let header = CelestiaHeader::try_from_raw(raw)?; + fn extend_from_header_list_if_well_formed(&mut self, list: SubmittedMetadataList) { + let initial_len = self.metadata.len(); + if let Err(err) = list.entries.into_iter().try_for_each(|raw| { + let header = SubmittedMetadata::try_from_raw(raw)?; self.push_header(header); - Ok::<(), CelestiaSequencerBlobError>(()) + Ok::<(), SubmittedMetadataError>(()) }) { info!( error = &err as &StdError, "one header in {} was not well-formed; dropping all", - CelestiaHeaderList::full_name(), + SubmittedMetadataList::full_name(), ); - self.headers.truncate(initial_len); + self.metadata.truncate(initial_len); } } - fn extend_from_rollup_data_list_if_well_formed(&mut self, list: CelestiaRollupDataList) { - let initial_len = self.rollup_data_entries.len(); + fn extend_from_rollup_data_list_if_well_formed(&mut self, list: SubmittedRollupDataList) { + let initial_len = self.rollup_data.len(); if let Err(err) = list.entries.into_iter().try_for_each(|raw| { - let entry = CelestiaRollupData::try_from_raw(raw)?; + let entry = SubmittedRollupData::try_from_raw(raw)?; self.push_rollup_data(entry); - Ok::<(), CelestiaRollupBlobError>(()) + Ok::<(), SubmittedRollupDataError>(()) }) { info!( error = &err as &StdError, "one entry in {} was not well-formed; dropping all", - CelestiaRollupDataList::full_name(), + SubmittedRollupDataList::full_name(), ); - self.rollup_data_entries.truncate(initial_len); + self.rollup_data.truncate(initial_len); } } } -fn convert_blob_to_header_list(blob: &Blob) -> Option { +fn convert_blob_to_header_list(blob: &Blob) -> Option { let data = decompress_bytes(&blob.data) .inspect_err(|err| { info!( @@ -147,11 +147,11 @@ fn convert_blob_to_header_list(blob: &Blob) -> Option { ); }) .ok()?; - let raw = CelestiaHeaderList::decode(&*data) + let raw = SubmittedMetadataList::decode(&*data) .inspect_err(|err| { info!( error = err as &StdError, - target = CelestiaHeaderList::full_name(), + target = SubmittedMetadataList::full_name(), "failed decoding blob bytes; dropping the blob", ); }) @@ -159,7 +159,7 @@ fn convert_blob_to_header_list(blob: &Blob) -> Option { Some(raw) } -fn convert_blob_to_rollup_data_list(blob: &Blob) -> Option { +fn convert_blob_to_rollup_data_list(blob: &Blob) -> Option { let data = decompress_bytes(&blob.data) .inspect_err(|err| { info!( @@ -168,11 +168,11 @@ fn convert_blob_to_rollup_data_list(blob: &Blob) -> Option, - rollup: &CelestiaRollupData, -) -> Option { + headers: &mut HashMap<[u8; 32], SubmittedMetadata>, + rollup: &SubmittedRollupData, +) -> Option { // chaining methods and returning () to use the ? operator and to not bind the value headers .get(&rollup.sequencer_block_hash()) @@ -106,8 +106,8 @@ fn remove_header_blob_matching_rollup_blob( } fn verify_rollup_blob_against_sequencer_blob( - rollup_blob: &CelestiaRollupData, - sequencer_blob: &CelestiaHeader, + rollup_blob: &SubmittedRollupData, + sequencer_blob: &SubmittedMetadata, ) -> bool { rollup_blob .proof() diff --git a/crates/astria-conductor/src/celestia/verify.rs b/crates/astria-conductor/src/celestia/verify.rs index 341c34be29..44602fc298 100644 --- a/crates/astria-conductor/src/celestia/verify.rs +++ b/crates/astria-conductor/src/celestia/verify.rs @@ -5,8 +5,8 @@ use std::{ }; use astria_core::sequencerblock::v1alpha1::{ - CelestiaHeader, - CelestiaRollupData, + SubmittedMetadata, + SubmittedRollupData, }; use astria_eyre::{ eyre, @@ -48,8 +48,8 @@ use crate::utils::flatten; pub(super) struct VerifiedBlobs { celestia_height: u64, - header_blobs: HashMap<[u8; 32], CelestiaHeader>, - rollup_blobs: Vec, + header_blobs: HashMap<[u8; 32], SubmittedMetadata>, + rollup_blobs: Vec, } impl VerifiedBlobs { @@ -65,8 +65,8 @@ impl VerifiedBlobs { self, ) -> ( u64, - HashMap<[u8; 32], CelestiaHeader>, - Vec, + HashMap<[u8; 32], SubmittedMetadata>, + Vec, ) { (self.celestia_height, self.header_blobs, self.rollup_blobs) } @@ -231,8 +231,8 @@ impl BlobVerifier { async fn verify_header( self: Arc, - header: CelestiaHeader, - ) -> eyre::Result { + header: SubmittedMetadata, + ) -> eyre::Result { use base64::prelude::*; let height = header.height(); let meta = self diff --git a/crates/astria-conductor/tests/blackbox/helpers/mod.rs b/crates/astria-conductor/tests/blackbox/helpers/mod.rs index fdb8b33cc2..515b091a34 100644 --- a/crates/astria-conductor/tests/blackbox/helpers/mod.rs +++ b/crates/astria-conductor/tests/blackbox/helpers/mod.rs @@ -477,26 +477,26 @@ pub struct Blobs { #[must_use] pub fn make_blobs(heights: &[u32]) -> Blobs { use astria_core::generated::sequencerblock::v1alpha1::{ - CelestiaHeaderList, - CelestiaRollupDataList, + SubmittedMetadataList, + SubmittedRollupDataList, }; - let mut headers = Vec::new(); - let mut entries = Vec::new(); + let mut metadata = Vec::new(); + let mut rollup_data = Vec::new(); for &height in heights { let (head, mut tail) = make_sequencer_block(height).split_for_celestia(); - headers.push(head.into_raw()); + metadata.push(head.into_raw()); assert_eq!( 1, tail.len(), "this test logic assumes that there is only one rollup in the mocked block" ); - entries.push(tail.swap_remove(0).into_raw()); + rollup_data.push(tail.swap_remove(0).into_raw()); } - let header_list = CelestiaHeaderList { - headers, + let header_list = SubmittedMetadataList { + entries: metadata, }; - let rollup_data_list = CelestiaRollupDataList { - entries, + let rollup_data_list = SubmittedRollupDataList { + entries: rollup_data, }; let raw_header_list = ::prost::Message::encode_to_vec(&header_list); diff --git a/crates/astria-core/src/generated/astria.sequencerblock.v1alpha1.rs b/crates/astria-core/src/generated/astria.sequencerblock.v1alpha1.rs index 0151f77f16..07bd00e7f7 100644 --- a/crates/astria-core/src/generated/astria.sequencerblock.v1alpha1.rs +++ b/crates/astria-core/src/generated/astria.sequencerblock.v1alpha1.rs @@ -213,32 +213,33 @@ impl ::prost::Name for RollupData { ::prost::alloc::format!("astria.sequencerblock.v1alpha1.{}", Self::NAME) } } -/// A sequence of `astria.sequencerblock.v1alpha1.CelestiaRollup` that are posted to Celestia. +/// A sequence of `astria.sequencerblock.v1alpha1.SubmittedRollupData` submitted to Celestia. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct CelestiaRollupDataList { +pub struct SubmittedRollupDataList { #[prost(message, repeated, tag = "1")] - pub entries: ::prost::alloc::vec::Vec, + pub entries: ::prost::alloc::vec::Vec, } -impl ::prost::Name for CelestiaRollupDataList { - const NAME: &'static str = "CelestiaRollupDataList"; +impl ::prost::Name for SubmittedRollupDataList { + const NAME: &'static str = "SubmittedRollupDataList"; const PACKAGE: &'static str = "astria.sequencerblock.v1alpha1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("astria.sequencerblock.v1alpha1.{}", Self::NAME) } } -/// A collection of transactions belonging to a specific rollup that are submitted to celestia. +/// A collection of transactions belonging to a specific Rollup that is submitted to a Data +/// Availability provider like Celestia. /// /// It is created by splitting an `astria.sequencerblock.v1alpha1.SequencerBlock` into a -/// `astria.sequencerblock.v1alpha1.CelestiaHeader`, and a sequence of -/// `astria.sequencerblock.v1alpha.CelestiaRollup` (this object). +/// `astria.sequencerblock.v1alpha1.SubmittedMetadata`, and a sequence of +/// `astria.sequencerblock.v1alpha.SubmittedRollupData` (this object; one object per rollup that had +/// data included in the sequencer block). /// -/// The transactions contained in the item belong to a rollup identified -/// by `rollup_id`, and were included in the sequencer block identified -/// by `sequencer_block_hash`. +/// The original sequencer block (and in turn CometBFT block) can be identified by the +/// `sequencer_block_hash` field. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct CelestiaRollupData { +pub struct SubmittedRollupData { /// The hash of the sequencer block. Must be 32 bytes. #[prost(bytes = "vec", tag = "1")] pub sequencer_block_hash: ::prost::alloc::vec::Vec, @@ -254,63 +255,65 @@ pub struct CelestiaRollupData { #[prost(message, optional, tag = "4")] pub proof: ::core::option::Option, } -impl ::prost::Name for CelestiaRollupData { - const NAME: &'static str = "CelestiaRollupData"; +impl ::prost::Name for SubmittedRollupData { + const NAME: &'static str = "SubmittedRollupData"; const PACKAGE: &'static str = "astria.sequencerblock.v1alpha1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("astria.sequencerblock.v1alpha1.{}", Self::NAME) } } -/// A sequence of `astria.sequencerblock.v1alpha1.CelestiaHeader` that are posted to Celestia. +/// A sequence of `astria.sequencerblock.v1alpha1.SubmittedMetadata` submitted to Celestia. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct CelestiaHeaderList { +pub struct SubmittedMetadataList { #[prost(message, repeated, tag = "1")] - pub headers: ::prost::alloc::vec::Vec, + pub entries: ::prost::alloc::vec::Vec, } -impl ::prost::Name for CelestiaHeaderList { - const NAME: &'static str = "CelestiaHeaderList"; +impl ::prost::Name for SubmittedMetadataList { + const NAME: &'static str = "SubmittedMetadataList"; const PACKAGE: &'static str = "astria.sequencerblock.v1alpha1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("astria.sequencerblock.v1alpha1.{}", Self::NAME) } } -/// The metadata of a sequencer block that is submitted to celestia. +/// The metadata of a sequencer block that is submitted to a Data Availability provider like +/// Celestia /// /// It is created by splitting an `astria.sequencerblock.v1alpha1.SequencerBlock` into a -/// `astria.sequencerblock.v1alphha1.CelestiaHeader` (this object), and a sequence of -/// `astria.sequencerblock.v1alpha.CelestiaRollupData` (one object per rollup that had data +/// `astria.sequencerblock.v1alpha1.SubmittedMetadata` (this object), and a sequence of +/// `astria.sequencerblock.v1alpha.SubmittedRollupData` (one object per rollup that had data /// included in the sequencer block). /// /// The original sequencer block (and in turn CometBFT block) can be identified by the /// `block_hash` field. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct CelestiaHeader { +pub struct SubmittedMetadata { /// the 32-byte block hash of the sequencer block. #[prost(bytes = "vec", tag = "1")] pub block_hash: ::prost::alloc::vec::Vec, /// the block header, which contains sequencer-specific commitments. #[prost(message, optional, tag = "2")] pub header: ::core::option::Option, - /// The rollup IDs for which `CelestiaRollupBlob`s were submitted to celestia. - /// Corresponds to the `astria.sequencer.v1.RollupTransactions.rollup_id` field - /// and is extracted from `astria.SequencerBlock.rollup_transactions`. + /// The rollup IDs that had transactions included in the `astria.sequencerblock.v1alpha1.SequencerBlock` + /// that this object is derived from. + /// Corresponds to `astria.sequencerblock.v1alpha1.RollupTransactions.rollup_id` + /// extracted from `astria.sequencerblock.v1alpha1.SsequencerBlock.rollup_transactions`. #[prost(message, repeated, tag = "3")] pub rollup_ids: ::prost::alloc::vec::Vec, /// The proof that the rollup transactions are included in sequencer block. - /// Corresponds to `astria.sequencer.v1alpha.SequencerBlock.rollup_transactions_proof`. + /// Corresponds to `astria.sequencerblock.v1alpha1.SequencerBlock.rollup_transactions_proof`. #[prost(message, optional, tag = "4")] pub rollup_transactions_proof: ::core::option::Option< super::super::primitive::v1::Proof, >, /// The proof that the rollup IDs are included in sequencer block. - /// Corresponds to `astria.sequencer.v1alpha.SequencerBlock.rollup_ids_proof`. + /// Corresponds to `astria.sequencerblock.v1alpha1.SequencerBlock.rollup_ids_proof`. #[prost(message, optional, tag = "5")] pub rollup_ids_proof: ::core::option::Option, } -impl ::prost::Name for CelestiaHeader { - const NAME: &'static str = "CelestiaHeader"; +impl ::prost::Name for SubmittedMetadata { + const NAME: &'static str = "SubmittedMetadata"; const PACKAGE: &'static str = "astria.sequencerblock.v1alpha1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("astria.sequencerblock.v1alpha1.{}", Self::NAME) diff --git a/crates/astria-core/src/generated/astria.sequencerblock.v1alpha1.serde.rs b/crates/astria-core/src/generated/astria.sequencerblock.v1alpha1.serde.rs index f93eaf551d..2a774726d3 100644 --- a/crates/astria-core/src/generated/astria.sequencerblock.v1alpha1.serde.rs +++ b/crates/astria-core/src/generated/astria.sequencerblock.v1alpha1.serde.rs @@ -1,4 +1,170 @@ -impl serde::Serialize for CelestiaHeader { +impl serde::Serialize for Deposit { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.bridge_address.is_some() { + len += 1; + } + if self.rollup_id.is_some() { + len += 1; + } + if self.amount.is_some() { + len += 1; + } + if !self.asset_id.is_empty() { + len += 1; + } + if !self.destination_chain_address.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("astria.sequencerblock.v1alpha1.Deposit", len)?; + if let Some(v) = self.bridge_address.as_ref() { + struct_ser.serialize_field("bridge_address", v)?; + } + if let Some(v) = self.rollup_id.as_ref() { + struct_ser.serialize_field("rollup_id", v)?; + } + if let Some(v) = self.amount.as_ref() { + struct_ser.serialize_field("amount", v)?; + } + if !self.asset_id.is_empty() { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("asset_id", pbjson::private::base64::encode(&self.asset_id).as_str())?; + } + if !self.destination_chain_address.is_empty() { + struct_ser.serialize_field("destination_chain_address", &self.destination_chain_address)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for Deposit { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "bridge_address", + "bridgeAddress", + "rollup_id", + "rollupId", + "amount", + "asset_id", + "assetId", + "destination_chain_address", + "destinationChainAddress", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + BridgeAddress, + RollupId, + Amount, + AssetId, + DestinationChainAddress, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + match value { + "bridgeAddress" | "bridge_address" => Ok(GeneratedField::BridgeAddress), + "rollupId" | "rollup_id" => Ok(GeneratedField::RollupId), + "amount" => Ok(GeneratedField::Amount), + "assetId" | "asset_id" => Ok(GeneratedField::AssetId), + "destinationChainAddress" | "destination_chain_address" => Ok(GeneratedField::DestinationChainAddress), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = Deposit; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct astria.sequencerblock.v1alpha1.Deposit") + } + + fn visit_map(self, mut map_: V) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut bridge_address__ = None; + let mut rollup_id__ = None; + let mut amount__ = None; + let mut asset_id__ = None; + let mut destination_chain_address__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::BridgeAddress => { + if bridge_address__.is_some() { + return Err(serde::de::Error::duplicate_field("bridgeAddress")); + } + bridge_address__ = map_.next_value()?; + } + GeneratedField::RollupId => { + if rollup_id__.is_some() { + return Err(serde::de::Error::duplicate_field("rollupId")); + } + rollup_id__ = map_.next_value()?; + } + GeneratedField::Amount => { + if amount__.is_some() { + return Err(serde::de::Error::duplicate_field("amount")); + } + amount__ = map_.next_value()?; + } + GeneratedField::AssetId => { + if asset_id__.is_some() { + return Err(serde::de::Error::duplicate_field("assetId")); + } + asset_id__ = + Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + GeneratedField::DestinationChainAddress => { + if destination_chain_address__.is_some() { + return Err(serde::de::Error::duplicate_field("destinationChainAddress")); + } + destination_chain_address__ = Some(map_.next_value()?); + } + } + } + Ok(Deposit { + bridge_address: bridge_address__, + rollup_id: rollup_id__, + amount: amount__, + asset_id: asset_id__.unwrap_or_default(), + destination_chain_address: destination_chain_address__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("astria.sequencerblock.v1alpha1.Deposit", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for FilteredSequencerBlock { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -12,16 +178,19 @@ impl serde::Serialize for CelestiaHeader { if self.header.is_some() { len += 1; } - if !self.rollup_ids.is_empty() { + if !self.rollup_transactions.is_empty() { len += 1; } if self.rollup_transactions_proof.is_some() { len += 1; } + if !self.all_rollup_ids.is_empty() { + len += 1; + } if self.rollup_ids_proof.is_some() { len += 1; } - let mut struct_ser = serializer.serialize_struct("astria.sequencerblock.v1alpha1.CelestiaHeader", len)?; + let mut struct_ser = serializer.serialize_struct("astria.sequencerblock.v1alpha1.FilteredSequencerBlock", len)?; if !self.block_hash.is_empty() { #[allow(clippy::needless_borrow)] struct_ser.serialize_field("block_hash", pbjson::private::base64::encode(&self.block_hash).as_str())?; @@ -29,19 +198,22 @@ impl serde::Serialize for CelestiaHeader { if let Some(v) = self.header.as_ref() { struct_ser.serialize_field("header", v)?; } - if !self.rollup_ids.is_empty() { - struct_ser.serialize_field("rollup_ids", &self.rollup_ids)?; + if !self.rollup_transactions.is_empty() { + struct_ser.serialize_field("rollup_transactions", &self.rollup_transactions)?; } if let Some(v) = self.rollup_transactions_proof.as_ref() { struct_ser.serialize_field("rollup_transactions_proof", v)?; } + if !self.all_rollup_ids.is_empty() { + struct_ser.serialize_field("all_rollup_ids", &self.all_rollup_ids.iter().map(pbjson::private::base64::encode).collect::>())?; + } if let Some(v) = self.rollup_ids_proof.as_ref() { struct_ser.serialize_field("rollup_ids_proof", v)?; } struct_ser.end() } } -impl<'de> serde::Deserialize<'de> for CelestiaHeader { +impl<'de> serde::Deserialize<'de> for FilteredSequencerBlock { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where @@ -51,10 +223,12 @@ impl<'de> serde::Deserialize<'de> for CelestiaHeader { "block_hash", "blockHash", "header", - "rollup_ids", - "rollupIds", + "rollup_transactions", + "rollupTransactions", "rollup_transactions_proof", "rollupTransactionsProof", + "all_rollup_ids", + "allRollupIds", "rollup_ids_proof", "rollupIdsProof", ]; @@ -63,8 +237,9 @@ impl<'de> serde::Deserialize<'de> for CelestiaHeader { enum GeneratedField { BlockHash, Header, - RollupIds, + RollupTransactions, RollupTransactionsProof, + AllRollupIds, RollupIdsProof, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -89,8 +264,9 @@ impl<'de> serde::Deserialize<'de> for CelestiaHeader { match value { "blockHash" | "block_hash" => Ok(GeneratedField::BlockHash), "header" => Ok(GeneratedField::Header), - "rollupIds" | "rollup_ids" => Ok(GeneratedField::RollupIds), + "rollupTransactions" | "rollup_transactions" => Ok(GeneratedField::RollupTransactions), "rollupTransactionsProof" | "rollup_transactions_proof" => Ok(GeneratedField::RollupTransactionsProof), + "allRollupIds" | "all_rollup_ids" => Ok(GeneratedField::AllRollupIds), "rollupIdsProof" | "rollup_ids_proof" => Ok(GeneratedField::RollupIdsProof), _ => Err(serde::de::Error::unknown_field(value, FIELDS)), } @@ -101,20 +277,21 @@ impl<'de> serde::Deserialize<'de> for CelestiaHeader { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = CelestiaHeader; + type Value = FilteredSequencerBlock; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct astria.sequencerblock.v1alpha1.CelestiaHeader") + formatter.write_str("struct astria.sequencerblock.v1alpha1.FilteredSequencerBlock") } - fn visit_map(self, mut map_: V) -> std::result::Result + fn visit_map(self, mut map_: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { let mut block_hash__ = None; let mut header__ = None; - let mut rollup_ids__ = None; + let mut rollup_transactions__ = None; let mut rollup_transactions_proof__ = None; + let mut all_rollup_ids__ = None; let mut rollup_ids_proof__ = None; while let Some(k) = map_.next_key()? { match k { @@ -132,11 +309,11 @@ impl<'de> serde::Deserialize<'de> for CelestiaHeader { } header__ = map_.next_value()?; } - GeneratedField::RollupIds => { - if rollup_ids__.is_some() { - return Err(serde::de::Error::duplicate_field("rollupIds")); + GeneratedField::RollupTransactions => { + if rollup_transactions__.is_some() { + return Err(serde::de::Error::duplicate_field("rollupTransactions")); } - rollup_ids__ = Some(map_.next_value()?); + rollup_transactions__ = Some(map_.next_value()?); } GeneratedField::RollupTransactionsProof => { if rollup_transactions_proof__.is_some() { @@ -144,6 +321,15 @@ impl<'de> serde::Deserialize<'de> for CelestiaHeader { } rollup_transactions_proof__ = map_.next_value()?; } + GeneratedField::AllRollupIds => { + if all_rollup_ids__.is_some() { + return Err(serde::de::Error::duplicate_field("allRollupIds")); + } + all_rollup_ids__ = + Some(map_.next_value::>>()? + .into_iter().map(|x| x.0).collect()) + ; + } GeneratedField::RollupIdsProof => { if rollup_ids_proof__.is_some() { return Err(serde::de::Error::duplicate_field("rollupIdsProof")); @@ -152,19 +338,20 @@ impl<'de> serde::Deserialize<'de> for CelestiaHeader { } } } - Ok(CelestiaHeader { + Ok(FilteredSequencerBlock { block_hash: block_hash__.unwrap_or_default(), header: header__, - rollup_ids: rollup_ids__.unwrap_or_default(), + rollup_transactions: rollup_transactions__.unwrap_or_default(), rollup_transactions_proof: rollup_transactions_proof__, + all_rollup_ids: all_rollup_ids__.unwrap_or_default(), rollup_ids_proof: rollup_ids_proof__, }) } } - deserializer.deserialize_struct("astria.sequencerblock.v1alpha1.CelestiaHeader", FIELDS, GeneratedVisitor) + deserializer.deserialize_struct("astria.sequencerblock.v1alpha1.FilteredSequencerBlock", FIELDS, GeneratedVisitor) } } -impl serde::Serialize for CelestiaHeaderList { +impl serde::Serialize for GetFilteredSequencerBlockRequest { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -172,29 +359,39 @@ impl serde::Serialize for CelestiaHeaderList { { use serde::ser::SerializeStruct; let mut len = 0; - if !self.headers.is_empty() { + if self.height != 0 { + len += 1; + } + if !self.rollup_ids.is_empty() { len += 1; } - let mut struct_ser = serializer.serialize_struct("astria.sequencerblock.v1alpha1.CelestiaHeaderList", len)?; - if !self.headers.is_empty() { - struct_ser.serialize_field("headers", &self.headers)?; + let mut struct_ser = serializer.serialize_struct("astria.sequencerblock.v1alpha1.GetFilteredSequencerBlockRequest", len)?; + if self.height != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("height", ToString::to_string(&self.height).as_str())?; + } + if !self.rollup_ids.is_empty() { + struct_ser.serialize_field("rollup_ids", &self.rollup_ids)?; } struct_ser.end() } } -impl<'de> serde::Deserialize<'de> for CelestiaHeaderList { +impl<'de> serde::Deserialize<'de> for GetFilteredSequencerBlockRequest { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ - "headers", + "height", + "rollup_ids", + "rollupIds", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - Headers, + Height, + RollupIds, } impl<'de> serde::Deserialize<'de> for GeneratedField { fn deserialize(deserializer: D) -> std::result::Result @@ -216,7 +413,8 @@ impl<'de> serde::Deserialize<'de> for CelestiaHeaderList { E: serde::de::Error, { match value { - "headers" => Ok(GeneratedField::Headers), + "height" => Ok(GeneratedField::Height), + "rollupIds" | "rollup_ids" => Ok(GeneratedField::RollupIds), _ => Err(serde::de::Error::unknown_field(value, FIELDS)), } } @@ -226,36 +424,46 @@ impl<'de> serde::Deserialize<'de> for CelestiaHeaderList { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = CelestiaHeaderList; + type Value = GetFilteredSequencerBlockRequest; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct astria.sequencerblock.v1alpha1.CelestiaHeaderList") + formatter.write_str("struct astria.sequencerblock.v1alpha1.GetFilteredSequencerBlockRequest") } - fn visit_map(self, mut map_: V) -> std::result::Result + fn visit_map(self, mut map_: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { - let mut headers__ = None; + let mut height__ = None; + let mut rollup_ids__ = None; while let Some(k) = map_.next_key()? { match k { - GeneratedField::Headers => { - if headers__.is_some() { - return Err(serde::de::Error::duplicate_field("headers")); + GeneratedField::Height => { + if height__.is_some() { + return Err(serde::de::Error::duplicate_field("height")); } - headers__ = Some(map_.next_value()?); + height__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; } - } - } - Ok(CelestiaHeaderList { - headers: headers__.unwrap_or_default(), - }) - } + GeneratedField::RollupIds => { + if rollup_ids__.is_some() { + return Err(serde::de::Error::duplicate_field("rollupIds")); + } + rollup_ids__ = Some(map_.next_value()?); + } + } + } + Ok(GetFilteredSequencerBlockRequest { + height: height__.unwrap_or_default(), + rollup_ids: rollup_ids__.unwrap_or_default(), + }) + } } - deserializer.deserialize_struct("astria.sequencerblock.v1alpha1.CelestiaHeaderList", FIELDS, GeneratedVisitor) + deserializer.deserialize_struct("astria.sequencerblock.v1alpha1.GetFilteredSequencerBlockRequest", FIELDS, GeneratedVisitor) } } -impl serde::Serialize for CelestiaRollupData { +impl serde::Serialize for GetSequencerBlockRequest { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -263,56 +471,30 @@ impl serde::Serialize for CelestiaRollupData { { use serde::ser::SerializeStruct; let mut len = 0; - if !self.sequencer_block_hash.is_empty() { - len += 1; - } - if self.rollup_id.is_some() { - len += 1; - } - if !self.transactions.is_empty() { - len += 1; - } - if self.proof.is_some() { + if self.height != 0 { len += 1; } - let mut struct_ser = serializer.serialize_struct("astria.sequencerblock.v1alpha1.CelestiaRollupData", len)?; - if !self.sequencer_block_hash.is_empty() { + let mut struct_ser = serializer.serialize_struct("astria.sequencerblock.v1alpha1.GetSequencerBlockRequest", len)?; + if self.height != 0 { #[allow(clippy::needless_borrow)] - struct_ser.serialize_field("sequencer_block_hash", pbjson::private::base64::encode(&self.sequencer_block_hash).as_str())?; - } - if let Some(v) = self.rollup_id.as_ref() { - struct_ser.serialize_field("rollup_id", v)?; - } - if !self.transactions.is_empty() { - struct_ser.serialize_field("transactions", &self.transactions.iter().map(pbjson::private::base64::encode).collect::>())?; - } - if let Some(v) = self.proof.as_ref() { - struct_ser.serialize_field("proof", v)?; + struct_ser.serialize_field("height", ToString::to_string(&self.height).as_str())?; } struct_ser.end() } } -impl<'de> serde::Deserialize<'de> for CelestiaRollupData { +impl<'de> serde::Deserialize<'de> for GetSequencerBlockRequest { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ - "sequencer_block_hash", - "sequencerBlockHash", - "rollup_id", - "rollupId", - "transactions", - "proof", + "height", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - SequencerBlockHash, - RollupId, - Transactions, - Proof, + Height, } impl<'de> serde::Deserialize<'de> for GeneratedField { fn deserialize(deserializer: D) -> std::result::Result @@ -334,10 +516,7 @@ impl<'de> serde::Deserialize<'de> for CelestiaRollupData { E: serde::de::Error, { match value { - "sequencerBlockHash" | "sequencer_block_hash" => Ok(GeneratedField::SequencerBlockHash), - "rollupId" | "rollup_id" => Ok(GeneratedField::RollupId), - "transactions" => Ok(GeneratedField::Transactions), - "proof" => Ok(GeneratedField::Proof), + "height" => Ok(GeneratedField::Height), _ => Err(serde::de::Error::unknown_field(value, FIELDS)), } } @@ -347,65 +526,38 @@ impl<'de> serde::Deserialize<'de> for CelestiaRollupData { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = CelestiaRollupData; + type Value = GetSequencerBlockRequest; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct astria.sequencerblock.v1alpha1.CelestiaRollupData") + formatter.write_str("struct astria.sequencerblock.v1alpha1.GetSequencerBlockRequest") } - fn visit_map(self, mut map_: V) -> std::result::Result + fn visit_map(self, mut map_: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { - let mut sequencer_block_hash__ = None; - let mut rollup_id__ = None; - let mut transactions__ = None; - let mut proof__ = None; + let mut height__ = None; while let Some(k) = map_.next_key()? { match k { - GeneratedField::SequencerBlockHash => { - if sequencer_block_hash__.is_some() { - return Err(serde::de::Error::duplicate_field("sequencerBlockHash")); - } - sequencer_block_hash__ = - Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) - ; - } - GeneratedField::RollupId => { - if rollup_id__.is_some() { - return Err(serde::de::Error::duplicate_field("rollupId")); - } - rollup_id__ = map_.next_value()?; - } - GeneratedField::Transactions => { - if transactions__.is_some() { - return Err(serde::de::Error::duplicate_field("transactions")); + GeneratedField::Height => { + if height__.is_some() { + return Err(serde::de::Error::duplicate_field("height")); } - transactions__ = - Some(map_.next_value::>>()? - .into_iter().map(|x| x.0).collect()) + height__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) ; } - GeneratedField::Proof => { - if proof__.is_some() { - return Err(serde::de::Error::duplicate_field("proof")); - } - proof__ = map_.next_value()?; - } } } - Ok(CelestiaRollupData { - sequencer_block_hash: sequencer_block_hash__.unwrap_or_default(), - rollup_id: rollup_id__, - transactions: transactions__.unwrap_or_default(), - proof: proof__, + Ok(GetSequencerBlockRequest { + height: height__.unwrap_or_default(), }) } } - deserializer.deserialize_struct("astria.sequencerblock.v1alpha1.CelestiaRollupData", FIELDS, GeneratedVisitor) + deserializer.deserialize_struct("astria.sequencerblock.v1alpha1.GetSequencerBlockRequest", FIELDS, GeneratedVisitor) } } -impl serde::Serialize for CelestiaRollupDataList { +impl serde::Serialize for RollupData { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -413,29 +565,40 @@ impl serde::Serialize for CelestiaRollupDataList { { use serde::ser::SerializeStruct; let mut len = 0; - if !self.entries.is_empty() { + if self.value.is_some() { len += 1; } - let mut struct_ser = serializer.serialize_struct("astria.sequencerblock.v1alpha1.CelestiaRollupDataList", len)?; - if !self.entries.is_empty() { - struct_ser.serialize_field("entries", &self.entries)?; + let mut struct_ser = serializer.serialize_struct("astria.sequencerblock.v1alpha1.RollupData", len)?; + if let Some(v) = self.value.as_ref() { + match v { + rollup_data::Value::SequencedData(v) => { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("sequenced_data", pbjson::private::base64::encode(&v).as_str())?; + } + rollup_data::Value::Deposit(v) => { + struct_ser.serialize_field("deposit", v)?; + } + } } struct_ser.end() } } -impl<'de> serde::Deserialize<'de> for CelestiaRollupDataList { +impl<'de> serde::Deserialize<'de> for RollupData { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ - "entries", + "sequenced_data", + "sequencedData", + "deposit", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - Entries, + SequencedData, + Deposit, } impl<'de> serde::Deserialize<'de> for GeneratedField { fn deserialize(deserializer: D) -> std::result::Result @@ -457,7 +620,8 @@ impl<'de> serde::Deserialize<'de> for CelestiaRollupDataList { E: serde::de::Error, { match value { - "entries" => Ok(GeneratedField::Entries), + "sequencedData" | "sequenced_data" => Ok(GeneratedField::SequencedData), + "deposit" => Ok(GeneratedField::Deposit), _ => Err(serde::de::Error::unknown_field(value, FIELDS)), } } @@ -467,36 +631,43 @@ impl<'de> serde::Deserialize<'de> for CelestiaRollupDataList { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = CelestiaRollupDataList; + type Value = RollupData; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct astria.sequencerblock.v1alpha1.CelestiaRollupDataList") + formatter.write_str("struct astria.sequencerblock.v1alpha1.RollupData") } - fn visit_map(self, mut map_: V) -> std::result::Result + fn visit_map(self, mut map_: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { - let mut entries__ = None; + let mut value__ = None; while let Some(k) = map_.next_key()? { match k { - GeneratedField::Entries => { - if entries__.is_some() { - return Err(serde::de::Error::duplicate_field("entries")); + GeneratedField::SequencedData => { + if value__.is_some() { + return Err(serde::de::Error::duplicate_field("sequencedData")); } - entries__ = Some(map_.next_value()?); + value__ = map_.next_value::<::std::option::Option<::pbjson::private::BytesDeserialize<_>>>()?.map(|x| rollup_data::Value::SequencedData(x.0)); + } + GeneratedField::Deposit => { + if value__.is_some() { + return Err(serde::de::Error::duplicate_field("deposit")); + } + value__ = map_.next_value::<::std::option::Option<_>>()?.map(rollup_data::Value::Deposit) +; } } } - Ok(CelestiaRollupDataList { - entries: entries__.unwrap_or_default(), + Ok(RollupData { + value: value__, }) } } - deserializer.deserialize_struct("astria.sequencerblock.v1alpha1.CelestiaRollupDataList", FIELDS, GeneratedVisitor) + deserializer.deserialize_struct("astria.sequencerblock.v1alpha1.RollupData", FIELDS, GeneratedVisitor) } } -impl serde::Serialize for Deposit { +impl serde::Serialize for RollupTransactions { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -504,66 +675,46 @@ impl serde::Serialize for Deposit { { use serde::ser::SerializeStruct; let mut len = 0; - if self.bridge_address.is_some() { - len += 1; - } if self.rollup_id.is_some() { len += 1; } - if self.amount.is_some() { - len += 1; - } - if !self.asset_id.is_empty() { + if !self.transactions.is_empty() { len += 1; } - if !self.destination_chain_address.is_empty() { + if self.proof.is_some() { len += 1; } - let mut struct_ser = serializer.serialize_struct("astria.sequencerblock.v1alpha1.Deposit", len)?; - if let Some(v) = self.bridge_address.as_ref() { - struct_ser.serialize_field("bridge_address", v)?; - } + let mut struct_ser = serializer.serialize_struct("astria.sequencerblock.v1alpha1.RollupTransactions", len)?; if let Some(v) = self.rollup_id.as_ref() { struct_ser.serialize_field("rollup_id", v)?; } - if let Some(v) = self.amount.as_ref() { - struct_ser.serialize_field("amount", v)?; - } - if !self.asset_id.is_empty() { - #[allow(clippy::needless_borrow)] - struct_ser.serialize_field("asset_id", pbjson::private::base64::encode(&self.asset_id).as_str())?; + if !self.transactions.is_empty() { + struct_ser.serialize_field("transactions", &self.transactions.iter().map(pbjson::private::base64::encode).collect::>())?; } - if !self.destination_chain_address.is_empty() { - struct_ser.serialize_field("destination_chain_address", &self.destination_chain_address)?; + if let Some(v) = self.proof.as_ref() { + struct_ser.serialize_field("proof", v)?; } struct_ser.end() } } -impl<'de> serde::Deserialize<'de> for Deposit { +impl<'de> serde::Deserialize<'de> for RollupTransactions { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ - "bridge_address", - "bridgeAddress", "rollup_id", "rollupId", - "amount", - "asset_id", - "assetId", - "destination_chain_address", - "destinationChainAddress", + "transactions", + "proof", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - BridgeAddress, RollupId, - Amount, - AssetId, - DestinationChainAddress, + Transactions, + Proof, } impl<'de> serde::Deserialize<'de> for GeneratedField { fn deserialize(deserializer: D) -> std::result::Result @@ -585,11 +736,9 @@ impl<'de> serde::Deserialize<'de> for Deposit { E: serde::de::Error, { match value { - "bridgeAddress" | "bridge_address" => Ok(GeneratedField::BridgeAddress), "rollupId" | "rollup_id" => Ok(GeneratedField::RollupId), - "amount" => Ok(GeneratedField::Amount), - "assetId" | "asset_id" => Ok(GeneratedField::AssetId), - "destinationChainAddress" | "destination_chain_address" => Ok(GeneratedField::DestinationChainAddress), + "transactions" => Ok(GeneratedField::Transactions), + "proof" => Ok(GeneratedField::Proof), _ => Err(serde::de::Error::unknown_field(value, FIELDS)), } } @@ -599,70 +748,55 @@ impl<'de> serde::Deserialize<'de> for Deposit { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = Deposit; + type Value = RollupTransactions; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct astria.sequencerblock.v1alpha1.Deposit") + formatter.write_str("struct astria.sequencerblock.v1alpha1.RollupTransactions") } - fn visit_map(self, mut map_: V) -> std::result::Result + fn visit_map(self, mut map_: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { - let mut bridge_address__ = None; let mut rollup_id__ = None; - let mut amount__ = None; - let mut asset_id__ = None; - let mut destination_chain_address__ = None; + let mut transactions__ = None; + let mut proof__ = None; while let Some(k) = map_.next_key()? { match k { - GeneratedField::BridgeAddress => { - if bridge_address__.is_some() { - return Err(serde::de::Error::duplicate_field("bridgeAddress")); - } - bridge_address__ = map_.next_value()?; - } GeneratedField::RollupId => { if rollup_id__.is_some() { return Err(serde::de::Error::duplicate_field("rollupId")); } rollup_id__ = map_.next_value()?; } - GeneratedField::Amount => { - if amount__.is_some() { - return Err(serde::de::Error::duplicate_field("amount")); - } - amount__ = map_.next_value()?; - } - GeneratedField::AssetId => { - if asset_id__.is_some() { - return Err(serde::de::Error::duplicate_field("assetId")); + GeneratedField::Transactions => { + if transactions__.is_some() { + return Err(serde::de::Error::duplicate_field("transactions")); } - asset_id__ = - Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + transactions__ = + Some(map_.next_value::>>()? + .into_iter().map(|x| x.0).collect()) ; } - GeneratedField::DestinationChainAddress => { - if destination_chain_address__.is_some() { - return Err(serde::de::Error::duplicate_field("destinationChainAddress")); + GeneratedField::Proof => { + if proof__.is_some() { + return Err(serde::de::Error::duplicate_field("proof")); } - destination_chain_address__ = Some(map_.next_value()?); + proof__ = map_.next_value()?; } } } - Ok(Deposit { - bridge_address: bridge_address__, + Ok(RollupTransactions { rollup_id: rollup_id__, - amount: amount__, - asset_id: asset_id__.unwrap_or_default(), - destination_chain_address: destination_chain_address__.unwrap_or_default(), + transactions: transactions__.unwrap_or_default(), + proof: proof__, }) } } - deserializer.deserialize_struct("astria.sequencerblock.v1alpha1.Deposit", FIELDS, GeneratedVisitor) + deserializer.deserialize_struct("astria.sequencerblock.v1alpha1.RollupTransactions", FIELDS, GeneratedVisitor) } } -impl serde::Serialize for FilteredSequencerBlock { +impl serde::Serialize for SequencerBlock { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -670,9 +804,6 @@ impl serde::Serialize for FilteredSequencerBlock { { use serde::ser::SerializeStruct; let mut len = 0; - if !self.block_hash.is_empty() { - len += 1; - } if self.header.is_some() { len += 1; } @@ -682,17 +813,13 @@ impl serde::Serialize for FilteredSequencerBlock { if self.rollup_transactions_proof.is_some() { len += 1; } - if !self.all_rollup_ids.is_empty() { - len += 1; - } if self.rollup_ids_proof.is_some() { len += 1; } - let mut struct_ser = serializer.serialize_struct("astria.sequencerblock.v1alpha1.FilteredSequencerBlock", len)?; if !self.block_hash.is_empty() { - #[allow(clippy::needless_borrow)] - struct_ser.serialize_field("block_hash", pbjson::private::base64::encode(&self.block_hash).as_str())?; + len += 1; } + let mut struct_ser = serializer.serialize_struct("astria.sequencerblock.v1alpha1.SequencerBlock", len)?; if let Some(v) = self.header.as_ref() { struct_ser.serialize_field("header", v)?; } @@ -702,43 +829,41 @@ impl serde::Serialize for FilteredSequencerBlock { if let Some(v) = self.rollup_transactions_proof.as_ref() { struct_ser.serialize_field("rollup_transactions_proof", v)?; } - if !self.all_rollup_ids.is_empty() { - struct_ser.serialize_field("all_rollup_ids", &self.all_rollup_ids.iter().map(pbjson::private::base64::encode).collect::>())?; - } if let Some(v) = self.rollup_ids_proof.as_ref() { struct_ser.serialize_field("rollup_ids_proof", v)?; } + if !self.block_hash.is_empty() { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("block_hash", pbjson::private::base64::encode(&self.block_hash).as_str())?; + } struct_ser.end() } } -impl<'de> serde::Deserialize<'de> for FilteredSequencerBlock { +impl<'de> serde::Deserialize<'de> for SequencerBlock { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ - "block_hash", - "blockHash", "header", "rollup_transactions", "rollupTransactions", "rollup_transactions_proof", "rollupTransactionsProof", - "all_rollup_ids", - "allRollupIds", "rollup_ids_proof", "rollupIdsProof", + "block_hash", + "blockHash", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - BlockHash, Header, RollupTransactions, RollupTransactionsProof, - AllRollupIds, RollupIdsProof, + BlockHash, } impl<'de> serde::Deserialize<'de> for GeneratedField { fn deserialize(deserializer: D) -> std::result::Result @@ -760,12 +885,11 @@ impl<'de> serde::Deserialize<'de> for FilteredSequencerBlock { E: serde::de::Error, { match value { - "blockHash" | "block_hash" => Ok(GeneratedField::BlockHash), "header" => Ok(GeneratedField::Header), "rollupTransactions" | "rollup_transactions" => Ok(GeneratedField::RollupTransactions), "rollupTransactionsProof" | "rollup_transactions_proof" => Ok(GeneratedField::RollupTransactionsProof), - "allRollupIds" | "all_rollup_ids" => Ok(GeneratedField::AllRollupIds), "rollupIdsProof" | "rollup_ids_proof" => Ok(GeneratedField::RollupIdsProof), + "blockHash" | "block_hash" => Ok(GeneratedField::BlockHash), _ => Err(serde::de::Error::unknown_field(value, FIELDS)), } } @@ -775,32 +899,23 @@ impl<'de> serde::Deserialize<'de> for FilteredSequencerBlock { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = FilteredSequencerBlock; + type Value = SequencerBlock; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct astria.sequencerblock.v1alpha1.FilteredSequencerBlock") + formatter.write_str("struct astria.sequencerblock.v1alpha1.SequencerBlock") } - fn visit_map(self, mut map_: V) -> std::result::Result + fn visit_map(self, mut map_: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { - let mut block_hash__ = None; let mut header__ = None; let mut rollup_transactions__ = None; let mut rollup_transactions_proof__ = None; - let mut all_rollup_ids__ = None; let mut rollup_ids_proof__ = None; + let mut block_hash__ = None; while let Some(k) = map_.next_key()? { match k { - GeneratedField::BlockHash => { - if block_hash__.is_some() { - return Err(serde::de::Error::duplicate_field("blockHash")); - } - block_hash__ = - Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) - ; - } GeneratedField::Header => { if header__.is_some() { return Err(serde::de::Error::duplicate_field("header")); @@ -819,37 +934,35 @@ impl<'de> serde::Deserialize<'de> for FilteredSequencerBlock { } rollup_transactions_proof__ = map_.next_value()?; } - GeneratedField::AllRollupIds => { - if all_rollup_ids__.is_some() { - return Err(serde::de::Error::duplicate_field("allRollupIds")); - } - all_rollup_ids__ = - Some(map_.next_value::>>()? - .into_iter().map(|x| x.0).collect()) - ; - } GeneratedField::RollupIdsProof => { if rollup_ids_proof__.is_some() { return Err(serde::de::Error::duplicate_field("rollupIdsProof")); } rollup_ids_proof__ = map_.next_value()?; } + GeneratedField::BlockHash => { + if block_hash__.is_some() { + return Err(serde::de::Error::duplicate_field("blockHash")); + } + block_hash__ = + Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } } } - Ok(FilteredSequencerBlock { - block_hash: block_hash__.unwrap_or_default(), + Ok(SequencerBlock { header: header__, rollup_transactions: rollup_transactions__.unwrap_or_default(), rollup_transactions_proof: rollup_transactions_proof__, - all_rollup_ids: all_rollup_ids__.unwrap_or_default(), rollup_ids_proof: rollup_ids_proof__, + block_hash: block_hash__.unwrap_or_default(), }) } } - deserializer.deserialize_struct("astria.sequencerblock.v1alpha1.FilteredSequencerBlock", FIELDS, GeneratedVisitor) + deserializer.deserialize_struct("astria.sequencerblock.v1alpha1.SequencerBlock", FIELDS, GeneratedVisitor) } } -impl serde::Serialize for GetFilteredSequencerBlockRequest { +impl serde::Serialize for SequencerBlockHeader { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -857,39 +970,77 @@ impl serde::Serialize for GetFilteredSequencerBlockRequest { { use serde::ser::SerializeStruct; let mut len = 0; + if !self.chain_id.is_empty() { + len += 1; + } if self.height != 0 { len += 1; } - if !self.rollup_ids.is_empty() { + if self.time.is_some() { len += 1; } - let mut struct_ser = serializer.serialize_struct("astria.sequencerblock.v1alpha1.GetFilteredSequencerBlockRequest", len)?; + if !self.data_hash.is_empty() { + len += 1; + } + if !self.proposer_address.is_empty() { + len += 1; + } + if !self.rollup_transactions_root.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("astria.sequencerblock.v1alpha1.SequencerBlockHeader", len)?; + if !self.chain_id.is_empty() { + struct_ser.serialize_field("chain_id", &self.chain_id)?; + } if self.height != 0 { #[allow(clippy::needless_borrow)] struct_ser.serialize_field("height", ToString::to_string(&self.height).as_str())?; } - if !self.rollup_ids.is_empty() { - struct_ser.serialize_field("rollup_ids", &self.rollup_ids)?; + if let Some(v) = self.time.as_ref() { + struct_ser.serialize_field("time", v)?; + } + if !self.data_hash.is_empty() { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("data_hash", pbjson::private::base64::encode(&self.data_hash).as_str())?; + } + if !self.proposer_address.is_empty() { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("proposer_address", pbjson::private::base64::encode(&self.proposer_address).as_str())?; + } + if !self.rollup_transactions_root.is_empty() { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("rollup_transactions_root", pbjson::private::base64::encode(&self.rollup_transactions_root).as_str())?; } struct_ser.end() } } -impl<'de> serde::Deserialize<'de> for GetFilteredSequencerBlockRequest { +impl<'de> serde::Deserialize<'de> for SequencerBlockHeader { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ + "chain_id", + "chainId", "height", - "rollup_ids", - "rollupIds", + "time", + "data_hash", + "dataHash", + "proposer_address", + "proposerAddress", + "rollup_transactions_root", + "rollupTransactionsRoot", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { + ChainId, Height, - RollupIds, + Time, + DataHash, + ProposerAddress, + RollupTransactionsRoot, } impl<'de> serde::Deserialize<'de> for GeneratedField { fn deserialize(deserializer: D) -> std::result::Result @@ -911,8 +1062,12 @@ impl<'de> serde::Deserialize<'de> for GetFilteredSequencerBlockRequest { E: serde::de::Error, { match value { + "chainId" | "chain_id" => Ok(GeneratedField::ChainId), "height" => Ok(GeneratedField::Height), - "rollupIds" | "rollup_ids" => Ok(GeneratedField::RollupIds), + "time" => Ok(GeneratedField::Time), + "dataHash" | "data_hash" => Ok(GeneratedField::DataHash), + "proposerAddress" | "proposer_address" => Ok(GeneratedField::ProposerAddress), + "rollupTransactionsRoot" | "rollup_transactions_root" => Ok(GeneratedField::RollupTransactionsRoot), _ => Err(serde::de::Error::unknown_field(value, FIELDS)), } } @@ -922,20 +1077,30 @@ impl<'de> serde::Deserialize<'de> for GetFilteredSequencerBlockRequest { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GetFilteredSequencerBlockRequest; + type Value = SequencerBlockHeader; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct astria.sequencerblock.v1alpha1.GetFilteredSequencerBlockRequest") + formatter.write_str("struct astria.sequencerblock.v1alpha1.SequencerBlockHeader") } - fn visit_map(self, mut map_: V) -> std::result::Result + fn visit_map(self, mut map_: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { + let mut chain_id__ = None; let mut height__ = None; - let mut rollup_ids__ = None; + let mut time__ = None; + let mut data_hash__ = None; + let mut proposer_address__ = None; + let mut rollup_transactions_root__ = None; while let Some(k) = map_.next_key()? { match k { + GeneratedField::ChainId => { + if chain_id__.is_some() { + return Err(serde::de::Error::duplicate_field("chainId")); + } + chain_id__ = Some(map_.next_value()?); + } GeneratedField::Height => { if height__.is_some() { return Err(serde::de::Error::duplicate_field("height")); @@ -944,24 +1109,52 @@ impl<'de> serde::Deserialize<'de> for GetFilteredSequencerBlockRequest { Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) ; } - GeneratedField::RollupIds => { - if rollup_ids__.is_some() { - return Err(serde::de::Error::duplicate_field("rollupIds")); + GeneratedField::Time => { + if time__.is_some() { + return Err(serde::de::Error::duplicate_field("time")); } - rollup_ids__ = Some(map_.next_value()?); + time__ = map_.next_value()?; + } + GeneratedField::DataHash => { + if data_hash__.is_some() { + return Err(serde::de::Error::duplicate_field("dataHash")); + } + data_hash__ = + Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + GeneratedField::ProposerAddress => { + if proposer_address__.is_some() { + return Err(serde::de::Error::duplicate_field("proposerAddress")); + } + proposer_address__ = + Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + GeneratedField::RollupTransactionsRoot => { + if rollup_transactions_root__.is_some() { + return Err(serde::de::Error::duplicate_field("rollupTransactionsRoot")); + } + rollup_transactions_root__ = + Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; } } } - Ok(GetFilteredSequencerBlockRequest { + Ok(SequencerBlockHeader { + chain_id: chain_id__.unwrap_or_default(), height: height__.unwrap_or_default(), - rollup_ids: rollup_ids__.unwrap_or_default(), + time: time__, + data_hash: data_hash__.unwrap_or_default(), + proposer_address: proposer_address__.unwrap_or_default(), + rollup_transactions_root: rollup_transactions_root__.unwrap_or_default(), }) } } - deserializer.deserialize_struct("astria.sequencerblock.v1alpha1.GetFilteredSequencerBlockRequest", FIELDS, GeneratedVisitor) + deserializer.deserialize_struct("astria.sequencerblock.v1alpha1.SequencerBlockHeader", FIELDS, GeneratedVisitor) } } -impl serde::Serialize for GetSequencerBlockRequest { +impl serde::Serialize for SubmittedMetadata { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -969,30 +1162,66 @@ impl serde::Serialize for GetSequencerBlockRequest { { use serde::ser::SerializeStruct; let mut len = 0; - if self.height != 0 { + if !self.block_hash.is_empty() { len += 1; } - let mut struct_ser = serializer.serialize_struct("astria.sequencerblock.v1alpha1.GetSequencerBlockRequest", len)?; - if self.height != 0 { + if self.header.is_some() { + len += 1; + } + if !self.rollup_ids.is_empty() { + len += 1; + } + if self.rollup_transactions_proof.is_some() { + len += 1; + } + if self.rollup_ids_proof.is_some() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("astria.sequencerblock.v1alpha1.SubmittedMetadata", len)?; + if !self.block_hash.is_empty() { #[allow(clippy::needless_borrow)] - struct_ser.serialize_field("height", ToString::to_string(&self.height).as_str())?; + struct_ser.serialize_field("block_hash", pbjson::private::base64::encode(&self.block_hash).as_str())?; + } + if let Some(v) = self.header.as_ref() { + struct_ser.serialize_field("header", v)?; + } + if !self.rollup_ids.is_empty() { + struct_ser.serialize_field("rollup_ids", &self.rollup_ids)?; + } + if let Some(v) = self.rollup_transactions_proof.as_ref() { + struct_ser.serialize_field("rollup_transactions_proof", v)?; + } + if let Some(v) = self.rollup_ids_proof.as_ref() { + struct_ser.serialize_field("rollup_ids_proof", v)?; } struct_ser.end() } } -impl<'de> serde::Deserialize<'de> for GetSequencerBlockRequest { +impl<'de> serde::Deserialize<'de> for SubmittedMetadata { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ - "height", + "block_hash", + "blockHash", + "header", + "rollup_ids", + "rollupIds", + "rollup_transactions_proof", + "rollupTransactionsProof", + "rollup_ids_proof", + "rollupIdsProof", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - Height, + BlockHash, + Header, + RollupIds, + RollupTransactionsProof, + RollupIdsProof, } impl<'de> serde::Deserialize<'de> for GeneratedField { fn deserialize(deserializer: D) -> std::result::Result @@ -1014,7 +1243,11 @@ impl<'de> serde::Deserialize<'de> for GetSequencerBlockRequest { E: serde::de::Error, { match value { - "height" => Ok(GeneratedField::Height), + "blockHash" | "block_hash" => Ok(GeneratedField::BlockHash), + "header" => Ok(GeneratedField::Header), + "rollupIds" | "rollup_ids" => Ok(GeneratedField::RollupIds), + "rollupTransactionsProof" | "rollup_transactions_proof" => Ok(GeneratedField::RollupTransactionsProof), + "rollupIdsProof" | "rollup_ids_proof" => Ok(GeneratedField::RollupIdsProof), _ => Err(serde::de::Error::unknown_field(value, FIELDS)), } } @@ -1024,38 +1257,70 @@ impl<'de> serde::Deserialize<'de> for GetSequencerBlockRequest { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GetSequencerBlockRequest; + type Value = SubmittedMetadata; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct astria.sequencerblock.v1alpha1.GetSequencerBlockRequest") + formatter.write_str("struct astria.sequencerblock.v1alpha1.SubmittedMetadata") } - fn visit_map(self, mut map_: V) -> std::result::Result + fn visit_map(self, mut map_: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { - let mut height__ = None; + let mut block_hash__ = None; + let mut header__ = None; + let mut rollup_ids__ = None; + let mut rollup_transactions_proof__ = None; + let mut rollup_ids_proof__ = None; while let Some(k) = map_.next_key()? { match k { - GeneratedField::Height => { - if height__.is_some() { - return Err(serde::de::Error::duplicate_field("height")); + GeneratedField::BlockHash => { + if block_hash__.is_some() { + return Err(serde::de::Error::duplicate_field("blockHash")); } - height__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + block_hash__ = + Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) ; } + GeneratedField::Header => { + if header__.is_some() { + return Err(serde::de::Error::duplicate_field("header")); + } + header__ = map_.next_value()?; + } + GeneratedField::RollupIds => { + if rollup_ids__.is_some() { + return Err(serde::de::Error::duplicate_field("rollupIds")); + } + rollup_ids__ = Some(map_.next_value()?); + } + GeneratedField::RollupTransactionsProof => { + if rollup_transactions_proof__.is_some() { + return Err(serde::de::Error::duplicate_field("rollupTransactionsProof")); + } + rollup_transactions_proof__ = map_.next_value()?; + } + GeneratedField::RollupIdsProof => { + if rollup_ids_proof__.is_some() { + return Err(serde::de::Error::duplicate_field("rollupIdsProof")); + } + rollup_ids_proof__ = map_.next_value()?; + } } } - Ok(GetSequencerBlockRequest { - height: height__.unwrap_or_default(), + Ok(SubmittedMetadata { + block_hash: block_hash__.unwrap_or_default(), + header: header__, + rollup_ids: rollup_ids__.unwrap_or_default(), + rollup_transactions_proof: rollup_transactions_proof__, + rollup_ids_proof: rollup_ids_proof__, }) } } - deserializer.deserialize_struct("astria.sequencerblock.v1alpha1.GetSequencerBlockRequest", FIELDS, GeneratedVisitor) + deserializer.deserialize_struct("astria.sequencerblock.v1alpha1.SubmittedMetadata", FIELDS, GeneratedVisitor) } } -impl serde::Serialize for RollupData { +impl serde::Serialize for SubmittedMetadataList { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -1063,40 +1328,29 @@ impl serde::Serialize for RollupData { { use serde::ser::SerializeStruct; let mut len = 0; - if self.value.is_some() { + if !self.entries.is_empty() { len += 1; } - let mut struct_ser = serializer.serialize_struct("astria.sequencerblock.v1alpha1.RollupData", len)?; - if let Some(v) = self.value.as_ref() { - match v { - rollup_data::Value::SequencedData(v) => { - #[allow(clippy::needless_borrow)] - struct_ser.serialize_field("sequenced_data", pbjson::private::base64::encode(&v).as_str())?; - } - rollup_data::Value::Deposit(v) => { - struct_ser.serialize_field("deposit", v)?; - } - } + let mut struct_ser = serializer.serialize_struct("astria.sequencerblock.v1alpha1.SubmittedMetadataList", len)?; + if !self.entries.is_empty() { + struct_ser.serialize_field("entries", &self.entries)?; } struct_ser.end() } } -impl<'de> serde::Deserialize<'de> for RollupData { +impl<'de> serde::Deserialize<'de> for SubmittedMetadataList { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ - "sequenced_data", - "sequencedData", - "deposit", + "entries", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - SequencedData, - Deposit, + Entries, } impl<'de> serde::Deserialize<'de> for GeneratedField { fn deserialize(deserializer: D) -> std::result::Result @@ -1118,8 +1372,7 @@ impl<'de> serde::Deserialize<'de> for RollupData { E: serde::de::Error, { match value { - "sequencedData" | "sequenced_data" => Ok(GeneratedField::SequencedData), - "deposit" => Ok(GeneratedField::Deposit), + "entries" => Ok(GeneratedField::Entries), _ => Err(serde::de::Error::unknown_field(value, FIELDS)), } } @@ -1129,43 +1382,36 @@ impl<'de> serde::Deserialize<'de> for RollupData { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = RollupData; + type Value = SubmittedMetadataList; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct astria.sequencerblock.v1alpha1.RollupData") + formatter.write_str("struct astria.sequencerblock.v1alpha1.SubmittedMetadataList") } - fn visit_map(self, mut map_: V) -> std::result::Result + fn visit_map(self, mut map_: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { - let mut value__ = None; + let mut entries__ = None; while let Some(k) = map_.next_key()? { match k { - GeneratedField::SequencedData => { - if value__.is_some() { - return Err(serde::de::Error::duplicate_field("sequencedData")); - } - value__ = map_.next_value::<::std::option::Option<::pbjson::private::BytesDeserialize<_>>>()?.map(|x| rollup_data::Value::SequencedData(x.0)); - } - GeneratedField::Deposit => { - if value__.is_some() { - return Err(serde::de::Error::duplicate_field("deposit")); + GeneratedField::Entries => { + if entries__.is_some() { + return Err(serde::de::Error::duplicate_field("entries")); } - value__ = map_.next_value::<::std::option::Option<_>>()?.map(rollup_data::Value::Deposit) -; + entries__ = Some(map_.next_value()?); } } } - Ok(RollupData { - value: value__, + Ok(SubmittedMetadataList { + entries: entries__.unwrap_or_default(), }) } } - deserializer.deserialize_struct("astria.sequencerblock.v1alpha1.RollupData", FIELDS, GeneratedVisitor) + deserializer.deserialize_struct("astria.sequencerblock.v1alpha1.SubmittedMetadataList", FIELDS, GeneratedVisitor) } } -impl serde::Serialize for RollupTransactions { +impl serde::Serialize for SubmittedRollupData { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -1173,6 +1419,9 @@ impl serde::Serialize for RollupTransactions { { use serde::ser::SerializeStruct; let mut len = 0; + if !self.sequencer_block_hash.is_empty() { + len += 1; + } if self.rollup_id.is_some() { len += 1; } @@ -1182,7 +1431,11 @@ impl serde::Serialize for RollupTransactions { if self.proof.is_some() { len += 1; } - let mut struct_ser = serializer.serialize_struct("astria.sequencerblock.v1alpha1.RollupTransactions", len)?; + let mut struct_ser = serializer.serialize_struct("astria.sequencerblock.v1alpha1.SubmittedRollupData", len)?; + if !self.sequencer_block_hash.is_empty() { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("sequencer_block_hash", pbjson::private::base64::encode(&self.sequencer_block_hash).as_str())?; + } if let Some(v) = self.rollup_id.as_ref() { struct_ser.serialize_field("rollup_id", v)?; } @@ -1195,13 +1448,15 @@ impl serde::Serialize for RollupTransactions { struct_ser.end() } } -impl<'de> serde::Deserialize<'de> for RollupTransactions { +impl<'de> serde::Deserialize<'de> for SubmittedRollupData { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ + "sequencer_block_hash", + "sequencerBlockHash", "rollup_id", "rollupId", "transactions", @@ -1210,6 +1465,7 @@ impl<'de> serde::Deserialize<'de> for RollupTransactions { #[allow(clippy::enum_variant_names)] enum GeneratedField { + SequencerBlockHash, RollupId, Transactions, Proof, @@ -1234,6 +1490,7 @@ impl<'de> serde::Deserialize<'de> for RollupTransactions { E: serde::de::Error, { match value { + "sequencerBlockHash" | "sequencer_block_hash" => Ok(GeneratedField::SequencerBlockHash), "rollupId" | "rollup_id" => Ok(GeneratedField::RollupId), "transactions" => Ok(GeneratedField::Transactions), "proof" => Ok(GeneratedField::Proof), @@ -1246,21 +1503,30 @@ impl<'de> serde::Deserialize<'de> for RollupTransactions { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = RollupTransactions; + type Value = SubmittedRollupData; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct astria.sequencerblock.v1alpha1.RollupTransactions") + formatter.write_str("struct astria.sequencerblock.v1alpha1.SubmittedRollupData") } - fn visit_map(self, mut map_: V) -> std::result::Result + fn visit_map(self, mut map_: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { + let mut sequencer_block_hash__ = None; let mut rollup_id__ = None; let mut transactions__ = None; let mut proof__ = None; while let Some(k) = map_.next_key()? { match k { + GeneratedField::SequencerBlockHash => { + if sequencer_block_hash__.is_some() { + return Err(serde::de::Error::duplicate_field("sequencerBlockHash")); + } + sequencer_block_hash__ = + Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } GeneratedField::RollupId => { if rollup_id__.is_some() { return Err(serde::de::Error::duplicate_field("rollupId")); @@ -1284,183 +1550,18 @@ impl<'de> serde::Deserialize<'de> for RollupTransactions { } } } - Ok(RollupTransactions { + Ok(SubmittedRollupData { + sequencer_block_hash: sequencer_block_hash__.unwrap_or_default(), rollup_id: rollup_id__, transactions: transactions__.unwrap_or_default(), proof: proof__, }) } } - deserializer.deserialize_struct("astria.sequencerblock.v1alpha1.RollupTransactions", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for SequencerBlock { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if self.header.is_some() { - len += 1; - } - if !self.rollup_transactions.is_empty() { - len += 1; - } - if self.rollup_transactions_proof.is_some() { - len += 1; - } - if self.rollup_ids_proof.is_some() { - len += 1; - } - if !self.block_hash.is_empty() { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("astria.sequencerblock.v1alpha1.SequencerBlock", len)?; - if let Some(v) = self.header.as_ref() { - struct_ser.serialize_field("header", v)?; - } - if !self.rollup_transactions.is_empty() { - struct_ser.serialize_field("rollup_transactions", &self.rollup_transactions)?; - } - if let Some(v) = self.rollup_transactions_proof.as_ref() { - struct_ser.serialize_field("rollup_transactions_proof", v)?; - } - if let Some(v) = self.rollup_ids_proof.as_ref() { - struct_ser.serialize_field("rollup_ids_proof", v)?; - } - if !self.block_hash.is_empty() { - #[allow(clippy::needless_borrow)] - struct_ser.serialize_field("block_hash", pbjson::private::base64::encode(&self.block_hash).as_str())?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for SequencerBlock { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "header", - "rollup_transactions", - "rollupTransactions", - "rollup_transactions_proof", - "rollupTransactionsProof", - "rollup_ids_proof", - "rollupIdsProof", - "block_hash", - "blockHash", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Header, - RollupTransactions, - RollupTransactionsProof, - RollupIdsProof, - BlockHash, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "header" => Ok(GeneratedField::Header), - "rollupTransactions" | "rollup_transactions" => Ok(GeneratedField::RollupTransactions), - "rollupTransactionsProof" | "rollup_transactions_proof" => Ok(GeneratedField::RollupTransactionsProof), - "rollupIdsProof" | "rollup_ids_proof" => Ok(GeneratedField::RollupIdsProof), - "blockHash" | "block_hash" => Ok(GeneratedField::BlockHash), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = SequencerBlock; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct astria.sequencerblock.v1alpha1.SequencerBlock") - } - - fn visit_map(self, mut map_: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut header__ = None; - let mut rollup_transactions__ = None; - let mut rollup_transactions_proof__ = None; - let mut rollup_ids_proof__ = None; - let mut block_hash__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Header => { - if header__.is_some() { - return Err(serde::de::Error::duplicate_field("header")); - } - header__ = map_.next_value()?; - } - GeneratedField::RollupTransactions => { - if rollup_transactions__.is_some() { - return Err(serde::de::Error::duplicate_field("rollupTransactions")); - } - rollup_transactions__ = Some(map_.next_value()?); - } - GeneratedField::RollupTransactionsProof => { - if rollup_transactions_proof__.is_some() { - return Err(serde::de::Error::duplicate_field("rollupTransactionsProof")); - } - rollup_transactions_proof__ = map_.next_value()?; - } - GeneratedField::RollupIdsProof => { - if rollup_ids_proof__.is_some() { - return Err(serde::de::Error::duplicate_field("rollupIdsProof")); - } - rollup_ids_proof__ = map_.next_value()?; - } - GeneratedField::BlockHash => { - if block_hash__.is_some() { - return Err(serde::de::Error::duplicate_field("blockHash")); - } - block_hash__ = - Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) - ; - } - } - } - Ok(SequencerBlock { - header: header__, - rollup_transactions: rollup_transactions__.unwrap_or_default(), - rollup_transactions_proof: rollup_transactions_proof__, - rollup_ids_proof: rollup_ids_proof__, - block_hash: block_hash__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("astria.sequencerblock.v1alpha1.SequencerBlock", FIELDS, GeneratedVisitor) + deserializer.deserialize_struct("astria.sequencerblock.v1alpha1.SubmittedRollupData", FIELDS, GeneratedVisitor) } } -impl serde::Serialize for SequencerBlockHeader { +impl serde::Serialize for SubmittedRollupDataList { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -1468,77 +1569,29 @@ impl serde::Serialize for SequencerBlockHeader { { use serde::ser::SerializeStruct; let mut len = 0; - if !self.chain_id.is_empty() { - len += 1; - } - if self.height != 0 { - len += 1; - } - if self.time.is_some() { - len += 1; - } - if !self.data_hash.is_empty() { - len += 1; - } - if !self.proposer_address.is_empty() { - len += 1; - } - if !self.rollup_transactions_root.is_empty() { + if !self.entries.is_empty() { len += 1; } - let mut struct_ser = serializer.serialize_struct("astria.sequencerblock.v1alpha1.SequencerBlockHeader", len)?; - if !self.chain_id.is_empty() { - struct_ser.serialize_field("chain_id", &self.chain_id)?; - } - if self.height != 0 { - #[allow(clippy::needless_borrow)] - struct_ser.serialize_field("height", ToString::to_string(&self.height).as_str())?; - } - if let Some(v) = self.time.as_ref() { - struct_ser.serialize_field("time", v)?; - } - if !self.data_hash.is_empty() { - #[allow(clippy::needless_borrow)] - struct_ser.serialize_field("data_hash", pbjson::private::base64::encode(&self.data_hash).as_str())?; - } - if !self.proposer_address.is_empty() { - #[allow(clippy::needless_borrow)] - struct_ser.serialize_field("proposer_address", pbjson::private::base64::encode(&self.proposer_address).as_str())?; - } - if !self.rollup_transactions_root.is_empty() { - #[allow(clippy::needless_borrow)] - struct_ser.serialize_field("rollup_transactions_root", pbjson::private::base64::encode(&self.rollup_transactions_root).as_str())?; + let mut struct_ser = serializer.serialize_struct("astria.sequencerblock.v1alpha1.SubmittedRollupDataList", len)?; + if !self.entries.is_empty() { + struct_ser.serialize_field("entries", &self.entries)?; } struct_ser.end() } } -impl<'de> serde::Deserialize<'de> for SequencerBlockHeader { +impl<'de> serde::Deserialize<'de> for SubmittedRollupDataList { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ - "chain_id", - "chainId", - "height", - "time", - "data_hash", - "dataHash", - "proposer_address", - "proposerAddress", - "rollup_transactions_root", - "rollupTransactionsRoot", + "entries", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - ChainId, - Height, - Time, - DataHash, - ProposerAddress, - RollupTransactionsRoot, + Entries, } impl<'de> serde::Deserialize<'de> for GeneratedField { fn deserialize(deserializer: D) -> std::result::Result @@ -1560,12 +1613,7 @@ impl<'de> serde::Deserialize<'de> for SequencerBlockHeader { E: serde::de::Error, { match value { - "chainId" | "chain_id" => Ok(GeneratedField::ChainId), - "height" => Ok(GeneratedField::Height), - "time" => Ok(GeneratedField::Time), - "dataHash" | "data_hash" => Ok(GeneratedField::DataHash), - "proposerAddress" | "proposer_address" => Ok(GeneratedField::ProposerAddress), - "rollupTransactionsRoot" | "rollup_transactions_root" => Ok(GeneratedField::RollupTransactionsRoot), + "entries" => Ok(GeneratedField::Entries), _ => Err(serde::de::Error::unknown_field(value, FIELDS)), } } @@ -1575,80 +1623,32 @@ impl<'de> serde::Deserialize<'de> for SequencerBlockHeader { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = SequencerBlockHeader; + type Value = SubmittedRollupDataList; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct astria.sequencerblock.v1alpha1.SequencerBlockHeader") + formatter.write_str("struct astria.sequencerblock.v1alpha1.SubmittedRollupDataList") } - fn visit_map(self, mut map_: V) -> std::result::Result + fn visit_map(self, mut map_: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { - let mut chain_id__ = None; - let mut height__ = None; - let mut time__ = None; - let mut data_hash__ = None; - let mut proposer_address__ = None; - let mut rollup_transactions_root__ = None; + let mut entries__ = None; while let Some(k) = map_.next_key()? { match k { - GeneratedField::ChainId => { - if chain_id__.is_some() { - return Err(serde::de::Error::duplicate_field("chainId")); - } - chain_id__ = Some(map_.next_value()?); - } - GeneratedField::Height => { - if height__.is_some() { - return Err(serde::de::Error::duplicate_field("height")); - } - height__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; - } - GeneratedField::Time => { - if time__.is_some() { - return Err(serde::de::Error::duplicate_field("time")); - } - time__ = map_.next_value()?; - } - GeneratedField::DataHash => { - if data_hash__.is_some() { - return Err(serde::de::Error::duplicate_field("dataHash")); - } - data_hash__ = - Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) - ; - } - GeneratedField::ProposerAddress => { - if proposer_address__.is_some() { - return Err(serde::de::Error::duplicate_field("proposerAddress")); - } - proposer_address__ = - Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) - ; - } - GeneratedField::RollupTransactionsRoot => { - if rollup_transactions_root__.is_some() { - return Err(serde::de::Error::duplicate_field("rollupTransactionsRoot")); + GeneratedField::Entries => { + if entries__.is_some() { + return Err(serde::de::Error::duplicate_field("entries")); } - rollup_transactions_root__ = - Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) - ; + entries__ = Some(map_.next_value()?); } } } - Ok(SequencerBlockHeader { - chain_id: chain_id__.unwrap_or_default(), - height: height__.unwrap_or_default(), - time: time__, - data_hash: data_hash__.unwrap_or_default(), - proposer_address: proposer_address__.unwrap_or_default(), - rollup_transactions_root: rollup_transactions_root__.unwrap_or_default(), + Ok(SubmittedRollupDataList { + entries: entries__.unwrap_or_default(), }) } } - deserializer.deserialize_struct("astria.sequencerblock.v1alpha1.SequencerBlockHeader", FIELDS, GeneratedVisitor) + deserializer.deserialize_struct("astria.sequencerblock.v1alpha1.SubmittedRollupDataList", FIELDS, GeneratedVisitor) } } diff --git a/crates/astria-core/src/sequencerblock/v1alpha1/block.rs b/crates/astria-core/src/sequencerblock/v1alpha1/block.rs index 426ebcc18c..90ef2f9bfc 100644 --- a/crates/astria-core/src/sequencerblock/v1alpha1/block.rs +++ b/crates/astria-core/src/sequencerblock/v1alpha1/block.rs @@ -12,8 +12,8 @@ use super::{ are_rollup_txs_included, celestia::{ self, - CelestiaHeader, - CelestiaRollupData, + SubmittedMetadata, + SubmittedRollupData, }, raw, }; @@ -684,10 +684,10 @@ impl SequencerBlock { } } - /// Turn the sequencer block into a [`CelestiaHeader`] and list of [`CelestiaRollupData`]. + /// Turn the sequencer block into a [`SubmittedMetadata`] and list of [`SubmittedRollupData`]. #[must_use] - pub fn split_for_celestia(self) -> (CelestiaHeader, Vec) { - celestia::CelestiaBlobBundle::from_sequencer_block(self).into_parts() + pub fn split_for_celestia(self) -> (SubmittedMetadata, Vec) { + celestia::PreparedBlock::from_sequencer_block(self).into_parts() } /// Converts from relevant header fields and the block data. diff --git a/crates/astria-core/src/sequencerblock/v1alpha1/celestia.rs b/crates/astria-core/src/sequencerblock/v1alpha1/celestia.rs index 905d01e483..14aecfd4ad 100644 --- a/crates/astria-core/src/sequencerblock/v1alpha1/celestia.rs +++ b/crates/astria-core/src/sequencerblock/v1alpha1/celestia.rs @@ -16,16 +16,15 @@ use super::{ }; use crate::Protobuf; -/// A bundle of blobs constructed from a [`super::SequencerBlock`]. +/// A [`super::SequencerBlock`] split and prepared for submission to a data availability provider. /// -/// Consists of a head [`CelestiaSequencerBlob`] and a tail of [`CelestiaRollupBlob`]s. -/// Used as a pass-through data structure to -pub(super) struct CelestiaBlobBundle { - head: CelestiaHeader, - tail: Vec, +/// Consists of a head [`SubmittedMetadata`] and a tail of [`SubmittedRollupData`]s. +pub(super) struct PreparedBlock { + head: SubmittedMetadata, + tail: Vec, } -impl CelestiaBlobBundle { +impl PreparedBlock { /// Construct a bundle of celestia blobs from a [`super::SequencerBlock`]. #[must_use] pub(super) fn from_sequencer_block(block: SequencerBlock) -> Self { @@ -37,7 +36,7 @@ impl CelestiaBlobBundle { rollup_ids_proof, } = block.into_parts(); - let head = CelestiaHeader { + let head = SubmittedMetadata { block_hash, header, rollup_ids: rollup_transactions.keys().copied().collect(), @@ -52,7 +51,7 @@ impl CelestiaBlobBundle { proof, .. } = rollup_txs.into_parts(); - tail.push(CelestiaRollupData { + tail.push(SubmittedRollupData { sequencer_block_hash: block_hash, rollup_id, transactions, @@ -65,8 +64,8 @@ impl CelestiaBlobBundle { } } - /// Returns the head and the tail of the celestia blob bundle, consuming it. - pub(super) fn into_parts(self) -> (CelestiaHeader, Vec) { + /// Returns the head and the tail of the split block, consuming it. + pub(super) fn into_parts(self) -> (SubmittedMetadata, Vec) { (self.head, self.tail) } } @@ -74,15 +73,15 @@ impl CelestiaBlobBundle { #[derive(Debug, thiserror::Error)] #[error("failed constructing a celestia rollup blob")] #[allow(clippy::module_name_repetitions)] -pub struct CelestiaRollupBlobError { +pub struct SubmittedRollupDataError { #[source] - kind: CelestiaRollupBlobErrorKind, + kind: SubmittedRollupDataErrorKind, } -impl CelestiaRollupBlobError { +impl SubmittedRollupDataError { fn field_not_set(field: &'static str) -> Self { Self { - kind: CelestiaRollupBlobErrorKind::FieldNotSet { + kind: SubmittedRollupDataErrorKind::FieldNotSet { field, }, } @@ -90,7 +89,7 @@ impl CelestiaRollupBlobError { fn rollup_id(source: IncorrectRollupIdLength) -> Self { Self { - kind: CelestiaRollupBlobErrorKind::RollupId { + kind: SubmittedRollupDataErrorKind::RollupId { source, }, } @@ -98,7 +97,7 @@ impl CelestiaRollupBlobError { fn proof(source: ::Error) -> Self { Self { - kind: CelestiaRollupBlobErrorKind::Proof { + kind: SubmittedRollupDataErrorKind::Proof { source, }, } @@ -106,13 +105,13 @@ impl CelestiaRollupBlobError { fn sequencer_block_hash(actual_len: usize) -> Self { Self { - kind: CelestiaRollupBlobErrorKind::SequencerBlockHash(actual_len), + kind: SubmittedRollupDataErrorKind::SequencerBlockHash(actual_len), } } } #[derive(Debug, thiserror::Error)] -enum CelestiaRollupBlobErrorKind { +enum SubmittedRollupDataErrorKind { #[error("the expected field in the raw source type was not set: `{field}`")] FieldNotSet { field: &'static str }, #[error("failed converting the provided bytes to Rollup ID")] @@ -128,11 +127,11 @@ enum CelestiaRollupBlobErrorKind { SequencerBlockHash(usize), } -/// A shadow of [`CelestiaRollupBlob`] with public access to all its fields. +/// A shadow of [`SubmittedRollupData`] with public access to all its fields. /// -/// At the moment there are no invariants upheld by [`CelestiaRollupBlob`] so +/// At the moment there are no invariants upheld by [`SubmittedRollupData`] so /// they can be converted directly into one another. This can change in the future. -pub struct UncheckedCelestiaRollupBlob { +pub struct UncheckedSubmittedRollupData { /// The hash of the sequencer block. Must be 32 bytes. pub sequencer_block_hash: [u8; 32], /// The 32 bytes identifying the rollup this blob belongs to. Matches @@ -144,16 +143,16 @@ pub struct UncheckedCelestiaRollupBlob { pub proof: merkle::Proof, } -impl UncheckedCelestiaRollupBlob { +impl UncheckedSubmittedRollupData { #[must_use] - pub fn into_celestia_rollup_blob(self) -> CelestiaRollupData { - CelestiaRollupData::from_unchecked(self) + pub fn into_celestia_rollup_blob(self) -> SubmittedRollupData { + SubmittedRollupData::from_unchecked(self) } } #[derive(Clone, Debug)] #[allow(clippy::module_name_repetitions)] -pub struct CelestiaRollupData { +pub struct SubmittedRollupData { /// The hash of the sequencer block. Must be 32 bytes. sequencer_block_hash: [u8; 32], /// The 32 bytes identifying the rollup this blob belongs to. Matches @@ -165,7 +164,7 @@ pub struct CelestiaRollupData { proof: merkle::Proof, } -impl CelestiaRollupData { +impl SubmittedRollupData { #[must_use] pub fn proof(&self) -> &merkle::Proof { &self.proof @@ -190,8 +189,8 @@ impl CelestiaRollupData { /// /// This type does not uphold any extra invariants so there are no extra checks necessary. #[must_use] - pub fn from_unchecked(unchecked: UncheckedCelestiaRollupBlob) -> Self { - let UncheckedCelestiaRollupBlob { + pub fn from_unchecked(unchecked: UncheckedSubmittedRollupData) -> Self { + let UncheckedSubmittedRollupData { sequencer_block_hash, rollup_id, transactions, @@ -209,14 +208,14 @@ impl CelestiaRollupData { /// /// Useful to get public access to the type's fields. #[must_use] - pub fn into_unchecked(self) -> UncheckedCelestiaRollupBlob { + pub fn into_unchecked(self) -> UncheckedSubmittedRollupData { let Self { sequencer_block_hash, rollup_id, transactions, proof, } = self; - UncheckedCelestiaRollupBlob { + UncheckedSubmittedRollupData { sequencer_block_hash, rollup_id, transactions, @@ -228,14 +227,14 @@ impl CelestiaRollupData { /// /// Useful for then encoding it as protobuf. #[must_use] - pub fn into_raw(self) -> raw::CelestiaRollupData { + pub fn into_raw(self) -> raw::SubmittedRollupData { let Self { sequencer_block_hash, rollup_id, transactions, proof, } = self; - raw::CelestiaRollupData { + raw::SubmittedRollupData { sequencer_block_hash: sequencer_block_hash.to_vec(), rollup_id: Some(rollup_id.to_raw()), transactions, @@ -247,26 +246,26 @@ impl CelestiaRollupData { /// /// # Errors /// TODO(https://github.com/astriaorg/astria/issues/612) - pub fn try_from_raw(raw: raw::CelestiaRollupData) -> Result { - let raw::CelestiaRollupData { + pub fn try_from_raw(raw: raw::SubmittedRollupData) -> Result { + let raw::SubmittedRollupData { sequencer_block_hash, rollup_id, transactions, proof, } = raw; let Some(rollup_id) = rollup_id else { - return Err(CelestiaRollupBlobError::field_not_set("rollup_id")); + return Err(SubmittedRollupDataError::field_not_set("rollup_id")); }; let rollup_id = - RollupId::try_from_raw(&rollup_id).map_err(CelestiaRollupBlobError::rollup_id)?; - let sequencer_block_hash = sequencer_block_hash - .try_into() - .map_err(|bytes: Vec| CelestiaRollupBlobError::sequencer_block_hash(bytes.len()))?; + RollupId::try_from_raw(&rollup_id).map_err(SubmittedRollupDataError::rollup_id)?; + let sequencer_block_hash = sequencer_block_hash.try_into().map_err(|bytes: Vec| { + SubmittedRollupDataError::sequencer_block_hash(bytes.len()) + })?; let proof = 'proof: { let Some(proof) = proof else { - break 'proof Err(CelestiaRollupBlobError::field_not_set("proof")); + break 'proof Err(SubmittedRollupDataError::field_not_set("proof")); }; - merkle::Proof::try_from_raw(proof).map_err(CelestiaRollupBlobError::proof) + merkle::Proof::try_from_raw(proof).map_err(SubmittedRollupDataError::proof) }?; Ok(Self { sequencer_block_hash, @@ -280,21 +279,21 @@ impl CelestiaRollupData { #[derive(Debug, thiserror::Error)] #[error("failed constructing a celestia sequencer blob")] #[allow(clippy::module_name_repetitions)] -pub struct CelestiaSequencerBlobError { +pub struct SubmittedMetadataError { #[source] - kind: CelestiaSequencerBlobErrorKind, + kind: SubmittedMetadataErrorKind, } -impl CelestiaSequencerBlobError { +impl SubmittedMetadataError { fn block_hash(actual_len: usize) -> Self { Self { - kind: CelestiaSequencerBlobErrorKind::BlockHash(actual_len), + kind: SubmittedMetadataErrorKind::BlockHash(actual_len), } } fn header(source: SequencerBlockHeaderError) -> Self { Self { - kind: CelestiaSequencerBlobErrorKind::Header { + kind: SubmittedMetadataErrorKind::Header { source, }, } @@ -302,13 +301,13 @@ impl CelestiaSequencerBlobError { fn field_not_set(field: &'static str) -> Self { Self { - kind: CelestiaSequencerBlobErrorKind::FieldNotSet(field), + kind: SubmittedMetadataErrorKind::FieldNotSet(field), } } fn rollup_ids(source: IncorrectRollupIdLength) -> Self { Self { - kind: CelestiaSequencerBlobErrorKind::RollupIds { + kind: SubmittedMetadataErrorKind::RollupIds { source, }, } @@ -316,7 +315,7 @@ impl CelestiaSequencerBlobError { fn rollup_transactions_proof(source: ::Error) -> Self { Self { - kind: CelestiaSequencerBlobErrorKind::RollupTransactionsProof { + kind: SubmittedMetadataErrorKind::RollupTransactionsProof { source, }, } @@ -324,7 +323,7 @@ impl CelestiaSequencerBlobError { fn rollup_ids_proof(source: ::Error) -> Self { Self { - kind: CelestiaSequencerBlobErrorKind::RollupIdsProof { + kind: SubmittedMetadataErrorKind::RollupIdsProof { source, }, } @@ -332,19 +331,19 @@ impl CelestiaSequencerBlobError { fn rollup_transactions_not_in_cometbft_block() -> Self { Self { - kind: CelestiaSequencerBlobErrorKind::RollupTransactionsNotInCometBftBlock, + kind: SubmittedMetadataErrorKind::RollupTransactionsNotInCometBftBlock, } } fn rollup_ids_not_in_cometbft_block() -> Self { Self { - kind: CelestiaSequencerBlobErrorKind::RollupIdsNotInCometBftBlock, + kind: SubmittedMetadataErrorKind::RollupIdsNotInCometBftBlock, } } } #[derive(Debug, thiserror::Error)] -enum CelestiaSequencerBlobErrorKind { +enum SubmittedMetadataErrorKind { #[error( "the provided bytes were too short for a block hash; expected: 32 bytes, actual: {0} bytes" )] @@ -378,17 +377,17 @@ enum CelestiaSequencerBlobErrorKind { RollupIdsNotInCometBftBlock, } -/// A shadow of [`CelestiaSequencerBlob`] with public access to its fields. +/// A shadow of [`SubmittedMetadata`] with public access to its fields. /// /// This type does not guarantee any invariants and is mainly useful to get /// access the sequencer block's internal types. #[derive(Clone, Debug)] -pub struct UncheckedCelestiaSequencerBlob { +pub struct UncheckedSubmittedMetadata { pub block_hash: [u8; 32], /// The original `CometBFT` header that is the input to this blob's original sequencer block. /// Corresponds to `astria.SequencerBlock.header`. pub header: SequencerBlockHeader, - /// The rollup rollup IDs for which `CelestiaRollupBlob`s were submitted to celestia. + /// The rollup rollup IDs for which `SubmittedRollupData`s were submitted to celestia. /// Corresponds to the `astria.sequencer.v1.RollupTransactions.id` field /// and is extracted from `astria.SequencerBlock.rollup_transactions`. pub rollup_ids: Vec, @@ -404,23 +403,23 @@ pub struct UncheckedCelestiaSequencerBlob { pub rollup_ids_proof: merkle::Proof, } -impl UncheckedCelestiaSequencerBlob { - /// Converts this unchecked blob into its checked [`CelestiaSequencerBlob`] representation. +impl UncheckedSubmittedMetadata { + /// Converts this unchecked blob into its checked [`SubmittedMetadata`] representation. /// /// # Errors /// TODO(https://github.com/astriaorg/astria/issues/612) pub fn try_into_celestia_sequencer_blob( self, - ) -> Result { - CelestiaHeader::try_from_unchecked(self) + ) -> Result { + SubmittedMetadata::try_from_unchecked(self) } /// Converts from the raw decoded protobuf representation of this type. /// /// # Errors /// TODO(https://github.com/astriaorg/astria/issues/612) - pub fn try_from_raw(raw: raw::CelestiaHeader) -> Result { - let raw::CelestiaHeader { + pub fn try_from_raw(raw: raw::SubmittedMetadata) -> Result { + let raw::SubmittedMetadata { block_hash, header, rollup_ids, @@ -430,39 +429,37 @@ impl UncheckedCelestiaSequencerBlob { } = raw; let header = 'header: { let Some(header) = header else { - break 'header Err(CelestiaSequencerBlobError::field_not_set("header")); + break 'header Err(SubmittedMetadataError::field_not_set("header")); }; - SequencerBlockHeader::try_from_raw(header).map_err(CelestiaSequencerBlobError::header) + SequencerBlockHeader::try_from_raw(header).map_err(SubmittedMetadataError::header) }?; let rollup_ids: Vec<_> = rollup_ids .iter() .map(RollupId::try_from_raw) .collect::>() - .map_err(CelestiaSequencerBlobError::rollup_ids)?; + .map_err(SubmittedMetadataError::rollup_ids)?; let rollup_transactions_proof = 'transactions_proof: { let Some(rollup_transactions_proof) = rollup_transactions_proof else { - break 'transactions_proof Err(CelestiaSequencerBlobError::field_not_set( + break 'transactions_proof Err(SubmittedMetadataError::field_not_set( "rollup_transactions_root", )); }; merkle::Proof::try_from_raw(rollup_transactions_proof) - .map_err(CelestiaSequencerBlobError::rollup_transactions_proof) + .map_err(SubmittedMetadataError::rollup_transactions_proof) }?; let rollup_ids_proof = 'ids_proof: { let Some(rollup_ids_proof) = rollup_ids_proof else { - break 'ids_proof Err(CelestiaSequencerBlobError::field_not_set( - "rollup_ids_proof", - )); + break 'ids_proof Err(SubmittedMetadataError::field_not_set("rollup_ids_proof")); }; merkle::Proof::try_from_raw(rollup_ids_proof) - .map_err(CelestiaSequencerBlobError::rollup_ids_proof) + .map_err(SubmittedMetadataError::rollup_ids_proof) }?; let block_hash = block_hash .try_into() - .map_err(|bytes: Vec<_>| CelestiaSequencerBlobError::block_hash(bytes.len()))?; + .map_err(|bytes: Vec<_>| SubmittedMetadataError::block_hash(bytes.len()))?; Ok(Self { block_hash, @@ -476,12 +473,12 @@ impl UncheckedCelestiaSequencerBlob { #[derive(Clone, Debug)] #[allow(clippy::module_name_repetitions)] -pub struct CelestiaHeader { +pub struct SubmittedMetadata { /// The block hash obtained from hashing `.header`. block_hash: [u8; 32], /// The sequencer block header. header: SequencerBlockHeader, - /// The rollup IDs for which `CelestiaRollupBlob`s were submitted to celestia. + /// The rollup IDs for which `SubmittedRollupData`s were submitted to celestia. /// Corresponds to the `astria.sequencer.v1.RollupTransactions.id` field /// and is extracted from `astria.SequencerBlock.rollup_transactions`. rollup_ids: Vec, @@ -497,7 +494,7 @@ pub struct CelestiaHeader { rollup_ids_proof: merkle::Proof, } -impl CelestiaHeader { +impl SubmittedMetadata { /// Returns the block hash of the tendermint header stored in this blob. #[must_use] pub fn block_hash(&self) -> [u8; 32] { @@ -537,7 +534,7 @@ impl CelestiaHeader { /// Converts into the unchecked representation fo this type. #[must_use] - pub fn into_unchecked(self) -> UncheckedCelestiaSequencerBlob { + pub fn into_unchecked(self) -> UncheckedSubmittedMetadata { let Self { block_hash, header, @@ -545,7 +542,7 @@ impl CelestiaHeader { rollup_transactions_proof, rollup_ids_proof, } = self; - UncheckedCelestiaSequencerBlob { + UncheckedSubmittedMetadata { block_hash, header, rollup_ids, @@ -559,9 +556,9 @@ impl CelestiaHeader { /// # Errors /// TODO(https://github.com/astriaorg/astria/issues/612) pub fn try_from_unchecked( - unchecked: UncheckedCelestiaSequencerBlob, - ) -> Result { - let UncheckedCelestiaSequencerBlob { + unchecked: UncheckedSubmittedMetadata, + ) -> Result { + let UncheckedSubmittedMetadata { block_hash, header, rollup_ids, @@ -573,7 +570,7 @@ impl CelestiaHeader { &Sha256::digest(header.rollup_transactions_root()), header.data_hash(), ) { - return Err(CelestiaSequencerBlobError::rollup_transactions_not_in_cometbft_block()); + return Err(SubmittedMetadataError::rollup_transactions_not_in_cometbft_block()); } if !super::are_rollup_ids_included( @@ -581,7 +578,7 @@ impl CelestiaHeader { &rollup_ids_proof, header.data_hash(), ) { - return Err(CelestiaSequencerBlobError::rollup_ids_not_in_cometbft_block()); + return Err(SubmittedMetadataError::rollup_ids_not_in_cometbft_block()); } Ok(Self { @@ -594,7 +591,7 @@ impl CelestiaHeader { } /// Converts into the raw decoded protobuf representation of this type. - pub fn into_raw(self) -> raw::CelestiaHeader { + pub fn into_raw(self) -> raw::SubmittedMetadata { let Self { block_hash, header, @@ -603,7 +600,7 @@ impl CelestiaHeader { rollup_ids_proof, .. } = self; - raw::CelestiaHeader { + raw::SubmittedMetadata { block_hash: block_hash.to_vec(), header: Some(header.into_raw()), rollup_ids: rollup_ids.into_iter().map(RollupId::into_raw).collect(), @@ -616,8 +613,8 @@ impl CelestiaHeader { /// /// # Errors /// TODO(https://github.com/astriaorg/astria/issues/612) - pub fn try_from_raw(raw: raw::CelestiaHeader) -> Result { - UncheckedCelestiaSequencerBlob::try_from_raw(raw) - .and_then(UncheckedCelestiaSequencerBlob::try_into_celestia_sequencer_blob) + pub fn try_from_raw(raw: raw::SubmittedMetadata) -> Result { + UncheckedSubmittedMetadata::try_from_raw(raw) + .and_then(UncheckedSubmittedMetadata::try_into_celestia_sequencer_blob) } } diff --git a/crates/astria-core/src/sequencerblock/v1alpha1/mod.rs b/crates/astria-core/src/sequencerblock/v1alpha1/mod.rs index c85d59a9d9..62487151cd 100644 --- a/crates/astria-core/src/sequencerblock/v1alpha1/mod.rs +++ b/crates/astria-core/src/sequencerblock/v1alpha1/mod.rs @@ -6,8 +6,8 @@ pub use block::{ SequencerBlock, }; pub use celestia::{ - CelestiaHeader, - CelestiaRollupData, + SubmittedMetadata, + SubmittedRollupData, }; use indexmap::IndexMap; use sha2::{ diff --git a/crates/astria-sequencer-relayer/src/relayer/write/conversion.rs b/crates/astria-sequencer-relayer/src/relayer/write/conversion.rs index 3632b71cb0..05a2e4bade 100644 --- a/crates/astria-sequencer-relayer/src/relayer/write/conversion.rs +++ b/crates/astria-sequencer-relayer/src/relayer/write/conversion.rs @@ -11,10 +11,10 @@ use std::{ use astria_core::{ brotli::compress_bytes, generated::sequencerblock::v1alpha1::{ - CelestiaHeader, - CelestiaHeaderList, - CelestiaRollupData, - CelestiaRollupDataList, + SubmittedMetadata, + SubmittedMetadataList, + SubmittedRollupData, + SubmittedRollupDataList, }, primitive::v1::RollupId, }; @@ -173,8 +173,8 @@ pub(super) struct InputMeta { #[derive(Clone, Debug, Default)] struct Input { - headers: Vec, - rollup_data_for_namespace: HashMap>, + metadata: Vec, + rollup_data_for_namespace: HashMap>, meta: InputMeta, } @@ -188,7 +188,7 @@ impl Input { } fn num_blocks(&self) -> usize { - self.headers.len() + self.metadata.len() } fn extend_from_sequencer_block( @@ -203,16 +203,16 @@ impl Input { already present; carrying on, but this shouldn't happen", ); } - let (header, rollup_elements) = block.split_for_celestia(); - let header = header.into_raw(); + let (metadata, rollup_data) = block.split_for_celestia(); + let metadata = metadata.into_raw(); // XXX: This should really be set at the beginning of the sequencer-relayer and reused // everywhere. self.meta .sequencer_namespace - .get_or_insert_with(|| sequencer_namespace(&header)); - self.headers.push(header); - for elem in rollup_elements { + .get_or_insert_with(|| sequencer_namespace(&metadata)); + self.metadata.push(metadata); + for elem in rollup_data { if rollup_filter.should_include(&elem.rollup_id()) { let namespace = astria_core::celestia::namespace_v0_from_rollup_id(elem.rollup_id()); @@ -236,7 +236,7 @@ impl Input { use prost::Name as _; let mut payload = - Payload::with_capacity(self.headers.len() + self.rollup_data_for_namespace.len()); + Payload::with_capacity(self.metadata.len() + self.rollup_data_for_namespace.len()); let sequencer_namespace = self .meta @@ -245,26 +245,26 @@ impl Input { payload .try_add( sequencer_namespace, - &CelestiaHeaderList { - headers: self.headers, + &SubmittedMetadataList { + entries: self.metadata, }, ) .map_err(|source| TryIntoPayloadError::AddToPayload { source, - type_url: CelestiaHeaderList::type_url(), + type_url: SubmittedMetadataList::type_url(), })?; for (namespace, entries) in self.rollup_data_for_namespace { payload .try_add( namespace, - &CelestiaRollupDataList { + &SubmittedRollupDataList { entries, }, ) .map_err(|source| TryIntoPayloadError::AddToPayload { source, - type_url: CelestiaRollupDataList::full_name(), + type_url: SubmittedRollupDataList::full_name(), })?; } Ok(payload) @@ -377,7 +377,7 @@ impl<'a> Future for TakeSubmission<'a> { } } -/// Constructs a Celestia [`Namespace`] from a [`CelestiaHeader`]. +/// Constructs a Celestia [`Namespace`] from a [`SubmittedMetadata`]. /// /// # Note /// This should be constructed once at the beginning of sequencer-relayer and then @@ -385,15 +385,16 @@ impl<'a> Future for TakeSubmission<'a> { /// /// # Panics /// Panics if the `header.header` field is unset. This is OK because the argument to this -/// function should only come from a [`CelestiaHeader`] that was created from its verified -/// counterpart [`astria_core::sequencerblock::v1alpha1::CelestiaHeader::into_raw`]. -fn sequencer_namespace(header: &CelestiaHeader) -> Namespace { +/// function should only come from a [`SubmittedMetadata`] that was created from its verified +/// counterpart [`astria_core::sequencerblock::v1alpha1::SubmittedMetadata::into_raw`]. +fn sequencer_namespace(metadata: &SubmittedMetadata) -> Namespace { use const_format::concatcp; use prost::Name; - const HEADER_EXPECT_MSG: &str = concatcp!(CelestiaHeader::PACKAGE, ".", CelestiaHeader::NAME,); + const HEADER_EXPECT_MSG: &str = + concatcp!(SubmittedMetadata::PACKAGE, ".", SubmittedMetadata::NAME,); astria_core::celestia::namespace_v0_from_sha256_of_bytes( - header + metadata .header .as_ref() .expect(HEADER_EXPECT_MSG) diff --git a/proto/sequencerblockapis/astria/sequencerblock/v1alpha1/celestia.proto b/proto/sequencerblockapis/astria/sequencerblock/v1alpha1/celestia.proto index d3d489622a..e60fca12d8 100644 --- a/proto/sequencerblockapis/astria/sequencerblock/v1alpha1/celestia.proto +++ b/proto/sequencerblockapis/astria/sequencerblock/v1alpha1/celestia.proto @@ -5,21 +5,32 @@ package astria.sequencerblock.v1alpha1; import "astria/primitive/v1/types.proto"; import "astria/sequencerblock/v1alpha1/block.proto"; -// A sequence of `astria.sequencerblock.v1alpha1.CelestiaRollup` that are posted to Celestia. -message CelestiaRollupDataList { - repeated astria.sequencerblock.v1alpha1.CelestiaRollupData entries = 1; +// A sequence of `astria.sequencerblock.v1alpha1.SubmittedRollupData` submitted to Celestia. +message SubmittedRollupDataList { + repeated SubmittedRollupData entries = 1; } // A collection of transactions belonging to a specific rollup that are submitted to celestia. // // It is created by splitting an `astria.sequencerblock.v1alpha1.SequencerBlock` into a -// `astria.sequencerblock.v1alpha1.CelestiaHeader`, and a sequence of -// `astria.sequencerblock.v1alpha.CelestiaRollup` (this object). +// `astria.sequencerblock.v1alpha1.SequencerBlockMetadata`, and a sequence of +// `astria.sequencerblock.v1alpha.RollupData` (this object). // // The transactions contained in the item belong to a rollup identified // by `rollup_id`, and were included in the sequencer block identified // by `sequencer_block_hash`. -message CelestiaRollupData { + +// A collection of transactions belonging to a specific Rollup that is submitted to a Data +// Availability provider like Celestia. +// +// It is created by splitting an `astria.sequencerblock.v1alpha1.SequencerBlock` into a +// `astria.sequencerblock.v1alpha1.SubmittedMetadata`, and a sequence of +// `astria.sequencerblock.v1alpha.SubmittedRollupData` (this object; one object per rollup that had +// data included in the sequencer block). +// +// The original sequencer block (and in turn CometBFT block) can be identified by the +// `sequencer_block_hash` field. +message SubmittedRollupData { // The hash of the sequencer block. Must be 32 bytes. bytes sequencer_block_hash = 1; // The 32 bytes identifying the rollup this blob belongs to. Matches @@ -32,33 +43,35 @@ message CelestiaRollupData { astria.primitive.v1.Proof proof = 4; } -// A sequence of `astria.sequencerblock.v1alpha1.CelestiaHeader` that are posted to Celestia. -message CelestiaHeaderList { - repeated astria.sequencerblock.v1alpha1.CelestiaHeader headers = 1; +// A sequence of `astria.sequencerblock.v1alpha1.SubmittedMetadata` submitted to Celestia. +message SubmittedMetadataList { + repeated SubmittedMetadata entries = 1; } -// The metadata of a sequencer block that is submitted to celestia. +// The metadata of a sequencer block that is submitted to a Data Availability provider like +// Celestia // // It is created by splitting an `astria.sequencerblock.v1alpha1.SequencerBlock` into a -// `astria.sequencerblock.v1alphha1.CelestiaHeader` (this object), and a sequence of -// `astria.sequencerblock.v1alpha.CelestiaRollupData` (one object per rollup that had data +// `astria.sequencerblock.v1alpha1.SubmittedMetadata` (this object), and a sequence of +// `astria.sequencerblock.v1alpha.SubmittedRollupData` (one object per rollup that had data // included in the sequencer block). // // The original sequencer block (and in turn CometBFT block) can be identified by the // `block_hash` field. -message CelestiaHeader { +message SubmittedMetadata { // the 32-byte block hash of the sequencer block. bytes block_hash = 1; // the block header, which contains sequencer-specific commitments. astria.sequencerblock.v1alpha1.SequencerBlockHeader header = 2; - // The rollup IDs for which `CelestiaRollupBlob`s were submitted to celestia. - // Corresponds to the `astria.sequencer.v1.RollupTransactions.rollup_id` field - // and is extracted from `astria.SequencerBlock.rollup_transactions`. + // The rollup IDs that had transactions included in the `astria.sequencerblock.v1alpha1.SequencerBlock` + // that this object is derived from. + // Corresponds to `astria.sequencerblock.v1alpha1.RollupTransactions.rollup_id` + // extracted from `astria.sequencerblock.v1alpha1.SsequencerBlock.rollup_transactions`. repeated astria.primitive.v1.RollupId rollup_ids = 3; // The proof that the rollup transactions are included in sequencer block. - // Corresponds to `astria.sequencer.v1alpha.SequencerBlock.rollup_transactions_proof`. + // Corresponds to `astria.sequencerblock.v1alpha1.SequencerBlock.rollup_transactions_proof`. astria.primitive.v1.Proof rollup_transactions_proof = 4; // The proof that the rollup IDs are included in sequencer block. - // Corresponds to `astria.sequencer.v1alpha.SequencerBlock.rollup_ids_proof`. + // Corresponds to `astria.sequencerblock.v1alpha1.SequencerBlock.rollup_ids_proof`. astria.primitive.v1.Proof rollup_ids_proof = 5; }