From 0a99f8c3af4974a055c58ea44ac1776e6e048ef8 Mon Sep 17 00:00:00 2001 From: Yiannis Marangos Date: Mon, 8 Apr 2024 19:00:59 +0300 Subject: [PATCH] chore(node): Upgrade blockstore and beetswap --- Cargo.lock | 9 ++++----- Cargo.toml | 11 ++++++----- node/Cargo.toml | 3 ++- node/src/p2p/shwap.rs | 2 -- 4 files changed, 12 insertions(+), 13 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 5bde982d8..f212805cd 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -542,9 +542,8 @@ dependencies = [ [[package]] name = "beetswap" version = "0.1.0" -source = "git+https://github.com/eigerco/beetswap?rev=13f1a08#13f1a08138ec33e2a63869d5dcef536ad6e10e92" +source = "git+https://github.com/eigerco/beetswap?rev=1cdfff8#1cdfff80aea25d957d53c622864db9fbe303a446" dependencies = [ - "async-trait", "asynchronous-codec 0.7.0", "blockstore", "bytes", @@ -552,6 +551,7 @@ dependencies = [ "fnv", "futures", "futures-timer", + "instant", "libp2p-core", "libp2p-identity", "libp2p-swarm", @@ -652,16 +652,15 @@ dependencies = [ [[package]] name = "blockstore" -version = "0.3.0" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "359816e624b0ab1d2ecaef2a07d3820d7078a16ad55f1f1c381422971c418acf" +checksum = "d4bf477ceba49f5eae2be7e54fe2cae4406a6f90921b21f4bb1a779b4f517649" dependencies = [ "cid", "dashmap", "js-sys", "multihash", "rexie", - "send_wrapper 0.6.0", "sled", "thiserror", "tokio", diff --git a/Cargo.toml b/Cargo.toml index 26cd55eb0..f156cbb52 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,7 +3,8 @@ resolver = "2" members = ["cli", "node", "node-wasm", "proto", "rpc", "types"] [workspace.dependencies] -blockstore = "0.3" +beetswap = { git = "https://github.com/eigerco/beetswap", rev = "1cdfff8" } +blockstore = "0.4" lumina-node = { version = "0.1.0", path = "node" } lumina-node-wasm = { version = "0.1.0", path = "node-wasm" } celestia-proto = { version = "0.1.0", path = "proto" } @@ -15,11 +16,11 @@ celestia-tendermint = { version = "0.32.1", default-features = false } celestia-tendermint-proto = "0.32.1" [patch.crates-io] -# This is a workaround. -# `lumina-node` depends on `beetswap`, which depends on `blockstore`. -# Because `beetswap` is outside of this workspace, cargo thinks that -# it depends on a different `blockstore` crate. # Uncomment to apply local changes +#blockstore = { path = "../blockstore" } #celestia-tendermint = { path = "../celestia-tendermint-rs/tendermint" } #celestia-tendermint-proto = { path = "../celestia-tendermint-rs/proto" } #nmt-rs = { path = "../nmt-rs" } + +#[patch."https://github.com/eigerco/beetswap"] +#beetswap = { path = "../beetswap" } diff --git a/node/Cargo.toml b/node/Cargo.toml index 9a12d490c..480943e9a 100644 --- a/node/Cargo.toml +++ b/node/Cargo.toml @@ -33,7 +33,7 @@ libp2p = { workspace = true, features = [ ] } async-trait = "0.1.73" -beetswap = { git = "https://github.com/eigerco/beetswap", rev = "13f1a08" } +beetswap = { workspace = true } cid = { version = "0.11.0", features = ["serde-codec"] } dashmap = "5.5.3" futures = "0.3.28" @@ -67,6 +67,7 @@ libp2p = { workspace = true, features = [ [target.'cfg(target_arch = "wasm32")'.dependencies] backoff = { version = "0.4.0", features = ["wasm-bindgen"] } +beetswap = { workspace = true, features = ["wasm-bindgen"] } blockstore = { workspace = true, features = ["indexeddb"] } celestia-types = { workspace = true, features = ["wasm-bindgen"] } getrandom = { version = "0.2.10", features = ["js"] } diff --git a/node/src/p2p/shwap.rs b/node/src/p2p/shwap.rs index 2765f8b0a..7ad6540d5 100644 --- a/node/src/p2p/shwap.rs +++ b/node/src/p2p/shwap.rs @@ -1,6 +1,5 @@ use std::sync::Arc; -use async_trait::async_trait; use beetswap::multihasher::{Multihasher, MultihasherError}; use blockstore::block::CidError; use celestia_tendermint_proto::Protobuf; @@ -33,7 +32,6 @@ where } } -#[async_trait] impl Multihasher for ShwapMultihasher where S: Store + 'static,