From 87fe1498d6c16dc13d9b2b78495af0b71ba8da2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maciej=20Zwoli=C5=84ski?= Date: Fri, 29 Nov 2024 12:35:27 +0100 Subject: [PATCH] feat(proto,types,rpc)!: celestia node v0.20.4 upgrade (#469) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: MikoĊ‚aj Florkiewicz Co-authored-by: Yiannis Marangos Signed-off-by: Yiannis Marangos --- .github/workflows/ci.yml | 19 +++- ci/Dockerfile.bridge | 4 +- ci/Dockerfile.validator | 2 +- ci/docker-compose.yml | 3 + ci/run-validator.sh | 14 +-- grpc/tests/{utils.rs => utils/mod.rs} | 0 node/src/block_ranges.rs | 2 +- node/src/store/indexed_db_store.rs | 2 +- node/src/store/utils.rs | 2 +- node/tests/shwap.rs | 5 +- proto/build.rs | 3 +- proto/vendor/celestia/core/v1/blob/blob.proto | 24 ----- rpc/Cargo.toml | 6 +- rpc/src/share.rs | 95 ++++++++++--------- rpc/tests/share.rs | 45 ++++++--- tools/update-proto-vendor.sh | 4 +- types/src/data_availability_header.rs | 2 +- types/src/row_namespace_data.rs | 4 +- 18 files changed, 122 insertions(+), 114 deletions(-) rename grpc/tests/{utils.rs => utils/mod.rs} (100%) delete mode 100644 proto/vendor/celestia/core/v1/blob/blob.proto diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index de80e38b..58316918 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,10 +19,10 @@ jobs: target: wasm32-unknown-unknown - name: Run clippy for native - run: cargo clippy --all --all-targets -- -D warnings -D missing-docs + run: cargo clippy --all --all-targets -- -D warnings - name: Run clippy for wasm32 - run: cargo clippy --all --all-targets --target=wasm32-unknown-unknown -- -D warnings -D missing-docs + run: cargo clippy --all --all-targets --target=wasm32-unknown-unknown -- -D warnings docs: @@ -30,7 +30,20 @@ jobs: steps: - uses: actions/checkout@v1 - - name: Install toolchain + - name: Install wasm Rust + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + components: clippy + target: wasm32-unknown-unknown + + - name: Missing docs for native + run: cargo clippy --all -- -D missing-docs + + - name: Missing docs for wasm32 + run: cargo clippy --all --target=wasm32-unknown-unknown -- -D missing-docs + + - name: Install nightly toolchain uses: dtolnay/rust-toolchain@nightly - name: Run rustdoc check diff --git a/ci/Dockerfile.bridge b/ci/Dockerfile.bridge index 48bed6f2..732acd9d 100644 --- a/ci/Dockerfile.bridge +++ b/ci/Dockerfile.bridge @@ -6,8 +6,8 @@ FROM docker.io/alpine:3.19.1 RUN apk update && apk add --no-cache bash jq dasel # Copy in the binary -COPY --from=ghcr.io/celestiaorg/celestia-node:v0.18.3-mocha /bin/celestia /bin/celestia -COPY --from=ghcr.io/celestiaorg/celestia-node:v0.18.3-mocha /bin/cel-key /bin/cel-key +COPY --from=ghcr.io/celestiaorg/celestia-node:v0.20.4 /bin/celestia /bin/celestia +COPY --from=ghcr.io/celestiaorg/celestia-node:v0.20.4 /bin/cel-key /bin/cel-key COPY ./run-bridge.sh /opt/entrypoint.sh diff --git a/ci/Dockerfile.validator b/ci/Dockerfile.validator index 94a4b87c..190a6f0f 100644 --- a/ci/Dockerfile.validator +++ b/ci/Dockerfile.validator @@ -8,7 +8,7 @@ ENV CELESTIA_HOME=/root RUN apk update && apk add --no-cache bash jq # Copy in the binary -COPY --from=ghcr.io/celestiaorg/celestia-app:v2.3.0 /bin/celestia-appd /bin/celestia-appd +COPY --from=ghcr.io/celestiaorg/celestia-app:v3.0.2 /bin/celestia-appd /bin/celestia-appd COPY ./run-validator.sh /opt/entrypoint.sh diff --git a/ci/docker-compose.yml b/ci/docker-compose.yml index 680afc45..19fe82a7 100644 --- a/ci/docker-compose.yml +++ b/ci/docker-compose.yml @@ -26,6 +26,7 @@ services: - NODE_ID=0 # setting SKIP_AUTH to true disables the use of JWT for authentication - SKIP_AUTH=true + - CELESTIA_ENABLE_QUIC=1 ports: - 26658:26658 volumes: @@ -42,6 +43,7 @@ services: # provide an id for the bridge node (default: 0) # each node should have a next natural number starting from 0 - NODE_ID=1 + - CELESTIA_ENABLE_QUIC=1 ports: - 36658:26658 volumes: @@ -60,6 +62,7 @@ services: # # provide an id for the bridge node (default: 0) # # each node should have a next natural number starting from 0 # - NODE_ID=2 + # - CELESTIA_ENABLE_QUIC=1 # ports: # - 46658:26658 # volumes: diff --git a/ci/run-validator.sh b/ci/run-validator.sh index 21a8e703..67e77ba3 100755 --- a/ci/run-validator.sh +++ b/ci/run-validator.sh @@ -34,7 +34,7 @@ wait_for_block() { local block_num="$1" local block_hash="" - # Wait for the block to be created + # Wait for the block to be created while [[ -z "$block_hash" ]]; do # `|| echo` fallbacks to an empty string in case it's not ready block_hash="$(celestia-appd query block "$block_num" 2>/dev/null | jq '.block_id.hash' || echo)" @@ -133,14 +133,8 @@ setup_private_validator() { # If you encounter: `sed: -I or -i may not be used with stdin` on MacOS you can mitigate by installing gnu-sed # https://gist.github.com/andre3k1/e3a1a7133fded5de5a9ee99c87c6fa0d?permalink_comment_id=3082272#gistcomment-3082272 sed -i'.bak' 's|"tcp://127.0.0.1:26657"|"tcp://0.0.0.0:26657"|g' "$CONFIG_DIR/config/config.toml" - sed -i'.bak' 's|"null"|"kv"|g' "$CONFIG_DIR/config/config.toml" - - # reduce the time of commiting the proposed block - # bringing this value too low results in errors - sed -i'.bak' 's|^timeout_commit.*|timeout_commit = "1s"|g' "$CONFIG_DIR/config/config.toml" - - # Set app version to 1 - sed -i'.bak' 's|"app_version": "2"|"app_version": "1"|g' "$CONFIG_DIR/config/genesis.json" + # enable transaction indexing + sed -i'.bak' 's|indexer = .*|indexer = "kv"|g' "$CONFIG_DIR/config/config.toml" } main() { @@ -150,7 +144,7 @@ main() { provision_bridge_nodes & # Start the celestia-app echo "Configuration finished. Running a validator node..." - celestia-appd start --api.enable --grpc.enable + celestia-appd start --api.enable --grpc.enable --force-no-bbr } main diff --git a/grpc/tests/utils.rs b/grpc/tests/utils/mod.rs similarity index 100% rename from grpc/tests/utils.rs rename to grpc/tests/utils/mod.rs diff --git a/node/src/block_ranges.rs b/node/src/block_ranges.rs index 5d3c573b..7e208e3b 100644 --- a/node/src/block_ranges.rs +++ b/node/src/block_ranges.rs @@ -49,7 +49,7 @@ pub(crate) trait BlockRangeExt { pub(crate) struct BlockRangeDisplay<'a>(&'a RangeInclusive); -impl<'a> Display for BlockRangeDisplay<'a> { +impl Display for BlockRangeDisplay<'_> { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { write!(f, "{}-{}", self.0.start(), self.0.end()) } diff --git a/node/src/store/indexed_db_store.rs b/node/src/store/indexed_db_store.rs index 3d9fcca5..58832f92 100644 --- a/node/src/store/indexed_db_store.rs +++ b/node/src/store/indexed_db_store.rs @@ -307,7 +307,7 @@ impl IndexedDbStore { } trait TransactionOperationFn<'a, Arg>: - FnOnce(&'a Transaction, Arg) -> >::Fut + FnOnce(&'a Transaction, Arg) -> >::Fut { type Fut: Future>::Output>; type Output; diff --git a/node/src/store/utils.rs b/node/src/store/utils.rs index 63beb893..f285e64c 100644 --- a/node/src/store/utils.rs +++ b/node/src/store/utils.rs @@ -55,7 +55,7 @@ impl From for VerifiedExtendedHeaders { } } -impl<'a> From<&'a ExtendedHeader> for VerifiedExtendedHeaders { +impl From<&'_ ExtendedHeader> for VerifiedExtendedHeaders { fn from(value: &ExtendedHeader) -> Self { Self(vec![value.to_owned()]) } diff --git a/node/tests/shwap.rs b/node/tests/shwap.rs index 177da24e..343fb47a 100644 --- a/node/tests/shwap.rs +++ b/node/tests/shwap.rs @@ -33,7 +33,8 @@ async fn shwap_sampling_forward() { break height; } }; - let new_head = timeout(Duration::from_secs(2), get_new_head).await.unwrap(); + // timeout is double of the block time on CI + let new_head = timeout(Duration::from_secs(9), get_new_head).await.unwrap(); // wait for height to be sampled let wait_height_sampled = async { @@ -86,7 +87,7 @@ async fn shwap_sampling_backward() { .unwrap(); // take just first N headers because batch size can be big - let mut headers_to_sample: HashSet<_> = (from_height..to_height).rev().take(50).collect(); + let mut headers_to_sample: HashSet<_> = (from_height..to_height).rev().take(25).collect(); // wait for all heights to be sampled timeout(Duration::from_secs(10), async { diff --git a/proto/build.rs b/proto/build.rs index 233cc8ed..77980156 100644 --- a/proto/build.rs +++ b/proto/build.rs @@ -17,6 +17,7 @@ const OPTION_TIMESTAMP: &str = r#"#[serde(with = "crate::serializers::option_tim const OPTION_PROTOBUF_DURATION: &str = r#"#[serde(with = "crate::serializers::option_protobuf_duration")]"#; const NULL_DEFAULT: &str = r#"#[serde(with = "crate::serializers::null_default")]"#; +const VEC_SKIP_IF_EMPTY: &str = r#"#[serde(skip_serializing_if = "::std::vec::Vec::is_empty")]"#; const BYTES_SKIP_IF_EMPTY: &str = r#"#[serde(skip_serializing_if = "bytes::Bytes::is_empty")]"#; #[rustfmt::skip] @@ -82,6 +83,7 @@ static CUSTOM_FIELD_ATTRIBUTES: &[(&str, &str)] = &[ (".proof.pb.Proof.nodes", VEC_BASE64STRING), (".proto.blob.v1.BlobProto.data", BASE64STRING), (".proto.blob.v1.BlobProto.namespace_id", BASE64STRING), + (".proto.blob.v1.BlobProto.signer", VEC_SKIP_IF_EMPTY), (".proto.blob.v1.BlobProto.signer", BASE64STRING), (".shwap.RowNamespaceData.shares", NULL_DEFAULT), (".shwap.Share", BASE64STRING), @@ -111,7 +113,6 @@ const PROTO_FILES: &[&str] = &[ "vendor/celestia/blob/v1/params.proto", "vendor/celestia/blob/v1/query.proto", "vendor/celestia/blob/v1/tx.proto", - "vendor/celestia/core/v1/blob/blob.proto", "vendor/celestia/core/v1/da/data_availability_header.proto", "vendor/celestia/core/v1/proof/proof.proto", "vendor/cosmos/auth/v1beta1/auth.proto", diff --git a/proto/vendor/celestia/core/v1/blob/blob.proto b/proto/vendor/celestia/core/v1/blob/blob.proto deleted file mode 100644 index 45ece976..00000000 --- a/proto/vendor/celestia/core/v1/blob/blob.proto +++ /dev/null @@ -1,24 +0,0 @@ -syntax = "proto3"; -package celestia.core.v1.blob; - -option go_package = "github.com/celestiaorg/go-square/blob"; - -// Blob (named after binary large object) is a chunk of data submitted by a user -// to be published to the Celestia blockchain. The data of a Blob is published -// to a namespace and is encoded into shares based on the format specified by -// share_version. -message Blob { - bytes namespace_id = 1; - bytes data = 2; - uint32 share_version = 3; - uint32 namespace_version = 4; -} - -// BlobTx wraps an encoded sdk.Tx with a second field to contain blobs of data. -// The raw bytes of the blobs are not signed over, instead we verify each blob -// using the relevant MsgPayForBlobs that is signed over in the encoded sdk.Tx. -message BlobTx { - bytes tx = 1; - repeated Blob blobs = 2; - string type_id = 3; -} \ No newline at end of file diff --git a/rpc/Cargo.toml b/rpc/Cargo.toml index 609a8473..1a79b05d 100644 --- a/rpc/Cargo.toml +++ b/rpc/Cargo.toml @@ -23,7 +23,6 @@ celestia-types.workspace = true prost.workspace = true async-trait = "0.1.80" -futures = "0.3.31" jsonrpsee = { version = "0.24.2", features = ["client-core", "macros"] } serde = { version = "1.0.203", features = ["derive"] } thiserror = "1.0.61" @@ -34,6 +33,9 @@ http = "1.1.0" jsonrpsee = { version = "0.24.2", features = ["http-client", "ws-client"] } [target.'cfg(not(target_arch = "wasm32"))'.dev-dependencies] +anyhow = "1.0.86" +dotenvy = "0.15.7" +futures = "0.3.31" libp2p = { workspace = true, features = [ "tokio", "macros", @@ -42,8 +44,6 @@ libp2p = { workspace = true, features = [ "yamux", ] } nmt-rs.workspace = true -anyhow = "1.0.86" -dotenvy = "0.15.7" rand = "0.8.5" tokio = { version = "1.38.0", features = ["rt", "macros"] } tracing = "0.1.40" diff --git a/rpc/src/share.rs b/rpc/src/share.rs index 296abb93..2ed2c879 100644 --- a/rpc/src/share.rs +++ b/rpc/src/share.rs @@ -5,9 +5,8 @@ use std::marker::{Send, Sync}; use celestia_types::consts::appconsts::AppVersion; use celestia_types::nmt::Namespace; -use celestia_types::row_namespace_data::NamespacedShares; +use celestia_types::row_namespace_data::NamespaceData; use celestia_types::{ExtendedDataSquare, ExtendedHeader, RawShare, Share, ShareProof}; -use futures::FutureExt; use jsonrpsee::core::client::{ClientT, Error}; use jsonrpsee::proc_macros::rpc; use serde::{Deserialize, Serialize}; @@ -17,7 +16,7 @@ use serde::{Deserialize, Serialize}; #[serde(rename_all = "PascalCase")] pub struct GetRangeResponse { /// Shares contained in given range. - pub shares: Vec, + pub shares: Vec, /// Proof of inclusion of the shares. pub proof: ShareProof, } @@ -29,40 +28,38 @@ mod rpc { #[rpc(client)] pub trait Share { #[method(name = "share.GetEDS")] - async fn share_get_eds( - &self, - root: &ExtendedHeader, - ) -> Result; + async fn share_get_eds(&self, height: u64) -> Result; #[method(name = "share.GetRange")] async fn share_get_range( &self, height: u64, - start: usize, - end: usize, + start: u64, + end: u64, ) -> Result; #[method(name = "share.GetShare")] - async fn share_get_share( - &self, - root: &ExtendedHeader, - row: u64, - col: u64, - ) -> Result; + async fn share_get_share(&self, height: u64, row: u64, col: u64) + -> Result; - #[method(name = "share.GetSharesByNamespace")] - async fn share_get_shares_by_namespace( + #[method(name = "share.GetNamespaceData")] + async fn share_get_namespace_data( &self, - root: &ExtendedHeader, + height: u64, namespace: Namespace, - ) -> Result; + ) -> Result; #[method(name = "share.SharesAvailable")] - async fn share_shares_available(&self, root: &ExtendedHeader) -> Result<(), Error>; + async fn share_shares_available(&self, height: u64) -> Result<(), Error>; } } /// Client implementation for the `Share` RPC API. +/// +/// Please note that celestia-node requires just the block height for most of those API's. +/// This trait instead requires [`ExtendedHeader`] to perform validation of the returned types. +// NOTE: we use EH wherever Share is returned because it's gonna be required in future +// to check if shares are allowed to have version 1 in corresponding app version pub trait ShareClient: ClientT { /// GetEDS gets the full EDS identified by the given root. fn share_get_eds<'a, 'b, 'fut>( @@ -81,7 +78,7 @@ pub trait ShareClient: ClientT { Error::Custom(e) })?; - let raw_eds = rpc::ShareClient::share_get_eds(self, root).await?; + let raw_eds = rpc::ShareClient::share_get_eds(self, root.height().value()).await?; ExtendedDataSquare::from_raw(raw_eds, app_version) .map_err(|e| Error::Custom(e.to_string())) @@ -89,18 +86,20 @@ pub trait ShareClient: ClientT { } /// GetRange gets a list of shares and their corresponding proof. + /// + /// The start and end index ignores parity shares and corresponds to ODS. fn share_get_range<'a, 'b, 'fut>( &'a self, - height: u64, - start: usize, - end: usize, + root: &'b ExtendedHeader, + start: u64, + end: u64, ) -> impl Future> + Send + 'fut where 'a: 'fut, 'b: 'fut, Self: Sized + Sync + 'fut, { - rpc::ShareClient::share_get_range(self, height, start, end) + rpc::ShareClient::share_get_range(self, root.height().value(), start, end) } /// GetShare gets a Share by coordinates in EDS. @@ -115,46 +114,52 @@ pub trait ShareClient: ClientT { 'b: 'fut, Self: Sized + Sync + 'fut, { - rpc::ShareClient::share_get_share(self, root, row, col).map(move |res| { - res.and_then(|shr| { - if row < root.dah.square_width() as u64 / 2 - && col < root.dah.square_width() as u64 / 2 - { - Share::from_raw(&shr.data) - } else { - Share::parity(&shr.data) - } - .map_err(|e| Error::Custom(e.to_string())) - }) - }) + async move { + let share = + rpc::ShareClient::share_get_share(self, root.height().value(), row, col).await?; + if is_ods_square(row, col, root.dah.square_width()) { + Share::from_raw(&share.data) + } else { + Share::parity(&share.data) + } + .map_err(|e| Error::Custom(e.to_string())) + } } - /// GetSharesByNamespace gets all shares from an EDS within the given namespace. Shares are returned in a row-by-row order if the namespace spans multiple rows. - fn share_get_shares_by_namespace<'a, 'b, 'fut>( + /// GetNamespaceData gets all shares from an EDS within the given namespace. + /// + /// Shares are returned in a row-by-row order if the namespace spans multiple rows. + /// + /// PARITY and TAIL PADDING namespaces are not allowed. + fn share_get_namespace_data<'a, 'b, 'fut>( &'a self, root: &'b ExtendedHeader, namespace: Namespace, - ) -> impl Future> + Send + 'fut + ) -> impl Future> + Send + 'fut where 'a: 'fut, 'b: 'fut, Self: Sized + Sync + 'fut, { - rpc::ShareClient::share_get_shares_by_namespace(self, root, namespace) + rpc::ShareClient::share_get_namespace_data(self, root.height().value(), namespace) } /// SharesAvailable subjectively validates if Shares committed to the given Root are available on the Network. - fn share_shares_available<'a, 'b, 'fut>( + fn share_shares_available<'a, 'fut>( &'a self, - root: &'b ExtendedHeader, + height: u64, ) -> impl Future> + Send + 'fut where 'a: 'fut, - 'b: 'fut, Self: Sized + Sync + 'fut, { - rpc::ShareClient::share_shares_available(self, root) + rpc::ShareClient::share_shares_available(self, height) } } impl ShareClient for T where T: ClientT {} + +fn is_ods_square(row: u64, column: u64, square_width: u16) -> bool { + let ods_width = square_width / 2; + row < ods_width as u64 && column < ods_width as u64 +} diff --git a/rpc/tests/share.rs b/rpc/tests/share.rs index 57aa9dfa..16f7cad3 100644 --- a/rpc/tests/share.rs +++ b/rpc/tests/share.rs @@ -3,7 +3,7 @@ use celestia_rpc::prelude::*; use celestia_types::consts::appconsts::AppVersion; use celestia_types::nmt::{Namespace, NamespacedSha2Hasher}; -use celestia_types::{Blob, Share}; +use celestia_types::Blob; pub mod utils; @@ -42,7 +42,7 @@ async fn get_shares_by_namespace() { let header = client.header_get_by_height(submitted_height).await.unwrap(); let ns_shares = client - .share_get_shares_by_namespace(&header, namespace) + .share_get_namespace_data(&header, namespace) .await .unwrap(); @@ -63,7 +63,7 @@ async fn get_shares_by_namespace_forbidden() { // those namespaces are forbidden in celestia-node's implementation for ns in [Namespace::TAIL_PADDING, Namespace::PARITY_SHARE] { client - .share_get_shares_by_namespace(&header, ns) + .share_get_namespace_data(&header, ns) .await .unwrap_err(); } @@ -88,11 +88,7 @@ async fn get_shares_range() { let shares = blob_on_chain.to_shares().unwrap(); let shares_range = client - .share_get_range( - submitted_height, - index as usize, - index as usize + shares.len(), - ) + .share_get_range(&header, index, index + shares.len() as u64) .await .unwrap(); @@ -103,7 +99,7 @@ async fn get_shares_range() { .zip(shares_range.shares.into_iter()) .zip(shares_range.proof.shares().iter()) { - assert_eq!(share, Share::try_from(received).unwrap()); + assert_eq!(share, received); assert_eq!(share.as_ref(), proven.as_ref()); } } @@ -116,14 +112,33 @@ async fn get_shares_range_not_existing() { client .share_get_range( - header.height().value(), - shares_in_block as usize - 2, - shares_in_block as usize + 2, + &header, + shares_in_block as u64 - 2, + shares_in_block as u64 + 2, ) .await .unwrap_err(); } +#[tokio::test] +async fn get_shares_range_ignores_parity() { + let client = new_test_client(AuthLevel::Write).await.unwrap(); + + let namespace = random_ns(); + let data = random_bytes(100); + let blob = Blob::new(namespace, data.clone(), AppVersion::V2).unwrap(); + let submitted_height = blob_submit(&client, &[blob]).await.unwrap(); + + let header = client.header_get_by_height(submitted_height).await.unwrap(); + let square_width = header.dah.square_width() as u64; + + // if the share was parity we would fail deserializing resulting shares + client + .share_get_range(&header, square_width / 2, square_width / 2 + 1) + .await + .unwrap(); +} + #[tokio::test] async fn get_shares_by_namespace_wrong_ns() { let client = new_test_client(AuthLevel::Write).await.unwrap(); @@ -149,7 +164,7 @@ async fn get_shares_by_namespace_wrong_ns() { // check the case where we receive absence proof let random_ns = random_ns_range(min_ns, max_ns); let ns_shares = client - .share_get_shares_by_namespace(&header, random_ns) + .share_get_namespace_data(&header, random_ns) .await .unwrap(); assert_eq!(ns_shares.rows.len(), 1); @@ -183,7 +198,7 @@ async fn get_shares_by_namespace_wrong_ns_out_of_range() { let zero = Namespace::const_v0([0, 0, 0, 0, 0, 0, 0, 0, 0, 0]); let random_ns = random_ns_range(zero, min_ns); let ns_shares = client - .share_get_shares_by_namespace(&header, random_ns) + .share_get_namespace_data(&header, random_ns) .await .unwrap(); @@ -203,7 +218,7 @@ async fn get_shares_by_namespace_wrong_roots() { let genesis = client.header_get_by_height(1).await.unwrap(); let ns_shares = client - .share_get_shares_by_namespace(&genesis, namespace) + .share_get_namespace_data(&genesis, namespace) .await .unwrap(); diff --git a/tools/update-proto-vendor.sh b/tools/update-proto-vendor.sh index 59547ce0..bf518b6c 100755 --- a/tools/update-proto-vendor.sh +++ b/tools/update-proto-vendor.sh @@ -23,7 +23,7 @@ rm -rf ../target/proto-vendor-src mkdir -p ../target/proto-vendor-src extract_urls ../target/proto-vendor-src \ - https://github.com/celestiaorg/celestia-app/archive/refs/tags/v2.3.0.tar.gz \ + https://github.com/celestiaorg/celestia-app/archive/refs/tags/v3.0.2.tar.gz \ https://github.com/celestiaorg/celestia-node/archive/refs/heads/main.tar.gz \ https://github.com/celestiaorg/cosmos-sdk/archive/refs/heads/release/v0.46.x-celestia.tar.gz \ https://github.com/cometbft/cometbft/archive/refs/tags/v0.34.35.tar.gz \ @@ -37,7 +37,7 @@ extract_urls ../target/proto-vendor-src \ mkdir -p vendor rm -rf vendor/celestia -cp -r ../target/proto-vendor-src/celestia-app-2.3.0/proto/celestia vendor +cp -r ../target/proto-vendor-src/celestia-app-3.0.2/proto/celestia vendor rm -rf vendor/go-header mkdir -p vendor/go-header/p2p diff --git a/types/src/data_availability_header.rs b/types/src/data_availability_header.rs index dbe5e2ac..4d2343c5 100644 --- a/types/src/data_availability_header.rs +++ b/types/src/data_availability_header.rs @@ -208,7 +208,7 @@ impl DataAvailabilityHeader { proofs.push(MerkleProof::new(idx as usize, &all_roots)?.0); let row = self .row_root(idx) - .ok_or_else(|| Error::IndexOutOfRange(idx as usize, self.row_roots.len()))?; + .ok_or(Error::IndexOutOfRange(idx as usize, self.row_roots.len()))?; row_roots.push(row); } diff --git a/types/src/row_namespace_data.rs b/types/src/row_namespace_data.rs index fc54a48f..69b443f0 100644 --- a/types/src/row_namespace_data.rs +++ b/types/src/row_namespace_data.rs @@ -154,7 +154,7 @@ impl RowNamespaceData { /// [`Share`]: crate::Share #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[serde(transparent)] -pub struct NamespacedShares { +pub struct NamespaceData { /// All rows containing shares within some namespace. pub rows: Vec, } @@ -370,7 +370,7 @@ mod tests { } ]"#; - let ns_shares: NamespacedShares = + let ns_shares: NamespaceData = serde_json::from_str(get_shares_by_namespace_response).unwrap(); assert_eq!(ns_shares.rows[0].shares.len(), 1);