Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
82 changes: 44 additions & 38 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down Expand Up @@ -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 = [
Expand All @@ -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"
Expand Down
6 changes: 3 additions & 3 deletions crates/block-processor/src/alias.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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<dyn StateProvider> {
impl AliasOracle for StateProviderBox {
fn should_alias(&self, address: Address) -> eyre::Result<bool> {
// No account at this address.
let Some(acct) = self.basic_account(&address)? else { return Ok(false) };
Expand Down Expand Up @@ -66,7 +66,7 @@ pub trait AliasOracleFactory: Send + Sync + 'static {
}

impl AliasOracleFactory for Box<dyn StateProviderFactory> {
type Oracle = Box<dyn StateProvider>;
type Oracle = StateProviderBox;

fn create(&self) -> eyre::Result<Self::Oracle> {
// NB: This becomes a problem if anyone ever birthday attacks a
Expand Down
2 changes: 1 addition & 1 deletion crates/block-processor/src/metrics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
8 changes: 6 additions & 2 deletions crates/block-processor/src/v1/processor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -212,8 +212,12 @@ where

let ru_info = provider.get_extraction_results(start..=current)?;

let inner =
Chain::<Host>::new(provider.recovered_block_range(start..=current)?, net_outcome, None);
let inner = Chain::<Host>::new(
provider.recovered_block_range(start..=current)?,
net_outcome,
Default::default(),
Default::default(),
);

Ok(Some(RuChain { inner, ru_info }))
}
Expand Down
1 change: 1 addition & 0 deletions crates/db/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
19 changes: 18 additions & 1 deletion crates/db/src/consistency.rs
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,20 @@ where
tables::Receipts<<EthPrimitives as NodePrimitives>::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);
}
Expand Down Expand Up @@ -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;
Expand Down
3 changes: 3 additions & 0 deletions crates/db/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 _;
2 changes: 1 addition & 1 deletion crates/db/src/provider.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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");

Expand Down
22 changes: 14 additions & 8 deletions crates/db/tests/common/mod.rs
Original file line number Diff line number Diff line change
@@ -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};
Expand All @@ -23,11 +28,12 @@ pub fn chain_spec() -> Arc<ChainSpec> {

/// Create a provider factory with a chain spec
pub fn create_test_provider_factory() -> ProviderFactory<SignetNodeTypes<TmpDb>> {
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")
}
18 changes: 17 additions & 1 deletion crates/node-config/src/core.rs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -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> {
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<reqwest::Url> {
self.forward_url
Expand Down
7 changes: 6 additions & 1 deletion crates/node-tests/src/convert.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
)
}
}

Expand Down
21 changes: 14 additions & 7 deletions crates/node-tests/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -128,10 +133,12 @@ pub fn create_test_provider_factory_with_chain_spec(
chain_spec: std::sync::Arc<ChainSpec>,
) -> ProviderFactory<SignetNodeTypes<TmpDB>> {
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()
}
6 changes: 4 additions & 2 deletions crates/node/src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ impl<Host, Db, Aof> SignetNodeBuilder<Host, Db, Aof> {
db,
self.config.chain_spec().clone(),
self.config.static_file_rw()?,
);
self.config.open_rocks_db()?,
)?;

Ok(SignetNodeBuilder {
config: self.config,
Expand All @@ -91,7 +92,8 @@ impl<Host, Db, Aof> SignetNodeBuilder<Host, Db, Aof> {
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,
Expand Down
6 changes: 3 additions & 3 deletions crates/rpc/src/ctx/fee_hist.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ fn strip_block(block: RecoveredBlock<Block>) -> RecoveredBlock<Block> {
/// instance.
fn strip_chain(chain: &Chain) -> Arc<Chain> {
// 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<RecoveredBlock<Block>> = 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`.
Expand Down Expand Up @@ -110,7 +110,7 @@ mod test {

fn test_chain(count: u64) -> Arc<Chain> {
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]
Expand Down
3 changes: 2 additions & 1 deletion crates/rpc/src/ctx/signet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down Expand Up @@ -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
Expand Down
Loading