From 5108d7ab7f57d1fb021ef6b0b9bf8cb6aee40a53 Mon Sep 17 00:00:00 2001 From: James Date: Sun, 18 Jan 2026 16:55:56 -0500 Subject: [PATCH] chore: bump reth to 1.10.0 --- Cargo.toml | 82 ++++++++++++---------- crates/block-processor/src/alias.rs | 6 +- crates/block-processor/src/metrics.rs | 2 +- crates/block-processor/src/v1/processor.rs | 8 ++- crates/db/Cargo.toml | 1 + crates/db/src/consistency.rs | 19 ++++- crates/db/src/lib.rs | 3 + crates/db/src/provider.rs | 2 +- crates/db/tests/common/mod.rs | 22 +++--- crates/node-config/src/core.rs | 18 ++++- crates/node-tests/src/convert.rs | 7 +- crates/node-tests/src/utils.rs | 21 ++++-- crates/node/src/builder.rs | 6 +- crates/rpc/src/ctx/fee_hist.rs | 6 +- crates/rpc/src/ctx/signet.rs | 3 +- crates/rpc/src/inspect/db.rs | 2 +- 16 files changed, 138 insertions(+), 70 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index cc89e52..31e1395 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,7 +3,7 @@ members = ["crates/*"] resolver = "2" [workspace.package] -version = "0.16.0-rc.4" +version = "0.16.0-rc.5" edition = "2024" rust-version = "1.88" authors = ["init4"] @@ -34,34 +34,34 @@ debug = false incremental = false [workspace.dependencies] -signet-blobber = { version = "0.16.0-rc.2", path = "crates/blobber" } -signet-block-processor = { version = "0.16.0-rc.2", path = "crates/block-processor" } -signet-db = { version = "0.16.0-rc.2", path = "crates/db" } -signet-genesis = { version = "0.16.0-rc.2", path = "crates/genesis" } -signet-node = { version = "0.16.0-rc.2", path = "crates/node" } -signet-node-config = { version = "0.16.0-rc.2", path = "crates/node-config" } -signet-node-tests = { version = "0.16.0-rc.2", path = "crates/node-tests" } -signet-node-types = { version = "0.16.0-rc.2", path = "crates/node-types" } -signet-rpc = { version = "0.16.0-rc.2", path = "crates/rpc" } +signet-blobber = { version = "0.16.0-rc.5", path = "crates/blobber" } +signet-block-processor = { version = "0.16.0-rc.5", path = "crates/block-processor" } +signet-db = { version = "0.16.0-rc.5", path = "crates/db" } +signet-genesis = { version = "0.16.0-rc.5", path = "crates/genesis" } +signet-node = { version = "0.16.0-rc.5", path = "crates/node" } +signet-node-config = { version = "0.16.0-rc.5", path = "crates/node-config" } +signet-node-tests = { version = "0.16.0-rc.5", path = "crates/node-tests" } +signet-node-types = { version = "0.16.0-rc.5", path = "crates/node-types" } +signet-rpc = { version = "0.16.0-rc.5", path = "crates/rpc" } init4-bin-base = { version = "0.18.0-rc.1", features = ["alloy"] } -signet-bundle = "0.16.0-rc.1" -signet-constants = "0.16.0-rc.1" -signet-evm = "0.16.0-rc.1" -signet-extract = "0.16.0-rc.1" -signet-test-utils = "0.16.0-rc.1" -signet-tx-cache = "0.16.0-rc.1" -signet-types = "0.16.0-rc.1" -signet-zenith = "0.16.0-rc.1" -signet-journal = "0.16.0-rc.1" +signet-bundle = "0.16.0-rc.5" +signet-constants = "0.16.0-rc.5" +signet-evm = "0.16.0-rc.5" +signet-extract = "0.16.0-rc.5" +signet-test-utils = "0.16.0-rc.5" +signet-tx-cache = "0.16.0-rc.5" +signet-types = "0.16.0-rc.5" +signet-zenith = "0.16.0-rc.5" +signet-journal = "0.16.0-rc.5" # ajj ajj = { version = "0.3.4" } # trevm -trevm = { version = "0.31.2", features = ["full_env_cfg"] } -revm-inspectors = "0.32.0" # should be 1 more than trevm version, usually +trevm = { version = "0.33.0", features = ["full_env_cfg"] } +revm-inspectors = "0.33.0" # should be 1 more than trevm version, usually # Alloy periphery crates alloy = { version = "1.4.0", features = [ @@ -74,23 +74,29 @@ alloy = { version = "1.4.0", features = [ alloy-contract = { version = "1.4.0", features = ["pubsub"] } # Reth -reth = { git = "https://github.com/paradigmxyz/reth", tag = "v1.9.1" } -reth-ethereum = { git = "https://github.com/paradigmxyz/reth", tag = "v1.9.1" } -reth-chainspec = { git = "https://github.com/paradigmxyz/reth", tag = "v1.9.1" } -reth-db = { git = "https://github.com/paradigmxyz/reth", tag = "v1.9.1" } -reth-db-common = { git = "https://github.com/paradigmxyz/reth", tag = "v1.9.1" } -reth-eth-wire-types = { git = "https://github.com/paradigmxyz/reth", tag = "v1.9.1" } -reth-evm-ethereum = { git = "https://github.com/paradigmxyz/reth", tag = "v1.9.1" } -reth-exex = { git = "https://github.com/paradigmxyz/reth", tag = "v1.9.1" } -reth-exex-test-utils = { git = "https://github.com/paradigmxyz/reth", tag = "v1.9.1" } -reth-network-api = { git = "https://github.com/paradigmxyz/reth", tag = "v1.9.1" } -reth-network-peers = { git = "https://github.com/paradigmxyz/reth", tag = "v1.9.1" } -reth-node-api = { git = "https://github.com/paradigmxyz/reth", tag = "v1.9.1" } -reth-node-ethereum = { git = "https://github.com/paradigmxyz/reth", tag = "v1.9.1" } -reth-prune-types = { git = "https://github.com/paradigmxyz/reth", tag = "v1.9.1" } -reth-rpc-eth-api = { git = "https://github.com/paradigmxyz/reth", tag = "v1.9.1" } -reth-stages-types = { git = "https://github.com/paradigmxyz/reth", tag = "v1.9.1" } -reth-transaction-pool = { git = "https://github.com/paradigmxyz/reth", tag = "v1.9.1" } +reth = { git = "https://github.com/paradigmxyz/reth", tag = "v1.10.0" } +reth-ethereum = { git = "https://github.com/paradigmxyz/reth", tag = "v1.10.0" } +reth-chainspec = { git = "https://github.com/paradigmxyz/reth", tag = "v1.10.0" } +reth-codecs = { git = "https://github.com/paradigmxyz/reth", tag = "v1.10.0" } +reth-db = { git = "https://github.com/paradigmxyz/reth", tag = "v1.10.0" } +reth-db-api = { git = "https://github.com/paradigmxyz/reth", tag = "v1.10.0" } +reth-db-common = { git = "https://github.com/paradigmxyz/reth", tag = "v1.10.0" } +reth-eth-wire-types = { git = "https://github.com/paradigmxyz/reth", tag = "v1.10.0" } +reth-evm-ethereum = { git = "https://github.com/paradigmxyz/reth", tag = "v1.10.0" } +reth-exex = { git = "https://github.com/paradigmxyz/reth", tag = "v1.10.0" } +reth-exex-test-utils = { git = "https://github.com/paradigmxyz/reth", tag = "v1.10.0" } +reth-libmdbx = { git = "https://github.com/paradigmxyz/reth", tag = "v1.10.0" } +reth-network-api = { git = "https://github.com/paradigmxyz/reth", tag = "v1.10.0" } +reth-network-peers = { git = "https://github.com/paradigmxyz/reth", tag = "v1.10.0" } +reth-node-api = { git = "https://github.com/paradigmxyz/reth", tag = "v1.10.0" } +reth-node-ethereum = { git = "https://github.com/paradigmxyz/reth", tag = "v1.10.0" } +reth-prune-types = { git = "https://github.com/paradigmxyz/reth", tag = "v1.10.0" } +reth-rpc-eth-api = { git = "https://github.com/paradigmxyz/reth", tag = "v1.10.0" } +reth-stages-types = { git = "https://github.com/paradigmxyz/reth", tag = "v1.10.0" } +reth-transaction-pool = { git = "https://github.com/paradigmxyz/reth", tag = "v1.10.0" } + +# need to pin vergen to avoid multiple versions of virgen-lib +vergen = "=9.0.6" # Foundry periphery foundry-blob-explorers = "0.17" diff --git a/crates/block-processor/src/alias.rs b/crates/block-processor/src/alias.rs index 8823b19..82ebb06 100644 --- a/crates/block-processor/src/alias.rs +++ b/crates/block-processor/src/alias.rs @@ -3,7 +3,7 @@ use alloy::{ primitives::{Address, map::HashSet}, }; use eyre::OptionExt; -use reth::providers::{StateProvider, StateProviderFactory}; +use reth::providers::{StateProviderBox, StateProviderFactory}; use std::sync::{Arc, Mutex}; /// Simple trait to allow checking if an address should be aliased. @@ -17,7 +17,7 @@ pub trait AliasOracle { /// associated with it, and if so, whether that bytecode matches the pattern /// for a 7702 delegation contract. If it is a delegation contract, it is not /// aliased; otherwise, it is aliased. -impl AliasOracle for Box { +impl AliasOracle for StateProviderBox { fn should_alias(&self, address: Address) -> eyre::Result { // No account at this address. let Some(acct) = self.basic_account(&address)? else { return Ok(false) }; @@ -66,7 +66,7 @@ pub trait AliasOracleFactory: Send + Sync + 'static { } impl AliasOracleFactory for Box { - type Oracle = Box; + type Oracle = StateProviderBox; fn create(&self) -> eyre::Result { // NB: This becomes a problem if anyone ever birthday attacks a diff --git a/crates/block-processor/src/metrics.rs b/crates/block-processor/src/metrics.rs index bb17835..5288d11 100644 --- a/crates/block-processor/src/metrics.rs +++ b/crates/block-processor/src/metrics.rs @@ -17,7 +17,7 @@ use alloy::consensus::BlockHeader; use metrics::{Counter, Histogram, counter, describe_counter, describe_histogram, histogram}; use signet_evm::BlockResult; -use signet_extract::{Extractable, Extracts, HasTxns}; +use signet_extract::{Extractable, Extracts}; use signet_types::{MagicSig, MagicSigInfo}; use std::sync::LazyLock; diff --git a/crates/block-processor/src/v1/processor.rs b/crates/block-processor/src/v1/processor.rs index 69f8cfa..328ce41 100644 --- a/crates/block-processor/src/v1/processor.rs +++ b/crates/block-processor/src/v1/processor.rs @@ -212,8 +212,12 @@ where let ru_info = provider.get_extraction_results(start..=current)?; - let inner = - Chain::::new(provider.recovered_block_range(start..=current)?, net_outcome, None); + let inner = Chain::::new( + provider.recovered_block_range(start..=current)?, + net_outcome, + Default::default(), + Default::default(), + ); Ok(Some(RuChain { inner, ru_info })) } diff --git a/crates/db/Cargo.toml b/crates/db/Cargo.toml index 784f3b0..7e20090 100644 --- a/crates/db/Cargo.toml +++ b/crates/db/Cargo.toml @@ -31,6 +31,7 @@ tracing.workspace = true futures-util = "0.3.31" tokio.workspace = true auto_impl = "1.3.0" +vergen.workspace = true [dev-dependencies] serde_json.workspace = true diff --git a/crates/db/src/consistency.rs b/crates/db/src/consistency.rs index 7edf4c0..5c81f97 100644 --- a/crates/db/src/consistency.rs +++ b/crates/db/src/consistency.rs @@ -143,6 +143,20 @@ where tables::Receipts<::Receipt>, >(self, segment, highest_tx, highest_block)? } + StaticFileSegment::TransactionSenders => { + ensure_invariants::<_, tables::TransactionSenders>( + self, + segment, + highest_tx, + highest_block, + )? + } + StaticFileSegment::AccountChangeSets => ensure_invariants::< + _, + tables::AccountChangeSets, + >( + self, segment, highest_tx, highest_block + )?, } { update_last_good_height(unwind); } @@ -213,7 +227,10 @@ where .get_stage_checkpoint(match segment { StaticFileSegment::Headers => StageId::Headers, StaticFileSegment::Transactions => StageId::Bodies, - StaticFileSegment::Receipts => StageId::Execution, + StaticFileSegment::Receipts | StaticFileSegment::AccountChangeSets => { + StageId::Execution + } + StaticFileSegment::TransactionSenders => StageId::SenderRecovery, })? .unwrap_or_default() .block_number; diff --git a/crates/db/src/lib.rs b/crates/db/src/lib.rs index 7c0458c..1c75188 100644 --- a/crates/db/src/lib.rs +++ b/crates/db/src/lib.rs @@ -35,3 +35,6 @@ pub use tables::{ mod traits; pub use traits::{DbProviderExt, RuWriter}; + +// TEMP: remove when reth @ 1.10.1 is released +use vergen as _; diff --git a/crates/db/src/provider.rs b/crates/db/src/provider.rs index cec5f56..2e061c0 100644 --- a/crates/db/src/provider.rs +++ b/crates/db/src/provider.rs @@ -481,7 +481,7 @@ where // Update pipeline stages self.update_pipeline_stages(target, true)?; - let chain = Chain::new(blocks, execution_state, None); + let chain = Chain::new(blocks, execution_state, Default::default(), Default::default()); debug!("Succesfully reverted blocks and updated pipeline stages"); diff --git a/crates/db/tests/common/mod.rs b/crates/db/tests/common/mod.rs index 5b42cf0..d230e90 100644 --- a/crates/db/tests/common/mod.rs +++ b/crates/db/tests/common/mod.rs @@ -1,9 +1,14 @@ use alloy::genesis::Genesis; use reth::{ chainspec::ChainSpec, - providers::{ProviderFactory, providers::StaticFileProvider}, + providers::{ + ProviderFactory, + providers::{RocksDBProvider, StaticFileProvider}, + }, +}; +use reth_db::test_utils::{ + create_test_rocksdb_dir, create_test_rw_db, create_test_static_files_dir, }; -use reth_db::test_utils::{create_test_rw_db, create_test_static_files_dir}; use reth_exex_test_utils::TmpDB as TmpDb; use signet_node_types::SignetNodeTypes; use std::sync::{Arc, OnceLock}; @@ -23,11 +28,12 @@ pub fn chain_spec() -> Arc { /// Create a provider factory with a chain spec pub fn create_test_provider_factory() -> ProviderFactory> { - let (static_dir, _) = create_test_static_files_dir(); let db = create_test_rw_db(); - ProviderFactory::new( - db, - chain_spec(), - StaticFileProvider::read_write(static_dir.keep()).expect("static file provider"), - ) + let (static_dir, _) = create_test_static_files_dir(); + let (rocksdb_dir, _) = create_test_rocksdb_dir(); + + let sfp = StaticFileProvider::read_write(static_dir.keep()).expect("static file provider"); + let rocks_db = RocksDBProvider::builder(rocksdb_dir.keep()).build().unwrap(); + + ProviderFactory::new(db, chain_spec(), sfp, rocks_db).expect("provider factory") } diff --git a/crates/node-config/src/core.rs b/crates/node-config/src/core.rs index 0bc8b5f..df37855 100644 --- a/crates/node-config/src/core.rs +++ b/crates/node-config/src/core.rs @@ -1,6 +1,7 @@ use alloy::genesis::Genesis; +use eyre::Context; use init4_bin_base::utils::{calc::SlotCalculator, from_env::FromEnv}; -use reth::providers::providers::StaticFileProvider; +use reth::providers::providers::{RocksDBProvider, StaticFileProvider}; use reth_chainspec::ChainSpec; use reth_node_api::NodePrimitives; use signet_blobber::BlobFetcherConfig; @@ -151,6 +152,21 @@ impl SignetNodeConfig { self.database_path.as_ref().to_owned().into() } + /// Get the RocksDB path as a String. + pub fn rocksdb_path_string(&self) -> String { + format!("{}-rocksdb", &self.database_path) + } + + /// Get the RocksDB path. + pub fn rocksdb_path(&self) -> PathBuf { + self.rocksdb_path_string().into() + } + + /// Open the RocksDB database. + pub fn open_rocks_db(&self) -> eyre::Result { + RocksDBProvider::builder(self.rocksdb_path()).build().wrap_err("Failed to open RocksDB") + } + /// Get the URL to which to forward raw transactions. pub fn forward_url(&self) -> Option { self.forward_url diff --git a/crates/node-tests/src/convert.rs b/crates/node-tests/src/convert.rs index 2601a6e..72e161d 100644 --- a/crates/node-tests/src/convert.rs +++ b/crates/node-tests/src/convert.rs @@ -67,7 +67,12 @@ impl ToRethPrimitive for signet_test_utils::chain::Chain { type RethPrimitive = reth::providers::Chain; fn to_reth(self) -> Self::RethPrimitive { - reth::providers::Chain::new(self.blocks.to_reth(), self.execution_outcome.to_reth(), None) + reth::providers::Chain::new( + self.blocks.to_reth(), + self.execution_outcome.to_reth(), + Default::default(), + Default::default(), + ) } } diff --git a/crates/node-tests/src/utils.rs b/crates/node-tests/src/utils.rs index 1fa980b..6d40508 100644 --- a/crates/node-tests/src/utils.rs +++ b/crates/node-tests/src/utils.rs @@ -8,9 +8,14 @@ use alloy::{ use reth::{ chainspec::ChainSpec, primitives::{Block, BlockBody, Header, RecoveredBlock, Transaction, TransactionSigned}, - providers::{ProviderFactory, providers::StaticFileProvider}, + providers::{ + ProviderFactory, + providers::{RocksDBProvider, StaticFileProvider}, + }, +}; +use reth_db::test_utils::{ + create_test_rocksdb_dir, create_test_rw_db, create_test_static_files_dir, }; -use reth_db::test_utils::{create_test_rw_db, create_test_static_files_dir}; use reth_exex_test_utils::TmpDB; use signet_node_types::SignetNodeTypes; use signet_zenith::Zenith; @@ -128,10 +133,12 @@ pub fn create_test_provider_factory_with_chain_spec( chain_spec: std::sync::Arc, ) -> ProviderFactory> { let (static_dir, _) = create_test_static_files_dir(); + let (rocks, _) = create_test_rocksdb_dir(); + let db = create_test_rw_db(); - ProviderFactory::new( - db, - chain_spec, - StaticFileProvider::read_write(static_dir.keep()).expect("static file provider"), - ) + let sfp = StaticFileProvider::read_write(static_dir.keep()).expect("static file provider"); + + let rocks = RocksDBProvider::builder(rocks.keep()).build().expect("rocksdb provider"); + + ProviderFactory::new(db, chain_spec, sfp, rocks).unwrap() } diff --git a/crates/node/src/builder.rs b/crates/node/src/builder.rs index eec7599..1cc4205 100644 --- a/crates/node/src/builder.rs +++ b/crates/node/src/builder.rs @@ -70,7 +70,8 @@ impl SignetNodeBuilder { db, self.config.chain_spec().clone(), self.config.static_file_rw()?, - ); + self.config.open_rocks_db()?, + )?; Ok(SignetNodeBuilder { config: self.config, @@ -91,7 +92,8 @@ impl SignetNodeBuilder { self.config.database_path(), self.config.chain_spec().clone(), reth_db::mdbx::DatabaseArguments::default(), - self.config.static_file_rw().unwrap(), + self.config.static_file_rw()?, + self.config.open_rocks_db()?, )?; Ok(SignetNodeBuilder { config: self.config, diff --git a/crates/rpc/src/ctx/fee_hist.rs b/crates/rpc/src/ctx/fee_hist.rs index 237fa26..26f42da 100644 --- a/crates/rpc/src/ctx/fee_hist.rs +++ b/crates/rpc/src/ctx/fee_hist.rs @@ -30,13 +30,13 @@ fn strip_block(block: RecoveredBlock) -> RecoveredBlock { /// instance. fn strip_chain(chain: &Chain) -> Arc { // Takes the contents out, replacing with default - let (blocks, outcome, trie) = chain.clone().into_inner(); + let (blocks, outcome, trie, hashed) = chain.clone().into_inner(); // Strip each block let blocks: Vec> = blocks.into_blocks().map(strip_block).collect(); // Replace the original chain with the stripped version - Arc::new(Chain::new(blocks, outcome, trie)) + Arc::new(Chain::new(blocks, outcome, trie, hashed)) } /// Strips Signet system transactions from the `CanonStateNotification`. @@ -110,7 +110,7 @@ mod test { fn test_chain(count: u64) -> Arc { let blocks = (0..count).map(test_block); - Arc::new(Chain::new(blocks, Default::default(), None)) + Arc::new(Chain::new(blocks, Default::default(), Default::default(), Default::default())) } #[test] diff --git a/crates/rpc/src/ctx/signet.rs b/crates/rpc/src/ctx/signet.rs index cc72e89..5ca08dc 100644 --- a/crates/rpc/src/ctx/signet.rs +++ b/crates/rpc/src/ctx/signet.rs @@ -757,7 +757,7 @@ where let to = to_block.map(|num| self.provider().convert_block_number(*num)).transpose()?.flatten(); let (from_block_number, to_block_number) = - logs_utils::get_filter_block_range(from, to, start_block, info); + logs_utils::get_filter_block_range(from, to, start_block, info)?; self.get_logs_in_block_range(filter, from_block_number, to_block_number).await } @@ -823,6 +823,7 @@ where .transpose()? .flatten(); logs_utils::get_filter_block_range(from, to, start_block, info) + .map_err(EthFilterError::from)? } FilterBlockOption::AtBlockHash(_) => { // blockHash is equivalent to fromBlock = toBlock = the block number with diff --git a/crates/rpc/src/inspect/db.rs b/crates/rpc/src/inspect/db.rs index 857e79f..73f2cde 100644 --- a/crates/rpc/src/inspect/db.rs +++ b/crates/rpc/src/inspect/db.rs @@ -109,7 +109,7 @@ impl>> TableViewer<()> tx.inner.open_db(Some(self.args.table_name())).wrap_err("Could not open db.")?; let stats = tx .inner - .db_stat(&table_db) + .db_stat(table_db.dbi()) .wrap_err(format!("Could not find table: {}", stringify!($table)))?; let total_entries = stats.entries(); let final_entry_idx = total_entries.saturating_sub(1);