From 9654a659cef99fd0c4220173ad0534953491cd21 Mon Sep 17 00:00:00 2001 From: Maxim Date: Wed, 5 Feb 2025 19:22:07 +0900 Subject: [PATCH 01/38] Add block validation logic --- bin/reth/src/commands/bitfinity_import.rs | 52 ++++++++---- .../downloaders/src/bitfinity_evm_client.rs | 79 +++++++++++++++++-- crates/node/core/src/args/bitfinity_args.rs | 6 ++ 3 files changed, 116 insertions(+), 21 deletions(-) diff --git a/bin/reth/src/commands/bitfinity_import.rs b/bin/reth/src/commands/bitfinity_import.rs index 9eb220dfb5e..aef11764a8f 100644 --- a/bin/reth/src/commands/bitfinity_import.rs +++ b/bin/reth/src/commands/bitfinity_import.rs @@ -21,10 +21,9 @@ use reth_node_core::{args::BitfinityImportArgs, dirs::ChainPath}; use reth_node_ethereum::{EthExecutorProvider, EthereumNode}; use reth_node_events::node::NodeEvent; use reth_primitives::{EthPrimitives, SealedHeader}; -use reth_provider::providers::BlockchainProvider; use reth_provider::{ - BlockNumReader, CanonChainTracker, ChainSpecProvider, DatabaseProviderFactory, HeaderProvider, - ProviderError, ProviderFactory, + providers::BlockchainProvider, BlockNumReader, CanonChainTracker, ChainSpecProvider, + DatabaseProviderFactory, HeaderProvider, ProviderError, ProviderFactory, }; use reth_prune::PruneModes; use reth_stages::{ @@ -35,7 +34,7 @@ use reth_stages::{ use reth_static_file::StaticFileProducer; use std::{path::PathBuf, sync::Arc, time::Duration}; use tokio::sync::watch; -use tracing::{debug, info}; +use tracing::{debug, error, info}; /// Syncs RLP encoded blocks from a file. #[derive(Clone)] @@ -57,7 +56,8 @@ pub struct BitfinityImportCommand { blockchain_provider: BlockchainProvider>>, } -/// Manually implement `Debug` for `ImportCommand` because `BlockchainProvider` doesn't implement it. +/// Manually implement `Debug` for `ImportCommand` because `BlockchainProvider` doesn't implement +/// it. impl std::fmt::Debug for BitfinityImportCommand { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { f.debug_struct("ImportCommand") @@ -147,7 +147,7 @@ impl BitfinityImportCommand { max_block_age_secs: Duration::from_secs(self.bitfinity.max_block_age_secs), }; - let remote_client = Arc::new( + let mut remote_client = BitfinityEvmClient::from_rpc_url( rpc_config, start_block, @@ -160,36 +160,58 @@ impl BitfinityImportCommand { }), self.bitfinity.check_evm_state_before_importing, ) - .await?, - ); + .await?; + + if self.bitfinity.validate_unsafe_blocks { + while let Some(unsafe_block) = remote_client.unsafe_block() { + if let Err(err) = remote_client.validate_block(unsafe_block).await { + error!(target: "reth::cli - BitfinityImportCommand", "Block validation failed: {}", err); + } + + info!(target: "reth::cli - BitfinityImportCommand", "Block validated: {}", unsafe_block); + } + } // override the tip - let tip = if let Some(tip) = remote_client.tip() { - tip + let safe_block = if let Some(safe_block) = remote_client.safe_block() { + safe_block } else { - debug!(target: "reth::cli - BitfinityImportCommand", "No tip found, skipping import"); + debug!(target: "reth::cli - BitfinityImportCommand", "No safe block found, skipping import"); return Ok(()); }; + self.import_to_block(safe_block, remote_client, provider_factory.clone(), consensus.clone()).await?; + + info!(target: "reth::cli - BitfinityImportCommand", "Finishing up"); + Ok(()) + } + + /// Imports the blocks up to the given block hash of the `remove_client`. + async fn import_to_block( + &self, + new_tip: B256, + remote_client: BitfinityEvmClient, + provider_factory: ProviderFactory>>, + consensus: Arc>, + ) -> eyre::Result<()> { info!(target: "reth::cli - BitfinityImportCommand", "Chain blocks imported"); let (mut pipeline, _events) = self.build_import_pipeline( &self.config, provider_factory.clone(), &consensus, - remote_client, + Arc::new(remote_client), StaticFileProducer::new(provider_factory.clone(), PruneModes::default()), )?; // override the tip - pipeline.set_tip(tip); - debug!(target: "reth::cli - BitfinityImportCommand", ?tip, "Tip manually set"); + pipeline.set_tip(new_tip); + debug!(target: "reth::cli - BitfinityImportCommand", ?new_tip, "Tip manually set"); // Run pipeline debug!(target: "reth::cli - BitfinityImportCommand", "Starting sync pipeline"); pipeline.run().await?; - info!(target: "reth::cli - BitfinityImportCommand", "Finishing up"); Ok(()) } diff --git a/crates/net/downloaders/src/bitfinity_evm_client.rs b/crates/net/downloaders/src/bitfinity_evm_client.rs index 04b567d8747..81208d06a0b 100644 --- a/crates/net/downloaders/src/bitfinity_evm_client.rs +++ b/crates/net/downloaders/src/bitfinity_evm_client.rs @@ -5,6 +5,7 @@ use candid::Principal; use did::certified::CertifiedResult; use ethereum_json_rpc_client::{reqwest::ReqwestClient, EthJsonRpcClient}; use eyre::Result; +use futures::future::Remote; use ic_cbor::{CertificateToCbor, HashTreeToCbor}; use ic_certificate_verification::VerifyCertificate; use ic_certification::{Certificate, HashTree, LookupResult}; @@ -27,8 +28,7 @@ use reth_network_peers::PeerId; use reth_primitives::{BlockBody, ForkCondition, Header, TransactionSigned}; use serde_json::json; -use std::{self, cmp::min, collections::HashMap}; -use std::{sync::OnceLock, time::Duration}; +use std::{self, cmp::min, collections::HashMap, sync::OnceLock, time::Duration}; use thiserror::Error; use backon::{ExponentialBuilder, Retryable}; @@ -64,6 +64,9 @@ pub struct BitfinityEvmClient { /// The buffered bodies retrieved when fetching new headers. bodies: HashMap, + + /// The number of the last safe block. + safe_block_number: BlockNumber, } /// An error that can occur when constructing and using a [`RemoteClient`]. @@ -80,6 +83,10 @@ pub enum RemoteClientError { /// Certificate check error #[error("certification check error: {0}")] CertificateError(String), + + /// Error while trying to validate a block + #[error("block validation error: {0}")] + ValidationError(String), } /// Setting for checking last certified block @@ -117,7 +124,12 @@ impl BitfinityEvmClient { } Ok(false) => { info!(target: "downloaders::bitfinity_evm_client", "Skipping block import: EVM is disabled"); - return Ok(Self { headers, hash_to_number, bodies }); + return Ok(Self { + headers, + hash_to_number, + bodies, + safe_block_number: BlockNumber::default(), + }); } Err(e) => { warn!(target: "downloaders::bitfinity_evm_client", "Failed to check EVM state: {}. Proceeding with import", e); @@ -135,6 +147,15 @@ impl BitfinityEvmClient { .await .map_err(|e| RemoteClientError::ProviderError(e.to_string()))?; + let safe_block_number: BlockNumber = provider + .get_block_by_number(did::BlockNumber::Safe) + .await + .map_err(|e| { + RemoteClientError::ProviderError(format!("error getting safe block: {e}")) + })? + .number + .into(); + info!(target: "downloaders::bitfinity_evm_client", "Latest remote block: {latest_remote_block}"); let mut end_block = @@ -202,7 +223,40 @@ impl BitfinityEvmClient { info!(blocks = headers.len(), "Initialized remote client"); - Ok(Self { headers, hash_to_number, bodies }) + Ok(Self { headers, hash_to_number, bodies, safe_block_number }) + } + + /// Validates the block with the given hash and update the latest safe block number if + /// successful. + pub async fn validate_block(&mut self, block_hash: B256) -> Result<(), RemoteClientError> { + let validation_hash: B256 = todo!(); + match self.send_validation_request(block_hash, validation_hash).await { + Ok(_) => { + let Some(safe_block) = self.hash_to_number.get(&block_hash) else { + return Err(RemoteClientError::ValidationError("validation succeeded but the block is not found in the headers".into())); + }; + + self.safe_block_number = *safe_block; + info!(target: "downloaders::bitfinity_evm_client", "Block validated: {}", block_hash); + + Ok(()) + } + Err(err) => { + warn!(target: "downloaders::bitfinity_evm_client", "Block validation failed: {}", err); + Err(err) + } + } + } + + /// Sends the validation request to the EVM. + /// + /// If `Ok` is returned, validation was successful and the new safe block is the validated one. + async fn send_validation_request( + &self, + block_hash: B256, + validation_hash: B256, + ) -> Result<(), RemoteClientError> { + todo!() } /// Get the remote tip hash of the chain. @@ -214,6 +268,17 @@ impl BitfinityEvmClient { .map(|h| h.hash_slow()) } + /// Returns the hash of the first block after the latest safe block. If the tip of the chain is + /// safe, returns `None`. + pub fn unsafe_block(&self) -> Option { + self.headers.get(&(self.safe_block_number + 1)).map(|h| h.hash_slow()) + } + + /// Returns the has of the last safe block in the chain. + pub fn safe_block(&self) -> Option { + self.headers.get(&self.safe_block_number).map(|h| h.hash_slow()) + } + /// Returns the highest block number of this client has or `None` if empty pub fn max_block(&self) -> Option { self.headers.keys().max().copied() @@ -393,7 +458,8 @@ impl BitfinityEvmClient { /// Creates a new JSON-RPC client with retry functionality /// - /// Tries the primary URL first, falls back to backup URL if provided or if primary is not producing blocks + /// Tries the primary URL first, falls back to backup URL if provided or if primary is not + /// producing blocks pub async fn client(config: RpcClientConfig) -> Result> { // Create retry configuration let backoff = ExponentialBuilder::default() @@ -645,7 +711,8 @@ impl DownloadClient for BitfinityEvmClient { fn report_bad_message(&self, _peer_id: PeerId) { error!("Reported a bad message on a remote client, the client may be corrupted or invalid"); // Uncomment this panic to stop the import job and print the stacktrace of the error - // panic!("Reported a bad message on a remote client, the client may be corrupted or invalid"); + // panic!("Reported a bad message on a remote client, the client may be corrupted or + // invalid"); } fn num_connected_peers(&self) -> usize { diff --git a/crates/node/core/src/args/bitfinity_args.rs b/crates/node/core/src/args/bitfinity_args.rs index 52201a6cb4a..e7f553d31d4 100644 --- a/crates/node/core/src/args/bitfinity_args.rs +++ b/crates/node/core/src/args/bitfinity_args.rs @@ -65,6 +65,12 @@ pub struct BitfinityImportArgs { /// A flag to check the EVM state before importing blocks #[arg(long, default_value = "true")] pub check_evm_state_before_importing: bool, + + /// If true, try to validate unsafe blocks before import. + /// + /// If validation is disabled, unsafe blocks will be ignored. + #[arg(long)] + pub validate_unsafe_blocks: bool, } /// Bitfinity Related Args From 70b8e9f797965f04d7f530b8ceae20acf999da03 Mon Sep 17 00:00:00 2001 From: Maxim Date: Thu, 6 Feb 2025 19:28:42 +0900 Subject: [PATCH 02/38] Fix validation logic --- bin/reth/src/commands/bitfinity_import.rs | 46 +++++++++++++------ .../downloaders/src/bitfinity_evm_client.rs | 2 +- 2 files changed, 34 insertions(+), 14 deletions(-) diff --git a/bin/reth/src/commands/bitfinity_import.rs b/bin/reth/src/commands/bitfinity_import.rs index aef11764a8f..348dc4a79fd 100644 --- a/bin/reth/src/commands/bitfinity_import.rs +++ b/bin/reth/src/commands/bitfinity_import.rs @@ -147,7 +147,7 @@ impl BitfinityImportCommand { max_block_age_secs: Duration::from_secs(self.bitfinity.max_block_age_secs), }; - let mut remote_client = + let remote_client = Arc::new( BitfinityEvmClient::from_rpc_url( rpc_config, start_block, @@ -160,27 +160,47 @@ impl BitfinityImportCommand { }), self.bitfinity.check_evm_state_before_importing, ) - .await?; + .await?, + ); + + // override the tip + let safe_block = if let Some(safe_block) = remote_client.safe_block() { + safe_block + } else { + debug!(target: "reth::cli - BitfinityImportCommand", "No safe block found, skipping import"); + return Ok(()); + }; + + self.import_to_block( + safe_block, + remote_client.clone(), + provider_factory.clone(), + consensus.clone(), + ) + .await?; if self.bitfinity.validate_unsafe_blocks { while let Some(unsafe_block) = remote_client.unsafe_block() { if let Err(err) = remote_client.validate_block(unsafe_block).await { error!(target: "reth::cli - BitfinityImportCommand", "Block validation failed: {}", err); + break; } info!(target: "reth::cli - BitfinityImportCommand", "Block validated: {}", unsafe_block); } } - // override the tip - let safe_block = if let Some(safe_block) = remote_client.safe_block() { - safe_block - } else { - debug!(target: "reth::cli - BitfinityImportCommand", "No safe block found, skipping import"); - return Ok(()); - }; - - self.import_to_block(safe_block, remote_client, provider_factory.clone(), consensus.clone()).await?; + if let Some(new_safe_block) = remote_client.safe_block() { + if new_safe_block != safe_block { + self.import_to_block( + new_safe_block, + remote_client.clone(), + provider_factory.clone(), + consensus.clone(), + ) + .await?; + } + } info!(target: "reth::cli - BitfinityImportCommand", "Finishing up"); Ok(()) @@ -190,7 +210,7 @@ impl BitfinityImportCommand { async fn import_to_block( &self, new_tip: B256, - remote_client: BitfinityEvmClient, + remote_client: Arc, provider_factory: ProviderFactory>>, consensus: Arc>, ) -> eyre::Result<()> { @@ -200,7 +220,7 @@ impl BitfinityImportCommand { &self.config, provider_factory.clone(), &consensus, - Arc::new(remote_client), + remote_client, StaticFileProducer::new(provider_factory.clone(), PruneModes::default()), )?; diff --git a/crates/net/downloaders/src/bitfinity_evm_client.rs b/crates/net/downloaders/src/bitfinity_evm_client.rs index 81208d06a0b..f2840aff162 100644 --- a/crates/net/downloaders/src/bitfinity_evm_client.rs +++ b/crates/net/downloaders/src/bitfinity_evm_client.rs @@ -228,7 +228,7 @@ impl BitfinityEvmClient { /// Validates the block with the given hash and update the latest safe block number if /// successful. - pub async fn validate_block(&mut self, block_hash: B256) -> Result<(), RemoteClientError> { + pub async fn validate_block(&self, block_hash: B256) -> Result<(), RemoteClientError> { let validation_hash: B256 = todo!(); match self.send_validation_request(block_hash, validation_hash).await { Ok(_) => { From 6b511dd28e9b9810c84765dae1af9fe1e177ef03 Mon Sep 17 00:00:00 2001 From: Maxim Date: Mon, 10 Feb 2025 14:36:40 +0900 Subject: [PATCH 03/38] Block validator --- Cargo.lock | 38 ++++++ Cargo.toml | 2 + bin/reth/Cargo.toml | 2 + bin/reth/src/commands/bitfinity_import.rs | 72 ++++++++--- crates/bitfinity-block-validator/Cargo.toml | 47 +++++++ crates/bitfinity-block-validator/src/lib.rs | 122 ++++++++++++++++++ .../downloaders/src/bitfinity_evm_client.rs | 66 +++++----- crates/node/core/src/args/bitfinity_args.rs | 12 ++ 8 files changed, 306 insertions(+), 55 deletions(-) create mode 100644 crates/bitfinity-block-validator/Cargo.toml create mode 100644 crates/bitfinity-block-validator/src/lib.rs diff --git a/Cargo.lock b/Cargo.lock index bee3c24489a..0f5ab738271 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1455,6 +1455,42 @@ version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" +[[package]] +name = "bitfinity-block-validator" +version = "1.1.5" +dependencies = [ + "alloy-consensus", + "alloy-genesis", + "alloy-primitives", + "alloy-signer", + "alloy-signer-local", + "async-trait", + "candid", + "did", + "ethereum-json-rpc-client", + "evm-canister-client", + "eyre", + "itertools 0.13.0", + "reth-chain-state", + "reth-chainspec", + "reth-db", + "reth-db-common", + "reth-engine-tree", + "reth-evm", + "reth-evm-ethereum", + "reth-node-types", + "reth-primitives", + "reth-primitives-traits", + "reth-provider", + "reth-revm", + "reth-trie", + "reth-trie-db", + "serde", + "tempfile", + "tokio", + "tracing", +] + [[package]] name = "bitflags" version = "1.3.2" @@ -7209,6 +7245,7 @@ dependencies = [ "async-channel 2.3.1", "async-trait", "backon", + "bitfinity-block-validator", "candid", "clap", "did", @@ -7217,6 +7254,7 @@ dependencies = [ "evm-canister-client", "eyre", "futures", + "hex", "jsonrpsee", "lightspeed_scheduler", "parking_lot", diff --git a/Cargo.toml b/Cargo.toml index d9f2843d182..3f647711b21 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -128,6 +128,7 @@ members = [ "crates/trie/parallel/", "crates/trie/sparse", "crates/trie/trie", + "crates/bitfinity-block-validator/", "examples/beacon-api-sidecar-fetcher/", "examples/beacon-api-sse/", "examples/bsc-p2p", @@ -649,6 +650,7 @@ tracy-client = "0.17.3" # Bitfinity Deps async-channel = "2" +bitfinity-block-validator = { path = "crates/bitfinity-block-validator" } candid = "0.10" did = { git = "https://github.com/bitfinity-network/bitfinity-evm-sdk", package = "did", tag = "v0.42.x" } dirs = "5.0.1" diff --git a/bin/reth/Cargo.toml b/bin/reth/Cargo.toml index ca31910c019..3afeb92099e 100644 --- a/bin/reth/Cargo.toml +++ b/bin/reth/Cargo.toml @@ -98,9 +98,11 @@ similar-asserts.workspace = true # bitfinity dependencies async-channel.workspace = true +bitfinity-block-validator.workspace = true candid.workspace = true did.workspace = true evm-canister-client = { workspace = true, features = ["ic-agent-client"] } +hex.workspace = true lightspeed_scheduler = { workspace = true, features = ["tracing"] } # rlp = { workspace = true } diff --git a/bin/reth/src/commands/bitfinity_import.rs b/bin/reth/src/commands/bitfinity_import.rs index 348dc4a79fd..ce329e3fd4f 100644 --- a/bin/reth/src/commands/bitfinity_import.rs +++ b/bin/reth/src/commands/bitfinity_import.rs @@ -1,6 +1,9 @@ //! Command that initializes the node by importing a chain from a remote EVM node. use crate::{dirs::DataDirPath, version::SHORT_VERSION}; +use bitfinity_block_validator::BitfinityBlockValidator; +use candid::Principal; +use evm_canister_client::{ic_agent::{identity::AnonymousIdentity, Agent}, EvmCanisterClient, IcAgentClient}; use futures::{Stream, StreamExt}; use lightspeed_scheduler::{job::Job, scheduler::Scheduler, JobExecutor}; use reth_beacon_consensus::EthBeaconConsensus; @@ -17,7 +20,7 @@ use reth_downloaders::{ }; use reth_exex::ExExManagerHandle; use reth_node_api::NodeTypesWithDBAdapter; -use reth_node_core::{args::BitfinityImportArgs, dirs::ChainPath}; +use reth_node_core::{args::{BitfinityImportArgs, IC_MAINNET_KEY, IC_MAINNET_URL}, dirs::ChainPath}; use reth_node_ethereum::{EthExecutorProvider, EthereumNode}; use reth_node_events::node::NodeEvent; use reth_primitives::{EthPrimitives, SealedHeader}; @@ -34,7 +37,7 @@ use reth_stages::{ use reth_static_file::StaticFileProducer; use std::{path::PathBuf, sync::Arc, time::Duration}; use tokio::sync::watch; -use tracing::{debug, error, info}; +use tracing::{debug, info, warn}; /// Syncs RLP encoded blocks from a file. #[derive(Clone)] @@ -180,25 +183,30 @@ impl BitfinityImportCommand { .await?; if self.bitfinity.validate_unsafe_blocks { - while let Some(unsafe_block) = remote_client.unsafe_block() { - if let Err(err) = remote_client.validate_block(unsafe_block).await { - error!(target: "reth::cli - BitfinityImportCommand", "Block validation failed: {}", err); - break; + let Some(mut tip) = remote_client.tip() else { + warn!(target: "reth::cli - BitfinityImportCommand", "Cannot find block for validation. Skipping."); + return Ok(()); + }; + + while tip != safe_block { + match self.validate_block(&tip, remote_client.clone(), provider_factory.clone()).await { + Ok(_) => { + self.import_to_block(tip, remote_client, provider_factory, consensus) + .await?; + break; + } + + Err(err) => { + warn!(target: "reth::cli - BitfinityImportCommand", "Failed to validate block {}: {}", tip, err); + + if let Some(parent) = remote_client.parent(&tip) { + tip = parent; + } else { + warn!(target: "reth::cli - BitfinityImportCommand", "Cannot find a parent block for {}", tip); + break; + } + } } - - info!(target: "reth::cli - BitfinityImportCommand", "Block validated: {}", unsafe_block); - } - } - - if let Some(new_safe_block) = remote_client.safe_block() { - if new_safe_block != safe_block { - self.import_to_block( - new_safe_block, - remote_client.clone(), - provider_factory.clone(), - consensus.clone(), - ) - .await?; } } @@ -206,6 +214,30 @@ impl BitfinityImportCommand { Ok(()) } + async fn validate_block( + &self, + block: &B256, + remote_client: Arc, + provider_factory: ProviderFactory>>, + ) -> eyre::Result<()> { + let agent = Agent::builder().with_identity(AnonymousIdentity).with_url(self.bitfinity.evm_network.clone()).build()?; + if self.bitfinity.evm_network == IC_MAINNET_URL { + let key = hex::decode(IC_MAINNET_KEY)?; + agent.set_root_key(key); + } else { + agent.fetch_root_key().await?; + } + + let evm_principal = Principal::from_text(&self.bitfinity.evmc_principal)?; + let agent_client = IcAgentClient::with_agent(evm_principal, agent); + let canister_client = EvmCanisterClient::new(agent_client); + + let validator = BitfinityBlockValidator::new(canister_client, provider_factory); + let blocks = remote_client.unsafe_blocks(block)?; + + validator.validate_blocks(&blocks).await + } + /// Imports the blocks up to the given block hash of the `remove_client`. async fn import_to_block( &self, diff --git a/crates/bitfinity-block-validator/Cargo.toml b/crates/bitfinity-block-validator/Cargo.toml new file mode 100644 index 00000000000..b14f337cad3 --- /dev/null +++ b/crates/bitfinity-block-validator/Cargo.toml @@ -0,0 +1,47 @@ +[package] +name = "bitfinity-block-validator" +version.workspace = true +edition.workspace = true +rust-version.workspace = true +license.workspace = true +homepage.workspace = true +repository.workspace = true + +[lints] +workspace = true + +[dependencies] +alloy-consensus.workspace = true +alloy-primitives.workspace = true +async-trait.workspace = true +did.workspace = true +evm-canister-client.workspace = true +eyre.workspace = true +itertools.workspace = true +reth-chain-state.workspace = true +reth-chainspec.workspace = true +reth-db.workspace = true +reth-engine-tree.workspace = true +reth-evm.workspace = true +reth-evm-ethereum.workspace = true +reth-node-types.workspace = true +reth-provider.workspace = true +reth-primitives.workspace = true +reth-primitives-traits.workspace = true +reth-revm.workspace = true +reth-trie.workspace = true +reth-trie-db.workspace = true +tracing.workspace = true + +[dev-dependencies] +alloy-consensus.workspace = true +alloy-genesis.workspace = true +alloy-signer.workspace = true +alloy-signer-local.workspace = true +async-trait.workspace = true +candid.workspace = true +ethereum-json-rpc-client = { workspace = true, features = ["reqwest"] } +reth-db-common.workspace = true +tokio.workspace = true +serde.workspace = true +tempfile.workspace = true diff --git a/crates/bitfinity-block-validator/src/lib.rs b/crates/bitfinity-block-validator/src/lib.rs new file mode 100644 index 00000000000..0190801c624 --- /dev/null +++ b/crates/bitfinity-block-validator/src/lib.rs @@ -0,0 +1,122 @@ +//! Bitfinity block validator. +use std::collections::HashSet; + +use alloy_primitives::B256; +use evm_canister_client::{CanisterClient, EvmCanisterClient}; +use itertools::Itertools; +use reth_chain_state::MemoryOverlayStateProvider; +use reth_evm::execute::{BasicBatchExecutor, BatchExecutor}; +use reth_evm_ethereum::{ + execute::{EthExecutionStrategy, EthExecutionStrategyFactory}, + EthEvmConfig, +}; +use reth_node_types::NodeTypesWithDB; +use reth_primitives::{Block, BlockWithSenders}; +use reth_provider::{ + providers::ProviderNodeTypes, ChainSpecProvider as _, ExecutionOutcome, + HashedPostStateProvider as _, LatestStateProviderRef, ProviderFactory, +}; +use reth_revm::{batch::BlockBatchRecord, database::StateProviderDatabase}; + +/// Block validator for Bitfinity. +/// +/// The validator validates the block by executing it and then +/// confirming it on the EVM. +#[derive(Clone, Debug)] +pub struct BitfinityBlockValidator +where + C: CanisterClient, + DB: NodeTypesWithDB + Clone, +{ + evm_client: EvmCanisterClient, + provider_factory: ProviderFactory, +} + +impl BitfinityBlockValidator +where + C: CanisterClient, + DB: NodeTypesWithDB + ProviderNodeTypes + Clone, +{ + /// Create a new [`BitfinityBlockValidator`]. + pub const fn new( + evm_client: EvmCanisterClient, + provider_factory: ProviderFactory, + ) -> Self { + Self { evm_client, provider_factory } + } + + /// Validate a block. + pub async fn validate_blocks(&self, blocks: &[Block]) -> eyre::Result<()> { + if blocks.is_empty() { + return Ok(()) + } + + let execution_result = self.execute_blocks(blocks)?; + let validation_hash = self.calculate_validation_hash(execution_result)?; + + let last_block = blocks.iter().last().expect("no blocks").hash_slow(); + + self.send_validation_request(last_block, validation_hash).await?; + + Ok(()) + } + + async fn send_validation_request( + &self, + block_hash: B256, + validation_hash: B256, + ) -> eyre::Result<()> { + todo!() + } + + fn calculate_validation_hash(&self, execution_result: ExecutionOutcome) -> eyre::Result { + let provider = self.provider_factory.provider()?; + let state_provider = LatestStateProviderRef::new(&provider); + let updated_state = state_provider.hashed_post_state(execution_result.state()); + + todo!() + } + + /// Execute block and return validation arguments. + fn execute_blocks(&self, blocks: &[Block]) -> eyre::Result { + let executor = self.executor(); + let blocks_with_senders: Vec<_> = blocks.iter().map(Self::convert_block).collect(); + + match executor.execute_and_verify_batch(&blocks_with_senders) { + Ok(output) => Ok(output), + Err(err) => Err(eyre::eyre!("Failed to execute blocks: {err:?}")), + } + } + + /// Convert [`Block`] to [`BlockWithSenders`]. + fn convert_block(block: &Block) -> BlockWithSenders { + use reth_primitives_traits::SignedTransaction; + + let senders: HashSet<_> = + block.body.transactions.iter().filter_map(|tx| tx.recover_signer()).collect(); + tracing::debug!("Found {} unique senders in block", senders.len()); + + BlockWithSenders { block: block.clone(), senders: senders.into_iter().collect() } + } + + /// Get the block executor for the latest block. + fn executor( + &self, + ) -> BasicBatchExecutor< + EthExecutionStrategy< + StateProviderDatabase>, + EthEvmConfig, + >, + > { + use reth_evm::execute::BlockExecutionStrategyFactory; + + let historical = self.provider_factory.latest().expect("no latest provider"); + let db = MemoryOverlayStateProvider::new(historical, Vec::new()); + + BasicBatchExecutor::new( + EthExecutionStrategyFactory::ethereum(self.provider_factory.chain_spec()) + .create_strategy(StateProviderDatabase::new(db)), + BlockBatchRecord::default(), + ) + } +} diff --git a/crates/net/downloaders/src/bitfinity_evm_client.rs b/crates/net/downloaders/src/bitfinity_evm_client.rs index f2840aff162..769282e9f87 100644 --- a/crates/net/downloaders/src/bitfinity_evm_client.rs +++ b/crates/net/downloaders/src/bitfinity_evm_client.rs @@ -2,7 +2,7 @@ use alloy_eips::BlockHashOrNumber; use alloy_genesis::{ChainConfig, Genesis, GenesisAccount}; use alloy_primitives::{BlockHash, BlockNumber, B256, U256}; use candid::Principal; -use did::certified::CertifiedResult; +use did::{certified::CertifiedResult, Transaction}; use ethereum_json_rpc_client::{reqwest::ReqwestClient, EthJsonRpcClient}; use eyre::Result; use futures::future::Remote; @@ -25,7 +25,7 @@ use reth_network_p2p::{ priority::Priority, }; use reth_network_peers::PeerId; -use reth_primitives::{BlockBody, ForkCondition, Header, TransactionSigned}; +use reth_primitives::{Block, BlockBody, ForkCondition, Header, TransactionSigned}; use serde_json::json; use std::{self, cmp::min, collections::HashMap, sync::OnceLock, time::Duration}; @@ -226,39 +226,6 @@ impl BitfinityEvmClient { Ok(Self { headers, hash_to_number, bodies, safe_block_number }) } - /// Validates the block with the given hash and update the latest safe block number if - /// successful. - pub async fn validate_block(&self, block_hash: B256) -> Result<(), RemoteClientError> { - let validation_hash: B256 = todo!(); - match self.send_validation_request(block_hash, validation_hash).await { - Ok(_) => { - let Some(safe_block) = self.hash_to_number.get(&block_hash) else { - return Err(RemoteClientError::ValidationError("validation succeeded but the block is not found in the headers".into())); - }; - - self.safe_block_number = *safe_block; - info!(target: "downloaders::bitfinity_evm_client", "Block validated: {}", block_hash); - - Ok(()) - } - Err(err) => { - warn!(target: "downloaders::bitfinity_evm_client", "Block validation failed: {}", err); - Err(err) - } - } - } - - /// Sends the validation request to the EVM. - /// - /// If `Ok` is returned, validation was successful and the new safe block is the validated one. - async fn send_validation_request( - &self, - block_hash: B256, - validation_hash: B256, - ) -> Result<(), RemoteClientError> { - todo!() - } - /// Get the remote tip hash of the chain. pub fn tip(&self) -> Option { self.headers @@ -268,6 +235,35 @@ impl BitfinityEvmClient { .map(|h| h.hash_slow()) } + /// Returns the parent block hash of the given one. + pub fn parent(&self, block: &B256) -> Option { + let block_number = self.hash_to_number.get(block)?; + if *block_number == 0 { + return None; + } + + self.headers.get(&(block_number - 1)).map(|h| h.hash_slow()) + } + + /// Returns unsafe blocks with transactions up to the `tip`. + pub fn unsafe_blocks(&self, tip: &B256) -> eyre::Result> { + let mut next_block_number = self.safe_block_number + 1; + let mut blocks = vec![]; + while let Some(header) = self.headers.get(&next_block_number) { + let block_hash = header.hash_slow(); + let body = self.bodies.get(&block_hash).ok_or_else(|| eyre::eyre!("Block body not found"))?; + blocks.push(body.clone().into_block(header.clone())); + + if block_hash == *tip { + return Ok(blocks); + } + + next_block_number += 1; + } + + Err(eyre::eyre!("Block {tip} not found")) + } + /// Returns the hash of the first block after the latest safe block. If the tip of the chain is /// safe, returns `None`. pub fn unsafe_block(&self) -> Option { diff --git a/crates/node/core/src/args/bitfinity_args.rs b/crates/node/core/src/args/bitfinity_args.rs index e7f553d31d4..a941d7dee7f 100644 --- a/crates/node/core/src/args/bitfinity_args.rs +++ b/crates/node/core/src/args/bitfinity_args.rs @@ -4,6 +4,9 @@ use clap::{arg, Args}; /// IC advices to use a hardcoded value instead of querying it to avoid main-in-the middle attacks. pub const IC_MAINNET_KEY: &str = "308182301d060d2b0601040182dc7c0503010201060c2b0601040182dc7c05030201036100814c0e6ec71fab583b08bd81373c255c3c371b2e84863c98a4f1e08b74235d14fb5d9c0cd546d9685f913a0c0b2cc5341583bf4b4392e467db96d65b9bb4cb717112f8472e0d5a4d14505ffd7484b01291091c5f87b98883463f98091a0baaae"; +/// URL of the IC mainnet. +pub const IC_MAINNET_URL: &str = "https://ic0.app"; + /// Bitfinity Related Args #[derive(Debug, Args, PartialEq, Eq, Default, Clone)] #[clap(next_help_heading = "Bitfinity Args")] @@ -71,6 +74,15 @@ pub struct BitfinityImportArgs { /// If validation is disabled, unsafe blocks will be ignored. #[arg(long)] pub validate_unsafe_blocks: bool, + + /// Network url + /// + /// This is the URL of the IC network. If not set, IC mainnet connection will be used. + /// E.g. + /// - + /// - + #[arg(long, default_value=IC_MAINNET_URL)] + pub evm_network: String, } /// Bitfinity Related Args From 4fb200f99fa1f4593c781d55f20395a8ad9c976e Mon Sep 17 00:00:00 2001 From: Maxim Date: Mon, 10 Feb 2025 17:33:53 +0900 Subject: [PATCH 04/38] Use updated evm client to send validation request --- crates/bitfinity-block-validator/src/lib.rs | 42 ++++++++++++++++----- 1 file changed, 33 insertions(+), 9 deletions(-) diff --git a/crates/bitfinity-block-validator/src/lib.rs b/crates/bitfinity-block-validator/src/lib.rs index 0190801c624..e0941f5e471 100644 --- a/crates/bitfinity-block-validator/src/lib.rs +++ b/crates/bitfinity-block-validator/src/lib.rs @@ -2,6 +2,7 @@ use std::collections::HashSet; use alloy_primitives::B256; +use did::BlockConfirmationData; use evm_canister_client::{CanisterClient, EvmCanisterClient}; use itertools::Itertools; use reth_chain_state::MemoryOverlayStateProvider; @@ -52,29 +53,44 @@ where } let execution_result = self.execute_blocks(blocks)?; - let validation_hash = self.calculate_validation_hash(execution_result)?; + let last_block = blocks.iter().last().expect("no blocks"); - let last_block = blocks.iter().last().expect("no blocks").hash_slow(); + let confirmation_data = self.calculate_confirmation_data(last_block, execution_result)?; - self.send_validation_request(last_block, validation_hash).await?; + self.send_confirmation_request(confirmation_data).await?; Ok(()) } - async fn send_validation_request( + /// Sends the block confirmation request to the EVM. + async fn send_confirmation_request( &self, - block_hash: B256, - validation_hash: B256, + confirmation_data: BlockConfirmationData, ) -> eyre::Result<()> { - todo!() + match self.evm_client.confirm_block(confirmation_data).await? { + Ok(_) => Ok(()), + Err(err) => Err(eyre::eyre!("{err}")), + } } - fn calculate_validation_hash(&self, execution_result: ExecutionOutcome) -> eyre::Result { + /// Calculates confirmation data for a block based on execution result. + fn calculate_confirmation_data( + &self, + block: &Block, + execution_result: ExecutionOutcome, + ) -> eyre::Result { let provider = self.provider_factory.provider()?; let state_provider = LatestStateProviderRef::new(&provider); let updated_state = state_provider.hashed_post_state(execution_result.state()); - todo!() + Ok(BlockConfirmationData { + block_number: block.number, + hash: block.hash_slow().into(), + state_root: block.state_root.into(), + transactions_root: block.transactions_root.into(), + receipts_root: block.receipts_root.into(), + proof_of_work: self.calculate_pow_hash(updated_state), + }) } /// Execute block and return validation arguments. @@ -119,4 +135,12 @@ where BlockBatchRecord::default(), ) } + + /// Calculates POW hash based on the given trie state. + fn calculate_pow_hash( + &self, + updated_state: reth_trie::HashedPostState, + ) -> did::hash::Hash> { + todo!() + } } From 30c84f4c7cbb0e566de2016569e33f49ebe66f7a Mon Sep 17 00:00:00 2001 From: Maxim Date: Tue, 11 Feb 2025 17:48:57 +0900 Subject: [PATCH 05/38] Fix integration tests --- .cargo/config.toml | 8 ++ Cargo.lock | 116 +++++++++++------- bin/reth/src/commands/bitfinity_import.rs | 4 +- .../tests/commands/bitfinity_import_it.rs | 13 +- bin/reth/tests/commands/bitfinity_node_it.rs | 45 +++---- bin/reth/tests/commands/utils.rs | 4 +- crates/bitfinity-block-validator/src/lib.rs | 2 - .../downloaders/src/bitfinity_evm_client.rs | 43 ++++--- 8 files changed, 145 insertions(+), 90 deletions(-) diff --git a/.cargo/config.toml b/.cargo/config.toml index 9430f38d1d0..dd0b6b2108d 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -14,3 +14,11 @@ rustflags = [ # in line with Linux (whereas default for Windows is 1MB) "-Clink-arg=/STACK:10000000", ] + + +[patch."https://github.com/bitfinity-network/bitfinity-evm-sdk"] +did = { path = "../bitfinity-evm-sdk/src/did" } +eth-signer = { path = "../bitfinity-evm-sdk/src/eth-signer" } +ethereum-json-rpc-client = { path = "../bitfinity-evm-sdk/src/ethereum-json-rpc-client" } +evm-canister-client = { path = "../bitfinity-evm-sdk/src/evm-canister-client" } +signature-verification-canister-client = { path = "../bitfinity-evm-sdk/src/signature-verification-canister-client" } diff --git a/Cargo.lock b/Cargo.lock index 0f5ab738271..51ade6ca88b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -151,7 +151,7 @@ dependencies = [ "arbitrary", "auto_impl", "c-kzg", - "derive_more", + "derive_more 1.0.0", "k256", "rand 0.8.5", "serde", @@ -216,7 +216,7 @@ dependencies = [ "alloy-sol-type-parser", "alloy-sol-types", "const-hex", - "derive_more", + "derive_more 1.0.0", "itoa", "serde", "serde_json", @@ -260,7 +260,7 @@ dependencies = [ "alloy-primitives", "alloy-rlp", "arbitrary", - "derive_more", + "derive_more 1.0.0", "k256", "rand 0.8.5", "serde", @@ -280,7 +280,7 @@ dependencies = [ "alloy-serde", "arbitrary", "c-kzg", - "derive_more", + "derive_more 1.0.0", "ethereum_ssz", "ethereum_ssz_derive", "once_cell", @@ -394,7 +394,7 @@ dependencies = [ "cfg-if", "const-hex", "derive_arbitrary", - "derive_more", + "derive_more 1.0.0", "foldhash", "getrandom 0.2.15", "hashbrown 0.15.2", @@ -605,7 +605,7 @@ dependencies = [ "alloy-primitives", "alloy-rlp", "alloy-serde", - "derive_more", + "derive_more 1.0.0", "ethereum_ssz", "ethereum_ssz_derive", "jsonrpsee-types", @@ -874,7 +874,7 @@ dependencies = [ "arbitrary", "arrayvec 0.7.6", "derive_arbitrary", - "derive_more", + "derive_more 1.0.0", "nybbles", "proptest", "proptest-derive", @@ -2743,7 +2743,16 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4a9b99b9cbbe49445b21764dc0625032a89b145a2642e67603e1c936f5458d05" dependencies = [ - "derive_more-impl", + "derive_more-impl 1.0.0", +] + +[[package]] +name = "derive_more" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "093242cf7570c207c83073cf82f79706fe7b8317e98620a47d5be7c3d8497678" +dependencies = [ + "derive_more-impl 2.0.1", ] [[package]] @@ -2759,16 +2768,27 @@ dependencies = [ "unicode-xid", ] +[[package]] +name = "derive_more-impl" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bda628edc44c4bb645fbe0f758797143e4e07926f7ebf4e9bdfbd3d2ce621df3" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.96", + "unicode-xid", +] + [[package]] name = "did" version = "0.42.0" -source = "git+https://github.com/bitfinity-network/bitfinity-evm-sdk?tag=v0.42.x#df8b9ffac634e5a9441ff92887ca613c1adcdb02" dependencies = [ "alloy", "bincode", "bytes", "candid", - "derive_more", + "derive_more 2.0.1", "ic-log", "ic-stable-structures 0.23.0", "jsonrpc-core", @@ -3117,7 +3137,6 @@ dependencies = [ [[package]] name = "ethereum-json-rpc-client" version = "0.42.0" -source = "git+https://github.com/bitfinity-network/bitfinity-evm-sdk?tag=v0.42.x#df8b9ffac634e5a9441ff92887ca613c1adcdb02" dependencies = [ "alloy", "anyhow", @@ -3203,7 +3222,6 @@ dependencies = [ [[package]] name = "evm-canister-client" version = "0.42.0" -source = "git+https://github.com/bitfinity-network/bitfinity-evm-sdk?tag=v0.42.x#df8b9ffac634e5a9441ff92887ca613c1adcdb02" dependencies = [ "candid", "did", @@ -5597,7 +5615,7 @@ dependencies = [ "alloy-sol-types", "async-trait", "brotli", - "derive_more", + "derive_more 1.0.0", "miniz_oxide", "op-alloy-consensus", "op-alloy-genesis", @@ -6153,7 +6171,7 @@ dependencies = [ "alloy-rlp", "alloy-serde", "arbitrary", - "derive_more", + "derive_more 1.0.0", "serde", "serde_with", "thiserror 2.0.10", @@ -6194,7 +6212,7 @@ dependencies = [ "alloy-rpc-types-eth", "alloy-serde", "arbitrary", - "derive_more", + "derive_more 1.0.0", "op-alloy-consensus", "serde", "serde_json", @@ -6209,7 +6227,7 @@ dependencies = [ "alloy-eips", "alloy-primitives", "alloy-rpc-types-engine", - "derive_more", + "derive_more 1.0.0", "op-alloy-consensus", "op-alloy-protocol", "thiserror 2.0.10", @@ -7501,7 +7519,7 @@ dependencies = [ "alloy-primitives", "alloy-signer", "alloy-signer-local", - "derive_more", + "derive_more 1.0.0", "metrics", "parking_lot", "pin-project", @@ -7533,7 +7551,7 @@ dependencies = [ "alloy-rlp", "alloy-trie", "auto_impl", - "derive_more", + "derive_more 1.0.0", "once_cell", "reth-ethereum-forks", "reth-network-peers", @@ -7707,7 +7725,7 @@ dependencies = [ "alloy-eips", "alloy-primitives", "auto_impl", - "derive_more", + "derive_more 1.0.0", "reth-primitives", "reth-primitives-traits", ] @@ -7759,7 +7777,7 @@ dependencies = [ "assert_matches", "bytes", "codspeed-criterion-compat", - "derive_more", + "derive_more 1.0.0", "eyre", "metrics", "page_size", @@ -7798,7 +7816,7 @@ dependencies = [ "alloy-primitives", "arbitrary", "bytes", - "derive_more", + "derive_more 1.0.0", "metrics", "modular-bitfield", "parity-scale-codec", @@ -7898,7 +7916,7 @@ version = "1.1.5" dependencies = [ "alloy-primitives", "alloy-rlp", - "derive_more", + "derive_more 1.0.0", "discv5", "enr", "futures", @@ -8008,7 +8026,7 @@ dependencies = [ "alloy-rpc-types-eth", "alloy-signer", "alloy-signer-local", - "derive_more", + "derive_more 1.0.0", "eyre", "futures-util", "jsonrpsee", @@ -8164,7 +8182,7 @@ dependencies = [ "assert_matches", "codspeed-criterion-compat", "crossbeam-channel", - "derive_more", + "derive_more 1.0.0", "futures", "metrics", "proptest", @@ -8265,7 +8283,7 @@ dependencies = [ "arbitrary", "async-stream", "bytes", - "derive_more", + "derive_more 1.0.0", "futures", "pin-project", "proptest", @@ -8303,7 +8321,7 @@ dependencies = [ "alloy-rlp", "arbitrary", "bytes", - "derive_more", + "derive_more 1.0.0", "proptest", "proptest-arbitrary-interop", "rand 0.8.5", @@ -8412,7 +8430,7 @@ dependencies = [ "alloy-primitives", "alloy-rlp", "arbitrary", - "derive_more", + "derive_more 1.0.0", "modular-bitfield", "once_cell", "proptest", @@ -8682,7 +8700,7 @@ dependencies = [ "byteorder", "codspeed-criterion-compat", "dashmap", - "derive_more", + "derive_more 1.0.0", "indexmap 2.7.0", "parking_lot", "pprof", @@ -8748,7 +8766,7 @@ dependencies = [ "aquamarine", "auto_impl", "codspeed-criterion-compat", - "derive_more", + "derive_more 1.0.0", "discv5", "enr", "futures", @@ -8805,7 +8823,7 @@ dependencies = [ "alloy-primitives", "alloy-rpc-types-admin", "auto_impl", - "derive_more", + "derive_more 1.0.0", "enr", "futures", "reth-eth-wire-types", @@ -8828,7 +8846,7 @@ dependencies = [ "alloy-eips", "alloy-primitives", "auto_impl", - "derive_more", + "derive_more 1.0.0", "futures", "parking_lot", "reth-consensus", @@ -8877,7 +8895,7 @@ version = "1.1.5" dependencies = [ "anyhow", "bincode", - "derive_more", + "derive_more 1.0.0", "lz4_flex", "memmap2", "rand 0.8.5", @@ -8984,7 +9002,7 @@ dependencies = [ "alloy-primitives", "alloy-rpc-types-engine", "clap", - "derive_more", + "derive_more 1.0.0", "dirs-next", "eyre", "futures", @@ -9082,7 +9100,7 @@ dependencies = [ "alloy-eips", "alloy-primitives", "alloy-rpc-types-engine", - "derive_more", + "derive_more 1.0.0", "futures", "humantime", "pin-project", @@ -9142,7 +9160,7 @@ dependencies = [ "alloy-rlp", "arbitrary", "bytes", - "derive_more", + "derive_more 1.0.0", "modular-bitfield", "once_cell", "op-alloy-consensus", @@ -9251,7 +9269,7 @@ dependencies = [ "bytes", "c-kzg", "codspeed-criterion-compat", - "derive_more", + "derive_more 1.0.0", "modular-bitfield", "once_cell", "op-alloy-consensus", @@ -9293,7 +9311,7 @@ dependencies = [ "bincode", "byteorder", "bytes", - "derive_more", + "derive_more 1.0.0", "k256", "modular-bitfield", "op-alloy-consensus", @@ -9400,7 +9418,7 @@ dependencies = [ "alloy-primitives", "arbitrary", "assert_matches", - "derive_more", + "derive_more 1.0.0", "modular-bitfield", "proptest", "proptest-arbitrary-interop", @@ -9454,7 +9472,7 @@ dependencies = [ "alloy-signer", "alloy-signer-local", "async-trait", - "derive_more", + "derive_more 1.0.0", "futures", "http", "http-body", @@ -9685,7 +9703,7 @@ dependencies = [ "alloy-primitives", "alloy-rpc-types-eth", "alloy-sol-types", - "derive_more", + "derive_more 1.0.0", "futures", "itertools 0.13.0", "jsonrpsee-core", @@ -9893,7 +9911,7 @@ version = "1.1.5" dependencies = [ "alloy-primitives", "clap", - "derive_more", + "derive_more 1.0.0", "reth-nippy-jar", "serde", "strum", @@ -9930,7 +9948,7 @@ dependencies = [ "alloy-eips", "alloy-primitives", "alloy-rlp", - "derive_more", + "derive_more 1.0.0", "reth-fs-util", "reth-primitives-traits", "reth-static-file-types", @@ -10083,7 +10101,7 @@ dependencies = [ "bincode", "bytes", "codspeed-criterion-compat", - "derive_more", + "derive_more 1.0.0", "hash-db", "itertools 0.13.0", "nybbles", @@ -10104,7 +10122,7 @@ dependencies = [ "alloy-consensus", "alloy-primitives", "alloy-rlp", - "derive_more", + "derive_more 1.0.0", "metrics", "proptest", "proptest-arbitrary-interop", @@ -10133,7 +10151,7 @@ dependencies = [ "alloy-primitives", "alloy-rlp", "codspeed-criterion-compat", - "derive_more", + "derive_more 1.0.0", "itertools 0.13.0", "metrics", "proptest", @@ -12930,3 +12948,11 @@ dependencies = [ "cc", "pkg-config", ] + +[[patch.unused]] +name = "eth-signer" +version = "0.42.0" + +[[patch.unused]] +name = "signature-verification-canister-client" +version = "0.42.0" diff --git a/bin/reth/src/commands/bitfinity_import.rs b/bin/reth/src/commands/bitfinity_import.rs index ce329e3fd4f..744ea9e6b1b 100644 --- a/bin/reth/src/commands/bitfinity_import.rs +++ b/bin/reth/src/commands/bitfinity_import.rs @@ -37,7 +37,7 @@ use reth_stages::{ use reth_static_file::StaticFileProducer; use std::{path::PathBuf, sync::Arc, time::Duration}; use tokio::sync::watch; -use tracing::{debug, info, warn}; +use tracing::{debug, error, info, warn}; /// Syncs RLP encoded blocks from a file. #[derive(Clone)] @@ -170,7 +170,7 @@ impl BitfinityImportCommand { let safe_block = if let Some(safe_block) = remote_client.safe_block() { safe_block } else { - debug!(target: "reth::cli - BitfinityImportCommand", "No safe block found, skipping import"); + error!(target: "reth::cli - BitfinityImportCommand", "No safe block found, skipping import"); return Ok(()); }; diff --git a/bin/reth/tests/commands/bitfinity_import_it.rs b/bin/reth/tests/commands/bitfinity_import_it.rs index 50e9a692038..951828a274a 100644 --- a/bin/reth/tests/commands/bitfinity_import_it.rs +++ b/bin/reth/tests/commands/bitfinity_import_it.rs @@ -41,7 +41,7 @@ async fn bitfinity_test_should_import_data_from_evm() { let evm_rpc_client = EthJsonRpcClient::new(ReqwestClient::new(evm_datasource_url.to_string())); - let remote_block = evm_rpc_client.get_block_by_number(end_block.into()).await.unwrap(); + let remote_block = evm_rpc_client.get_block_by_number(end_block.into()).await.unwrap().unwrap(); let local_block = provider.block_by_number(end_block).unwrap().unwrap(); assert_eq!(remote_block.hash.0, local_block.header.hash_slow().0); @@ -73,7 +73,7 @@ async fn bitfinity_test_should_import_with_small_batch_size() { let evm_rpc_client = EthJsonRpcClient::new(ReqwestClient::new(evm_datasource_url.to_string())); - let remote_block = evm_rpc_client.get_block_by_number(end_block.into()).await.unwrap(); + let remote_block = evm_rpc_client.get_block_by_number(end_block.into()).await.unwrap().unwrap(); let local_block = provider.block_by_number(end_block).unwrap().unwrap(); assert_eq!(remote_block.hash.0, local_block.header.hash_slow().0); @@ -135,7 +135,7 @@ async fn bitfinity_test_should_import_data_from_evm_with_backup_rpc_url() { // create evm client let evm_rpc_client = EthJsonRpcClient::new(ReqwestClient::new(backup_rpc_url.to_string())); - let remote_block = evm_rpc_client.get_block_by_number(end_block.into()).await.unwrap(); + let remote_block = evm_rpc_client.get_block_by_number(end_block.into()).await.unwrap().unwrap(); let local_block = provider.block_by_number(end_block).unwrap().unwrap(); assert_eq!(remote_block.hash.0, local_block.header.hash_slow().0); @@ -196,6 +196,10 @@ async fn bitfinity_test_should_import_blocks_when_evm_is_enabled_and_check_evm_s let (_temp_dir, mut import_data) = bitfinity_import_config_data(&evm_datasource_url, None, None).await.unwrap(); + // + // Wait for enough blocks to be minted + tokio::time::sleep(Duration::from_secs(1)).await; + import_data.bitfinity_args.end_block = Some(10); import_data.bitfinity_args.batch_size = 5; import_data.bitfinity_args.max_fetch_blocks = 10; @@ -238,6 +242,9 @@ async fn bitfinity_test_should_import_block_when_evm_is_enabled_and_check_evm_st let (_temp_dir, mut import_data) = bitfinity_import_config_data(&evm_datasource_url, None, None).await.unwrap(); + // Wait for enough blocks to be minted + tokio::time::sleep(Duration::from_secs(1)).await; + import_data.bitfinity_args.end_block = Some(10); import_data.bitfinity_args.batch_size = 5; import_data.bitfinity_args.max_fetch_blocks = 10; diff --git a/bin/reth/tests/commands/bitfinity_node_it.rs b/bin/reth/tests/commands/bitfinity_node_it.rs index 62eb65c6a3d..6352aa38bb0 100644 --- a/bin/reth/tests/commands/bitfinity_node_it.rs +++ b/bin/reth/tests/commands/bitfinity_node_it.rs @@ -1,12 +1,10 @@ //! //! Integration tests for the bitfinity node command. -//! use super::utils::*; use did::keccak; use eth_server::{EthImpl, EthServer}; -use ethereum_json_rpc_client::CertifiedResult; -use ethereum_json_rpc_client::{reqwest::ReqwestClient, EthJsonRpcClient}; +use ethereum_json_rpc_client::{reqwest::ReqwestClient, CertifiedResult, EthJsonRpcClient}; use jsonrpsee::{ server::{Server, ServerHandle}, Methods, RpcModule, @@ -17,24 +15,22 @@ use reth::{ dirs::{DataDirPath, MaybePlatformPath}, }; use reth_consensus::FullConsensus; -use reth_db::DatabaseEnv; -use reth_db::{init_db, test_utils::tempdir_path}; +use reth_db::{init_db, test_utils::tempdir_path, DatabaseEnv}; use reth_network::NetworkHandle; use reth_node_api::{FullNodeTypesAdapter, NodeTypesWithDBAdapter}; -use reth_node_builder::components::Components; -use reth_node_builder::rpc::RpcAddOns; -use reth_node_builder::{NodeAdapter, NodeBuilder, NodeConfig, NodeHandle}; -use reth_node_ethereum::node::EthereumEngineValidatorBuilder; +use reth_node_builder::{ + components::Components, rpc::RpcAddOns, NodeAdapter, NodeBuilder, NodeConfig, NodeHandle, +}; use reth_node_ethereum::{ - BasicBlockExecutorProvider, EthEvmConfig, EthExecutionStrategyFactory, EthereumNode, + node::EthereumEngineValidatorBuilder, BasicBlockExecutorProvider, EthEvmConfig, + EthExecutionStrategyFactory, EthereumNode, }; use reth_provider::providers::BlockchainProvider; use reth_rpc::EthApi; use reth_tasks::TaskManager; -use reth_transaction_pool::blobstore::DiskFileBlobStore; use reth_transaction_pool::{ - CoinbaseTipOrdering, EthPooledTransaction, EthTransactionValidator, Pool, - TransactionValidationTaskExecutor, + blobstore::DiskFileBlobStore, CoinbaseTipOrdering, EthPooledTransaction, + EthTransactionValidator, Pool, TransactionValidationTaskExecutor, }; use revm_primitives::{hex, Address, U256}; use std::{net::SocketAddr, str::FromStr, sync::Arc}; @@ -362,7 +358,7 @@ pub async fn mock_eth_server_start(methods: impl Into) -> (ServerHandle /// Eth server mock for local testing pub mod eth_server { - use std::sync::Arc; + use std::sync::{atomic::Ordering, Arc}; use alloy_consensus::constants::{EMPTY_RECEIPTS, EMPTY_TRANSACTIONS}; use alloy_rlp::Bytes; @@ -401,7 +397,7 @@ pub mod eth_server { async fn get_block_by_number( &self, number: BlockNumber, - ) -> RpcResult>; + ) -> RpcResult>>; /// Returns the chain ID #[method(name = "chainId")] @@ -447,7 +443,8 @@ pub mod eth_server { let mut interval = tokio::time::interval(std::time::Duration::from_millis(100)); loop { interval.tick().await; - block_counter.fetch_add(1, std::sync::atomic::Ordering::Relaxed); + let block = block_counter.fetch_add(1, std::sync::atomic::Ordering::Relaxed); + tracing::info!("Minted block {}", block + 1); } })); @@ -497,11 +494,12 @@ pub mod eth_server { async fn get_block_by_number( &self, number: BlockNumber, - ) -> RpcResult> { + ) -> RpcResult>> { + tracing::info!("Requested block {:?}", number); + + let current_block = self.current_block.load(Ordering::Relaxed); let block_num = match number { - BlockNumber::Latest | BlockNumber::Finalized | BlockNumber::Safe => { - self.current_block.load(std::sync::atomic::Ordering::Relaxed) - } + BlockNumber::Latest | BlockNumber::Finalized | BlockNumber::Safe => current_block, BlockNumber::Earliest => 0, BlockNumber::Pending => { self.current_block.fetch_add(1, std::sync::atomic::Ordering::Relaxed) @@ -509,6 +507,10 @@ pub mod eth_server { BlockNumber::Number(num) => num.as_u64(), }; + if block_num > current_block { + return Ok(None); + } + let mut block = did::Block { number: block_num.into(), timestamp: did::U256::from(1234567890_u64 + block_num), @@ -522,13 +524,14 @@ pub mod eth_server { } else { self.get_block_by_number(BlockNumber::Number(U64::from(block_num - 1))) .await? + .unwrap() .hash }, ..Default::default() }; block.hash = keccak::keccak_hash(&block.header_rlp_encoded()); - Ok(block) + Ok(Some(block)) } async fn chain_id(&self) -> RpcResult { diff --git a/bin/reth/tests/commands/utils.rs b/bin/reth/tests/commands/utils.rs index 94de57b61a1..b37e143d029 100644 --- a/bin/reth/tests/commands/utils.rs +++ b/bin/reth/tests/commands/utils.rs @@ -14,7 +14,7 @@ use alloy_primitives::BlockNumber; use lightspeed_scheduler::JobExecutor; use parking_lot::Mutex; use reth::{ - args::{BitfinityImportArgs, IC_MAINNET_KEY}, + args::{BitfinityImportArgs, IC_MAINNET_KEY, IC_MAINNET_URL}, commands::bitfinity_import::BitfinityImportCommand, dirs::{ChainPath, DataDirPath, PlatformPath}, }; @@ -172,6 +172,8 @@ pub async fn bitfinity_import_config_data( retry_delay_secs: 3, check_evm_state_before_importing: false, max_block_age_secs: 600, + validate_unsafe_blocks: false, + evm_network: IC_MAINNET_URL.to_string(), }; Ok(( diff --git a/crates/bitfinity-block-validator/src/lib.rs b/crates/bitfinity-block-validator/src/lib.rs index e0941f5e471..76fd21865ff 100644 --- a/crates/bitfinity-block-validator/src/lib.rs +++ b/crates/bitfinity-block-validator/src/lib.rs @@ -1,10 +1,8 @@ //! Bitfinity block validator. use std::collections::HashSet; -use alloy_primitives::B256; use did::BlockConfirmationData; use evm_canister_client::{CanisterClient, EvmCanisterClient}; -use itertools::Itertools; use reth_chain_state::MemoryOverlayStateProvider; use reth_evm::execute::{BasicBatchExecutor, BatchExecutor}; use reth_evm_ethereum::{ diff --git a/crates/net/downloaders/src/bitfinity_evm_client.rs b/crates/net/downloaders/src/bitfinity_evm_client.rs index 769282e9f87..a3548d2c0cb 100644 --- a/crates/net/downloaders/src/bitfinity_evm_client.rs +++ b/crates/net/downloaders/src/bitfinity_evm_client.rs @@ -2,10 +2,9 @@ use alloy_eips::BlockHashOrNumber; use alloy_genesis::{ChainConfig, Genesis, GenesisAccount}; use alloy_primitives::{BlockHash, BlockNumber, B256, U256}; use candid::Principal; -use did::{certified::CertifiedResult, Transaction}; +use did::certified::CertifiedResult; use ethereum_json_rpc_client::{reqwest::ReqwestClient, EthJsonRpcClient}; -use eyre::Result; -use futures::future::Remote; +use eyre::{OptionExt, Result}; use ic_cbor::{CertificateToCbor, HashTreeToCbor}; use ic_certificate_verification::VerifyCertificate; use ic_certification::{Certificate, HashTree, LookupResult}; @@ -28,7 +27,7 @@ use reth_network_peers::PeerId; use reth_primitives::{Block, BlockBody, ForkCondition, Header, TransactionSigned}; use serde_json::json; -use std::{self, cmp::min, collections::HashMap, sync::OnceLock, time::Duration}; +use std::{self, collections::HashMap, sync::OnceLock, time::Duration}; use thiserror::Error; use backon::{ExponentialBuilder, Retryable}; @@ -147,24 +146,33 @@ impl BitfinityEvmClient { .await .map_err(|e| RemoteClientError::ProviderError(e.to_string()))?; - let safe_block_number: BlockNumber = provider + let safe_block_number: u64 = provider .get_block_by_number(did::BlockNumber::Safe) .await .map_err(|e| { RemoteClientError::ProviderError(format!("error getting safe block: {e}")) })? + .ok_or_else(|| RemoteClientError::ProviderError("block not found".to_string()))? .number .into(); info!(target: "downloaders::bitfinity_evm_client", "Latest remote block: {latest_remote_block}"); - - let mut end_block = - min(end_block.unwrap_or(latest_remote_block), start_block + max_blocks - 1); - - if let Some(block_checker) = &block_checker { - end_block = min(end_block, block_checker.get_block_number()); - } - + info!(target: "downloaders::bitfinity_evm_client", "Safe remote block number: {safe_block_number}"); + + let end_block = [ + end_block.unwrap_or(u64::MAX), + latest_remote_block, + start_block + max_blocks - 1, + block_checker.as_ref().map(|v| v.get_block_number()).unwrap_or(u64::MAX), + ] + .into_iter() + .min() + .unwrap_or(latest_remote_block); + + let safe_block_number = + if safe_block_number > end_block { end_block } else { safe_block_number }; + + info!(target: "downloaders::bitfinity_evm_client", "Using safe block number: {safe_block_number}"); info!(target: "downloaders::bitfinity_evm_client", "Start fetching blocks from {} to {}", start_block, end_block); for begin_block in (start_block..=end_block).step_by(batch_size) { @@ -251,7 +259,8 @@ impl BitfinityEvmClient { let mut blocks = vec![]; while let Some(header) = self.headers.get(&next_block_number) { let block_hash = header.hash_slow(); - let body = self.bodies.get(&block_hash).ok_or_else(|| eyre::eyre!("Block body not found"))?; + let body = + self.bodies.get(&block_hash).ok_or_else(|| eyre::eyre!("Block body not found"))?; blocks.push(body.clone().into_block(header.clone())); if block_hash == *tip { @@ -343,7 +352,8 @@ impl BitfinityEvmClient { let genesis_block = client .get_block_by_number(0.into()) .await - .map_err(|e| eyre::eyre!("error getting genesis block: {}", e))?; + .map_err(|e| eyre::eyre!("error getting genesis block: {}", e))? + .ok_or_else(|| eyre::eyre!("genesis block not found"))?; let genesis_accounts = client.get_genesis_balances().await.map_err(|e| eyre::eyre!(e))?.into_iter().map( @@ -440,7 +450,8 @@ impl BitfinityEvmClient { let last_block = client .get_block_by_number(did::BlockNumber::Latest) .await - .map_err(|e| eyre::eyre!("error getting block number: {}", e))?; + .map_err(|e| eyre::eyre!("error getting block number: {}", e))? + .ok_or_eyre("latest block not found")?; let block_ts = last_block.timestamp.0.to::(); From f66e03cd86d1a1c912253a9bf61d36dfb9c081c3 Mon Sep 17 00:00:00 2001 From: Yasir Date: Tue, 11 Feb 2025 18:03:48 +0300 Subject: [PATCH 06/38] Add StateProvider and EVM configuration for POW hash calculation --- Cargo.lock | 106 ++++++++------------ crates/bitfinity-block-validator/Cargo.toml | 1 + crates/bitfinity-block-validator/src/lib.rs | 76 +++++++++++++- 3 files changed, 115 insertions(+), 68 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 51ade6ca88b..d8e3630746e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -151,7 +151,7 @@ dependencies = [ "arbitrary", "auto_impl", "c-kzg", - "derive_more 1.0.0", + "derive_more", "k256", "rand 0.8.5", "serde", @@ -216,7 +216,7 @@ dependencies = [ "alloy-sol-type-parser", "alloy-sol-types", "const-hex", - "derive_more 1.0.0", + "derive_more", "itoa", "serde", "serde_json", @@ -260,7 +260,7 @@ dependencies = [ "alloy-primitives", "alloy-rlp", "arbitrary", - "derive_more 1.0.0", + "derive_more", "k256", "rand 0.8.5", "serde", @@ -280,7 +280,7 @@ dependencies = [ "alloy-serde", "arbitrary", "c-kzg", - "derive_more 1.0.0", + "derive_more", "ethereum_ssz", "ethereum_ssz_derive", "once_cell", @@ -394,7 +394,7 @@ dependencies = [ "cfg-if", "const-hex", "derive_arbitrary", - "derive_more 1.0.0", + "derive_more", "foldhash", "getrandom 0.2.15", "hashbrown 0.15.2", @@ -605,7 +605,7 @@ dependencies = [ "alloy-primitives", "alloy-rlp", "alloy-serde", - "derive_more 1.0.0", + "derive_more", "ethereum_ssz", "ethereum_ssz_derive", "jsonrpsee-types", @@ -874,7 +874,7 @@ dependencies = [ "arbitrary", "arrayvec 0.7.6", "derive_arbitrary", - "derive_more 1.0.0", + "derive_more", "nybbles", "proptest", "proptest-derive", @@ -1483,6 +1483,7 @@ dependencies = [ "reth-primitives-traits", "reth-provider", "reth-revm", + "reth-rpc-eth-types", "reth-trie", "reth-trie-db", "serde", @@ -2743,16 +2744,7 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4a9b99b9cbbe49445b21764dc0625032a89b145a2642e67603e1c936f5458d05" dependencies = [ - "derive_more-impl 1.0.0", -] - -[[package]] -name = "derive_more" -version = "2.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "093242cf7570c207c83073cf82f79706fe7b8317e98620a47d5be7c3d8497678" -dependencies = [ - "derive_more-impl 2.0.1", + "derive_more-impl", ] [[package]] @@ -2768,18 +2760,6 @@ dependencies = [ "unicode-xid", ] -[[package]] -name = "derive_more-impl" -version = "2.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bda628edc44c4bb645fbe0f758797143e4e07926f7ebf4e9bdfbd3d2ce621df3" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.96", - "unicode-xid", -] - [[package]] name = "did" version = "0.42.0" @@ -2788,7 +2768,7 @@ dependencies = [ "bincode", "bytes", "candid", - "derive_more 2.0.1", + "derive_more", "ic-log", "ic-stable-structures 0.23.0", "jsonrpc-core", @@ -5615,7 +5595,7 @@ dependencies = [ "alloy-sol-types", "async-trait", "brotli", - "derive_more 1.0.0", + "derive_more", "miniz_oxide", "op-alloy-consensus", "op-alloy-genesis", @@ -6171,7 +6151,7 @@ dependencies = [ "alloy-rlp", "alloy-serde", "arbitrary", - "derive_more 1.0.0", + "derive_more", "serde", "serde_with", "thiserror 2.0.10", @@ -6212,7 +6192,7 @@ dependencies = [ "alloy-rpc-types-eth", "alloy-serde", "arbitrary", - "derive_more 1.0.0", + "derive_more", "op-alloy-consensus", "serde", "serde_json", @@ -6227,7 +6207,7 @@ dependencies = [ "alloy-eips", "alloy-primitives", "alloy-rpc-types-engine", - "derive_more 1.0.0", + "derive_more", "op-alloy-consensus", "op-alloy-protocol", "thiserror 2.0.10", @@ -7519,7 +7499,7 @@ dependencies = [ "alloy-primitives", "alloy-signer", "alloy-signer-local", - "derive_more 1.0.0", + "derive_more", "metrics", "parking_lot", "pin-project", @@ -7551,7 +7531,7 @@ dependencies = [ "alloy-rlp", "alloy-trie", "auto_impl", - "derive_more 1.0.0", + "derive_more", "once_cell", "reth-ethereum-forks", "reth-network-peers", @@ -7725,7 +7705,7 @@ dependencies = [ "alloy-eips", "alloy-primitives", "auto_impl", - "derive_more 1.0.0", + "derive_more", "reth-primitives", "reth-primitives-traits", ] @@ -7777,7 +7757,7 @@ dependencies = [ "assert_matches", "bytes", "codspeed-criterion-compat", - "derive_more 1.0.0", + "derive_more", "eyre", "metrics", "page_size", @@ -7816,7 +7796,7 @@ dependencies = [ "alloy-primitives", "arbitrary", "bytes", - "derive_more 1.0.0", + "derive_more", "metrics", "modular-bitfield", "parity-scale-codec", @@ -7916,7 +7896,7 @@ version = "1.1.5" dependencies = [ "alloy-primitives", "alloy-rlp", - "derive_more 1.0.0", + "derive_more", "discv5", "enr", "futures", @@ -8026,7 +8006,7 @@ dependencies = [ "alloy-rpc-types-eth", "alloy-signer", "alloy-signer-local", - "derive_more 1.0.0", + "derive_more", "eyre", "futures-util", "jsonrpsee", @@ -8182,7 +8162,7 @@ dependencies = [ "assert_matches", "codspeed-criterion-compat", "crossbeam-channel", - "derive_more 1.0.0", + "derive_more", "futures", "metrics", "proptest", @@ -8283,7 +8263,7 @@ dependencies = [ "arbitrary", "async-stream", "bytes", - "derive_more 1.0.0", + "derive_more", "futures", "pin-project", "proptest", @@ -8321,7 +8301,7 @@ dependencies = [ "alloy-rlp", "arbitrary", "bytes", - "derive_more 1.0.0", + "derive_more", "proptest", "proptest-arbitrary-interop", "rand 0.8.5", @@ -8430,7 +8410,7 @@ dependencies = [ "alloy-primitives", "alloy-rlp", "arbitrary", - "derive_more 1.0.0", + "derive_more", "modular-bitfield", "once_cell", "proptest", @@ -8700,7 +8680,7 @@ dependencies = [ "byteorder", "codspeed-criterion-compat", "dashmap", - "derive_more 1.0.0", + "derive_more", "indexmap 2.7.0", "parking_lot", "pprof", @@ -8766,7 +8746,7 @@ dependencies = [ "aquamarine", "auto_impl", "codspeed-criterion-compat", - "derive_more 1.0.0", + "derive_more", "discv5", "enr", "futures", @@ -8823,7 +8803,7 @@ dependencies = [ "alloy-primitives", "alloy-rpc-types-admin", "auto_impl", - "derive_more 1.0.0", + "derive_more", "enr", "futures", "reth-eth-wire-types", @@ -8846,7 +8826,7 @@ dependencies = [ "alloy-eips", "alloy-primitives", "auto_impl", - "derive_more 1.0.0", + "derive_more", "futures", "parking_lot", "reth-consensus", @@ -8895,7 +8875,7 @@ version = "1.1.5" dependencies = [ "anyhow", "bincode", - "derive_more 1.0.0", + "derive_more", "lz4_flex", "memmap2", "rand 0.8.5", @@ -9002,7 +8982,7 @@ dependencies = [ "alloy-primitives", "alloy-rpc-types-engine", "clap", - "derive_more 1.0.0", + "derive_more", "dirs-next", "eyre", "futures", @@ -9100,7 +9080,7 @@ dependencies = [ "alloy-eips", "alloy-primitives", "alloy-rpc-types-engine", - "derive_more 1.0.0", + "derive_more", "futures", "humantime", "pin-project", @@ -9160,7 +9140,7 @@ dependencies = [ "alloy-rlp", "arbitrary", "bytes", - "derive_more 1.0.0", + "derive_more", "modular-bitfield", "once_cell", "op-alloy-consensus", @@ -9269,7 +9249,7 @@ dependencies = [ "bytes", "c-kzg", "codspeed-criterion-compat", - "derive_more 1.0.0", + "derive_more", "modular-bitfield", "once_cell", "op-alloy-consensus", @@ -9311,7 +9291,7 @@ dependencies = [ "bincode", "byteorder", "bytes", - "derive_more 1.0.0", + "derive_more", "k256", "modular-bitfield", "op-alloy-consensus", @@ -9418,7 +9398,7 @@ dependencies = [ "alloy-primitives", "arbitrary", "assert_matches", - "derive_more 1.0.0", + "derive_more", "modular-bitfield", "proptest", "proptest-arbitrary-interop", @@ -9472,7 +9452,7 @@ dependencies = [ "alloy-signer", "alloy-signer-local", "async-trait", - "derive_more 1.0.0", + "derive_more", "futures", "http", "http-body", @@ -9703,7 +9683,7 @@ dependencies = [ "alloy-primitives", "alloy-rpc-types-eth", "alloy-sol-types", - "derive_more 1.0.0", + "derive_more", "futures", "itertools 0.13.0", "jsonrpsee-core", @@ -9911,7 +9891,7 @@ version = "1.1.5" dependencies = [ "alloy-primitives", "clap", - "derive_more 1.0.0", + "derive_more", "reth-nippy-jar", "serde", "strum", @@ -9948,7 +9928,7 @@ dependencies = [ "alloy-eips", "alloy-primitives", "alloy-rlp", - "derive_more 1.0.0", + "derive_more", "reth-fs-util", "reth-primitives-traits", "reth-static-file-types", @@ -10101,7 +10081,7 @@ dependencies = [ "bincode", "bytes", "codspeed-criterion-compat", - "derive_more 1.0.0", + "derive_more", "hash-db", "itertools 0.13.0", "nybbles", @@ -10122,7 +10102,7 @@ dependencies = [ "alloy-consensus", "alloy-primitives", "alloy-rlp", - "derive_more 1.0.0", + "derive_more", "metrics", "proptest", "proptest-arbitrary-interop", @@ -10151,7 +10131,7 @@ dependencies = [ "alloy-primitives", "alloy-rlp", "codspeed-criterion-compat", - "derive_more 1.0.0", + "derive_more", "itertools 0.13.0", "metrics", "proptest", diff --git a/crates/bitfinity-block-validator/Cargo.toml b/crates/bitfinity-block-validator/Cargo.toml index b14f337cad3..6f07d4de888 100644 --- a/crates/bitfinity-block-validator/Cargo.toml +++ b/crates/bitfinity-block-validator/Cargo.toml @@ -32,6 +32,7 @@ reth-revm.workspace = true reth-trie.workspace = true reth-trie-db.workspace = true tracing.workspace = true +reth-rpc-eth-types.workspace = true [dev-dependencies] alloy-consensus.workspace = true diff --git a/crates/bitfinity-block-validator/src/lib.rs b/crates/bitfinity-block-validator/src/lib.rs index 76fd21865ff..db0522313d3 100644 --- a/crates/bitfinity-block-validator/src/lib.rs +++ b/crates/bitfinity-block-validator/src/lib.rs @@ -1,10 +1,15 @@ //! Bitfinity block validator. use std::collections::HashSet; +use std::sync::Arc; +use alloy_primitives::{Address, B256, U256}; use did::BlockConfirmationData; use evm_canister_client::{CanisterClient, EvmCanisterClient}; +use eyre::Ok; use reth_chain_state::MemoryOverlayStateProvider; +use reth_evm::env::EvmEnv; use reth_evm::execute::{BasicBatchExecutor, BatchExecutor}; +use reth_evm::{ConfigureEvm, ConfigureEvmEnv}; use reth_evm_ethereum::{ execute::{EthExecutionStrategy, EthExecutionStrategyFactory}, EthEvmConfig, @@ -15,7 +20,14 @@ use reth_provider::{ providers::ProviderNodeTypes, ChainSpecProvider as _, ExecutionOutcome, HashedPostStateProvider as _, LatestStateProviderRef, ProviderFactory, }; +use reth_provider::{BlockNumReader, DatabaseProviderFactory, HeaderProvider, StateRootProvider}; +use reth_revm::db::CacheDB; +use reth_revm::primitives::{BlockEnv, CfgEnvWithHandlerCfg, Env, EnvWithHandlerCfg, TxEnv}; use reth_revm::{batch::BlockBatchRecord, database::StateProviderDatabase}; +use reth_revm::{CacheState, DatabaseCommit, Evm, StateBuilder}; +use reth_rpc_eth_types::cache::db::StateProviderTraitObjWrapper; +use reth_rpc_eth_types::StateCacheDb; +use reth_trie::HashedPostState; /// Block validator for Bitfinity. /// @@ -47,7 +59,7 @@ where /// Validate a block. pub async fn validate_blocks(&self, blocks: &[Block]) -> eyre::Result<()> { if blocks.is_empty() { - return Ok(()) + return Ok(()); } let execution_result = self.execute_blocks(blocks)?; @@ -87,7 +99,7 @@ where state_root: block.state_root.into(), transactions_root: block.transactions_root.into(), receipts_root: block.receipts_root.into(), - proof_of_work: self.calculate_pow_hash(updated_state), + proof_of_work: self.calculate_pow_hash(&block), }) } @@ -137,8 +149,62 @@ where /// Calculates POW hash based on the given trie state. fn calculate_pow_hash( &self, - updated_state: reth_trie::HashedPostState, - ) -> did::hash::Hash> { - todo!() + block: &Block, + ) -> eyre::Result>> { + let historical = self.provider_factory.latest().expect("no latest provider"); + + let db = StateProviderTraitObjWrapper(&historical); + + let cache = StateCacheDb::new(StateProviderDatabase::new(db)); + + let mut state = StateBuilder::new().with_database(cache).with_bundle_update().build(); + + let chain_spec = self.provider_factory.chain_spec(); + let evm_config = EthEvmConfig::new(chain_spec); + + let EvmEnv { mut cfg_env_with_handler_cfg, block_env } = + evm_config.cfg_and_block_env(&block.header); + + cfg_env_with_handler_cfg.cfg_env.disable_balance_check = true; + + // let tx = TxEnv { + // caller: todo!(), + // gas_limit: todo!(), + // gas_price: todo!(), + // transact_to: todo!(), + // value: todo!(), + // data: todo!(), + // nonce: todo!(), + // chain_id: todo!(), + // access_list: todo!(), + // gas_priority_fee: todo!(), + // blob_hashes: todo!(), + // max_fee_per_blob_gas: todo!(), + // authorization_list: todo!(), + // }; + + { + // Setup EVM + let mut evm = evm_config.evm_with_env( + &mut state, + EnvWithHandlerCfg::new_with_cfg_env( + cfg_env_with_handler_cfg, + block_env, + TxEnv::default(), + ), + ); + + let res = evm.transact()?; + evm.db_mut().commit(res.state); + assert!(res.result.is_success()); + } + + let bundle = state.take_bundle(); + + let post_hashed_state = db.hashed_post_state(&bundle); + + let state_root = db.state_root(post_hashed_state)?; + + Ok(state_root.into()) } } From 224ba328a5b0341550050c08c73629a3d778a860 Mon Sep 17 00:00:00 2001 From: Yasir Date: Tue, 11 Feb 2025 18:35:44 +0300 Subject: [PATCH 07/38] Refactor transaction environment setup and improve state handling in block validator --- crates/bitfinity-block-validator/src/lib.rs | 42 +++++++++------------ 1 file changed, 17 insertions(+), 25 deletions(-) diff --git a/crates/bitfinity-block-validator/src/lib.rs b/crates/bitfinity-block-validator/src/lib.rs index db0522313d3..25724b768ef 100644 --- a/crates/bitfinity-block-validator/src/lib.rs +++ b/crates/bitfinity-block-validator/src/lib.rs @@ -1,7 +1,4 @@ //! Bitfinity block validator. -use std::collections::HashSet; -use std::sync::Arc; - use alloy_primitives::{Address, B256, U256}; use did::BlockConfirmationData; use evm_canister_client::{CanisterClient, EvmCanisterClient}; @@ -27,7 +24,11 @@ use reth_revm::{batch::BlockBatchRecord, database::StateProviderDatabase}; use reth_revm::{CacheState, DatabaseCommit, Evm, StateBuilder}; use reth_rpc_eth_types::cache::db::StateProviderTraitObjWrapper; use reth_rpc_eth_types::StateCacheDb; -use reth_trie::HashedPostState; +use reth_trie::{HashedPostState, KeccakKeyHasher}; +use reth_trie::{KeyHasher, StateRoot}; +use reth_trie_db::DatabaseStateRoot; +use std::collections::HashSet; +use std::sync::Arc; /// Block validator for Bitfinity. /// @@ -167,31 +168,21 @@ where cfg_env_with_handler_cfg.cfg_env.disable_balance_check = true; - // let tx = TxEnv { - // caller: todo!(), - // gas_limit: todo!(), - // gas_price: todo!(), - // transact_to: todo!(), - // value: todo!(), - // data: todo!(), - // nonce: todo!(), - // chain_id: todo!(), - // access_list: todo!(), - // gas_priority_fee: todo!(), - // blob_hashes: todo!(), - // max_fee_per_blob_gas: todo!(), - // authorization_list: todo!(), - // }; + let tx = TxEnv { + caller: Address::from_slice(&[1]), + gas_limit: 21000, + gas_price: U256::from(1), + transact_to: alloy_primitives::TxKind::Call(Address::from_slice(&[2; 20])), + value: U256::from(1), + nonce: Some(0), + ..Default::default() + }; { // Setup EVM let mut evm = evm_config.evm_with_env( &mut state, - EnvWithHandlerCfg::new_with_cfg_env( - cfg_env_with_handler_cfg, - block_env, - TxEnv::default(), - ), + EnvWithHandlerCfg::new_with_cfg_env(cfg_env_with_handler_cfg, block_env, tx), ); let res = evm.transact()?; @@ -201,7 +192,8 @@ where let bundle = state.take_bundle(); - let post_hashed_state = db.hashed_post_state(&bundle); + let post_hashed_state = + HashedPostState::from_bundle_state::(bundle.state()); let state_root = db.state_root(post_hashed_state)?; From 6461115ada0d3650712d832240e810bbb3212b6c Mon Sep 17 00:00:00 2001 From: Yasir Date: Tue, 11 Feb 2025 19:33:59 +0300 Subject: [PATCH 08/38] Refactor state handling in block validator to use StateCacheDb for improved database management --- crates/bitfinity-block-validator/src/lib.rs | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/crates/bitfinity-block-validator/src/lib.rs b/crates/bitfinity-block-validator/src/lib.rs index 25724b768ef..859a7ba420c 100644 --- a/crates/bitfinity-block-validator/src/lib.rs +++ b/crates/bitfinity-block-validator/src/lib.rs @@ -147,18 +147,18 @@ where ) } - /// Calculates POW hash based on the given trie state. + /// Calculates POW hash fn calculate_pow_hash( &self, block: &Block, ) -> eyre::Result>> { let historical = self.provider_factory.latest().expect("no latest provider"); - let db = StateProviderTraitObjWrapper(&historical); + let cache = StateCacheDb::new(StateProviderDatabase::new(StateProviderTraitObjWrapper( + &historical, + ))); - let cache = StateCacheDb::new(StateProviderDatabase::new(db)); - - let mut state = StateBuilder::new().with_database(cache).with_bundle_update().build(); + let mut state = StateBuilder::new().with_database_ref(&cache).with_bundle_update().build(); let chain_spec = self.provider_factory.chain_spec(); let evm_config = EthEvmConfig::new(chain_spec); @@ -168,6 +168,7 @@ where cfg_env_with_handler_cfg.cfg_env.disable_balance_check = true; + // Simple transaction let tx = TxEnv { caller: Address::from_slice(&[1]), gas_limit: 21000, @@ -195,7 +196,7 @@ where let post_hashed_state = HashedPostState::from_bundle_state::(bundle.state()); - let state_root = db.state_root(post_hashed_state)?; + let state_root = cache.db.state_root(post_hashed_state)?; Ok(state_root.into()) } From e93ee97b1a04cdea59dbabf57d7d539160789e1a Mon Sep 17 00:00:00 2001 From: Yasir Date: Tue, 11 Feb 2025 19:56:22 +0300 Subject: [PATCH 09/38] Refactor proof of work hash calculation to utilize execution result state and improve state management --- crates/bitfinity-block-validator/src/lib.rs | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/crates/bitfinity-block-validator/src/lib.rs b/crates/bitfinity-block-validator/src/lib.rs index 859a7ba420c..54725bb7c6f 100644 --- a/crates/bitfinity-block-validator/src/lib.rs +++ b/crates/bitfinity-block-validator/src/lib.rs @@ -90,17 +90,13 @@ where block: &Block, execution_result: ExecutionOutcome, ) -> eyre::Result { - let provider = self.provider_factory.provider()?; - let state_provider = LatestStateProviderRef::new(&provider); - let updated_state = state_provider.hashed_post_state(execution_result.state()); - Ok(BlockConfirmationData { block_number: block.number, hash: block.hash_slow().into(), state_root: block.state_root.into(), transactions_root: block.transactions_root.into(), receipts_root: block.receipts_root.into(), - proof_of_work: self.calculate_pow_hash(&block), + proof_of_work: self.calculate_pow_hash(&block, execution_result)?, }) } @@ -151,14 +147,19 @@ where fn calculate_pow_hash( &self, block: &Block, + execution_result: ExecutionOutcome, ) -> eyre::Result>> { - let historical = self.provider_factory.latest().expect("no latest provider"); - + let state = execution_result.bundle; + let state_provider = self.provider_factory.latest().expect("no latest provider"); let cache = StateCacheDb::new(StateProviderDatabase::new(StateProviderTraitObjWrapper( - &historical, + &state_provider, ))); - let mut state = StateBuilder::new().with_database_ref(&cache).with_bundle_update().build(); + let mut state = StateBuilder::new() + .with_database_ref(&cache) + .with_bundle_prestate(state) + .with_bundle_update() + .build(); let chain_spec = self.provider_factory.chain_spec(); let evm_config = EthEvmConfig::new(chain_spec); From 30e7e54d08124aa555950a0f0e2235fd81089ca5 Mon Sep 17 00:00:00 2001 From: Maxim Date: Wed, 12 Feb 2025 18:36:42 +0900 Subject: [PATCH 10/38] Integration tests for block validation --- bin/reth/src/commands/bitfinity_import.rs | 53 ++++---- .../tests/commands/bitfinity_import_it.rs | 116 ++++++++++++++++-- bin/reth/tests/commands/bitfinity_node_it.rs | 64 +++++++++- bin/reth/tests/commands/utils.rs | 3 +- crates/bitfinity-block-validator/Cargo.toml | 2 +- crates/bitfinity-block-validator/src/lib.rs | 27 ++-- .../downloaders/src/bitfinity_evm_client.rs | 14 ++- crates/node/core/src/args/bitfinity_args.rs | 9 -- 8 files changed, 219 insertions(+), 69 deletions(-) diff --git a/bin/reth/src/commands/bitfinity_import.rs b/bin/reth/src/commands/bitfinity_import.rs index 744ea9e6b1b..8de6af98f0e 100644 --- a/bin/reth/src/commands/bitfinity_import.rs +++ b/bin/reth/src/commands/bitfinity_import.rs @@ -2,8 +2,6 @@ use crate::{dirs::DataDirPath, version::SHORT_VERSION}; use bitfinity_block_validator::BitfinityBlockValidator; -use candid::Principal; -use evm_canister_client::{ic_agent::{identity::AnonymousIdentity, Agent}, EvmCanisterClient, IcAgentClient}; use futures::{Stream, StreamExt}; use lightspeed_scheduler::{job::Job, scheduler::Scheduler, JobExecutor}; use reth_beacon_consensus::EthBeaconConsensus; @@ -20,7 +18,7 @@ use reth_downloaders::{ }; use reth_exex::ExExManagerHandle; use reth_node_api::NodeTypesWithDBAdapter; -use reth_node_core::{args::{BitfinityImportArgs, IC_MAINNET_KEY, IC_MAINNET_URL}, dirs::ChainPath}; +use reth_node_core::{args::BitfinityImportArgs, dirs::ChainPath}; use reth_node_ethereum::{EthExecutorProvider, EthereumNode}; use reth_node_events::node::NodeEvent; use reth_primitives::{EthPrimitives, SealedHeader}; @@ -131,6 +129,16 @@ impl BitfinityImportCommand { Ok((job_executor, job_handle)) } + fn rpc_config(&self) -> RpcClientConfig { + RpcClientConfig { + primary_url: self.bitfinity.rpc_url.clone(), + backup_url: self.bitfinity.backup_rpc_url.clone(), + max_retries: self.bitfinity.max_retries, + retry_delay: Duration::from_secs(self.bitfinity.retry_delay_secs), + max_block_age_secs: Duration::from_secs(self.bitfinity.max_block_age_secs), + } + } + /// Execute the import job. async fn single_execution(&self) -> eyre::Result<()> { let consensus = Arc::new(EthBeaconConsensus::new(self.chain.clone())); @@ -142,17 +150,9 @@ impl BitfinityImportCommand { debug!(target: "reth::cli - BitfinityImportCommand", "Starting block: {}", start_block); - let rpc_config = RpcClientConfig { - primary_url: self.bitfinity.rpc_url.clone(), - backup_url: self.bitfinity.backup_rpc_url.clone(), - max_retries: self.bitfinity.max_retries, - retry_delay: Duration::from_secs(self.bitfinity.retry_delay_secs), - max_block_age_secs: Duration::from_secs(self.bitfinity.max_block_age_secs), - }; - let remote_client = Arc::new( BitfinityEvmClient::from_rpc_url( - rpc_config, + self.rpc_config(), start_block, self.bitfinity.end_block, self.bitfinity.batch_size, @@ -189,7 +189,10 @@ impl BitfinityImportCommand { }; while tip != safe_block { - match self.validate_block(&tip, remote_client.clone(), provider_factory.clone()).await { + match self + .validate_block(&tip, remote_client.clone(), provider_factory.clone()) + .await + { Ok(_) => { self.import_to_block(tip, remote_client, provider_factory, consensus) .await?; @@ -220,19 +223,12 @@ impl BitfinityImportCommand { remote_client: Arc, provider_factory: ProviderFactory>>, ) -> eyre::Result<()> { - let agent = Agent::builder().with_identity(AnonymousIdentity).with_url(self.bitfinity.evm_network.clone()).build()?; - if self.bitfinity.evm_network == IC_MAINNET_URL { - let key = hex::decode(IC_MAINNET_KEY)?; - agent.set_root_key(key); - } else { - agent.fetch_root_key().await?; - } + debug!(target: "reth::cli - BitfinityImportCommand", "Validating block {block}"); - let evm_principal = Principal::from_text(&self.bitfinity.evmc_principal)?; - let agent_client = IcAgentClient::with_agent(evm_principal, agent); - let canister_client = EvmCanisterClient::new(agent_client); + let config = self.rpc_config(); + let client = BitfinityEvmClient::client(config).await?; - let validator = BitfinityBlockValidator::new(canister_client, provider_factory); + let validator = BitfinityBlockValidator::new(client, provider_factory); let blocks = remote_client.unsafe_blocks(block)?; validator.validate_blocks(&blocks).await @@ -248,12 +244,17 @@ impl BitfinityImportCommand { ) -> eyre::Result<()> { info!(target: "reth::cli - BitfinityImportCommand", "Chain blocks imported"); + let block_index = remote_client + .get_block_number(&new_tip) + .ok_or_else(|| eyre::eyre!("block not found"))?; + let (mut pipeline, _events) = self.build_import_pipeline( &self.config, provider_factory.clone(), &consensus, remote_client, StaticFileProducer::new(provider_factory.clone(), PruneModes::default()), + block_index, )?; // override the tip @@ -264,6 +265,8 @@ impl BitfinityImportCommand { debug!(target: "reth::cli - BitfinityImportCommand", "Starting sync pipeline"); pipeline.run().await?; + debug!(target: "reth::cli - BitfinityImportCommand", "Sync process complete"); + Ok(()) } @@ -295,6 +298,7 @@ impl BitfinityImportCommand { static_file_producer: StaticFileProducer< ProviderFactory>>, >, + max_block: u64, ) -> eyre::Result<(TypedPipeline, impl Stream>)> where C: Consensus + 'static, @@ -314,7 +318,6 @@ impl BitfinityImportCommand { let (tip_tx, tip_rx) = watch::channel(B256::ZERO); let executor = EthExecutorProvider::ethereum(provider_factory.chain_spec()); - let max_block = remote_client.max_block().unwrap_or(0); let pipeline = Pipeline::>>::builder() .with_tip_sender(tip_tx) diff --git a/bin/reth/tests/commands/bitfinity_import_it.rs b/bin/reth/tests/commands/bitfinity_import_it.rs index 951828a274a..d8c2bb3f084 100644 --- a/bin/reth/tests/commands/bitfinity_import_it.rs +++ b/bin/reth/tests/commands/bitfinity_import_it.rs @@ -1,13 +1,16 @@ //! //! Integration tests for the bitfinity import command. //! These tests requires a running EVM node or EVM block extractor node at the specified URL. -//! -use super::bitfinity_node_it::{ - eth_server::{EthImpl, EthServer}, - mock_eth_server_start, +use crate::commands::bitfinity_node_it::eth_server::BfEvmServer; + +use super::{ + bitfinity_node_it::{ + eth_server::{EthImpl, EthServer}, + mock_eth_server_start, mock_multi_server_start, + }, + utils::*, }; -use super::utils::*; use alloy_eips::BlockNumberOrTag; use ethereum_json_rpc_client::{reqwest::ReqwestClient, EthJsonRpcClient}; @@ -41,7 +44,7 @@ async fn bitfinity_test_should_import_data_from_evm() { let evm_rpc_client = EthJsonRpcClient::new(ReqwestClient::new(evm_datasource_url.to_string())); - let remote_block = evm_rpc_client.get_block_by_number(end_block.into()).await.unwrap().unwrap(); + let remote_block = evm_rpc_client.get_block_by_number(end_block.into()).await.unwrap(); let local_block = provider.block_by_number(end_block).unwrap().unwrap(); assert_eq!(remote_block.hash.0, local_block.header.hash_slow().0); @@ -73,7 +76,7 @@ async fn bitfinity_test_should_import_with_small_batch_size() { let evm_rpc_client = EthJsonRpcClient::new(ReqwestClient::new(evm_datasource_url.to_string())); - let remote_block = evm_rpc_client.get_block_by_number(end_block.into()).await.unwrap().unwrap(); + let remote_block = evm_rpc_client.get_block_by_number(end_block.into()).await.unwrap(); let local_block = provider.block_by_number(end_block).unwrap().unwrap(); assert_eq!(remote_block.hash.0, local_block.header.hash_slow().0); @@ -135,7 +138,7 @@ async fn bitfinity_test_should_import_data_from_evm_with_backup_rpc_url() { // create evm client let evm_rpc_client = EthJsonRpcClient::new(ReqwestClient::new(backup_rpc_url.to_string())); - let remote_block = evm_rpc_client.get_block_by_number(end_block.into()).await.unwrap().unwrap(); + let remote_block = evm_rpc_client.get_block_by_number(end_block.into()).await.unwrap(); let local_block = provider.block_by_number(end_block).unwrap().unwrap(); assert_eq!(remote_block.hash.0, local_block.header.hash_slow().0); @@ -313,3 +316,100 @@ async fn bitfinity_test_should_not_import_block_when_evm_is_staging_and_check_ev let last_block = provider.last_block_number().unwrap(); assert_eq!(last_block, 0, "Expected no blocks to be imported when EVM is staging"); } + +#[tokio::test] +async fn bitfinity_test_should_import_data_to_safe_block() { + // Arrange + let _log = init_logs(); + + const UNSAFE_BLOCKS: u64 = 3; + const MAX_BLOCKS: u64 = 10; + + let mut eth_server = EthImpl::new_with_max_block(MAX_BLOCKS); + let bf_evm_server = eth_server.bf_impl(UNSAFE_BLOCKS); + + let (_server, eth_server_address) = mock_multi_server_start([ + EthServer::into_rpc(eth_server).into(), + BfEvmServer::into_rpc(bf_evm_server).into(), + ]) + .await; + let evm_datasource_url = format!("http://{}", eth_server_address); + + // Wait for blocks to be minted + tokio::time::sleep(Duration::from_secs(1)).await; + + // Act + let (_temp_dir, mut import_data) = + bitfinity_import_config_data(&evm_datasource_url, None, None).await.unwrap(); + + import_data.bitfinity_args.max_fetch_blocks = 100; + + let import = BitfinityImportCommand::new( + None, + import_data.data_dir, + import_data.chain, + import_data.bitfinity_args, + import_data.provider_factory.clone(), + import_data.blockchain_db, + ); + let (job_executor, _import_handle) = import.schedule_execution().await.unwrap(); + + let safe_block = MAX_BLOCKS - UNSAFE_BLOCKS; + + // Allow some time for potential imports + tokio::time::sleep(Duration::from_secs(2)).await; + job_executor.stop(true).await.unwrap(); + + // Assert + let provider = import_data.provider_factory.provider().unwrap(); + let last_imported_block = provider.last_block_number().unwrap(); + assert_eq!(last_imported_block, safe_block); +} + +#[tokio::test] +async fn bitfinity_test_should_validate_and_import_unsafe_blocks() { + // Arrange + let _log = init_logs(); + + const UNSAFE_BLOCKS: u64 = 3; + const MAX_BLOCKS: u64 = 10; + + let mut eth_server = EthImpl::new_with_max_block(MAX_BLOCKS); + let bf_evm_server = eth_server.bf_impl(UNSAFE_BLOCKS); + + let (_server, eth_server_address) = mock_multi_server_start([ + EthServer::into_rpc(eth_server).into(), + BfEvmServer::into_rpc(bf_evm_server).into(), + ]) + .await; + let evm_datasource_url = format!("http://{}", eth_server_address); + + // Wait for blocks to be minted + tokio::time::sleep(Duration::from_secs(1)).await; + + // Act + let (_temp_dir, mut import_data) = + bitfinity_import_config_data(&evm_datasource_url, None, None).await.unwrap(); + + import_data.bitfinity_args.max_fetch_blocks = 100; + import_data.bitfinity_args.validate_unsafe_blocks = true; + + let import = BitfinityImportCommand::new( + None, + import_data.data_dir, + import_data.chain, + import_data.bitfinity_args, + import_data.provider_factory.clone(), + import_data.blockchain_db, + ); + let (job_executor, _import_handle) = import.schedule_execution().await.unwrap(); + + // Allow some time for potential imports + tokio::time::sleep(Duration::from_secs(2)).await; + job_executor.stop(true).await.unwrap(); + + // Assert + let provider = import_data.provider_factory.provider().unwrap(); + let last_imported_block = provider.last_block_number().unwrap(); + assert_eq!(last_imported_block, MAX_BLOCKS); +} diff --git a/bin/reth/tests/commands/bitfinity_node_it.rs b/bin/reth/tests/commands/bitfinity_node_it.rs index 6352aa38bb0..162ff3d6f0b 100644 --- a/bin/reth/tests/commands/bitfinity_node_it.rs +++ b/bin/reth/tests/commands/bitfinity_node_it.rs @@ -343,11 +343,19 @@ pub async fn start_reth_node( /// Start a local Eth server. /// Reth requests will be forwarded to this server pub async fn mock_eth_server_start(methods: impl Into) -> (ServerHandle, SocketAddr) { + mock_multi_server_start([methods.into()]).await +} + +/// Starts a local mock server that combines methods from different sources. +pub async fn mock_multi_server_start(methods: impl IntoIterator) -> (ServerHandle, SocketAddr) { let addr = SocketAddr::from(([127, 0, 0, 1], 0)); let server = Server::builder().build(addr).await.unwrap(); let mut module = RpcModule::new(()); - module.merge(methods).unwrap(); + + for method_group in methods { + module.merge(method_group).unwrap(); + } let server_address = server.local_addr().unwrap(); let handle = server.start(module); @@ -362,7 +370,7 @@ pub mod eth_server { use alloy_consensus::constants::{EMPTY_RECEIPTS, EMPTY_TRANSACTIONS}; use alloy_rlp::Bytes; - use did::{keccak, BlockNumber, H256, U64}; + use did::{error::EvmError, keccak, BlockConfirmationData, BlockConfirmationResult, BlockNumber, H256, U64}; use ethereum_json_rpc_client::CertifiedResult; use jsonrpsee::{core::RpcResult, proc_macros::rpc}; use reth_trie::EMPTY_ROOT_HASH; @@ -412,6 +420,13 @@ pub mod eth_server { async fn get_evm_global_state(&self) -> RpcResult; } + #[rpc(server, namespace = "ic")] + trait BfEvm { + /// Send block confirmation request. + #[method(name = "sendConfirmBlock")] + async fn confirm_block(&self, data: BlockConfirmationData) -> RpcResult; + } + /// Eth server implementation for local testing #[derive(Debug)] pub struct EthImpl { @@ -430,11 +445,18 @@ pub mod eth_server { block_task: Option>, /// Genesis Balances pub genesis_balances: Vec<(Address, U256)>, + /// Unsafe blocks count + pub unsafe_blocks_count: u64, } impl EthImpl { /// Create a new Eth server implementation pub fn new() -> Self { + Self::new_with_max_block(u64::MAX) + } + + /// Creates a new Eth server implementation that will mint blocks until `max_block` number + pub fn new_with_max_block(max_block: u64) -> Self { // Fake block counter let current_block = Arc::new(std::sync::atomic::AtomicU64::new(1)); let block_counter = current_block.clone(); @@ -445,6 +467,10 @@ pub mod eth_server { interval.tick().await; let block = block_counter.fetch_add(1, std::sync::atomic::Ordering::Relaxed); tracing::info!("Minted block {}", block + 1); + + if block + 1 >= max_block { + break; + } } })); @@ -456,6 +482,7 @@ pub mod eth_server { state: did::evm_state::EvmGlobalState::Staging { max_block_number: None }, block_task, genesis_balances: vec![], + unsafe_blocks_count: 0, } } @@ -472,6 +499,14 @@ pub mod eth_server { instance.genesis_balances = balances; instance } + + /// Returns an implementation of Bitfinity EVM canister API + pub fn bf_impl(&mut self, unsafe_blocks_count: u64) -> BfEvmImpl { + self.unsafe_blocks_count = unsafe_blocks_count; + BfEvmImpl { + confirm_until: u64::MAX, + } + } } impl Drop for EthImpl { @@ -495,14 +530,13 @@ pub mod eth_server { &self, number: BlockNumber, ) -> RpcResult>> { - tracing::info!("Requested block {:?}", number); - let current_block = self.current_block.load(Ordering::Relaxed); let block_num = match number { - BlockNumber::Latest | BlockNumber::Finalized | BlockNumber::Safe => current_block, + BlockNumber::Safe => current_block - self.unsafe_blocks_count, + BlockNumber::Latest | BlockNumber::Finalized => current_block, BlockNumber::Earliest => 0, BlockNumber::Pending => { - self.current_block.fetch_add(1, std::sync::atomic::Ordering::Relaxed) + self.current_block.load(std::sync::atomic::Ordering::Relaxed) + 1 } BlockNumber::Number(num) => num.as_u64(), }; @@ -581,4 +615,22 @@ pub mod eth_server { }) } } + + /// Mock implementation of Bitfinity EVM canister API + #[derive(Debug)] + pub struct BfEvmImpl { + /// Will allow confirming block until this block number + pub confirm_until: u64, + } + + #[async_trait::async_trait] + impl BfEvmServer for BfEvmImpl { + async fn confirm_block(&self, data: BlockConfirmationData) -> RpcResult { + if data.block_number > self.confirm_until { + Ok(BlockConfirmationResult::NotConfirmed) + } else { + Ok(BlockConfirmationResult::Confirmed) + } + } + } } diff --git a/bin/reth/tests/commands/utils.rs b/bin/reth/tests/commands/utils.rs index b37e143d029..613e16577cb 100644 --- a/bin/reth/tests/commands/utils.rs +++ b/bin/reth/tests/commands/utils.rs @@ -50,7 +50,7 @@ pub fn init_logs() -> eyre::Result> { let mut tracer = RethTracer::new(); let stdout = LayerInfo::new( LogFormat::Terminal, - "info".to_string(), + "debug".to_string(), String::new(), Some("always".to_string()), ); @@ -173,7 +173,6 @@ pub async fn bitfinity_import_config_data( check_evm_state_before_importing: false, max_block_age_secs: 600, validate_unsafe_blocks: false, - evm_network: IC_MAINNET_URL.to_string(), }; Ok(( diff --git a/crates/bitfinity-block-validator/Cargo.toml b/crates/bitfinity-block-validator/Cargo.toml index b14f337cad3..36a4d512b4a 100644 --- a/crates/bitfinity-block-validator/Cargo.toml +++ b/crates/bitfinity-block-validator/Cargo.toml @@ -16,6 +16,7 @@ alloy-primitives.workspace = true async-trait.workspace = true did.workspace = true evm-canister-client.workspace = true +ethereum-json-rpc-client = { workspace = true, features = ["reqwest"] } eyre.workspace = true itertools.workspace = true reth-chain-state.workspace = true @@ -40,7 +41,6 @@ alloy-signer.workspace = true alloy-signer-local.workspace = true async-trait.workspace = true candid.workspace = true -ethereum-json-rpc-client = { workspace = true, features = ["reqwest"] } reth-db-common.workspace = true tokio.workspace = true serde.workspace = true diff --git a/crates/bitfinity-block-validator/src/lib.rs b/crates/bitfinity-block-validator/src/lib.rs index 76fd21865ff..5cac827c407 100644 --- a/crates/bitfinity-block-validator/src/lib.rs +++ b/crates/bitfinity-block-validator/src/lib.rs @@ -1,8 +1,9 @@ //! Bitfinity block validator. use std::collections::HashSet; -use did::BlockConfirmationData; -use evm_canister_client::{CanisterClient, EvmCanisterClient}; +use did::{BlockConfirmationData, BlockConfirmationResult}; +use ethereum_json_rpc_client::{Client, EthJsonRpcClient}; +use eyre::eyre; use reth_chain_state::MemoryOverlayStateProvider; use reth_evm::execute::{BasicBatchExecutor, BatchExecutor}; use reth_evm_ethereum::{ @@ -21,24 +22,25 @@ use reth_revm::{batch::BlockBatchRecord, database::StateProviderDatabase}; /// /// The validator validates the block by executing it and then /// confirming it on the EVM. -#[derive(Clone, Debug)] +#[derive(Clone)] +#[allow(missing_debug_implementations)] pub struct BitfinityBlockValidator where - C: CanisterClient, + C: Client, DB: NodeTypesWithDB + Clone, { - evm_client: EvmCanisterClient, + evm_client: EthJsonRpcClient, provider_factory: ProviderFactory, } impl BitfinityBlockValidator where - C: CanisterClient, + C: Client, DB: NodeTypesWithDB + ProviderNodeTypes + Clone, { /// Create a new [`BitfinityBlockValidator`]. pub const fn new( - evm_client: EvmCanisterClient, + evm_client: EthJsonRpcClient, provider_factory: ProviderFactory, ) -> Self { Self { evm_client, provider_factory } @@ -65,9 +67,9 @@ where &self, confirmation_data: BlockConfirmationData, ) -> eyre::Result<()> { - match self.evm_client.confirm_block(confirmation_data).await? { - Ok(_) => Ok(()), - Err(err) => Err(eyre::eyre!("{err}")), + match self.evm_client.send_confirm_block(confirmation_data).await.map_err(|e| eyre!("{e}"))? { + BlockConfirmationResult::NotConfirmed => Err(eyre!("confirmation request rejected")), + _ => Ok(()), } } @@ -137,8 +139,9 @@ where /// Calculates POW hash based on the given trie state. fn calculate_pow_hash( &self, - updated_state: reth_trie::HashedPostState, + _updated_state: reth_trie::HashedPostState, ) -> did::hash::Hash> { - todo!() + // TODO: calculate hash here + Default::default() } } diff --git a/crates/net/downloaders/src/bitfinity_evm_client.rs b/crates/net/downloaders/src/bitfinity_evm_client.rs index a3548d2c0cb..abbecbe4f5b 100644 --- a/crates/net/downloaders/src/bitfinity_evm_client.rs +++ b/crates/net/downloaders/src/bitfinity_evm_client.rs @@ -4,7 +4,7 @@ use alloy_primitives::{BlockHash, BlockNumber, B256, U256}; use candid::Principal; use did::certified::CertifiedResult; use ethereum_json_rpc_client::{reqwest::ReqwestClient, EthJsonRpcClient}; -use eyre::{OptionExt, Result}; +use eyre::Result; use ic_cbor::{CertificateToCbor, HashTreeToCbor}; use ic_certificate_verification::VerifyCertificate; use ic_certification::{Certificate, HashTree, LookupResult}; @@ -152,7 +152,6 @@ impl BitfinityEvmClient { .map_err(|e| { RemoteClientError::ProviderError(format!("error getting safe block: {e}")) })? - .ok_or_else(|| RemoteClientError::ProviderError("block not found".to_string()))? .number .into(); @@ -273,6 +272,11 @@ impl BitfinityEvmClient { Err(eyre::eyre!("Block {tip} not found")) } + /// Returns the number of the given block + pub fn get_block_number(&self, block_hash: &B256) -> Option { + self.hash_to_number.get(block_hash).copied() + } + /// Returns the hash of the first block after the latest safe block. If the tip of the chain is /// safe, returns `None`. pub fn unsafe_block(&self) -> Option { @@ -352,8 +356,7 @@ impl BitfinityEvmClient { let genesis_block = client .get_block_by_number(0.into()) .await - .map_err(|e| eyre::eyre!("error getting genesis block: {}", e))? - .ok_or_else(|| eyre::eyre!("genesis block not found"))?; + .map_err(|e| eyre::eyre!("error getting genesis block: {}", e))?; let genesis_accounts = client.get_genesis_balances().await.map_err(|e| eyre::eyre!(e))?.into_iter().map( @@ -450,8 +453,7 @@ impl BitfinityEvmClient { let last_block = client .get_block_by_number(did::BlockNumber::Latest) .await - .map_err(|e| eyre::eyre!("error getting block number: {}", e))? - .ok_or_eyre("latest block not found")?; + .map_err(|e| eyre::eyre!("error getting block number: {}", e))?; let block_ts = last_block.timestamp.0.to::(); diff --git a/crates/node/core/src/args/bitfinity_args.rs b/crates/node/core/src/args/bitfinity_args.rs index a941d7dee7f..a14ac0450ba 100644 --- a/crates/node/core/src/args/bitfinity_args.rs +++ b/crates/node/core/src/args/bitfinity_args.rs @@ -74,15 +74,6 @@ pub struct BitfinityImportArgs { /// If validation is disabled, unsafe blocks will be ignored. #[arg(long)] pub validate_unsafe_blocks: bool, - - /// Network url - /// - /// This is the URL of the IC network. If not set, IC mainnet connection will be used. - /// E.g. - /// - - /// - - #[arg(long, default_value=IC_MAINNET_URL)] - pub evm_network: String, } /// Bitfinity Related Args From 03ecb81768a7b7ed47e9cbcd727e90550d0b76e8 Mon Sep 17 00:00:00 2001 From: Maxim Date: Wed, 12 Feb 2025 18:41:24 +0900 Subject: [PATCH 11/38] Test that unconfirmed blocks are skipped normally --- .../tests/commands/bitfinity_import_it.rs | 50 +++++++++++++++++++ bin/reth/tests/commands/bitfinity_node_it.rs | 2 +- bin/reth/tests/commands/utils.rs | 2 +- 3 files changed, 52 insertions(+), 2 deletions(-) diff --git a/bin/reth/tests/commands/bitfinity_import_it.rs b/bin/reth/tests/commands/bitfinity_import_it.rs index d8c2bb3f084..f4472df416b 100644 --- a/bin/reth/tests/commands/bitfinity_import_it.rs +++ b/bin/reth/tests/commands/bitfinity_import_it.rs @@ -413,3 +413,53 @@ async fn bitfinity_test_should_validate_and_import_unsafe_blocks() { let last_imported_block = provider.last_block_number().unwrap(); assert_eq!(last_imported_block, MAX_BLOCKS); } + +#[tokio::test] +async fn bitfinity_test_should_import_until_last_confirmed() { + // Arrange + let _log = init_logs(); + + const UNSAFE_BLOCKS: u64 = 3; + const MAX_BLOCKS: u64 = 10; + const CONFIRM_UNTIL: u64 = 8; + + let mut eth_server = EthImpl::new_with_max_block(MAX_BLOCKS); + let mut bf_evm_server = eth_server.bf_impl(UNSAFE_BLOCKS); + bf_evm_server.confirm_until = CONFIRM_UNTIL; + + let (_server, eth_server_address) = mock_multi_server_start([ + EthServer::into_rpc(eth_server).into(), + BfEvmServer::into_rpc(bf_evm_server).into(), + ]) + .await; + let evm_datasource_url = format!("http://{}", eth_server_address); + + // Wait for blocks to be minted + tokio::time::sleep(Duration::from_secs(1)).await; + + // Act + let (_temp_dir, mut import_data) = + bitfinity_import_config_data(&evm_datasource_url, None, None).await.unwrap(); + + import_data.bitfinity_args.max_fetch_blocks = 100; + import_data.bitfinity_args.validate_unsafe_blocks = true; + + let import = BitfinityImportCommand::new( + None, + import_data.data_dir, + import_data.chain, + import_data.bitfinity_args, + import_data.provider_factory.clone(), + import_data.blockchain_db, + ); + let (job_executor, _import_handle) = import.schedule_execution().await.unwrap(); + + // Allow some time for potential imports + tokio::time::sleep(Duration::from_secs(2)).await; + job_executor.stop(true).await.unwrap(); + + // Assert + let provider = import_data.provider_factory.provider().unwrap(); + let last_imported_block = provider.last_block_number().unwrap(); + assert_eq!(last_imported_block, CONFIRM_UNTIL); +} diff --git a/bin/reth/tests/commands/bitfinity_node_it.rs b/bin/reth/tests/commands/bitfinity_node_it.rs index 162ff3d6f0b..6e141f795e4 100644 --- a/bin/reth/tests/commands/bitfinity_node_it.rs +++ b/bin/reth/tests/commands/bitfinity_node_it.rs @@ -370,7 +370,7 @@ pub mod eth_server { use alloy_consensus::constants::{EMPTY_RECEIPTS, EMPTY_TRANSACTIONS}; use alloy_rlp::Bytes; - use did::{error::EvmError, keccak, BlockConfirmationData, BlockConfirmationResult, BlockNumber, H256, U64}; + use did::{keccak, BlockConfirmationData, BlockConfirmationResult, BlockNumber, H256, U64}; use ethereum_json_rpc_client::CertifiedResult; use jsonrpsee::{core::RpcResult, proc_macros::rpc}; use reth_trie::EMPTY_ROOT_HASH; diff --git a/bin/reth/tests/commands/utils.rs b/bin/reth/tests/commands/utils.rs index 613e16577cb..4d3d154ef82 100644 --- a/bin/reth/tests/commands/utils.rs +++ b/bin/reth/tests/commands/utils.rs @@ -14,7 +14,7 @@ use alloy_primitives::BlockNumber; use lightspeed_scheduler::JobExecutor; use parking_lot::Mutex; use reth::{ - args::{BitfinityImportArgs, IC_MAINNET_KEY, IC_MAINNET_URL}, + args::{BitfinityImportArgs, IC_MAINNET_KEY}, commands::bitfinity_import::BitfinityImportCommand, dirs::{ChainPath, DataDirPath, PlatformPath}, }; From d7d47213648dff8372490f55cf1a8fcd9d8a57dc Mon Sep 17 00:00:00 2001 From: Maxim Date: Thu, 13 Feb 2025 15:01:35 +0900 Subject: [PATCH 12/38] Rename validator to confirmation --- Cargo.lock | 4 ++-- Cargo.toml | 4 ++-- bin/reth/Cargo.toml | 2 +- bin/reth/src/commands/bitfinity_import.rs | 18 ++++++++--------- .../tests/commands/bitfinity_import_it.rs | 6 +++--- bin/reth/tests/commands/utils.rs | 2 +- .../Cargo.toml | 2 +- .../src/lib.rs | 20 +++++++++---------- crates/node/core/src/args/bitfinity_args.rs | 2 +- 9 files changed, 30 insertions(+), 30 deletions(-) rename crates/{bitfinity-block-validator => bitfinity-block-confirmation}/Cargo.toml (96%) rename crates/{bitfinity-block-validator => bitfinity-block-confirmation}/src/lib.rs (89%) diff --git a/Cargo.lock b/Cargo.lock index 51ade6ca88b..0d656ade69a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1456,7 +1456,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" [[package]] -name = "bitfinity-block-validator" +name = "bitfinity-block-confirmation" version = "1.1.5" dependencies = [ "alloy-consensus", @@ -7263,7 +7263,7 @@ dependencies = [ "async-channel 2.3.1", "async-trait", "backon", - "bitfinity-block-validator", + "bitfinity-block-confirmation", "candid", "clap", "did", diff --git a/Cargo.toml b/Cargo.toml index 3f647711b21..85ec8c169b0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -128,7 +128,7 @@ members = [ "crates/trie/parallel/", "crates/trie/sparse", "crates/trie/trie", - "crates/bitfinity-block-validator/", + "crates/bitfinity-block-confirmation", "examples/beacon-api-sidecar-fetcher/", "examples/beacon-api-sse/", "examples/bsc-p2p", @@ -650,7 +650,7 @@ tracy-client = "0.17.3" # Bitfinity Deps async-channel = "2" -bitfinity-block-validator = { path = "crates/bitfinity-block-validator" } +bitfinity-block-confirmation = { path = "crates/bitfinity-block-confirmation" } candid = "0.10" did = { git = "https://github.com/bitfinity-network/bitfinity-evm-sdk", package = "did", tag = "v0.42.x" } dirs = "5.0.1" diff --git a/bin/reth/Cargo.toml b/bin/reth/Cargo.toml index 3afeb92099e..240d7f4fabb 100644 --- a/bin/reth/Cargo.toml +++ b/bin/reth/Cargo.toml @@ -98,7 +98,7 @@ similar-asserts.workspace = true # bitfinity dependencies async-channel.workspace = true -bitfinity-block-validator.workspace = true +bitfinity-block-confirmation.workspace = true candid.workspace = true did.workspace = true evm-canister-client = { workspace = true, features = ["ic-agent-client"] } diff --git a/bin/reth/src/commands/bitfinity_import.rs b/bin/reth/src/commands/bitfinity_import.rs index 8de6af98f0e..2bee03ce801 100644 --- a/bin/reth/src/commands/bitfinity_import.rs +++ b/bin/reth/src/commands/bitfinity_import.rs @@ -1,7 +1,7 @@ //! Command that initializes the node by importing a chain from a remote EVM node. use crate::{dirs::DataDirPath, version::SHORT_VERSION}; -use bitfinity_block_validator::BitfinityBlockValidator; +use bitfinity_block_confirmation::BitfinityBlockConfirmation; use futures::{Stream, StreamExt}; use lightspeed_scheduler::{job::Job, scheduler::Scheduler, JobExecutor}; use reth_beacon_consensus::EthBeaconConsensus; @@ -182,15 +182,15 @@ impl BitfinityImportCommand { ) .await?; - if self.bitfinity.validate_unsafe_blocks { + if self.bitfinity.confirm_unsafe_blocks { let Some(mut tip) = remote_client.tip() else { - warn!(target: "reth::cli - BitfinityImportCommand", "Cannot find block for validation. Skipping."); + warn!(target: "reth::cli - BitfinityImportCommand", "Cannot find block for confirmation. Skipping."); return Ok(()); }; while tip != safe_block { match self - .validate_block(&tip, remote_client.clone(), provider_factory.clone()) + .confirm_block(&tip, remote_client.clone(), provider_factory.clone()) .await { Ok(_) => { @@ -200,7 +200,7 @@ impl BitfinityImportCommand { } Err(err) => { - warn!(target: "reth::cli - BitfinityImportCommand", "Failed to validate block {}: {}", tip, err); + warn!(target: "reth::cli - BitfinityImportCommand", "Failed to confirm block {}: {}", tip, err); if let Some(parent) = remote_client.parent(&tip) { tip = parent; @@ -217,21 +217,21 @@ impl BitfinityImportCommand { Ok(()) } - async fn validate_block( + async fn confirm_block( &self, block: &B256, remote_client: Arc, provider_factory: ProviderFactory>>, ) -> eyre::Result<()> { - debug!(target: "reth::cli - BitfinityImportCommand", "Validating block {block}"); + debug!(target: "reth::cli - BitfinityImportCommand", "Configurming block {block}"); let config = self.rpc_config(); let client = BitfinityEvmClient::client(config).await?; - let validator = BitfinityBlockValidator::new(client, provider_factory); + let confirmator = BitfinityBlockConfirmation::new(client, provider_factory); let blocks = remote_client.unsafe_blocks(block)?; - validator.validate_blocks(&blocks).await + confirmator.confirm_blocks(&blocks).await } /// Imports the blocks up to the given block hash of the `remove_client`. diff --git a/bin/reth/tests/commands/bitfinity_import_it.rs b/bin/reth/tests/commands/bitfinity_import_it.rs index f4472df416b..b8ea1e5d25c 100644 --- a/bin/reth/tests/commands/bitfinity_import_it.rs +++ b/bin/reth/tests/commands/bitfinity_import_it.rs @@ -367,7 +367,7 @@ async fn bitfinity_test_should_import_data_to_safe_block() { } #[tokio::test] -async fn bitfinity_test_should_validate_and_import_unsafe_blocks() { +async fn bitfinity_test_should_confirm_and_import_unsafe_blocks() { // Arrange let _log = init_logs(); @@ -392,7 +392,7 @@ async fn bitfinity_test_should_validate_and_import_unsafe_blocks() { bitfinity_import_config_data(&evm_datasource_url, None, None).await.unwrap(); import_data.bitfinity_args.max_fetch_blocks = 100; - import_data.bitfinity_args.validate_unsafe_blocks = true; + import_data.bitfinity_args.confirm_unsafe_blocks = true; let import = BitfinityImportCommand::new( None, @@ -442,7 +442,7 @@ async fn bitfinity_test_should_import_until_last_confirmed() { bitfinity_import_config_data(&evm_datasource_url, None, None).await.unwrap(); import_data.bitfinity_args.max_fetch_blocks = 100; - import_data.bitfinity_args.validate_unsafe_blocks = true; + import_data.bitfinity_args.confirm_unsafe_blocks = true; let import = BitfinityImportCommand::new( None, diff --git a/bin/reth/tests/commands/utils.rs b/bin/reth/tests/commands/utils.rs index 4d3d154ef82..532a5e3615e 100644 --- a/bin/reth/tests/commands/utils.rs +++ b/bin/reth/tests/commands/utils.rs @@ -172,7 +172,7 @@ pub async fn bitfinity_import_config_data( retry_delay_secs: 3, check_evm_state_before_importing: false, max_block_age_secs: 600, - validate_unsafe_blocks: false, + confirm_unsafe_blocks: false, }; Ok(( diff --git a/crates/bitfinity-block-validator/Cargo.toml b/crates/bitfinity-block-confirmation/Cargo.toml similarity index 96% rename from crates/bitfinity-block-validator/Cargo.toml rename to crates/bitfinity-block-confirmation/Cargo.toml index 36a4d512b4a..409afaf7cef 100644 --- a/crates/bitfinity-block-validator/Cargo.toml +++ b/crates/bitfinity-block-confirmation/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "bitfinity-block-validator" +name = "bitfinity-block-confirmation" version.workspace = true edition.workspace = true rust-version.workspace = true diff --git a/crates/bitfinity-block-validator/src/lib.rs b/crates/bitfinity-block-confirmation/src/lib.rs similarity index 89% rename from crates/bitfinity-block-validator/src/lib.rs rename to crates/bitfinity-block-confirmation/src/lib.rs index 5cac827c407..1c3346aa54d 100644 --- a/crates/bitfinity-block-validator/src/lib.rs +++ b/crates/bitfinity-block-confirmation/src/lib.rs @@ -1,4 +1,4 @@ -//! Bitfinity block validator. +//! Bitfinity block confirmation. use std::collections::HashSet; use did::{BlockConfirmationData, BlockConfirmationResult}; @@ -18,13 +18,13 @@ use reth_provider::{ }; use reth_revm::{batch::BlockBatchRecord, database::StateProviderDatabase}; -/// Block validator for Bitfinity. +/// Block confirmation for Bitfinity. /// -/// The validator validates the block by executing it and then -/// confirming it on the EVM. +/// Uses custom Bitfinity logic to prove that the block was executed and sends confirmation request +/// to the EVM canister. #[derive(Clone)] #[allow(missing_debug_implementations)] -pub struct BitfinityBlockValidator +pub struct BitfinityBlockConfirmation where C: Client, DB: NodeTypesWithDB + Clone, @@ -33,12 +33,12 @@ where provider_factory: ProviderFactory, } -impl BitfinityBlockValidator +impl BitfinityBlockConfirmation where C: Client, DB: NodeTypesWithDB + ProviderNodeTypes + Clone, { - /// Create a new [`BitfinityBlockValidator`]. + /// Create a new [`BitfinityBlockConfirmation`]. pub const fn new( evm_client: EthJsonRpcClient, provider_factory: ProviderFactory, @@ -46,8 +46,8 @@ where Self { evm_client, provider_factory } } - /// Validate a block. - pub async fn validate_blocks(&self, blocks: &[Block]) -> eyre::Result<()> { + /// Execute the block and send the confirmation request to the EVM. + pub async fn confirm_blocks(&self, blocks: &[Block]) -> eyre::Result<()> { if blocks.is_empty() { return Ok(()) } @@ -93,7 +93,7 @@ where }) } - /// Execute block and return validation arguments. + /// Execute block and return execution result. fn execute_blocks(&self, blocks: &[Block]) -> eyre::Result { let executor = self.executor(); let blocks_with_senders: Vec<_> = blocks.iter().map(Self::convert_block).collect(); diff --git a/crates/node/core/src/args/bitfinity_args.rs b/crates/node/core/src/args/bitfinity_args.rs index a14ac0450ba..9e85ed1ed44 100644 --- a/crates/node/core/src/args/bitfinity_args.rs +++ b/crates/node/core/src/args/bitfinity_args.rs @@ -73,7 +73,7 @@ pub struct BitfinityImportArgs { /// /// If validation is disabled, unsafe blocks will be ignored. #[arg(long)] - pub validate_unsafe_blocks: bool, + pub confirm_unsafe_blocks: bool, } /// Bitfinity Related Args From 63a580bb3ee4610d77d657961fe6b5c4372afde9 Mon Sep 17 00:00:00 2001 From: Maxim Date: Thu, 13 Feb 2025 17:48:21 +0900 Subject: [PATCH 13/38] Change deps to use confirmation branch for sdk (temporarily) --- .cargo/config.toml | 7 ------- Cargo.lock | 31 +++++++++++++------------------ Cargo.toml | 6 +++--- 3 files changed, 16 insertions(+), 28 deletions(-) diff --git a/.cargo/config.toml b/.cargo/config.toml index dd0b6b2108d..79a872fbaf5 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -15,10 +15,3 @@ rustflags = [ "-Clink-arg=/STACK:10000000", ] - -[patch."https://github.com/bitfinity-network/bitfinity-evm-sdk"] -did = { path = "../bitfinity-evm-sdk/src/did" } -eth-signer = { path = "../bitfinity-evm-sdk/src/eth-signer" } -ethereum-json-rpc-client = { path = "../bitfinity-evm-sdk/src/ethereum-json-rpc-client" } -evm-canister-client = { path = "../bitfinity-evm-sdk/src/evm-canister-client" } -signature-verification-canister-client = { path = "../bitfinity-evm-sdk/src/signature-verification-canister-client" } diff --git a/Cargo.lock b/Cargo.lock index 0d656ade69a..d636a78841a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2195,7 +2195,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "117725a109d387c937a1533ce01b450cbde6b88abceea8473c4d7a85853cda3c" dependencies = [ "lazy_static", - "windows-sys 0.59.0", + "windows-sys 0.48.0", ] [[package]] @@ -2783,6 +2783,7 @@ dependencies = [ [[package]] name = "did" version = "0.42.0" +source = "git+https://github.com/bitfinity-network/bitfinity-evm-sdk?branch=EPROD-1132_block_validation#f2f6650129275cabe67df0743cf344f1752e8e30" dependencies = [ "alloy", "bincode", @@ -3137,6 +3138,7 @@ dependencies = [ [[package]] name = "ethereum-json-rpc-client" version = "0.42.0" +source = "git+https://github.com/bitfinity-network/bitfinity-evm-sdk?branch=EPROD-1132_block_validation#f2f6650129275cabe67df0743cf344f1752e8e30" dependencies = [ "alloy", "anyhow", @@ -3222,6 +3224,7 @@ dependencies = [ [[package]] name = "evm-canister-client" version = "0.42.0" +source = "git+https://github.com/bitfinity-network/bitfinity-evm-sdk?branch=EPROD-1132_block_validation#f2f6650129275cabe67df0743cf344f1752e8e30" dependencies = [ "candid", "did", @@ -4444,7 +4447,7 @@ dependencies = [ [[package]] name = "ic-canister-client" version = "0.23.0" -source = "git+https://github.com/bitfinity-network/canister-sdk?tag=v0.23.x#85f5619ec74fab01090fb66dc391ec60d3e28895" +source = "git+https://github.com/bitfinity-network/canister-sdk?tag=v0.23.x#8e7672dbc3c21376051e9150d4ff982b3effe009" dependencies = [ "async-trait", "candid", @@ -4542,7 +4545,7 @@ dependencies = [ [[package]] name = "ic-crypto-getrandom-for-wasm" version = "0.23.0" -source = "git+https://github.com/bitfinity-network/canister-sdk?tag=v0.23.x#85f5619ec74fab01090fb66dc391ec60d3e28895" +source = "git+https://github.com/bitfinity-network/canister-sdk?tag=v0.23.x#8e7672dbc3c21376051e9150d4ff982b3effe009" dependencies = [ "getrandom 0.2.15", ] @@ -4550,7 +4553,7 @@ dependencies = [ [[package]] name = "ic-exports" version = "0.23.0" -source = "git+https://github.com/bitfinity-network/canister-sdk?tag=v0.23.x#85f5619ec74fab01090fb66dc391ec60d3e28895" +source = "git+https://github.com/bitfinity-network/canister-sdk?tag=v0.23.x#8e7672dbc3c21376051e9150d4ff982b3effe009" dependencies = [ "candid", "ic-cdk", @@ -4564,7 +4567,7 @@ dependencies = [ [[package]] name = "ic-kit" version = "0.23.0" -source = "git+https://github.com/bitfinity-network/canister-sdk?tag=v0.23.x#85f5619ec74fab01090fb66dc391ec60d3e28895" +source = "git+https://github.com/bitfinity-network/canister-sdk?tag=v0.23.x#8e7672dbc3c21376051e9150d4ff982b3effe009" dependencies = [ "candid", "futures", @@ -4577,7 +4580,7 @@ dependencies = [ [[package]] name = "ic-log" version = "0.23.0" -source = "git+https://github.com/bitfinity-network/canister-sdk?tag=v0.23.x#85f5619ec74fab01090fb66dc391ec60d3e28895" +source = "git+https://github.com/bitfinity-network/canister-sdk?tag=v0.23.x#8e7672dbc3c21376051e9150d4ff982b3effe009" dependencies = [ "anyhow", "arc-swap", @@ -4602,7 +4605,7 @@ dependencies = [ [[package]] name = "ic-stable-structures" version = "0.23.0" -source = "git+https://github.com/bitfinity-network/canister-sdk?tag=v0.23.x#85f5619ec74fab01090fb66dc391ec60d3e28895" +source = "git+https://github.com/bitfinity-network/canister-sdk?tag=v0.23.x#8e7672dbc3c21376051e9150d4ff982b3effe009" dependencies = [ "candid", "ic-stable-structures 0.6.7", @@ -5405,7 +5408,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fc2f4eb4bc735547cfed7c0a4922cbd04a4655978c09b54f1f7b228750664c34" dependencies = [ "cfg-if", - "windows-targets 0.52.6", + "windows-targets 0.48.5", ] [[package]] @@ -12013,7 +12016,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "69fff37da548239c3bf9e64a12193d261e8b22b660991c6fd2df057c168f435f" dependencies = [ "cc", - "windows-targets 0.52.6", + "windows-targets 0.48.5", ] [[package]] @@ -12454,7 +12457,7 @@ version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" dependencies = [ - "windows-sys 0.59.0", + "windows-sys 0.48.0", ] [[package]] @@ -12948,11 +12951,3 @@ dependencies = [ "cc", "pkg-config", ] - -[[patch.unused]] -name = "eth-signer" -version = "0.42.0" - -[[patch.unused]] -name = "signature-verification-canister-client" -version = "0.42.0" diff --git a/Cargo.toml b/Cargo.toml index 85ec8c169b0..5b4cf74a3f3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -652,14 +652,14 @@ tracy-client = "0.17.3" async-channel = "2" bitfinity-block-confirmation = { path = "crates/bitfinity-block-confirmation" } candid = "0.10" -did = { git = "https://github.com/bitfinity-network/bitfinity-evm-sdk", package = "did", tag = "v0.42.x" } +did = { git = "https://github.com/bitfinity-network/bitfinity-evm-sdk", package = "did", branch = "EPROD-1132_block_validation" } dirs = "5.0.1" -ethereum-json-rpc-client = { git = "https://github.com/bitfinity-network/bitfinity-evm-sdk", package = "ethereum-json-rpc-client", tag = "v0.42.x", features = [ +ethereum-json-rpc-client = { git = "https://github.com/bitfinity-network/bitfinity-evm-sdk", package = "ethereum-json-rpc-client", branch = "EPROD-1132_block_validation", features = [ "reqwest", ] } evm-canister-client = { git = "https://github.com/bitfinity-network/bitfinity-evm-sdk", package = "evm-canister-client", features = [ "ic-agent-client", -], tag = "v0.42.x" } +], branch = "EPROD-1132_block_validation" } ic-cbor = "3" ic-certificate-verification = "3" ic-certification = "3" From d50b3a6f22869eb06b5800261c1f8d34e6f11f5a Mon Sep 17 00:00:00 2001 From: Yasir Date: Mon, 17 Feb 2025 13:30:58 +0300 Subject: [PATCH 14/38] Update dependencies in Cargo.toml and improve code formatting in Bitfinity EVM client --- Cargo.lock | 1235 +++++++++-------- Cargo.toml | 6 +- bin/reth/src/commands/bitfinity_import.rs | 20 +- .../tests/commands/bitfinity_import_it.rs | 7 +- crates/bitfinity-block-validator/Cargo.toml | 4 +- crates/bitfinity-block-validator/src/lib.rs | 194 ++- .../downloaders/src/bitfinity_evm_client.rs | 7 +- 7 files changed, 843 insertions(+), 630 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d8e3630746e..96c8cff3c08 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -62,7 +62,7 @@ dependencies = [ "getrandom 0.2.15", "once_cell", "version_check", - "zerocopy", + "zerocopy 0.7.35", ] [[package]] @@ -124,9 +124,9 @@ dependencies = [ [[package]] name = "alloy-chains" -version = "0.1.55" +version = "0.1.61" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e39f295f876b61a1222d937e1dd31f965e4a1acc3bba98e448dd7e84b1a4566" +checksum = "3a754dbb534198644cb8355b8c23f4aaecf03670fb9409242be1fa1e25897ee9" dependencies = [ "alloy-primitives", "alloy-rlp", @@ -151,7 +151,7 @@ dependencies = [ "arbitrary", "auto_impl", "c-kzg", - "derive_more", + "derive_more 1.0.0", "k256", "rand 0.8.5", "serde", @@ -189,14 +189,14 @@ dependencies = [ "alloy-transport", "futures", "futures-util", - "thiserror 2.0.10", + "thiserror 2.0.11", ] [[package]] name = "alloy-core" -version = "0.8.18" +version = "0.8.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0713007d14d88a6edb8e248cddab783b698dbb954a28b8eee4bab21cfb7e578" +checksum = "482f377cebceed4bb1fb5e7970f0805e2ab123d06701be9351b67ed6341e74aa" dependencies = [ "alloy-dyn-abi", "alloy-json-abi", @@ -207,16 +207,16 @@ dependencies = [ [[package]] name = "alloy-dyn-abi" -version = "0.8.18" +version = "0.8.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44e3b98c37b3218924cd1d2a8570666b89662be54e5b182643855f783ea68b33" +checksum = "555896f0b8578adb522b1453b6e6cc6704c3027bd0af20058befdde992cee8e9" dependencies = [ "alloy-json-abi", "alloy-primitives", "alloy-sol-type-parser", "alloy-sol-types", "const-hex", - "derive_more", + "derive_more 1.0.0", "itoa", "serde", "serde_json", @@ -235,7 +235,7 @@ dependencies = [ "crc", "rand 0.8.5", "serde", - "thiserror 2.0.10", + "thiserror 2.0.11", ] [[package]] @@ -260,7 +260,7 @@ dependencies = [ "alloy-primitives", "alloy-rlp", "arbitrary", - "derive_more", + "derive_more 1.0.0", "k256", "rand 0.8.5", "serde", @@ -280,7 +280,7 @@ dependencies = [ "alloy-serde", "arbitrary", "c-kzg", - "derive_more", + "derive_more 1.0.0", "ethereum_ssz", "ethereum_ssz_derive", "once_cell", @@ -303,9 +303,9 @@ dependencies = [ [[package]] name = "alloy-json-abi" -version = "0.8.18" +version = "0.8.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "731ea743b3d843bc657e120fb1d1e9cc94f5dab8107e35a82125a63e6420a102" +checksum = "4012581681b186ba0882007ed873987cc37f86b1b488fe6b91d5efd0b585dc41" dependencies = [ "alloy-primitives", "alloy-sol-type-parser", @@ -323,7 +323,7 @@ dependencies = [ "alloy-sol-types", "serde", "serde_json", - "thiserror 2.0.10", + "thiserror 2.0.11", "tracing", ] @@ -349,7 +349,7 @@ dependencies = [ "futures-utils-wasm", "serde", "serde_json", - "thiserror 2.0.10", + "thiserror 2.0.11", ] [[package]] @@ -377,16 +377,16 @@ dependencies = [ "rand 0.8.5", "serde_json", "tempfile", - "thiserror 2.0.10", + "thiserror 2.0.11", "tracing", "url", ] [[package]] name = "alloy-primitives" -version = "0.8.18" +version = "0.8.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "788bb18e8f61d5d9340b52143f27771daf7e1dccbaf2741621d2493f9debf52e" +checksum = "478bedf4d24e71ea48428d1bc278553bd7c6ae07c30ca063beb0b09fe58a9e74" dependencies = [ "alloy-rlp", "arbitrary", @@ -394,11 +394,11 @@ dependencies = [ "cfg-if", "const-hex", "derive_arbitrary", - "derive_more", + "derive_more 1.0.0", "foldhash", "getrandom 0.2.15", "hashbrown 0.15.2", - "indexmap 2.7.0", + "indexmap 2.7.1", "itoa", "k256", "keccak-asm", @@ -407,7 +407,7 @@ dependencies = [ "proptest-derive", "rand 0.8.5", "ruint", - "rustc-hash 2.1.0", + "rustc-hash 2.1.1", "serde", "sha3", "tiny-keccak", @@ -447,7 +447,7 @@ dependencies = [ "schnellru", "serde", "serde_json", - "thiserror 2.0.10", + "thiserror 2.0.11", "tokio", "tracing", "url", @@ -475,9 +475,9 @@ dependencies = [ [[package]] name = "alloy-rlp" -version = "0.3.10" +version = "0.3.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f542548a609dca89fcd72b3b9f355928cf844d4363c5eed9c5273a3dd225e097" +checksum = "3d6c1d995bff8d011f7cd6c81820d51825e6e06d6db73914c1630ecf544d83d6" dependencies = [ "alloy-rlp-derive", "arrayvec 0.7.6", @@ -486,13 +486,13 @@ dependencies = [ [[package]] name = "alloy-rlp-derive" -version = "0.3.10" +version = "0.3.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a833d97bf8a5f0f878daf2c8451fff7de7f9de38baa5a45d936ec718d81255a" +checksum = "a40e1ef334153322fd878d07e86af7a529bcb86b2439525920a88eba87bcf943" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.98", ] [[package]] @@ -581,7 +581,7 @@ dependencies = [ "ethereum_ssz_derive", "serde", "serde_with", - "thiserror 2.0.10", + "thiserror 2.0.11", ] [[package]] @@ -605,7 +605,7 @@ dependencies = [ "alloy-primitives", "alloy-rlp", "alloy-serde", - "derive_more", + "derive_more 1.0.0", "ethereum_ssz", "ethereum_ssz_derive", "jsonrpsee-types", @@ -634,7 +634,7 @@ dependencies = [ "jsonrpsee-types", "serde", "serde_json", - "thiserror 2.0.10", + "thiserror 2.0.11", ] [[package]] @@ -662,7 +662,7 @@ dependencies = [ "alloy-serde", "serde", "serde_json", - "thiserror 2.0.10", + "thiserror 2.0.11", ] [[package]] @@ -700,7 +700,7 @@ dependencies = [ "auto_impl", "elliptic-curve", "k256", - "thiserror 2.0.10", + "thiserror 2.0.11", ] [[package]] @@ -718,61 +718,61 @@ dependencies = [ "coins-bip39", "k256", "rand 0.8.5", - "thiserror 2.0.10", + "thiserror 2.0.11", ] [[package]] name = "alloy-sol-macro" -version = "0.8.18" +version = "0.8.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a07b74d48661ab2e4b50bb5950d74dbff5e61dd8ed03bb822281b706d54ebacb" +checksum = "a2708e27f58d747423ae21d31b7a6625159bd8d867470ddd0256f396a68efa11" dependencies = [ "alloy-sol-macro-expander", "alloy-sol-macro-input", "proc-macro-error2", "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.98", ] [[package]] name = "alloy-sol-macro-expander" -version = "0.8.18" +version = "0.8.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19cc9c7f20b90f9be1a8f71a3d8e283a43745137b0837b1a1cb13159d37cad72" +checksum = "c6b7984d7e085dec382d2c5ef022b533fcdb1fe6129200af30ebf5afddb6a361" dependencies = [ "alloy-sol-macro-input", "const-hex", "heck", - "indexmap 2.7.0", + "indexmap 2.7.1", "proc-macro-error2", "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.98", "syn-solidity", "tiny-keccak", ] [[package]] name = "alloy-sol-macro-input" -version = "0.8.18" +version = "0.8.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "713b7e6dfe1cb2f55c80fb05fd22ed085a1b4e48217611365ed0ae598a74c6ac" +checksum = "33d6a9fc4ed1a3c70bdb2357bec3924551c1a59f24e5a04a74472c755b37f87d" dependencies = [ "const-hex", "dunce", "heck", "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.98", "syn-solidity", ] [[package]] name = "alloy-sol-type-parser" -version = "0.8.18" +version = "0.8.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1eda2711ab2e1fb517fc6e2ffa9728c9a232e296d16810810e6957b781a1b8bc" +checksum = "1b1b3e9a48a6dd7bb052a111c8d93b5afc7956ed5e2cb4177793dc63bb1d2a36" dependencies = [ "serde", "winnow", @@ -780,9 +780,9 @@ dependencies = [ [[package]] name = "alloy-sol-types" -version = "0.8.18" +version = "0.8.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3b478bc9c0c4737a04cd976accde4df7eba0bdc0d90ad6ff43d58bc93cf79c1" +checksum = "6044800da35c38118fd4b98e18306bd3b91af5dedeb54c1b768cf1b4fb68f549" dependencies = [ "alloy-json-abi", "alloy-primitives", @@ -803,7 +803,7 @@ dependencies = [ "futures-utils-wasm", "serde", "serde_json", - "thiserror 2.0.10", + "thiserror 2.0.11", "tokio", "tower 0.5.2", "tracing", @@ -865,16 +865,16 @@ dependencies = [ [[package]] name = "alloy-trie" -version = "0.7.8" +version = "0.7.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6917c79e837aa7b77b7a6dae9f89cbe15313ac161c4d3cfaf8909ef21f3d22d8" +checksum = "d95a94854e420f07e962f7807485856cde359ab99ab6413883e15235ad996e8b" dependencies = [ "alloy-primitives", "alloy-rlp", "arbitrary", "arrayvec 0.7.6", "derive_arbitrary", - "derive_more", + "derive_more 1.0.0", "nybbles", "proptest", "proptest-derive", @@ -945,11 +945,12 @@ dependencies = [ [[package]] name = "anstyle-wincon" -version = "3.0.6" +version = "3.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2109dbce0e72be3ec00bed26e6a7479ca384ad226efdd66db8fa2e3a38c83125" +checksum = "ca3534e77181a9cc07539ad51f2141fe32f6c3ffd4df76db8ad92346b003ae4e" dependencies = [ "anstyle", + "once_cell", "windows-sys 0.59.0", ] @@ -970,7 +971,7 @@ dependencies = [ "proc-macro-error2", "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.98", ] [[package]] @@ -1203,7 +1204,7 @@ checksum = "3b43422f69d8ff38f95f1b2bb76517c91589a924d1559a0e935d7c8ce0274c11" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.98", ] [[package]] @@ -1239,18 +1240,18 @@ checksum = "c7c24de15d275a1ecfd47a380fb4d5ec9bfe0933f309ed5e705b775596a3574d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.98", ] [[package]] name = "async-trait" -version = "0.1.85" +version = "0.1.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f934833b4b7233644e5848f235df3f57ed8c80f1528a26c3dfa13d2147fa056" +checksum = "644dd749086bf3771a2fbc5f256fdb982d53f011c7d5d560304eafeecebce79d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.98", ] [[package]] @@ -1281,9 +1282,9 @@ checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" [[package]] name = "aurora-engine-modexp" -version = "1.1.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0aef7712851e524f35fbbb74fa6599c5cd8692056a1c36f9ca0d2001b670e7e5" +checksum = "518bc5745a6264b5fd7b09dffb9667e400ee9e2bbe18555fac75e1fe9afa0df9" dependencies = [ "hex", "num", @@ -1291,13 +1292,13 @@ dependencies = [ [[package]] name = "auto_impl" -version = "1.2.0" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c87f3f15e7794432337fc718554eaa4dc8f04c9677a950ffe366f20a162ae42" +checksum = "e12882f59de5360c748c4cbf569a042d5fb0eb515f7bea9c1f470b47f6ffbd73" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.98", ] [[package]] @@ -1405,7 +1406,7 @@ version = "0.70.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f49d8fed880d473ea71efb9bf597651e77201bdd4893efe54c9e5d65ae04ce6f" dependencies = [ - "bitflags 2.7.0", + "bitflags 2.8.0", "cexpr", "clang-sys", "itertools 0.13.0", @@ -1414,7 +1415,7 @@ dependencies = [ "regex", "rustc-hash 1.1.0", "shlex", - "syn 2.0.96", + "syn 2.0.98", ] [[package]] @@ -1442,18 +1443,18 @@ dependencies = [ [[package]] name = "bit-set" -version = "0.5.3" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0700ddab506f33b20a03b13996eccd309a48e5ff77d0d95926aa0210fb4e95f1" +checksum = "08807e080ed7f9d5433fa9b275196cfc35414f66a0c79d864dc51a0d825231a3" dependencies = [ "bit-vec", ] [[package]] name = "bit-vec" -version = "0.6.3" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" +checksum = "5e764a1d40d510daf35e07be9eb06e75770908c27d411ee6c92109c9840eaaf7" [[package]] name = "bitfinity-block-validator" @@ -1476,6 +1477,7 @@ dependencies = [ "reth-db", "reth-db-common", "reth-engine-tree", + "reth-ethereum-engine-primitives", "reth-evm", "reth-evm-ethereum", "reth-node-types", @@ -1484,6 +1486,7 @@ dependencies = [ "reth-provider", "reth-revm", "reth-rpc-eth-types", + "reth-testing-utils", "reth-trie", "reth-trie-db", "serde", @@ -1500,9 +1503,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.7.0" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1be3f42a67d6d345ecd59f675f3f012d6974981560836e938c22b424b85ce1be" +checksum = "8f68f53c83ab957f72c32642f3868eec03eb974d1fb82e453128456482613d36" dependencies = [ "arbitrary", "serde", @@ -1550,9 +1553,9 @@ dependencies = [ [[package]] name = "blst" -version = "0.3.13" +version = "0.3.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4378725facc195f1a538864863f6de233b500a8862747e7f165078a419d5e874" +checksum = "47c79a94619fade3c0b887670333513a67ac28a6a7e653eb260bf0d4103db38d" dependencies = [ "cc", "glob", @@ -1566,13 +1569,13 @@ version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2c340fe0f0b267787095cbe35240c6786ff19da63ec7b69367ba338eace8169b" dependencies = [ - "bitflags 2.7.0", + "bitflags 2.8.0", "boa_interner", "boa_macros", "boa_string", - "indexmap 2.7.0", + "indexmap 2.7.1", "num-bigint", - "rustc-hash 2.1.0", + "rustc-hash 2.1.1", ] [[package]] @@ -1582,7 +1585,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f620c3f06f51e65c0504ddf04978be1b814ac6586f0b45f6019801ab5efd37f9" dependencies = [ "arrayvec 0.7.6", - "bitflags 2.7.0", + "bitflags 2.8.0", "boa_ast", "boa_gc", "boa_interner", @@ -1596,7 +1599,7 @@ dependencies = [ "fast-float2", "hashbrown 0.15.2", "icu_normalizer", - "indexmap 2.7.0", + "indexmap 2.7.1", "intrusive-collections", "itertools 0.13.0", "num-bigint", @@ -1608,7 +1611,7 @@ dependencies = [ "portable-atomic", "rand 0.8.5", "regress", - "rustc-hash 2.1.0", + "rustc-hash 2.1.1", "ryu-js", "serde", "serde_json", @@ -1616,7 +1619,7 @@ dependencies = [ "static_assertions", "tap", "thin-vec", - "thiserror 2.0.10", + "thiserror 2.0.11", "time", ] @@ -1642,10 +1645,10 @@ dependencies = [ "boa_gc", "boa_macros", "hashbrown 0.15.2", - "indexmap 2.7.0", + "indexmap 2.7.1", "once_cell", "phf", - "rustc-hash 2.1.0", + "rustc-hash 2.1.1", "static_assertions", ] @@ -1657,7 +1660,7 @@ checksum = "9fd3f870829131332587f607a7ff909f1af5fc523fd1b192db55fbbdf52e8d3c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.98", "synstructure", ] @@ -1667,7 +1670,7 @@ version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9cc142dac798cdc6e2dbccfddeb50f36d2523bb977a976e19bdb3ae19b740804" dependencies = [ - "bitflags 2.7.0", + "bitflags 2.8.0", "boa_ast", "boa_interner", "boa_macros", @@ -1677,7 +1680,7 @@ dependencies = [ "num-bigint", "num-traits", "regress", - "rustc-hash 2.1.0", + "rustc-hash 2.1.1", ] [[package]] @@ -1694,7 +1697,7 @@ checksum = "7debc13fbf7997bf38bf8e9b20f1ad5e2a7d27a900e1f6039fe244ce30f589b5" dependencies = [ "fast-float2", "paste", - "rustc-hash 2.1.0", + "rustc-hash 2.1.1", "sptr", "static_assertions", ] @@ -1721,9 +1724,9 @@ dependencies = [ [[package]] name = "brotli-decompressor" -version = "4.0.1" +version = "4.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a45bd2e4095a8b518033b128020dd4a55aab1c0a381ba4404a472630f4bc362" +checksum = "74fa05ad7d803d413eb8380983b092cbbaf9a85f151b871360e7b00cd7060b37" dependencies = [ "alloc-no-stdlib", "alloc-stdlib", @@ -1752,9 +1755,9 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.16.0" +version = "3.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" +checksum = "1628fb46dfa0b37568d12e5edd512553eccf6a22a78e8bde00bb4aed84d5bdbf" [[package]] name = "byte-slice-cast" @@ -1779,7 +1782,7 @@ checksum = "3fa76293b4f7bb636ab88fd78228235b5248b4d05cc589aed610f954af5d7c7a" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.98", ] [[package]] @@ -1790,9 +1793,9 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.9.0" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "325918d6fe32f23b19878fe4b34794ae41fc19ddbe53b10571a4874d44ffd39b" +checksum = "f61dac84819c6588b558454b194026eb1f09c293b9036ae9b159e74e73ab6cf9" dependencies = [ "serde", ] @@ -1849,7 +1852,7 @@ dependencies = [ "darling", "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.98", ] [[package]] @@ -1869,9 +1872,9 @@ dependencies = [ [[package]] name = "candid" -version = "0.10.11" +version = "0.10.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d04aa85a9ba2542bded33d1eff0ffb17cb98b1be8117e0a25e1ad8c62bedc881" +checksum = "a253bab4a9be502c82332b60cbeee6202ad0692834efeec95fae9f29db33d692" dependencies = [ "anyhow", "binread", @@ -1899,7 +1902,7 @@ dependencies = [ "lazy_static", "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.98", ] [[package]] @@ -1919,7 +1922,7 @@ checksum = "2d886547e41f740c616ae73108f6eb70afe6d940c7bc697cb30f13daec073037" dependencies = [ "camino", "cargo-platform", - "semver 1.0.24", + "semver 1.0.25", "serde", "serde_json", "thiserror 1.0.69", @@ -1948,9 +1951,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.2.7" +version = "1.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a012a0df96dd6d06ba9a1b29d6402d1a5d77c6befd2566afdc26e10603dc93d7" +checksum = "0c3d1b2e905a3a7b00a6141adb0e4c0bb941d11caf55349d863942a1cc44e3c9" dependencies = [ "jobserver", "libc", @@ -2001,9 +2004,9 @@ dependencies = [ [[package]] name = "chrono-tz" -version = "0.10.0" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd6dd8046d00723a59a2f8c5f295c515b9bb9a331ee4f8f3d4dd49e428acd3b6" +checksum = "9c6ac4f2c0bf0f44e9161aec9675e1050aa4a530663c4a9e37e108fa948bca9f" dependencies = [ "chrono", "chrono-tz-build", @@ -2070,9 +2073,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.26" +version = "4.5.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8eb5e908ef3a6efbe1ed62520fb7287959888c88485abe072543190ecc66783" +checksum = "8acebd8ad879283633b343856142139f2da2317c96b05b4dd6181c61e2480184" dependencies = [ "clap_builder", "clap_derive", @@ -2080,9 +2083,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.26" +version = "4.5.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96b01801b5fc6a0a232407abc821660c9c6d25a1cafc0d4f85f29fb8d9afc121" +checksum = "f6ba32cbda51c7e1dfd49acc1457ba1a7dec5b64fe360e828acb13ca8dc9c2f9" dependencies = [ "anstream", "anstyle", @@ -2092,14 +2095,14 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.5.24" +version = "4.5.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54b755194d6389280185988721fffba69495eed5ee9feeee9a599b53db80318c" +checksum = "bf4ced95c6f4a675af3da73304b9ac4ed991640c36374e4b46795c49e17cf1ed" dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.98", ] [[package]] @@ -2110,20 +2113,22 @@ checksum = "f46ad14479a25103f283c0f10005961cf086d8dc42205bb44c46ac563475dca6" [[package]] name = "codspeed" -version = "2.7.2" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "450a0e9df9df1c154156f4344f99d8f6f6e69d0fc4de96ef6e2e68b2ec3bce97" +checksum = "25d2f5a6570db487f5258e0bded6352fa2034c2aeb46bb5cc3ff060a0fcfba2f" dependencies = [ "colored", "libc", + "serde", "serde_json", + "uuid", ] [[package]] name = "codspeed-criterion-compat" -version = "2.7.2" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8eb1a6cb9c20e177fde58cdef97c1c7c9264eb1424fe45c4fccedc2fb078a569" +checksum = "f53a55558dedec742b14aae3c5fec389361b8b5ca28c1aadf09dd91faf710074" dependencies = [ "codspeed", "colored", @@ -2211,13 +2216,12 @@ dependencies = [ [[package]] name = "comfy-table" -version = "7.1.3" +version = "7.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24f165e7b643266ea80cb858aed492ad9280e3e05ce24d4a99d7d7b889b6a4d9" +checksum = "4a65ebfec4fb190b6f90e944a817d60499ee0744e582530e2c9900a22e591d9a" dependencies = [ "crossterm", - "strum", - "strum_macros", + "unicode-segmentation", "unicode-width 0.2.0", ] @@ -2284,6 +2288,26 @@ version = "0.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" +[[package]] +name = "const_format" +version = "0.2.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "126f97965c8ad46d6d9163268ff28432e8f6a1196a55578867832e3049df63dd" +dependencies = [ + "const_format_proc_macros", +] + +[[package]] +name = "const_format_proc_macros" +version = "0.2.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d57c2eccfb16dbac1f4e61e206105db5820c9d26c3c472bc17c774259ef7744" +dependencies = [ + "proc-macro2", + "quote", + "unicode-xid", +] + [[package]] name = "convert_case" version = "0.6.0" @@ -2339,9 +2363,9 @@ dependencies = [ [[package]] name = "cpufeatures" -version = "0.2.16" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16b80225097f2e5ae4e7179dd2266824648f3e2f49d9134d584b76389d31c4c3" +checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280" dependencies = [ "libc", ] @@ -2465,7 +2489,7 @@ version = "0.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "829d955a0bb380ef178a640b91779e3987da38c9aea133b20614cfed8cdea9c6" dependencies = [ - "bitflags 2.7.0", + "bitflags 2.8.0", "crossterm_winapi", "mio 1.0.3", "parking_lot", @@ -2486,9 +2510,9 @@ dependencies = [ [[package]] name = "crunchy" -version = "0.2.2" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" +checksum = "43da5946c66ffcc7745f48db692ffbb10a83bfe0afd96235c5c2a4fb23994929" [[package]] name = "crypto-bigint" @@ -2537,9 +2561,9 @@ dependencies = [ [[package]] name = "csv-core" -version = "0.1.11" +version = "0.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5efa2b3d7902f4b634a20cae3c9c4e6209dc4779feb6863329607560143efa70" +checksum = "7d02f3b0da4c6504f86e9cd789d8dbafab48c2321be74e9987593de5a894d93d" dependencies = [ "memchr", ] @@ -2577,7 +2601,7 @@ checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.98", ] [[package]] @@ -2614,7 +2638,7 @@ dependencies = [ "proc-macro2", "quote", "strsim", - "syn 2.0.96", + "syn 2.0.98", ] [[package]] @@ -2625,7 +2649,7 @@ checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" dependencies = [ "darling_core", "quote", - "syn 2.0.96", + "syn 2.0.98", ] [[package]] @@ -2645,15 +2669,15 @@ dependencies = [ [[package]] name = "data-encoding" -version = "2.6.0" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8566979429cf69b49a5c740c60791108e86440e8be149bbea4fe54d2c32d6e2" +checksum = "575f75dfd25738df5b91b8e43e14d44bda14637a58fae779fd2b064f8bf3e010" [[package]] name = "data-encoding-macro" -version = "0.1.15" +version = "0.1.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1559b6cba622276d6d63706db152618eeb15b89b3e4041446b05876e352e639" +checksum = "9f9724adfcf41f45bf652b3995837669d73c4d49a1b5ac1ff82905ac7d9b5558" dependencies = [ "data-encoding", "data-encoding-macro-internal", @@ -2661,12 +2685,12 @@ dependencies = [ [[package]] name = "data-encoding-macro-internal" -version = "0.1.13" +version = "0.1.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "332d754c0af53bc87c108fed664d121ecf59207ec4196041f04d6ab9002ad33f" +checksum = "18e4fdb82bd54a12e42fb58a800dcae6b9e13982238ce2296dc3570b92148e1f" dependencies = [ "data-encoding", - "syn 1.0.109", + "syn 2.0.98", ] [[package]] @@ -2735,7 +2759,7 @@ checksum = "30542c1ad912e0e3d22a1935c290e12e8a29d704a420177a31faad4a601a0800" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.98", ] [[package]] @@ -2744,7 +2768,16 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4a9b99b9cbbe49445b21764dc0625032a89b145a2642e67603e1c936f5458d05" dependencies = [ - "derive_more-impl", + "derive_more-impl 1.0.0", +] + +[[package]] +name = "derive_more" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "093242cf7570c207c83073cf82f79706fe7b8317e98620a47d5be7c3d8497678" +dependencies = [ + "derive_more-impl 2.0.1", ] [[package]] @@ -2756,7 +2789,19 @@ dependencies = [ "convert_case", "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.98", + "unicode-xid", +] + +[[package]] +name = "derive_more-impl" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bda628edc44c4bb645fbe0f758797143e4e07926f7ebf4e9bdfbd3d2ce621df3" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.98", "unicode-xid", ] @@ -2768,7 +2813,7 @@ dependencies = [ "bincode", "bytes", "candid", - "derive_more", + "derive_more 2.0.1", "ic-log", "ic-stable-structures 0.23.0", "jsonrpc-core", @@ -2779,7 +2824,7 @@ dependencies = [ "serde_with", "sha2 0.10.8", "sha3", - "thiserror 2.0.10", + "thiserror 2.0.11", ] [[package]] @@ -2892,7 +2937,7 @@ checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.98", ] [[package]] @@ -2909,9 +2954,9 @@ checksum = "92773504d58c093f6de2459af4af33faa518c13451eb8f2b5698ed3d36e7c813" [[package]] name = "dyn-clone" -version = "1.0.17" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d6ef0072f8a535281e4876be788938b528e9a1d43900b82c2569af7da799125" +checksum = "feeef44e73baff3a26d371801df019877a9866a8c493d315ab00177843314f35" [[package]] name = "ecdsa" @@ -2988,7 +3033,7 @@ dependencies = [ "revm", "serde", "serde_json", - "thiserror 2.0.10", + "thiserror 2.0.11", "walkdir", ] @@ -3054,7 +3099,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.98", ] [[package]] @@ -3065,7 +3110,7 @@ checksum = "2f9ed6b3789237c8a0c1c505af1c7eb2c560df6186f01b098c3a1064ea532f38" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.98", ] [[package]] @@ -3095,14 +3140,14 @@ checksum = "3bf679796c0322556351f287a51b49e48f7c4986e727b5dd78c972d30e2e16cc" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.98", ] [[package]] name = "equivalent" -version = "1.0.1" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" +checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" [[package]] name = "errno" @@ -3147,9 +3192,9 @@ dependencies = [ [[package]] name = "ethereum_ssz" -version = "0.8.2" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "862e41ea8eea7508f70cfd8cd560f0c34bb0af37c719a8e06c2672f0f031d8e5" +checksum = "86da3096d1304f5f28476ce383005385459afeaf0eea08592b65ddbc9b258d16" dependencies = [ "alloy-primitives", "ethereum_serde_utils", @@ -3162,14 +3207,14 @@ dependencies = [ [[package]] name = "ethereum_ssz_derive" -version = "0.8.2" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d31ecf6640112f61dc34b4d8359c081102969af0edd18381fed2052f6db6a410" +checksum = "d832a5c38eba0e7ad92592f7a22d693954637fbb332b4f669590d66a5c3183e5" dependencies = [ "darling", "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.98", ] [[package]] @@ -3224,7 +3269,7 @@ dependencies = [ "reth-node-ethereum", "serde", "serde_json", - "thiserror 2.0.10", + "thiserror 2.0.11", ] [[package]] @@ -3312,7 +3357,7 @@ dependencies = [ "reth-tracing", "reth-trie-db", "serde", - "thiserror 2.0.10", + "thiserror 2.0.11", "tokio", ] @@ -3579,17 +3624,6 @@ dependencies = [ "bytes", ] -[[package]] -name = "fastrlp" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce8dba4714ef14b8274c371879b175aa55b16b30f269663f19d576f380018dc4" -dependencies = [ - "arrayvec 0.7.6", - "auto_impl", - "bytes", -] - [[package]] name = "fdlimit" version = "0.3.0" @@ -3784,7 +3818,7 @@ checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.98", ] [[package]] @@ -3882,6 +3916,18 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "getrandom" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43a49c392881ce6d5c3b8cb70f98717b7c07aabbdff06687b9030dbfbe2725f8" +dependencies = [ + "cfg-if", + "libc", + "wasi 0.13.3+wasi-0.2.2", + "windows-targets 0.52.6", +] + [[package]] name = "ghash" version = "0.5.1" @@ -3973,7 +4019,7 @@ dependencies = [ "futures-core", "futures-sink", "http", - "indexmap 2.7.0", + "indexmap 2.7.1", "slab", "tokio", "tokio-util", @@ -4084,9 +4130,9 @@ dependencies = [ [[package]] name = "hickory-proto" -version = "0.25.0-alpha.4" +version = "0.25.0-alpha.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d063c0692ee669aa6d261988aa19ca5510f1cc40e4f211024f50c888499a35d7" +checksum = "1d00147af6310f4392a31680db52a3ed45a2e0f68eb18e8c3fe5537ecc96d9e2" dependencies = [ "async-recursion", "async-trait", @@ -4099,9 +4145,9 @@ dependencies = [ "idna", "ipnet", "once_cell", - "rand 0.8.5", + "rand 0.9.0", "serde", - "thiserror 2.0.10", + "thiserror 2.0.11", "tinyvec", "tokio", "tracing", @@ -4110,9 +4156,9 @@ dependencies = [ [[package]] name = "hickory-resolver" -version = "0.25.0-alpha.4" +version = "0.25.0-alpha.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42bc352e4412fb657e795f79b4efcf2bd60b59ee5ca0187f3554194cd1107a27" +checksum = "5762f69ebdbd4ddb2e975cd24690bf21fe6b2604039189c26acddbc427f12887" dependencies = [ "cfg-if", "futures-util", @@ -4121,11 +4167,11 @@ dependencies = [ "moka", "once_cell", "parking_lot", - "rand 0.8.5", + "rand 0.9.0", "resolv-conf", "serde", "smallvec", - "thiserror 2.0.10", + "thiserror 2.0.11", "tokio", "tracing", ] @@ -4242,9 +4288,9 @@ dependencies = [ [[package]] name = "httparse" -version = "1.9.5" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d71d3574edd2771538b901e6549113b4006ece66150fb69c0fb6d9a2adae946" +checksum = "f2d708df4e7140240a16cd6ab0ab65c972d7433ab77819ea693fde9c43811e2a" [[package]] name = "httpdate" @@ -4276,9 +4322,9 @@ dependencies = [ [[package]] name = "hyper" -version = "1.5.2" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "256fb8d4bd6413123cc9d91832d78325c48ff41677595be797d90f42969beae0" +checksum = "cc2b571658e38e0c01b1fdca3bbbe93c00d3d71693ff2770043f8c29bc7d6f80" dependencies = [ "bytes", "futures-channel", @@ -4375,9 +4421,9 @@ dependencies = [ [[package]] name = "ic-agent" -version = "0.39.2" +version = "0.39.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ba408987ca48fc3eee6a613e760d076a9046cccbbb5ba29efbada339ab28ed9" +checksum = "820d65a05258f2fdff326c65561b1ddc7ec54e5d43a4b1203b25eb83075c83d4" dependencies = [ "arc-swap", "async-channel 1.9.0", @@ -4414,7 +4460,7 @@ dependencies = [ "sha2 0.10.8", "simple_asn1", "stop-token", - "thiserror 2.0.10", + "thiserror 2.0.11", "time", "tokio", "tower-service", @@ -4424,21 +4470,21 @@ dependencies = [ [[package]] name = "ic-canister-client" version = "0.23.0" -source = "git+https://github.com/bitfinity-network/canister-sdk?tag=v0.23.x#85f5619ec74fab01090fb66dc391ec60d3e28895" +source = "git+https://github.com/bitfinity-network/canister-sdk?tag=v0.23.x#8e7672dbc3c21376051e9150d4ff982b3effe009" dependencies = [ "async-trait", "candid", "ic-agent", "ic-exports", "serde", - "thiserror 2.0.10", + "thiserror 2.0.11", ] [[package]] name = "ic-cbor" -version = "3.0.2" +version = "3.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5500d6e85bc2ca8ea8aaed16cb84811882589244831a2fd8eefe02e90b3006c6" +checksum = "a0efada960a6c9fb023f45ed95801b757a033dafba071e4f386c6c112ca186d9" dependencies = [ "candid", "ic-certification", @@ -4471,7 +4517,7 @@ dependencies = [ "quote", "serde", "serde_tokenstream", - "syn 2.0.96", + "syn 2.0.98", ] [[package]] @@ -4490,9 +4536,9 @@ dependencies = [ [[package]] name = "ic-certificate-verification" -version = "3.0.2" +version = "3.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2daec653eb7895b5549cdf58d871985711c03cf5e389f7800a970f4f42dc0897" +checksum = "546dfd75c4da975b9f1c55ef3da461321ab4313a66da653af321ed6dc7319b61" dependencies = [ "cached 0.54.0", "candid", @@ -4509,9 +4555,9 @@ dependencies = [ [[package]] name = "ic-certification" -version = "3.0.2" +version = "3.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9eae40f26fcac9c141cad54d9aa5f423efffde78ac371057c53d275ebbcad443" +checksum = "ffb40d73f9f8273dc6569a68859003bbd467c9dc6d53c6fd7d174742f857209d" dependencies = [ "hex", "serde", @@ -4522,7 +4568,7 @@ dependencies = [ [[package]] name = "ic-crypto-getrandom-for-wasm" version = "0.23.0" -source = "git+https://github.com/bitfinity-network/canister-sdk?tag=v0.23.x#85f5619ec74fab01090fb66dc391ec60d3e28895" +source = "git+https://github.com/bitfinity-network/canister-sdk?tag=v0.23.x#8e7672dbc3c21376051e9150d4ff982b3effe009" dependencies = [ "getrandom 0.2.15", ] @@ -4530,7 +4576,7 @@ dependencies = [ [[package]] name = "ic-exports" version = "0.23.0" -source = "git+https://github.com/bitfinity-network/canister-sdk?tag=v0.23.x#85f5619ec74fab01090fb66dc391ec60d3e28895" +source = "git+https://github.com/bitfinity-network/canister-sdk?tag=v0.23.x#8e7672dbc3c21376051e9150d4ff982b3effe009" dependencies = [ "candid", "ic-cdk", @@ -4544,7 +4590,7 @@ dependencies = [ [[package]] name = "ic-kit" version = "0.23.0" -source = "git+https://github.com/bitfinity-network/canister-sdk?tag=v0.23.x#85f5619ec74fab01090fb66dc391ec60d3e28895" +source = "git+https://github.com/bitfinity-network/canister-sdk?tag=v0.23.x#8e7672dbc3c21376051e9150d4ff982b3effe009" dependencies = [ "candid", "futures", @@ -4557,7 +4603,7 @@ dependencies = [ [[package]] name = "ic-log" version = "0.23.0" -source = "git+https://github.com/bitfinity-network/canister-sdk?tag=v0.23.x#85f5619ec74fab01090fb66dc391ec60d3e28895" +source = "git+https://github.com/bitfinity-network/canister-sdk?tag=v0.23.x#8e7672dbc3c21376051e9150d4ff982b3effe009" dependencies = [ "anyhow", "arc-swap", @@ -4582,20 +4628,20 @@ dependencies = [ [[package]] name = "ic-stable-structures" version = "0.23.0" -source = "git+https://github.com/bitfinity-network/canister-sdk?tag=v0.23.x#85f5619ec74fab01090fb66dc391ec60d3e28895" +source = "git+https://github.com/bitfinity-network/canister-sdk?tag=v0.23.x#8e7672dbc3c21376051e9150d4ff982b3effe009" dependencies = [ "candid", "ic-stable-structures 0.6.7", "parking_lot", "schnellru", - "thiserror 2.0.10", + "thiserror 2.0.11", ] [[package]] name = "ic-transport-types" -version = "0.39.2" +version = "0.39.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21e2418868dd5857d2a5bac3f1cb6de1aecf2316d380997ef842aec3d8a79d4e" +checksum = "979ee7bee5a67150a4c090fb012c93c294a528b4a867bad9a15cc6d01cb4227f" dependencies = [ "candid", "hex", @@ -4606,7 +4652,7 @@ dependencies = [ "serde_cbor", "serde_repr", "sha2 0.10.8", - "thiserror 2.0.10", + "thiserror 2.0.11", ] [[package]] @@ -4771,7 +4817,7 @@ checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.98", ] [[package]] @@ -4828,7 +4874,7 @@ checksum = "a0eb5a3343abf848c0984fe4604b2b105da9539376e24fc0a3b0007411ae4fd9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.98", ] [[package]] @@ -4869,9 +4915,9 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.7.0" +version = "2.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62f822373a4fe84d4bb149bf54e584a7f4abec90e072ed49cda0edea5b95471f" +checksum = "8c9c992b02b5b4c94ea26e32fe5bccb7aa7d9f390ab5c1221ff895bc7ea8b652" dependencies = [ "arbitrary", "equivalent", @@ -4898,7 +4944,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "232929e1d75fe899576a3d5c7416ad0d88dbfbb3c3d6aa00873a7408a50ddb88" dependencies = [ "ahash", - "indexmap 2.7.0", + "indexmap 2.7.1", "is-terminal", "itoa", "log", @@ -4941,15 +4987,15 @@ dependencies = [ [[package]] name = "instability" -version = "0.3.6" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "894813a444908c0c8c0e221b041771d107c4a21de1d317dc49bcc66e3c9e5b3f" +checksum = "0bf9fed6d91cfb734e7476a06bde8300a1b94e217e1b523b6f0cd1a01998c71d" dependencies = [ "darling", "indoc", "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.98", ] [[package]] @@ -4999,9 +5045,9 @@ dependencies = [ [[package]] name = "ipnet" -version = "2.10.1" +version = "2.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ddc24109865250148c2e0f3d25d4f0f479571723792d3802153c60922a4fb708" +checksum = "469fb0b9cefa57e3ef31275ee7cacb78f2fdca44e4765491884a2b119d4eb130" [[package]] name = "iri-string" @@ -5015,13 +5061,13 @@ dependencies = [ [[package]] name = "is-terminal" -version = "0.4.13" +version = "0.4.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "261f68e344040fbd0edea105bef17c66edf46f984ddb1115b775ce31be948f4b" +checksum = "e19b23d53f35ce9f56aebc7d1bb4e6ac1e9c0db7ac85c8d1760c04379edced37" dependencies = [ "hermit-abi 0.4.0", "libc", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -5094,9 +5140,9 @@ dependencies = [ [[package]] name = "js-sys" -version = "0.3.76" +version = "0.3.77" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6717b6b5b077764fb5966237269cb3c64edddde4b14ce42647430a78ced9e7b7" +checksum = "1cfaf33c695fc6e08064efbc1f72ec937429614f25eef83af942d0e227c3a28f" dependencies = [ "once_cell", "wasm-bindgen", @@ -5119,9 +5165,9 @@ dependencies = [ [[package]] name = "jsonrpsee" -version = "0.24.7" +version = "0.24.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5c71d8c1a731cc4227c2f698d377e7848ca12c8a48866fc5e6951c43a4db843" +checksum = "834af00800e962dee8f7bfc0f60601de215e73e78e5497d733a2919da837d3c8" dependencies = [ "jsonrpsee-client-transport", "jsonrpsee-core", @@ -5137,9 +5183,9 @@ dependencies = [ [[package]] name = "jsonrpsee-client-transport" -version = "0.24.7" +version = "0.24.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "548125b159ba1314104f5bb5f38519e03a41862786aa3925cf349aae9cdd546e" +checksum = "def0fd41e2f53118bd1620478d12305b2c75feef57ea1f93ef70568c98081b7e" dependencies = [ "base64 0.22.1", "futures-channel", @@ -5162,9 +5208,9 @@ dependencies = [ [[package]] name = "jsonrpsee-core" -version = "0.24.7" +version = "0.24.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2882f6f8acb9fdaec7cefc4fd607119a9bd709831df7d7672a1d3b644628280" +checksum = "76637f6294b04e747d68e69336ef839a3493ca62b35bf488ead525f7da75c5bb" dependencies = [ "async-trait", "bytes", @@ -5177,7 +5223,7 @@ dependencies = [ "parking_lot", "pin-project", "rand 0.8.5", - "rustc-hash 2.1.0", + "rustc-hash 2.1.1", "serde", "serde_json", "thiserror 1.0.69", @@ -5189,9 +5235,9 @@ dependencies = [ [[package]] name = "jsonrpsee-http-client" -version = "0.24.7" +version = "0.24.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3638bc4617f96675973253b3a45006933bde93c2fd8a6170b33c777cc389e5b" +checksum = "87c24e981ad17798bbca852b0738bfb7b94816ed687bd0d5da60bfa35fa0fdc3" dependencies = [ "async-trait", "base64 0.22.1", @@ -5214,22 +5260,22 @@ dependencies = [ [[package]] name = "jsonrpsee-proc-macros" -version = "0.24.7" +version = "0.24.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c06c01ae0007548e73412c08e2285ffe5d723195bf268bce67b1b77c3bb2a14d" +checksum = "6fcae0c6c159e11541080f1f829873d8f374f81eda0abc67695a13fc8dc1a580" dependencies = [ "heck", "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.98", ] [[package]] name = "jsonrpsee-server" -version = "0.24.7" +version = "0.24.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82ad8ddc14be1d4290cd68046e7d1d37acd408efed6d3ca08aefcc3ad6da069c" +checksum = "66b7a3df90a1a60c3ed68e7ca63916b53e9afa928e33531e87f61a9c8e9ae87b" dependencies = [ "futures-util", "http", @@ -5254,9 +5300,9 @@ dependencies = [ [[package]] name = "jsonrpsee-types" -version = "0.24.7" +version = "0.24.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a178c60086f24cc35bb82f57c651d0d25d99c4742b4d335de04e97fa1f08a8a1" +checksum = "ddb81adb1a5ae9182df379e374a79e24e992334e7346af4d065ae5b2acb8d4c6" dependencies = [ "http", "serde", @@ -5266,9 +5312,9 @@ dependencies = [ [[package]] name = "jsonrpsee-wasm-client" -version = "0.24.7" +version = "0.24.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a01cd500915d24ab28ca17527e23901ef1be6d659a2322451e1045532516c25" +checksum = "42e41af42ca39657313748174d02766e5287d3a57356f16756dbd8065b933977" dependencies = [ "jsonrpsee-client-transport", "jsonrpsee-core", @@ -5277,9 +5323,9 @@ dependencies = [ [[package]] name = "jsonrpsee-ws-client" -version = "0.24.7" +version = "0.24.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fe322e0896d0955a3ebdd5bf813571c53fea29edd713bc315b76620b327e86d" +checksum = "6f4f3642a292f5b76d8a16af5c88c16a0860f2ccc778104e5c848b28183d9538" dependencies = [ "http", "jsonrpsee-client-transport", @@ -5290,11 +5336,11 @@ dependencies = [ [[package]] name = "jsonwebtoken" -version = "9.3.0" +version = "9.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9ae10193d25051e74945f1ea2d0b42e03cc3b890f7e4cc5faa44997d808193f" +checksum = "5a87cc7a48537badeae96744432de36f4be2b4a34a05a5ef32e9dd8a1c169dde" dependencies = [ - "base64 0.21.7", + "base64 0.22.1", "js-sys", "pem", "ring", @@ -5388,12 +5434,6 @@ dependencies = [ "windows-targets 0.52.6", ] -[[package]] -name = "libm" -version = "0.2.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8355be11b20d696c8f18f6cc018c4e372165b1fa8126cef092399c9951984ffa" - [[package]] name = "libp2p-identity" version = "0.2.10" @@ -5430,7 +5470,7 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" dependencies = [ - "bitflags 2.7.0", + "bitflags 2.8.0", "libc", "redox_syscall", ] @@ -5540,9 +5580,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.22" +version = "0.4.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" +checksum = "04cbf5b083de1c7e0222a7a51dbfdba1cbe1c6ab0b15e29fff3f6c077fd9cd9f" [[package]] name = "loom" @@ -5581,30 +5621,6 @@ dependencies = [ "libc", ] -[[package]] -name = "maili-protocol" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfcd6cd2bab854872c24d551308cb84df4c20db38593b4392d68cacd75d4c60c" -dependencies = [ - "alloc-no-stdlib", - "alloy-consensus", - "alloy-eips", - "alloy-primitives", - "alloy-rlp", - "alloy-sol-types", - "async-trait", - "brotli", - "derive_more", - "miniz_oxide", - "op-alloy-consensus", - "op-alloy-genesis", - "rand 0.8.5", - "thiserror 2.0.10", - "tracing", - "unsigned-varint", -] - [[package]] name = "match_cfg" version = "0.1.0" @@ -5663,17 +5679,17 @@ dependencies = [ "proc-macro2", "quote", "regex", - "syn 2.0.96", + "syn 2.0.98", ] [[package]] name = "metrics-exporter-prometheus" -version = "0.16.1" +version = "0.16.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12779523996a67c13c84906a876ac6fe4d07a6e1adb54978378e13f199251a62" +checksum = "dd7399781913e5393588a8d8c6a2867bf85fb38eaf2502fdce465aad2dc6f034" dependencies = [ "base64 0.22.1", - "indexmap 2.7.0", + "indexmap 2.7.1", "metrics", "metrics-util 0.19.0", "quanta", @@ -5705,7 +5721,7 @@ dependencies = [ "crossbeam-epoch", "crossbeam-utils", "hashbrown 0.15.2", - "indexmap 2.7.0", + "indexmap 2.7.1", "metrics", "ordered-float", ] @@ -5770,9 +5786,9 @@ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" [[package]] name = "miniz_oxide" -version = "0.8.2" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ffbe83022cedc1d264172192511ae958937694cd57ce297164951b8b3568394" +checksum = "b3b1c9bd4fe1f0f8b387f6eb9eb3b4a1aa26185e5750efb9140301703f62cd1b" dependencies = [ "adler2", ] @@ -5895,9 +5911,9 @@ dependencies = [ [[package]] name = "native-tls" -version = "0.2.12" +version = "0.2.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8614eb2c83d59d1c8cc974dd3f920198647674a0a035e1af1fa58707e317466" +checksum = "0dab59f8e050d5df8e4dd87d9206fb6f65a483e20ac9fda365ade4fab353196c" dependencies = [ "libc", "log", @@ -5937,7 +5953,7 @@ version = "6.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6205bd8bb1e454ad2e27422015fb5e4f2bcc7e08fa8f27058670d208324a4d2d" dependencies = [ - "bitflags 2.7.0", + "bitflags 2.8.0", "filetime", "fsevent-sys", "inotify", @@ -6057,7 +6073,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" dependencies = [ "autocfg", - "libm", ] [[package]] @@ -6088,7 +6103,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.98", ] [[package]] @@ -6125,9 +6140,9 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.20.2" +version = "1.20.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" +checksum = "945462a4b81e43c4e3ba96bd7b49d834c6f61198356aa858733bc4acf3cbe62e" dependencies = [ "critical-section", "portable-atomic", @@ -6141,9 +6156,9 @@ checksum = "b410bbe7e14ab526a0e86877eb47c6996a2bd7746f027ba551028c925390e4e9" [[package]] name = "op-alloy-consensus" -version = "0.9.2" +version = "0.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "442518bf0ef88f4d79409527565b8cdee235c891f2e2a829497caec5ed9d8d1c" +checksum = "e28dc4e397dd8969f7f98ea6454a5c531349a58c76e12448b0c2de6581df7b8c" dependencies = [ "alloy-consensus", "alloy-eips", @@ -6151,39 +6166,17 @@ dependencies = [ "alloy-rlp", "alloy-serde", "arbitrary", - "derive_more", + "derive_more 1.0.0", "serde", "serde_with", - "thiserror 2.0.10", -] - -[[package]] -name = "op-alloy-genesis" -version = "0.9.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a2af7fee1fa297569199b524493e50355eab3f1bff75cef492036eb4a3ffb5e" -dependencies = [ - "alloy-consensus", - "alloy-eips", - "alloy-primitives", - "alloy-sol-types", - "thiserror 2.0.10", -] - -[[package]] -name = "op-alloy-protocol" -version = "0.9.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a144b1ed079913b11c0640f4eaa3d2ac1bdb6cc35e3658a1640e88b241e0c32" -dependencies = [ - "maili-protocol", + "thiserror 2.0.11", ] [[package]] name = "op-alloy-rpc-types" -version = "0.9.2" +version = "0.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50223d61cad040db6721bcc2d489c924c1691ce3f5e674d4d8776131dab786a0" +checksum = "4b9c83c664b953d474d6b58825800b6ff1d61876a686407e646cbf76891c1f9b" dependencies = [ "alloy-consensus", "alloy-eips", @@ -6192,7 +6185,7 @@ dependencies = [ "alloy-rpc-types-eth", "alloy-serde", "arbitrary", - "derive_more", + "derive_more 1.0.0", "op-alloy-consensus", "serde", "serde_json", @@ -6200,17 +6193,15 @@ dependencies = [ [[package]] name = "op-alloy-rpc-types-engine" -version = "0.9.2" +version = "0.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f5e2419373bae23ea3f6cf5a49c624d9b644061e2e929d4f9629cbcbffa4964d" +checksum = "e8d05b5b5b3cff7f24eec2bc366f86a7ff0934678b1bda36d0ecaadba9504170" dependencies = [ "alloy-eips", "alloy-primitives", "alloy-rpc-types-engine", - "derive_more", "op-alloy-consensus", - "op-alloy-protocol", - "thiserror 2.0.10", + "thiserror 2.0.11", ] [[package]] @@ -6221,11 +6212,11 @@ checksum = "c08d65885ee38876c4f86fa503fb49d7b507c2b62552df7c70b2fce627e06381" [[package]] name = "openssl" -version = "0.10.68" +version = "0.10.71" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6174bc48f102d208783c2c84bf931bb75927a617866870de8a4ea85597f871f5" +checksum = "5e14130c6a98cd258fdcb0fb6d744152343ff729cbfcb28c656a9d12b999fbcd" dependencies = [ - "bitflags 2.7.0", + "bitflags 2.8.0", "cfg-if", "foreign-types", "libc", @@ -6242,20 +6233,20 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.98", ] [[package]] name = "openssl-probe" -version = "0.1.5" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" +checksum = "d05e27ee213611ffe7d6348b942e8f942b37114c00cc03cec254295a4a17852e" [[package]] name = "openssl-sys" -version = "0.9.104" +version = "0.9.106" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45abf306cbf99debc8195b66b7346498d7b10c210de50418b5ccd7ceba08c741" +checksum = "8bb61ea9811cc39e3c2069f40b8b8e2e70d8569b361f879786cc7ed48b777cdd" dependencies = [ "cc", "libc", @@ -6317,30 +6308,32 @@ dependencies = [ [[package]] name = "parity-scale-codec" -version = "3.6.12" +version = "3.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "306800abfa29c7f16596b5970a588435e3d5b3149683d00c12b699cc19f895ee" +checksum = "c9fde3d0718baf5bc92f577d652001da0f8d54cd03a7974e118d04fc888dc23d" dependencies = [ "arbitrary", "arrayvec 0.7.6", "bitvec", "byte-slice-cast", "bytes", + "const_format", "impl-trait-for-tuples", "parity-scale-codec-derive", + "rustversion", "serde", ] [[package]] name = "parity-scale-codec-derive" -version = "3.6.12" +version = "3.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d830939c76d294956402033aee57a6da7b438f2294eb94864c37b0569053a42c" +checksum = "581c837bb6b9541ce7faa9377c20616e4fb7650f6b0f68bc93c827ee504fb7b3" dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.98", ] [[package]] @@ -6429,7 +6422,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b7cafe60d6cf8e62e1b9b2ea516a089c008945bb5a275416789e7db0bc199dc" dependencies = [ "memchr", - "thiserror 2.0.10", + "thiserror 2.0.11", "ucd-trie", ] @@ -6483,7 +6476,7 @@ dependencies = [ "phf_shared", "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.98", ] [[package]] @@ -6497,22 +6490,22 @@ dependencies = [ [[package]] name = "pin-project" -version = "1.1.8" +version = "1.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e2ec53ad785f4d35dac0adea7f7dc6f1bb277ad84a680c7afefeae05d1f5916" +checksum = "dfe2e71e1471fe07709406bf725f710b02927c9c54b2b5b2ec0e8087d97c327d" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.1.8" +version = "1.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d56a66c0c55993aa927429d0f8a0abfd74f084e4d9c192cffed01e418d83eefb" +checksum = "f6e859e6e5bd50440ab63c47e3ebabc90f26251f7c73c3d3e837b74a1cc3fa67" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.98", ] [[package]] @@ -6639,7 +6632,7 @@ version = "0.2.20" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "77957b295656769bb8ad2b6a6b09d897d94f05c41b069aede1fcdaa675eaea04" dependencies = [ - "zerocopy", + "zerocopy 0.7.35", ] [[package]] @@ -6665,12 +6658,12 @@ dependencies = [ [[package]] name = "prettyplease" -version = "0.2.27" +version = "0.2.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "483f8c21f64f3ea09fe0f30f5d48c3e8eefe5dac9129f0075f76593b4c1da705" +checksum = "6924ced06e1f7dfe3fa48d57b9f74f55d8915f5036121bef647ef4b204895fac" dependencies = [ "proc-macro2", - "syn 2.0.96", + "syn 2.0.98", ] [[package]] @@ -6721,14 +6714,14 @@ dependencies = [ "proc-macro-error-attr2", "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.98", ] [[package]] name = "proc-macro2" -version = "1.0.92" +version = "1.0.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37d3544b3f2748c54e147655edb5025752e2303145b5aefb3c3ea2c78b973bb0" +checksum = "60946a68e5f9d28b0dc1c21bb8a97ee7d018a8b322fa57838ba31cc878e22d99" dependencies = [ "unicode-ident", ] @@ -6739,7 +6732,7 @@ version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "731e0d9356b0c25f16f33b5be79b1c57b562f141ebfcdb0ad8ac2c13a24293b4" dependencies = [ - "bitflags 2.7.0", + "bitflags 2.8.0", "chrono", "flate2", "hex", @@ -6754,7 +6747,7 @@ version = "0.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cc5b72d8145275d844d4b5f6d4e1eef00c8cd889edb6035c21675d1bb1f45c9f" dependencies = [ - "bitflags 2.7.0", + "bitflags 2.8.0", "hex", "procfs-core 0.17.0", "rustix", @@ -6766,7 +6759,7 @@ version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2d3554923a69f4ce04c4a754260c338f505ce22642d3830e049a399fc2059a29" dependencies = [ - "bitflags 2.7.0", + "bitflags 2.8.0", "chrono", "hex", ] @@ -6777,19 +6770,19 @@ version = "0.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "239df02d8349b06fc07398a3a1697b06418223b1c7725085e801e7c0fc6a12ec" dependencies = [ - "bitflags 2.7.0", + "bitflags 2.8.0", "hex", ] [[package]] name = "proptest" -version = "1.5.0" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4c2511913b88df1637da85cc8d96ec8e43a3f8bb8ccb71ee1ac240d6f3df58d" +checksum = "14cae93065090804185d3b75f0bf93b8eeda30c7a9b4a33d3bdb3988d6229e50" dependencies = [ "bit-set", "bit-vec", - "bitflags 2.7.0", + "bitflags 2.8.0", "lazy_static", "num-traits", "rand 0.8.5", @@ -6819,14 +6812,14 @@ checksum = "4ee1c9ac207483d5e7db4940700de86a9aae46ef90c48b57f99fe7edb8345e49" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.98", ] [[package]] name = "psm" -version = "0.1.24" +version = "0.1.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "200b9ff220857e53e184257720a14553b2f4aa02577d2ed9842d45d4b9654810" +checksum = "f58e5423e24c18cc840e1c98370b3993c6649cd1678b4d24318bcf0a083cbe88" dependencies = [ "cc", ] @@ -6880,10 +6873,10 @@ dependencies = [ "pin-project-lite", "quinn-proto", "quinn-udp", - "rustc-hash 2.1.0", + "rustc-hash 2.1.1", "rustls", "socket2", - "thiserror 2.0.10", + "thiserror 2.0.11", "tokio", "tracing", ] @@ -6898,11 +6891,11 @@ dependencies = [ "getrandom 0.2.15", "rand 0.8.5", "ring", - "rustc-hash 2.1.0", + "rustc-hash 2.1.1", "rustls", "rustls-pki-types", "slab", - "thiserror 2.0.10", + "thiserror 2.0.11", "tinyvec", "tracing", "web-time", @@ -6910,9 +6903,9 @@ dependencies = [ [[package]] name = "quinn-udp" -version = "0.5.9" +version = "0.5.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c40286217b4ba3a71d644d752e6a0b71f13f1b6a2c5311acfcbe0c2418ed904" +checksum = "e46f3055866785f6b92bc6164b76be02ca8f2eb4b002c0354b28cf4c119e5944" dependencies = [ "cfg_aliases", "libc", @@ -6962,6 +6955,17 @@ dependencies = [ "serde", ] +[[package]] +name = "rand" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3779b94aeb87e8bd4e834cee3650289ee9e0d5677f976ecdb6d219e5f4f6cd94" +dependencies = [ + "rand_chacha 0.9.0", + "rand_core 0.9.1", + "zerocopy 0.8.18", +] + [[package]] name = "rand_chacha" version = "0.2.2" @@ -6982,6 +6986,16 @@ dependencies = [ "rand_core 0.6.4", ] +[[package]] +name = "rand_chacha" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3022b5f1df60f26e1ffddd6c66e8aa15de382ae63b3a0c1bfc0e4d3e3f325cb" +dependencies = [ + "ppv-lite86", + "rand_core 0.9.1", +] + [[package]] name = "rand_core" version = "0.5.1" @@ -7000,6 +7014,16 @@ dependencies = [ "getrandom 0.2.15", ] +[[package]] +name = "rand_core" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a88e0da7a2c97baa202165137c158d0a2e824ac465d13d81046727b34cb247d3" +dependencies = [ + "getrandom 0.3.1", + "zerocopy 0.8.18", +] + [[package]] name = "rand_hc" version = "0.2.0" @@ -7039,7 +7063,7 @@ version = "0.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fdef7f9be5c0122f890d58bdf4d964349ba6a6161f705907526d891efabba57d" dependencies = [ - "bitflags 2.7.0", + "bitflags 2.8.0", "cassowary", "compact_str", "crossterm", @@ -7056,11 +7080,11 @@ dependencies = [ [[package]] name = "raw-cpuid" -version = "11.2.0" +version = "11.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ab240315c661615f2ee9f0f2cd32d5a7343a84d5ebcccb99d46e6637565e7b0" +checksum = "c6928fa44c097620b706542d428957635951bade7143269085389d42c8a4927e" dependencies = [ - "bitflags 2.7.0", + "bitflags 2.8.0", ] [[package]] @@ -7095,7 +7119,7 @@ version = "0.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "03a862b389f93e68874fbf580b9de08dd02facb9a788ebadaf4a3fd33cf58834" dependencies = [ - "bitflags 2.7.0", + "bitflags 2.8.0", ] [[package]] @@ -7155,11 +7179,11 @@ checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" [[package]] name = "regress" -version = "0.10.1" +version = "0.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1541daf4e4ed43a0922b7969bdc2170178bcacc5dabf7e39bc508a9fa3953a7a" +checksum = "78ef7fa9ed0256d64a688a3747d0fef7a88851c18a5e1d57f115f38ec2e09366" dependencies = [ - "hashbrown 0.14.5", + "hashbrown 0.15.2", "memchr", ] @@ -7395,7 +7419,7 @@ dependencies = [ "reth-tokio-util", "reth-tracing", "schnellru", - "thiserror 2.0.10", + "thiserror 2.0.11", "tokio", "tokio-stream", "tracing", @@ -7431,7 +7455,7 @@ dependencies = [ "reth-rpc-types-compat", "reth-tracing", "serde", - "thiserror 2.0.10", + "thiserror 2.0.11", "tokio", "tower 0.4.13", "tracing", @@ -7487,7 +7511,7 @@ dependencies = [ "reth-primitives", "reth-primitives-traits", "reth-storage-errors", - "thiserror 2.0.10", + "thiserror 2.0.11", ] [[package]] @@ -7499,7 +7523,7 @@ dependencies = [ "alloy-primitives", "alloy-signer", "alloy-signer-local", - "derive_more", + "derive_more 1.0.0", "metrics", "parking_lot", "pin-project", @@ -7531,7 +7555,7 @@ dependencies = [ "alloy-rlp", "alloy-trie", "auto_impl", - "derive_more", + "derive_more 1.0.0", "once_cell", "reth-ethereum-forks", "reth-network-peers", @@ -7642,7 +7666,7 @@ dependencies = [ "reth-fs-util", "secp256k1", "serde", - "thiserror 2.0.10", + "thiserror 2.0.11", "tikv-jemallocator", "tracy-client", ] @@ -7678,7 +7702,7 @@ dependencies = [ "proc-macro2", "quote", "similar-asserts", - "syn 2.0.96", + "syn 2.0.98", ] [[package]] @@ -7705,7 +7729,7 @@ dependencies = [ "alloy-eips", "alloy-primitives", "auto_impl", - "derive_more", + "derive_more 1.0.0", "reth-primitives", "reth-primitives-traits", ] @@ -7757,7 +7781,7 @@ dependencies = [ "assert_matches", "bytes", "codspeed-criterion-compat", - "derive_more", + "derive_more 1.0.0", "eyre", "metrics", "page_size", @@ -7777,14 +7801,14 @@ dependencies = [ "reth-storage-errors", "reth-tracing", "reth-trie-common", - "rustc-hash 2.1.0", + "rustc-hash 2.1.1", "serde", "serde_json", "strum", "sysinfo", "tempfile", "test-fuzz", - "thiserror 2.0.10", + "thiserror 2.0.11", ] [[package]] @@ -7796,7 +7820,7 @@ dependencies = [ "alloy-primitives", "arbitrary", "bytes", - "derive_more", + "derive_more 1.0.0", "metrics", "modular-bitfield", "parity-scale-codec", @@ -7842,7 +7866,7 @@ dependencies = [ "reth-trie-db", "serde", "serde_json", - "thiserror 2.0.10", + "thiserror 2.0.11", "tracing", ] @@ -7884,7 +7908,7 @@ dependencies = [ "schnellru", "secp256k1", "serde", - "thiserror 2.0.10", + "thiserror 2.0.11", "tokio", "tokio-stream", "tracing", @@ -7896,7 +7920,7 @@ version = "1.1.5" dependencies = [ "alloy-primitives", "alloy-rlp", - "derive_more", + "derive_more 1.0.0", "discv5", "enr", "futures", @@ -7909,7 +7933,7 @@ dependencies = [ "reth-network-peers", "reth-tracing", "secp256k1", - "thiserror 2.0.10", + "thiserror 2.0.11", "tokio", "tracing", ] @@ -7936,7 +7960,7 @@ dependencies = [ "secp256k1", "serde", "serde_with", - "thiserror 2.0.10", + "thiserror 2.0.11", "tokio", "tokio-stream", "tracing", @@ -7986,7 +8010,7 @@ dependencies = [ "reth-tracing", "serde_json", "tempfile", - "thiserror 2.0.10", + "thiserror 2.0.11", "tokio", "tokio-stream", "tokio-util", @@ -8006,7 +8030,7 @@ dependencies = [ "alloy-rpc-types-eth", "alloy-signer", "alloy-signer-local", - "derive_more", + "derive_more 1.0.0", "eyre", "futures-util", "jsonrpsee", @@ -8063,7 +8087,7 @@ dependencies = [ "secp256k1", "sha2 0.10.8", "sha3", - "thiserror 2.0.10", + "thiserror 2.0.11", "tokio", "tokio-stream", "tokio-util", @@ -8118,7 +8142,7 @@ dependencies = [ "reth-primitives-traits", "reth-trie", "serde", - "thiserror 2.0.10", + "thiserror 2.0.11", "tokio", ] @@ -8145,7 +8169,7 @@ dependencies = [ "reth-prune", "reth-stages-api", "reth-tasks", - "thiserror 2.0.10", + "thiserror 2.0.11", "tokio", "tokio-stream", ] @@ -8162,7 +8186,7 @@ dependencies = [ "assert_matches", "codspeed-criterion-compat", "crossbeam-channel", - "derive_more", + "derive_more 1.0.0", "futures", "metrics", "proptest", @@ -8203,7 +8227,7 @@ dependencies = [ "reth-trie-parallel", "reth-trie-sparse", "revm-primitives", - "thiserror 2.0.10", + "thiserror 2.0.11", "tokio", "tracing", ] @@ -8249,7 +8273,7 @@ dependencies = [ "reth-execution-errors", "reth-fs-util", "reth-storage-errors", - "thiserror 2.0.10", + "thiserror 2.0.11", ] [[package]] @@ -8263,7 +8287,7 @@ dependencies = [ "arbitrary", "async-stream", "bytes", - "derive_more", + "derive_more 1.0.0", "futures", "pin-project", "proptest", @@ -8282,7 +8306,7 @@ dependencies = [ "serde", "snap", "test-fuzz", - "thiserror 2.0.10", + "thiserror 2.0.11", "tokio", "tokio-stream", "tokio-util", @@ -8301,7 +8325,7 @@ dependencies = [ "alloy-rlp", "arbitrary", "bytes", - "derive_more", + "derive_more 1.0.0", "proptest", "proptest-arbitrary-interop", "rand 0.8.5", @@ -8311,7 +8335,7 @@ dependencies = [ "reth-primitives", "reth-primitives-traits", "serde", - "thiserror 2.0.10", + "thiserror 2.0.11", ] [[package]] @@ -8371,7 +8395,7 @@ dependencies = [ "auto_impl", "dyn-clone", "once_cell", - "rustc-hash 2.1.0", + "rustc-hash 2.1.1", "serde", ] @@ -8410,7 +8434,7 @@ dependencies = [ "alloy-primitives", "alloy-rlp", "arbitrary", - "derive_more", + "derive_more 1.0.0", "modular-bitfield", "once_cell", "proptest", @@ -8498,7 +8522,7 @@ dependencies = [ "reth-prune-types", "reth-storage-errors", "revm-primitives", - "thiserror 2.0.10", + "thiserror 2.0.11", ] [[package]] @@ -8594,7 +8618,7 @@ dependencies = [ "reth-transaction-pool", "reth-trie-db", "tempfile", - "thiserror 2.0.10", + "thiserror 2.0.11", "tokio", ] @@ -8621,7 +8645,7 @@ version = "1.1.5" dependencies = [ "serde", "serde_json", - "thiserror 2.0.10", + "thiserror 2.0.11", ] [[package]] @@ -8664,7 +8688,7 @@ dependencies = [ "rand 0.8.5", "reth-tracing", "serde_json", - "thiserror 2.0.10", + "thiserror 2.0.11", "tokio", "tokio-stream", "tokio-util", @@ -8676,12 +8700,12 @@ dependencies = [ name = "reth-libmdbx" version = "1.1.5" dependencies = [ - "bitflags 2.7.0", + "bitflags 2.8.0", "byteorder", "codspeed-criterion-compat", "dashmap", - "derive_more", - "indexmap 2.7.0", + "derive_more 1.0.0", + "indexmap 2.7.1", "parking_lot", "pprof", "rand 0.8.5", @@ -8689,7 +8713,7 @@ dependencies = [ "reth-mdbx-sys", "smallvec", "tempfile", - "thiserror 2.0.10", + "thiserror 2.0.11", "tracing", ] @@ -8728,7 +8752,7 @@ dependencies = [ "reqwest", "reth-tracing", "serde_with", - "thiserror 2.0.10", + "thiserror 2.0.11", "tokio", "tracing", ] @@ -8746,7 +8770,7 @@ dependencies = [ "aquamarine", "auto_impl", "codspeed-criterion-compat", - "derive_more", + "derive_more 1.0.0", "discv5", "enr", "futures", @@ -8781,14 +8805,14 @@ dependencies = [ "reth-tokio-util", "reth-tracing", "reth-transaction-pool", - "rustc-hash 2.1.0", + "rustc-hash 2.1.1", "schnellru", "secp256k1", "serde", "serial_test", "smallvec", "tempfile", - "thiserror 2.0.10", + "thiserror 2.0.11", "tokio", "tokio-stream", "tokio-util", @@ -8803,7 +8827,7 @@ dependencies = [ "alloy-primitives", "alloy-rpc-types-admin", "auto_impl", - "derive_more", + "derive_more 1.0.0", "enr", "futures", "reth-eth-wire-types", @@ -8813,7 +8837,7 @@ dependencies = [ "reth-network-types", "reth-tokio-util", "serde", - "thiserror 2.0.10", + "thiserror 2.0.11", "tokio", "tokio-stream", ] @@ -8826,7 +8850,7 @@ dependencies = [ "alloy-eips", "alloy-primitives", "auto_impl", - "derive_more", + "derive_more 1.0.0", "futures", "parking_lot", "reth-consensus", @@ -8851,7 +8875,7 @@ dependencies = [ "secp256k1", "serde_json", "serde_with", - "thiserror 2.0.10", + "thiserror 2.0.11", "tokio", "url", ] @@ -8875,14 +8899,14 @@ version = "1.1.5" dependencies = [ "anyhow", "bincode", - "derive_more", + "derive_more 1.0.0", "lz4_flex", "memmap2", "rand 0.8.5", "reth-fs-util", "serde", "tempfile", - "thiserror 2.0.10", + "thiserror 2.0.11", "tracing", "zstd", ] @@ -8982,7 +9006,7 @@ dependencies = [ "alloy-primitives", "alloy-rpc-types-engine", "clap", - "derive_more", + "derive_more 1.0.0", "dirs-next", "eyre", "futures", @@ -9016,7 +9040,7 @@ dependencies = [ "serde", "shellexpand", "strum", - "thiserror 2.0.10", + "thiserror 2.0.11", "tokio", "toml", "tracing", @@ -9080,7 +9104,7 @@ dependencies = [ "alloy-eips", "alloy-primitives", "alloy-rpc-types-engine", - "derive_more", + "derive_more 1.0.0", "futures", "humantime", "pin-project", @@ -9140,7 +9164,7 @@ dependencies = [ "alloy-rlp", "arbitrary", "bytes", - "derive_more", + "derive_more 1.0.0", "modular-bitfield", "once_cell", "op-alloy-consensus", @@ -9207,7 +9231,7 @@ dependencies = [ "reth-primitives", "revm-primitives", "serde", - "thiserror 2.0.10", + "thiserror 2.0.11", "tokio", ] @@ -9249,7 +9273,7 @@ dependencies = [ "bytes", "c-kzg", "codspeed-criterion-compat", - "derive_more", + "derive_more 1.0.0", "modular-bitfield", "once_cell", "op-alloy-consensus", @@ -9291,7 +9315,7 @@ dependencies = [ "bincode", "byteorder", "bytes", - "derive_more", + "derive_more 1.0.0", "k256", "modular-bitfield", "op-alloy-consensus", @@ -9306,7 +9330,7 @@ dependencies = [ "serde_json", "serde_with", "test-fuzz", - "thiserror 2.0.10", + "thiserror 2.0.11", ] [[package]] @@ -9385,8 +9409,8 @@ dependencies = [ "reth-testing-utils", "reth-tokio-util", "reth-tracing", - "rustc-hash 2.1.0", - "thiserror 2.0.10", + "rustc-hash 2.1.1", + "thiserror 2.0.11", "tokio", "tracing", ] @@ -9398,7 +9422,7 @@ dependencies = [ "alloy-primitives", "arbitrary", "assert_matches", - "derive_more", + "derive_more 1.0.0", "modular-bitfield", "proptest", "proptest-arbitrary-interop", @@ -9406,7 +9430,7 @@ dependencies = [ "serde", "serde_json", "test-fuzz", - "thiserror 2.0.10", + "thiserror 2.0.11", "toml", ] @@ -9452,7 +9476,7 @@ dependencies = [ "alloy-signer", "alloy-signer-local", "async-trait", - "derive_more", + "derive_more 1.0.0", "futures", "http", "http-body", @@ -9491,7 +9515,7 @@ dependencies = [ "revm-primitives", "serde", "serde_json", - "thiserror 2.0.10", + "thiserror 2.0.11", "tokio", "tokio-stream", "tower 0.4.13", @@ -9584,7 +9608,7 @@ dependencies = [ "reth-transaction-pool", "serde", "serde_json", - "thiserror 2.0.10", + "thiserror 2.0.11", "tokio", "tokio-util", "tower 0.4.13", @@ -9624,7 +9648,7 @@ dependencies = [ "reth-tokio-util", "reth-transaction-pool", "serde", - "thiserror 2.0.10", + "thiserror 2.0.11", "tokio", "tracing", ] @@ -9683,7 +9707,7 @@ dependencies = [ "alloy-primitives", "alloy-rpc-types-eth", "alloy-sol-types", - "derive_more", + "derive_more 1.0.0", "futures", "itertools 0.13.0", "jsonrpsee-core", @@ -9710,7 +9734,7 @@ dependencies = [ "schnellru", "serde", "serde_json", - "thiserror 2.0.10", + "thiserror 2.0.11", "tokio", "tokio-stream", "tracing", @@ -9810,7 +9834,7 @@ dependencies = [ "reth-trie", "reth-trie-db", "tempfile", - "thiserror 2.0.10", + "thiserror 2.0.11", "tokio", "tracing", ] @@ -9838,7 +9862,7 @@ dependencies = [ "reth-static-file-types", "reth-testing-utils", "reth-tokio-util", - "thiserror 2.0.10", + "thiserror 2.0.11", "tokio", "tokio-stream", "tracing", @@ -9891,7 +9915,7 @@ version = "1.1.5" dependencies = [ "alloy-primitives", "clap", - "derive_more", + "derive_more 1.0.0", "reth-nippy-jar", "serde", "strum", @@ -9928,11 +9952,11 @@ dependencies = [ "alloy-eips", "alloy-primitives", "alloy-rlp", - "derive_more", + "derive_more 1.0.0", "reth-fs-util", "reth-primitives-traits", "reth-static-file-types", - "thiserror 2.0.10", + "thiserror 2.0.11", ] [[package]] @@ -9946,7 +9970,7 @@ dependencies = [ "pin-project", "rayon", "reth-metrics", - "thiserror 2.0.10", + "thiserror 2.0.11", "tokio", "tracing", "tracing-futures", @@ -10000,7 +10024,7 @@ dependencies = [ "aquamarine", "assert_matches", "auto_impl", - "bitflags 2.7.0", + "bitflags 2.8.0", "codspeed-criterion-compat", "futures-util", "metrics", @@ -10025,13 +10049,13 @@ dependencies = [ "reth-tracing", "revm-interpreter", "revm-primitives", - "rustc-hash 2.1.0", + "rustc-hash 2.1.1", "schnellru", "serde", "serde_json", "smallvec", "tempfile", - "thiserror 2.0.10", + "thiserror 2.0.11", "tokio", "tokio-stream", "tracing", @@ -10081,7 +10105,7 @@ dependencies = [ "bincode", "bytes", "codspeed-criterion-compat", - "derive_more", + "derive_more 1.0.0", "hash-db", "itertools 0.13.0", "nybbles", @@ -10102,7 +10126,7 @@ dependencies = [ "alloy-consensus", "alloy-primitives", "alloy-rlp", - "derive_more", + "derive_more 1.0.0", "metrics", "proptest", "proptest-arbitrary-interop", @@ -10131,7 +10155,7 @@ dependencies = [ "alloy-primitives", "alloy-rlp", "codspeed-criterion-compat", - "derive_more", + "derive_more 1.0.0", "itertools 0.13.0", "metrics", "proptest", @@ -10146,7 +10170,7 @@ dependencies = [ "reth-trie", "reth-trie-common", "reth-trie-db", - "thiserror 2.0.10", + "thiserror 2.0.11", "tracing", ] @@ -10171,7 +10195,7 @@ dependencies = [ "reth-trie", "reth-trie-common", "smallvec", - "thiserror 2.0.10", + "thiserror 2.0.11", ] [[package]] @@ -10183,9 +10207,9 @@ dependencies = [ [[package]] name = "revm" -version = "19.2.0" +version = "19.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b829dc9d6e62c5a540dfdceb0c4d2217e445bf5f6f5ed3866817e7a9637c019" +checksum = "dfc5bef3c95fadf3b6a24a253600348380c169ef285f9780a793bb7090c8990d" dependencies = [ "auto_impl", "cfg-if", @@ -10213,14 +10237,14 @@ dependencies = [ "colorchoice", "revm", "serde_json", - "thiserror 2.0.10", + "thiserror 2.0.11", ] [[package]] name = "revm-interpreter" -version = "15.0.0" +version = "15.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5ff76b50b5a9fa861fbc236fc82ce1afdf58861f65012aea807d679e54630d6" +checksum = "7dcab7ef2064057acfc84731205f4bc77f4ec1b35630800b26ff6a185731c5ab" dependencies = [ "revm-primitives", "serde", @@ -10228,9 +10252,9 @@ dependencies = [ [[package]] name = "revm-precompile" -version = "16.0.0" +version = "16.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6542fb37650dfdbf4b9186769e49c4a8bc1901a3280b2ebf32f915b6c8850f36" +checksum = "6caa1a7ff2cc4a09a263fcf9de99151706f323d30f33d519ed329f017a02b046" dependencies = [ "aurora-engine-modexp", "blst", @@ -10248,15 +10272,15 @@ dependencies = [ [[package]] name = "revm-primitives" -version = "15.1.0" +version = "15.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48faea1ecf2c9f80d9b043bbde0db9da616431faed84c4cfa3dd7393005598e6" +checksum = "f0f987564210317706def498421dfba2ae1af64a8edce82c6102758b48133fcb" dependencies = [ "alloy-eip2930", "alloy-eip7702", "alloy-primitives", "auto_impl", - "bitflags 2.7.0", + "bitflags 2.8.0", "bitvec", "c-kzg", "cfg-if", @@ -10287,15 +10311,14 @@ dependencies = [ [[package]] name = "ring" -version = "0.17.8" +version = "0.17.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c17fa4cb658e3583423e915b9f3acc01cceaee1860e33d59ebae66adc3a2dc0d" +checksum = "e75ec5e92c4d8aede845126adc388046234541629e76029599ed35a003c7ed24" dependencies = [ "cc", "cfg-if", "getrandom 0.2.15", "libc", - "spin", "untrusted", "windows-sys 0.52.0", ] @@ -10407,25 +10430,23 @@ dependencies = [ "regex", "relative-path", "rustc_version 0.4.1", - "syn 2.0.96", + "syn 2.0.98", "unicode-ident", ] [[package]] name = "ruint" -version = "1.12.4" +version = "1.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f5ef8fb1dd8de3870cb8400d51b4c2023854bbafd5431a3ac7e7317243e22d2f" +checksum = "2c3cc4c2511671f327125da14133d0c5c5d137f006a1017a16f557bc85b16286" dependencies = [ "alloy-rlp", "arbitrary", "ark-ff 0.3.0", "ark-ff 0.4.2", "bytes", - "fastrlp 0.3.1", - "fastrlp 0.4.0", + "fastrlp", "num-bigint", - "num-integer", "num-traits", "parity-scale-codec", "primitive-types", @@ -10458,9 +10479,9 @@ checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" [[package]] name = "rustc-hash" -version = "2.1.0" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7fb8039b3032c191086b10f11f319a6e99e1e82889c5cc6046f515c9db1d497" +checksum = "357703d41365b4b27c590e3ed91eabb1b663f07c4c084095e60cbed4362dff0d" dependencies = [ "rand 0.8.5", ] @@ -10486,16 +10507,16 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" dependencies = [ - "semver 1.0.24", + "semver 1.0.25", ] [[package]] name = "rustix" -version = "0.38.43" +version = "0.38.44" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a78891ee6bf2340288408954ac787aa063d8e8817e9f53abb37c695c6d834ef6" +checksum = "fdb5bc1ae2baa591800df16c9ca78619bf65c0488b41b96ccec5d11220d8c154" dependencies = [ - "bitflags 2.7.0", + "bitflags 2.8.0", "errno", "libc", "linux-raw-sys", @@ -10504,9 +10525,9 @@ dependencies = [ [[package]] name = "rustls" -version = "0.23.20" +version = "0.23.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5065c3f250cbd332cd894be57c40fa52387247659b14a2d6041d121547903b1b" +checksum = "47796c98c480fce5406ef69d1c76378375492c3b0a0de587be0c1d9feb12f395" dependencies = [ "log", "once_cell", @@ -10553,9 +10574,9 @@ dependencies = [ [[package]] name = "rustls-pki-types" -version = "1.10.1" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2bf47e6ff922db3825eb750c4e2ff784c6ff8fb9e13046ef6a1d1c5401b0b37" +checksum = "917ce264624a4b4db1c364dcc35bfca9ded014d0a958cd47ad3e960e988ea51c" dependencies = [ "web-time", ] @@ -10618,15 +10639,15 @@ dependencies = [ [[package]] name = "ryu" -version = "1.0.18" +version = "1.0.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" +checksum = "6ea1a2d0a644769cc99faa24c3ad26b379b786fe7c36fd3c546254801650e6dd" [[package]] name = "ryu-js" -version = "1.0.1" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad97d4ce1560a5e27cec89519dc8300d1aa6035b099821261c651486a19e44d5" +checksum = "dd29631678d6fb0903b69223673e122c32e9ae559d0960a38d574695ebc0ea15" [[package]] name = "same-file" @@ -10639,9 +10660,9 @@ dependencies = [ [[package]] name = "scc" -version = "2.3.0" +version = "2.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28e1c91382686d21b5ac7959341fcb9780fa7c03773646995a87c950fa7be640" +checksum = "ea091f6cac2595aa38993f04f4ee692ed43757035c36e67c180b6828356385b1" dependencies = [ "sdd", ] @@ -10680,9 +10701,9 @@ checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] name = "sdd" -version = "3.0.5" +version = "3.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "478f121bb72bbf63c52c93011ea1791dca40140dfe13f8336c4c5ac952c33aa9" +checksum = "b07779b9b918cc05650cb30f404d4d7835d26df37c235eded8a6832e2fb82cca" [[package]] name = "sec1" @@ -10725,7 +10746,7 @@ version = "2.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" dependencies = [ - "bitflags 2.7.0", + "bitflags 2.8.0", "core-foundation 0.9.4", "core-foundation-sys", "libc", @@ -10739,7 +10760,7 @@ version = "3.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "271720403f46ca04f7ba6f55d438f8bd878d6b8ca0a1046e8228c4145bcbb316" dependencies = [ - "bitflags 2.7.0", + "bitflags 2.8.0", "core-foundation 0.10.0", "core-foundation-sys", "libc", @@ -10767,9 +10788,9 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.24" +version = "1.0.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3cb6eb87a131f756572d7fb904f6e7b68633f09cca868c5df1c4b8d1a694bbba" +checksum = "f79dfe2d285b0488816f30e700a7438c5a73d816b5b7d3ac72fbc48b0d185e03" dependencies = [ "serde", ] @@ -10831,16 +10852,16 @@ checksum = "5a9bf7cf98d04a2b28aead066b7496853d4779c9cc183c440dbac457641e19a0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.98", ] [[package]] name = "serde_json" -version = "1.0.135" +version = "1.0.138" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b0d7ba2887406110130a978386c4e1befb98c674b4fba677954e4db976630d9" +checksum = "d434192e7da787e94a6ea7e9670b26a036d0ca41e0b7efb2676dd32bae872949" dependencies = [ - "indexmap 2.7.0", + "indexmap 2.7.1", "itoa", "memchr", "ryu", @@ -10866,7 +10887,7 @@ checksum = "6c64451ba24fc7a6a2d60fc75dd9c83c90903b19028d4eff35e88fc1e86564e9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.98", ] [[package]] @@ -10887,7 +10908,7 @@ dependencies = [ "proc-macro2", "quote", "serde", - "syn 2.0.96", + "syn 2.0.98", ] [[package]] @@ -10912,7 +10933,7 @@ dependencies = [ "chrono", "hex", "indexmap 1.9.3", - "indexmap 2.7.0", + "indexmap 2.7.1", "serde", "serde_derive", "serde_json", @@ -10929,7 +10950,7 @@ dependencies = [ "darling", "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.98", ] [[package]] @@ -10962,7 +10983,7 @@ checksum = "5d69265a08751de7844521fd15003ae0a888e035773ba05695c5c759a6f89eef" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.98", ] [[package]] @@ -11086,9 +11107,9 @@ dependencies = [ [[package]] name = "similar" -version = "2.6.0" +version = "2.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1de1d4f81173b03af4c0cbed3c898f6bff5b870e4a7f5d6f4057d62a7a4b686e" +checksum = "bbbb5d9659141646ae647b42fe094daf6c6192d1620870b449d9557f748b2daa" dependencies = [ "bstr", "unicode-segmentation", @@ -11096,9 +11117,9 @@ dependencies = [ [[package]] name = "similar-asserts" -version = "1.6.0" +version = "1.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cfe85670573cd6f0fa97940f26e7e6601213c3b0555246c24234131f88c5709e" +checksum = "9f08357795f0d604ea7d7130f22c74b03838c959bdb14adde3142aab4d18a293" dependencies = [ "console", "serde", @@ -11107,13 +11128,13 @@ dependencies = [ [[package]] name = "simple_asn1" -version = "0.6.2" +version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adc4e5204eb1910f40f9cfa375f6f05b68c3abac4b6fd879c8ff5e7ae8a0a085" +checksum = "297f631f50729c8c99b84667867963997ec0b50f32b2a7dbcab828ef0541e8bb" dependencies = [ "num-bigint", "num-traits", - "thiserror 1.0.69", + "thiserror 2.0.11", "time", ] @@ -11149,9 +11170,9 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.13.2" +version = "1.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" +checksum = "7fcf8323ef1faaee30a44a340193b1ac6814fd9b7b4e88e9d4519a3e4abe1cfd" dependencies = [ "arbitrary", "serde", @@ -11219,9 +11240,9 @@ checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" [[package]] name = "stacker" -version = "0.1.17" +version = "0.1.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "799c883d55abdb5e98af1a7b3f23b9b6de8ecada0ecac058672d7635eb48ca7b" +checksum = "1d08feb8f695b465baed819b03c128dc23f57a694510ab1f06c77f763975685e" dependencies = [ "cc", "cfg-if", @@ -11279,7 +11300,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.96", + "syn 2.0.98", ] [[package]] @@ -11309,9 +11330,9 @@ checksum = "734676eb262c623cec13c3155096e08d1f8f29adce39ba17948b18dad1e54142" [[package]] name = "symbolic-common" -version = "12.13.1" +version = "12.13.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf08b42a6f9469bd8584daee39a1352c8133ccabc5151ccccb15896ef047d99a" +checksum = "b6189977df1d6ec30c920647919d76f29fb8d8f25e8952e835b0fcda25e8f792" dependencies = [ "debugid", "memmap2", @@ -11321,9 +11342,9 @@ dependencies = [ [[package]] name = "symbolic-demangle" -version = "12.13.1" +version = "12.13.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32f73b5a5bd4da72720c45756a2d11edf110116b87f998bda59b97be8c2c7cf1" +checksum = "d234917f7986498e7f62061438cee724bafb483fe84cfbe2486f68dce48240d7" dependencies = [ "cpp_demangle", "rustc-demangle", @@ -11343,9 +11364,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.96" +version = "2.0.98" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5d0adab1ae378d7f53bdebc67a39f1f151407ef230f0ce2883572f5d8985c80" +checksum = "36147f1a48ae0ec2b5b3bc5b537d267457555a10dc06f3dbc8cb11ba3006d3b1" dependencies = [ "proc-macro2", "quote", @@ -11354,14 +11375,14 @@ dependencies = [ [[package]] name = "syn-solidity" -version = "0.8.18" +version = "0.8.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31e89d8bf2768d277f40573c83a02a099e96d96dd3104e13ea676194e61ac4b0" +checksum = "9c2de690018098e367beeb793991c7d4dc7270f42c9d2ac4ccc876c1368ca430" dependencies = [ "paste", "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.98", ] [[package]] @@ -11381,7 +11402,7 @@ checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.98", ] [[package]] @@ -11411,13 +11432,13 @@ checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" [[package]] name = "tempfile" -version = "3.15.0" +version = "3.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a8a559c81686f576e8cd0290cd2a24a2a9ad80c98b3478856500fcbd7acd704" +checksum = "a40f762a77d2afa88c2d919489e390a12bdd261ed568e60cfa7e48d4e20f0d33" dependencies = [ "cfg-if", "fastrand 2.3.0", - "getrandom 0.2.15", + "getrandom 0.3.1", "once_cell", "rustix", "windows-sys 0.59.0", @@ -11459,7 +11480,7 @@ dependencies = [ "prettyplease", "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.98", ] [[package]] @@ -11492,11 +11513,11 @@ dependencies = [ [[package]] name = "thiserror" -version = "2.0.10" +version = "2.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3ac7f54ca534db81081ef1c1e7f6ea8a3ef428d2fc069097c079443d24124d3" +checksum = "d452f284b73e6d76dd36758a0c8684b1d5be31f92b89d07fd5822175732206fc" dependencies = [ - "thiserror-impl 2.0.10", + "thiserror-impl 2.0.11", ] [[package]] @@ -11507,18 +11528,18 @@ checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.98", ] [[package]] name = "thiserror-impl" -version = "2.0.10" +version = "2.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e9465d30713b56a37ede7185763c3492a91be2f5fa68d958c44e41ab9248beb" +checksum = "26afc1baea8a989337eeb52b6e72a039780ce45c3edfcc9c5b9d112feeb173c2" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.98", ] [[package]] @@ -11675,7 +11696,7 @@ checksum = "6e06d43f1345a3bcd39f6a56dbb7dcab2ba47e68e8ac134855e7e2bdbaf8cab8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.98", ] [[package]] @@ -11743,9 +11764,9 @@ dependencies = [ [[package]] name = "toml" -version = "0.8.19" +version = "0.8.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1ed1f98e3fdc28d6d910e6737ae6ab1a93bf1985935a1193e68f93eeb68d24e" +checksum = "cd87a5cdd6ffab733b2f74bc4fd7ee5fff6634124999ac278c35fc78c6120148" dependencies = [ "serde", "serde_spanned", @@ -11764,11 +11785,11 @@ dependencies = [ [[package]] name = "toml_edit" -version = "0.22.22" +version = "0.22.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ae48d6208a266e853d946088ed816055e556cc6028c5e8e2b84d9fa5dd7c7f5" +checksum = "17b4795ff5edd201c7cd6dca065ae59972ce77d1b80fa0a84d94950ece7d1474" dependencies = [ - "indexmap 2.7.0", + "indexmap 2.7.1", "serde", "serde_spanned", "toml_datetime", @@ -11819,7 +11840,7 @@ checksum = "403fa3b783d4b626a8ad51d766ab03cb6d2dbfc46b1c5d4448395e6628dc9697" dependencies = [ "async-compression", "base64 0.22.1", - "bitflags 2.7.0", + "bitflags 2.8.0", "bytes", "futures-core", "futures-util", @@ -11886,7 +11907,7 @@ checksum = "395ae124c09f9e6918a2310af6038fba074bcf474ac352496d5910dd59a2226d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.98", ] [[package]] @@ -12088,9 +12109,9 @@ checksum = "75b844d17643ee918803943289730bec8aac480150456169e647ed0b576ba539" [[package]] name = "unicode-ident" -version = "1.0.14" +version = "1.0.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adb9e6ca4f869e1180728b7950e35922a7fc6397f7b641499e8f3ef06e50dc83" +checksum = "a210d160f08b701c8721ba1c726c11662f877ea6b7094007e1ca9a1041945034" [[package]] name = "unicode-segmentation" @@ -12187,18 +12208,18 @@ checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" [[package]] name = "uuid" -version = "1.11.1" +version = "1.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b913a3b5fe84142e269d63cc62b64319ccaf89b748fc31fe025177f767a756c4" +checksum = "ced87ca4be083373936a67f8de945faa23b6b42384bd5b64434850802c6dccd0" dependencies = [ - "getrandom 0.2.15", + "getrandom 0.3.1", ] [[package]] name = "valuable" -version = "0.1.0" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" +checksum = "ba73ea9cf16a25df0c8caa16c51acb937d5712a8429db78a3ee29d5dcacd3a65" [[package]] name = "vcpkg" @@ -12234,14 +12255,14 @@ checksum = "d674d135b4a8c1d7e813e2f8d1c9a58308aee4a680323066025e53132218bd91" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.98", ] [[package]] name = "wait-timeout" -version = "0.2.0" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f200f5b12eb75f8c1ed65abd4b2db8a6e1b138a20de009dacee265a2498f3f6" +checksum = "09ac3b126d3914f9849036f826e054cbabdc8519970b8998ddaf3b5bd3c65f11" dependencies = [ "libc", ] @@ -12283,36 +12304,46 @@ version = "0.11.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" +[[package]] +name = "wasi" +version = "0.13.3+wasi-0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26816d2e1a4a36a2940b96c5296ce403917633dff8f3440e9b236ed6f6bacad2" +dependencies = [ + "wit-bindgen-rt", +] + [[package]] name = "wasm-bindgen" -version = "0.2.99" +version = "0.2.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a474f6281d1d70c17ae7aa6a613c87fce69a127e2624002df63dcb39d6cf6396" +checksum = "1edc8929d7499fc4e8f0be2262a241556cfc54a0bea223790e71446f2aab1ef5" dependencies = [ "cfg-if", "once_cell", + "rustversion", "wasm-bindgen-macro", ] [[package]] name = "wasm-bindgen-backend" -version = "0.2.99" +version = "0.2.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f89bb38646b4f81674e8f5c3fb81b562be1fd936d84320f3264486418519c79" +checksum = "2f0a0651a5c2bc21487bde11ee802ccaf4c51935d0d3d42a6101f98161700bc6" dependencies = [ "bumpalo", "log", "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.98", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.49" +version = "0.4.50" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38176d9b44ea84e9184eff0bc34cc167ed044f816accfe5922e54d84cf48eca2" +checksum = "555d470ec0bc3bb57890405e5d4322cc9ea83cebb085523ced7be4144dac1e61" dependencies = [ "cfg-if", "js-sys", @@ -12323,9 +12354,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.99" +version = "0.2.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2cc6181fd9a7492eef6fef1f33961e3695e4579b9872a6f7c83aee556666d4fe" +checksum = "7fe63fc6d09ed3792bd0897b314f53de8e16568c2b3f7982f468c0bf9bd0b407" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -12333,22 +12364,25 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.99" +version = "0.2.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30d7a95b763d3c45903ed6c81f156801839e5ee968bb07e534c44df0fcd330c2" +checksum = "8ae87ea40c9f689fc23f209965b6fb8a99ad69aeeb0231408be24920604395de" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.98", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.99" +version = "0.2.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "943aab3fdaaa029a6e0271b35ea10b72b943135afe9bffca82384098ad0e06a6" +checksum = "1a05d73b933a847d6cccdda8f838a22ff101ad9bf93e33684f39c1f5f0eece3d" +dependencies = [ + "unicode-ident", +] [[package]] name = "wasm-streams" @@ -12379,9 +12413,9 @@ dependencies = [ [[package]] name = "web-sys" -version = "0.3.76" +version = "0.3.77" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04dd7223427d52553d3702c004d3b2fe07c148165faa56313cb00211e31c12bc" +checksum = "33b6dd2ef9186f1f2072e409e99cd22a975331a6b3591b12c764e0e55c60d5d2" dependencies = [ "js-sys", "wasm-bindgen", @@ -12399,9 +12433,9 @@ dependencies = [ [[package]] name = "webpki-roots" -version = "0.26.7" +version = "0.26.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d642ff16b7e79272ae451b7322067cdc17cadf68c23264be9d94a32319efe7e" +checksum = "2210b291f7ea53617fbafcc4939f10914214ec15aace5ba62293a668f322c5c9" dependencies = [ "rustls-pki-types", ] @@ -12505,7 +12539,7 @@ checksum = "9107ddc059d5b6fbfbffdfa7a7fe3e22a226def0b2608f72e9d552763d3e1ad7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.98", ] [[package]] @@ -12516,7 +12550,7 @@ checksum = "2bbd5b46c938e506ecbce286b6628a02171d56153ba733b6c741fc627ec9579b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.98", ] [[package]] @@ -12527,7 +12561,7 @@ checksum = "29bee4b38ea3cde66011baa44dba677c432a78593e202392d1e9070cf2a7fca7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.98", ] [[package]] @@ -12538,7 +12572,7 @@ checksum = "053c4c462dc91d3b1504c6fe5a726dd15e216ba718e84a0e46a88fbe5ded3515" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.98", ] [[package]] @@ -12730,9 +12764,9 @@ checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] name = "winnow" -version = "0.6.22" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39281189af81c07ec09db316b302a3e67bf9bd7cbf6c820b50e35fee9c2fa980" +checksum = "59690dea168f2198d1a3b0cac23b8063efcd11012f10ae4698f284808c8ef603" dependencies = [ "memchr", ] @@ -12747,6 +12781,15 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "wit-bindgen-rt" +version = "0.33.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3268f3d866458b787f390cf61f4bbb563b922d091359f9608842999eaee3943c" +dependencies = [ + "bitflags 2.8.0", +] + [[package]] name = "write16" version = "1.0.0" @@ -12813,7 +12856,7 @@ checksum = "2380878cad4ac9aac1e2435f3eb4020e8374b5f13c296cb75b4620ff8e229154" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.98", "synstructure", ] @@ -12824,7 +12867,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" dependencies = [ "byteorder", - "zerocopy-derive", + "zerocopy-derive 0.7.35", +] + +[[package]] +name = "zerocopy" +version = "0.8.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "79386d31a42a4996e3336b0919ddb90f81112af416270cff95b5f5af22b839c2" +dependencies = [ + "zerocopy-derive 0.8.18", ] [[package]] @@ -12835,7 +12887,18 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.98", +] + +[[package]] +name = "zerocopy-derive" +version = "0.8.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76331675d372f91bf8d17e13afbd5fe639200b73d01f0fc748bb059f9cca2db7" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.98", ] [[package]] @@ -12855,7 +12918,7 @@ checksum = "595eed982f7d355beb85837f651fa22e90b3c044842dc7f2c2842c086f295808" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.98", "synstructure", ] @@ -12876,7 +12939,7 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.98", ] [[package]] @@ -12898,7 +12961,7 @@ checksum = "6eafa6dfb17584ea3e2bd6e76e0cc15ad7af12b09abdd1ca55961bed9b1063c6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.98", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 3f647711b21..0b3937574a0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -652,14 +652,14 @@ tracy-client = "0.17.3" async-channel = "2" bitfinity-block-validator = { path = "crates/bitfinity-block-validator" } candid = "0.10" -did = { git = "https://github.com/bitfinity-network/bitfinity-evm-sdk", package = "did", tag = "v0.42.x" } +did = { git = "https://github.com/bitfinity-network/bitfinity-evm-sdk", package = "did", branch= "feat/ephermal-tx" } dirs = "5.0.1" -ethereum-json-rpc-client = { git = "https://github.com/bitfinity-network/bitfinity-evm-sdk", package = "ethereum-json-rpc-client", tag = "v0.42.x", features = [ +ethereum-json-rpc-client = { git = "https://github.com/bitfinity-network/bitfinity-evm-sdk", package = "ethereum-json-rpc-client", branch= "feat/ephermal-tx", features = [ "reqwest", ] } evm-canister-client = { git = "https://github.com/bitfinity-network/bitfinity-evm-sdk", package = "evm-canister-client", features = [ "ic-agent-client", -], tag = "v0.42.x" } +], branch= "feat/ephermal-tx" } ic-cbor = "3" ic-certificate-verification = "3" ic-certification = "3" diff --git a/bin/reth/src/commands/bitfinity_import.rs b/bin/reth/src/commands/bitfinity_import.rs index 744ea9e6b1b..facbb14f1e2 100644 --- a/bin/reth/src/commands/bitfinity_import.rs +++ b/bin/reth/src/commands/bitfinity_import.rs @@ -3,7 +3,10 @@ use crate::{dirs::DataDirPath, version::SHORT_VERSION}; use bitfinity_block_validator::BitfinityBlockValidator; use candid::Principal; -use evm_canister_client::{ic_agent::{identity::AnonymousIdentity, Agent}, EvmCanisterClient, IcAgentClient}; +use evm_canister_client::{ + ic_agent::{identity::AnonymousIdentity, Agent}, + EvmCanisterClient, IcAgentClient, +}; use futures::{Stream, StreamExt}; use lightspeed_scheduler::{job::Job, scheduler::Scheduler, JobExecutor}; use reth_beacon_consensus::EthBeaconConsensus; @@ -20,7 +23,10 @@ use reth_downloaders::{ }; use reth_exex::ExExManagerHandle; use reth_node_api::NodeTypesWithDBAdapter; -use reth_node_core::{args::{BitfinityImportArgs, IC_MAINNET_KEY, IC_MAINNET_URL}, dirs::ChainPath}; +use reth_node_core::{ + args::{BitfinityImportArgs, IC_MAINNET_KEY, IC_MAINNET_URL}, + dirs::ChainPath, +}; use reth_node_ethereum::{EthExecutorProvider, EthereumNode}; use reth_node_events::node::NodeEvent; use reth_primitives::{EthPrimitives, SealedHeader}; @@ -189,7 +195,10 @@ impl BitfinityImportCommand { }; while tip != safe_block { - match self.validate_block(&tip, remote_client.clone(), provider_factory.clone()).await { + match self + .validate_block(&tip, remote_client.clone(), provider_factory.clone()) + .await + { Ok(_) => { self.import_to_block(tip, remote_client, provider_factory, consensus) .await?; @@ -220,7 +229,10 @@ impl BitfinityImportCommand { remote_client: Arc, provider_factory: ProviderFactory>>, ) -> eyre::Result<()> { - let agent = Agent::builder().with_identity(AnonymousIdentity).with_url(self.bitfinity.evm_network.clone()).build()?; + let agent = Agent::builder() + .with_identity(AnonymousIdentity) + .with_url(self.bitfinity.evm_network.clone()) + .build()?; if self.bitfinity.evm_network == IC_MAINNET_URL { let key = hex::decode(IC_MAINNET_KEY)?; agent.set_root_key(key); diff --git a/bin/reth/tests/commands/bitfinity_import_it.rs b/bin/reth/tests/commands/bitfinity_import_it.rs index 951828a274a..fd16930af12 100644 --- a/bin/reth/tests/commands/bitfinity_import_it.rs +++ b/bin/reth/tests/commands/bitfinity_import_it.rs @@ -41,7 +41,8 @@ async fn bitfinity_test_should_import_data_from_evm() { let evm_rpc_client = EthJsonRpcClient::new(ReqwestClient::new(evm_datasource_url.to_string())); - let remote_block = evm_rpc_client.get_block_by_number(end_block.into()).await.unwrap().unwrap(); + let remote_block = + evm_rpc_client.get_block_by_number(end_block.into()).await.unwrap(); let local_block = provider.block_by_number(end_block).unwrap().unwrap(); assert_eq!(remote_block.hash.0, local_block.header.hash_slow().0); @@ -73,7 +74,7 @@ async fn bitfinity_test_should_import_with_small_batch_size() { let evm_rpc_client = EthJsonRpcClient::new(ReqwestClient::new(evm_datasource_url.to_string())); - let remote_block = evm_rpc_client.get_block_by_number(end_block.into()).await.unwrap().unwrap(); + let remote_block = evm_rpc_client.get_block_by_number(end_block.into()).await.unwrap(); let local_block = provider.block_by_number(end_block).unwrap().unwrap(); assert_eq!(remote_block.hash.0, local_block.header.hash_slow().0); @@ -135,7 +136,7 @@ async fn bitfinity_test_should_import_data_from_evm_with_backup_rpc_url() { // create evm client let evm_rpc_client = EthJsonRpcClient::new(ReqwestClient::new(backup_rpc_url.to_string())); - let remote_block = evm_rpc_client.get_block_by_number(end_block.into()).await.unwrap().unwrap(); + let remote_block = evm_rpc_client.get_block_by_number(end_block.into()).await.unwrap(); let local_block = provider.block_by_number(end_block).unwrap().unwrap(); assert_eq!(remote_block.hash.0, local_block.header.hash_slow().0); diff --git a/crates/bitfinity-block-validator/Cargo.toml b/crates/bitfinity-block-validator/Cargo.toml index 6f07d4de888..1515df683ab 100644 --- a/crates/bitfinity-block-validator/Cargo.toml +++ b/crates/bitfinity-block-validator/Cargo.toml @@ -25,7 +25,7 @@ reth-engine-tree.workspace = true reth-evm.workspace = true reth-evm-ethereum.workspace = true reth-node-types.workspace = true -reth-provider.workspace = true +reth-provider = { workspace = true, features = ["test-utils"] } reth-primitives.workspace = true reth-primitives-traits.workspace = true reth-revm.workspace = true @@ -46,3 +46,5 @@ reth-db-common.workspace = true tokio.workspace = true serde.workspace = true tempfile.workspace = true +reth-testing-utils.workspace = true +reth-ethereum-engine-primitives.workspace = true diff --git a/crates/bitfinity-block-validator/src/lib.rs b/crates/bitfinity-block-validator/src/lib.rs index 54725bb7c6f..64715d7d75d 100644 --- a/crates/bitfinity-block-validator/src/lib.rs +++ b/crates/bitfinity-block-validator/src/lib.rs @@ -1,5 +1,5 @@ //! Bitfinity block validator. -use alloy_primitives::{Address, B256, U256}; +use alloy_primitives::TxKind; use did::BlockConfirmationData; use evm_canister_client::{CanisterClient, EvmCanisterClient}; use eyre::Ok; @@ -13,22 +13,20 @@ use reth_evm_ethereum::{ }; use reth_node_types::NodeTypesWithDB; use reth_primitives::{Block, BlockWithSenders}; +use reth_provider::StateRootProvider; use reth_provider::{ - providers::ProviderNodeTypes, ChainSpecProvider as _, ExecutionOutcome, - HashedPostStateProvider as _, LatestStateProviderRef, ProviderFactory, + providers::ProviderNodeTypes, ChainSpecProvider as _, ExecutionOutcome, ProviderFactory, }; -use reth_provider::{BlockNumReader, DatabaseProviderFactory, HeaderProvider, StateRootProvider}; -use reth_revm::db::CacheDB; -use reth_revm::primitives::{BlockEnv, CfgEnvWithHandlerCfg, Env, EnvWithHandlerCfg, TxEnv}; +use reth_revm::db::states::bundle_state::BundleRetention; + +use reth_revm::primitives::{EnvWithHandlerCfg, TxEnv}; use reth_revm::{batch::BlockBatchRecord, database::StateProviderDatabase}; -use reth_revm::{CacheState, DatabaseCommit, Evm, StateBuilder}; +use reth_revm::{DatabaseCommit, StateBuilder}; use reth_rpc_eth_types::cache::db::StateProviderTraitObjWrapper; use reth_rpc_eth_types::StateCacheDb; use reth_trie::{HashedPostState, KeccakKeyHasher}; -use reth_trie::{KeyHasher, StateRoot}; -use reth_trie_db::DatabaseStateRoot; + use std::collections::HashSet; -use std::sync::Arc; /// Block validator for Bitfinity. /// @@ -78,10 +76,9 @@ where &self, confirmation_data: BlockConfirmationData, ) -> eyre::Result<()> { - match self.evm_client.confirm_block(confirmation_data).await? { - Ok(_) => Ok(()), - Err(err) => Err(eyre::eyre!("{err}")), - } + self.evm_client.confirm_block(confirmation_data).await??; + + Ok(()) } /// Calculates confirmation data for a block based on execution result. @@ -96,7 +93,7 @@ where state_root: block.state_root.into(), transactions_root: block.transactions_root.into(), receipts_root: block.receipts_root.into(), - proof_of_work: self.calculate_pow_hash(&block, execution_result)?, + proof_of_work: self.compute_pow_hash(&block, execution_result)?, }) } @@ -105,10 +102,9 @@ where let executor = self.executor(); let blocks_with_senders: Vec<_> = blocks.iter().map(Self::convert_block).collect(); - match executor.execute_and_verify_batch(&blocks_with_senders) { - Ok(output) => Ok(output), - Err(err) => Err(eyre::eyre!("Failed to execute blocks: {err:?}")), - } + let output = executor.execute_and_verify_batch(&blocks_with_senders)?; + + Ok(output) } /// Convert [`Block`] to [`BlockWithSenders`]. @@ -144,7 +140,7 @@ where } /// Calculates POW hash - fn calculate_pow_hash( + fn compute_pow_hash( &self, block: &Block, execution_result: ExecutionOutcome, @@ -168,15 +164,20 @@ where evm_config.cfg_and_block_env(&block.header); cfg_env_with_handler_cfg.cfg_env.disable_balance_check = true; - + let base_fee = block.base_fee_per_gas; + let pow_tx = did::utils::pow_transaction(base_fee.map(Into::into)); // Simple transaction + let to = match pow_tx.to { + Some(to) => TxKind::Call(to.0), + None => TxKind::Create, + }; let tx = TxEnv { - caller: Address::from_slice(&[1]), - gas_limit: 21000, - gas_price: U256::from(1), - transact_to: alloy_primitives::TxKind::Call(Address::from_slice(&[2; 20])), - value: U256::from(1), - nonce: Some(0), + caller: pow_tx.from.into(), + gas_limit: pow_tx.gas.0.to(), + gas_price: pow_tx.gas_price.unwrap_or_default().0, + transact_to: to, + value: pow_tx.value.0, + nonce: Some(pow_tx.nonce.0.to()), ..Default::default() }; @@ -188,10 +189,11 @@ where ); let res = evm.transact()?; + evm.db_mut().commit(res.state); assert!(res.result.is_success()); } - + state.merge_transitions(BundleRetention::PlainState); let bundle = state.take_bundle(); let post_hashed_state = @@ -202,3 +204,139 @@ where Ok(state_root.into()) } } + +#[cfg(test)] +mod tests { + + use std::sync::Arc; + + use candid::Principal; + + use evm_canister_client::{EvmCanisterClient, IcCanisterClient}; + use reth_chain_state::test_utils::TestBlockBuilder; + use reth_chainspec::ChainSpec; + use reth_db::test_utils::TempDatabase; + use reth_db::DatabaseEnv; + use reth_db_common::init::init_genesis; + use reth_ethereum_engine_primitives::EthEngineTypes; + + use reth_node_types::{AnyNodeTypesWithEngine, NodeTypesWithDBAdapter}; + use reth_primitives::{EthPrimitives, SealedBlockWithSenders}; + use reth_provider::test_utils::create_test_provider_factory; + use reth_provider::{ + BlockReader, BlockWriter, DatabaseProviderFactory, EthStorage, StorageLocation, + TransactionVariant, + }; + use reth_revm::primitives::KECCAK_EMPTY; + use reth_testing_utils::generators::{self, random_block, BlockParams}; + use reth_trie::StateRoot; + use reth_trie_db::{DatabaseStateRoot, MerklePatriciaTrie}; + + use super::*; + + // Common test setup function to initialize the test environment. + fn setup_test_block_validator() -> ( + BitfinityBlockValidator< + IcCanisterClient, + NodeTypesWithDBAdapter< + AnyNodeTypesWithEngine< + EthPrimitives, + EthEngineTypes, + ChainSpec, + MerklePatriciaTrie, + EthStorage, + >, + Arc>, + >, + >, + SealedBlockWithSenders, + ) { + let provider_factory = create_test_provider_factory(); + let genesis_hash = init_genesis(&provider_factory).unwrap(); + let genesis_block = provider_factory + .sealed_block_with_senders(genesis_hash.into(), TransactionVariant::NoHash) + .unwrap() + .ok_or_else(|| eyre::eyre!("genesis block not found")) + .unwrap(); + + // Insert genesis block into the underlying database. + let provider_rw = provider_factory.database_provider_rw().unwrap(); + provider_rw.insert_block(genesis_block.clone(), StorageLocation::Database).unwrap(); + provider_rw.commit().unwrap(); + + let canister_client = EvmCanisterClient::new(IcCanisterClient::new(Principal::anonymous())); + let block_validator = + BitfinityBlockValidator::new(canister_client, provider_factory.clone()); + + (block_validator, genesis_block) + } + + #[tokio::test] + async fn test_execute_and_calculate_pow_with_empty_execution() { + let mut rng = generators::rng(); + let (block_validator, genesis_block) = setup_test_block_validator(); + + let block1 = { + // Create a test block based on genesis. + let test_block = random_block( + &mut rng, + genesis_block.number + 1, + BlockParams { + parent: Some(genesis_block.hash_slow()), + tx_count: Some(10), + ..Default::default() + }, + ) + .seal_with_senders::() + .unwrap() + .unseal(); + + //Insert the test block into the database. + let provider_rw = block_validator.provider_factory.database_provider_rw().unwrap(); + provider_rw + .insert_block(test_block.clone().seal_slow(), StorageLocation::Database) + .unwrap(); + provider_rw.commit().unwrap(); + + test_block + }; + + let original_state = + StateRoot::from_tx(block_validator.provider_factory.provider().unwrap().tx_ref()) + .root() + .unwrap(); + println!("Original state: {:?}", original_state); + // Calculate the POW hash. + let pow = block_validator.compute_pow_hash(&block1, ExecutionOutcome::default()).unwrap(); + println!("POW: {:?}", pow); + assert_ne!(pow.0, KECCAK_EMPTY, "Proof of work hash should not be empty"); + + assert_ne!(original_state, pow.0, "State should change after POW calculation"); + + let new_state = + StateRoot::from_tx(block_validator.provider_factory.provider().unwrap().tx_ref()) + .root() + .unwrap(); + + assert_eq!(original_state, new_state, "State should not change after POW calculation"); + } + + #[tokio::test] + async fn test_pow_hash_with_execution_outcome() { + let (block_validator, genesis_block) = setup_test_block_validator(); + + let mut block_builder = TestBlockBuilder::eth(); + let block = block_builder + .get_executed_block_with_number(genesis_block.number + 1, genesis_block.hash_slow()); + + let outcome = block.execution_outcome(); + let block = + block.block().clone().seal_with_senders::().unwrap().unseal(); + + let pow_res = block_validator.compute_pow_hash(&block.block, outcome.clone()); + + assert!(pow_res.is_ok()); + + assert_ne!(pow_res.unwrap().0, KECCAK_EMPTY, "Proof of work hash should not be empty"); + } +} diff --git a/crates/net/downloaders/src/bitfinity_evm_client.rs b/crates/net/downloaders/src/bitfinity_evm_client.rs index a3548d2c0cb..4703b117c65 100644 --- a/crates/net/downloaders/src/bitfinity_evm_client.rs +++ b/crates/net/downloaders/src/bitfinity_evm_client.rs @@ -152,7 +152,6 @@ impl BitfinityEvmClient { .map_err(|e| { RemoteClientError::ProviderError(format!("error getting safe block: {e}")) })? - .ok_or_else(|| RemoteClientError::ProviderError("block not found".to_string()))? .number .into(); @@ -352,8 +351,7 @@ impl BitfinityEvmClient { let genesis_block = client .get_block_by_number(0.into()) .await - .map_err(|e| eyre::eyre!("error getting genesis block: {}", e))? - .ok_or_else(|| eyre::eyre!("genesis block not found"))?; + .map_err(|e| eyre::eyre!("error getting genesis block: {}", e))?; let genesis_accounts = client.get_genesis_balances().await.map_err(|e| eyre::eyre!(e))?.into_iter().map( @@ -450,8 +448,7 @@ impl BitfinityEvmClient { let last_block = client .get_block_by_number(did::BlockNumber::Latest) .await - .map_err(|e| eyre::eyre!("error getting block number: {}", e))? - .ok_or_eyre("latest block not found")?; + .map_err(|e| eyre::eyre!("error getting block number: {}", e))?; let block_ts = last_block.timestamp.0.to::(); From d8a99c43c6d0917ffa19e329b5216ce61826cb38 Mon Sep 17 00:00:00 2001 From: Yasir Date: Mon, 17 Feb 2025 15:12:41 +0300 Subject: [PATCH 15/38] Add deterministic and state independence tests for POW hash computation --- crates/bitfinity-block-validator/src/lib.rs | 53 +++++++++++++++++++++ 1 file changed, 53 insertions(+) diff --git a/crates/bitfinity-block-validator/src/lib.rs b/crates/bitfinity-block-validator/src/lib.rs index 64715d7d75d..e5c627655a0 100644 --- a/crates/bitfinity-block-validator/src/lib.rs +++ b/crates/bitfinity-block-validator/src/lib.rs @@ -339,4 +339,57 @@ mod tests { assert_ne!(pow_res.unwrap().0, KECCAK_EMPTY, "Proof of work hash should not be empty"); } + + #[tokio::test] + async fn test_pow_hash_deterministic() { + let (block_validator, genesis_block) = setup_test_block_validator(); + let mut block_builder = TestBlockBuilder::eth(); + let block = block_builder + .get_executed_block_with_number(genesis_block.number + 1, genesis_block.hash_slow()); + + let outcome = block.execution_outcome(); + let block = + block.block().clone().seal_with_senders::().unwrap().unseal(); + + // Compute POW hash twice with the same input + let pow1 = block_validator.compute_pow_hash(&block.block, outcome.clone()).unwrap(); + let pow2 = block_validator.compute_pow_hash(&block.block, outcome.clone()).unwrap(); + + // Results should be deterministic + assert_eq!(pow1, pow2, "POW hash computation should be deterministic"); + } + + #[tokio::test] + async fn test_pow_hash_state_independence() { + let (block_validator, genesis_block) = setup_test_block_validator(); + let mut block_builder = TestBlockBuilder::eth(); + let block = block_builder + .get_executed_block_with_number(genesis_block.number + 1, genesis_block.hash_slow()); + + let outcome = block.execution_outcome(); + let block = + block.block().clone().seal_with_senders::().unwrap().unseal(); + + // Get initial state + let initial_state = + StateRoot::from_tx(block_validator.provider_factory.provider().unwrap().tx_ref()) + .root() + .unwrap(); + + // Compute POW multiple times + for _ in 0..3 { + let _ = block_validator.compute_pow_hash(&block.block, outcome.clone()).unwrap(); + + // Check state after each computation + let current_state = + StateRoot::from_tx(block_validator.provider_factory.provider().unwrap().tx_ref()) + .root() + .unwrap(); + + assert_eq!( + initial_state, current_state, + "State should remain unchanged after POW computation" + ); + } + } } From 8b06d8f9c9e12b961031a18e41f2ce2b2a148807 Mon Sep 17 00:00:00 2001 From: Yasir Date: Mon, 17 Feb 2025 15:14:01 +0300 Subject: [PATCH 16/38] Remove debug print statements from POW hash computation test --- crates/bitfinity-block-validator/src/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/bitfinity-block-validator/src/lib.rs b/crates/bitfinity-block-validator/src/lib.rs index e5c627655a0..50afcd978d9 100644 --- a/crates/bitfinity-block-validator/src/lib.rs +++ b/crates/bitfinity-block-validator/src/lib.rs @@ -305,10 +305,10 @@ mod tests { StateRoot::from_tx(block_validator.provider_factory.provider().unwrap().tx_ref()) .root() .unwrap(); - println!("Original state: {:?}", original_state); + // Calculate the POW hash. let pow = block_validator.compute_pow_hash(&block1, ExecutionOutcome::default()).unwrap(); - println!("POW: {:?}", pow); + assert_ne!(pow.0, KECCAK_EMPTY, "Proof of work hash should not be empty"); assert_ne!(original_state, pow.0, "State should change after POW calculation"); From a78a338668f9f4b800b5329688260043aa2af7c9 Mon Sep 17 00:00:00 2001 From: Yasir Date: Thu, 20 Feb 2025 11:12:28 +0300 Subject: [PATCH 17/38] update cargo --- Cargo.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index a2ee0741268..a36953a3710 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2808,7 +2808,7 @@ dependencies = [ [[package]] name = "did" version = "0.42.0" -source = "git+https://github.com/bitfinity-network/bitfinity-evm-sdk?branch=EPROD-1132_block_validation#f2f6650129275cabe67df0743cf344f1752e8e30" +source = "git+https://github.com/bitfinity-network/bitfinity-evm-sdk?branch=feat/ephermal-tx#49ec54d7298472f7617733af6deb9d486f453acb" dependencies = [ "alloy", "bincode", @@ -3163,7 +3163,7 @@ dependencies = [ [[package]] name = "ethereum-json-rpc-client" version = "0.42.0" -source = "git+https://github.com/bitfinity-network/bitfinity-evm-sdk?branch=EPROD-1132_block_validation#f2f6650129275cabe67df0743cf344f1752e8e30" +source = "git+https://github.com/bitfinity-network/bitfinity-evm-sdk?branch=feat/ephermal-tx#49ec54d7298472f7617733af6deb9d486f453acb" dependencies = [ "alloy", "anyhow", @@ -3249,7 +3249,7 @@ dependencies = [ [[package]] name = "evm-canister-client" version = "0.42.0" -source = "git+https://github.com/bitfinity-network/bitfinity-evm-sdk?branch=EPROD-1132_block_validation#f2f6650129275cabe67df0743cf344f1752e8e30" +source = "git+https://github.com/bitfinity-network/bitfinity-evm-sdk?branch=feat/ephermal-tx#49ec54d7298472f7617733af6deb9d486f453acb" dependencies = [ "candid", "did", From 393bd1b334be5299d4521c8b30beb91cf72deb93 Mon Sep 17 00:00:00 2001 From: Yasir Date: Thu, 20 Feb 2025 11:20:35 +0300 Subject: [PATCH 18/38] fix: merge conflicts --- .../bitfinity-block-confirmation/src/lib.rs | 31 ++++++++++--------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/crates/bitfinity-block-confirmation/src/lib.rs b/crates/bitfinity-block-confirmation/src/lib.rs index 1112ac261cb..7ee938d6845 100644 --- a/crates/bitfinity-block-confirmation/src/lib.rs +++ b/crates/bitfinity-block-confirmation/src/lib.rs @@ -1,7 +1,9 @@ //! Bitfinity block validator. use alloy_primitives::TxKind; -use did::BlockConfirmationData; -use evm_canister_client::{CanisterClient, EvmCanisterClient}; +use did::{BlockConfirmationData, BlockConfirmationResult}; +use ethereum_json_rpc_client::{Client, EthJsonRpcClient}; + +use eyre::eyre; use eyre::Ok; use reth_chain_state::MemoryOverlayStateProvider; use reth_evm::env::EvmEnv; @@ -77,7 +79,12 @@ where &self, confirmation_data: BlockConfirmationData, ) -> eyre::Result<()> { - match self.evm_client.send_confirm_block(confirmation_data).await.map_err(|e| eyre!("{e}"))? { + match self + .evm_client + .send_confirm_block(confirmation_data) + .await + .map_err(|e| eyre!("{e}"))? + { BlockConfirmationResult::NotConfirmed => Err(eyre!("confirmation request rejected")), _ => Ok(()), } @@ -167,7 +174,7 @@ where cfg_env_with_handler_cfg.cfg_env.disable_balance_check = true; let base_fee = block.base_fee_per_gas; - let pow_tx = did::utils::pow_transaction(base_fee.map(Into::into)); + let pow_tx = did::utils::block_confirmation_pow_transaction(base_fee.map(Into::into)); // Simple transaction let to = match pow_tx.to { Some(to) => TxKind::Call(to.0), @@ -209,18 +216,14 @@ where #[cfg(test)] mod tests { - - use std::sync::Arc; - - use candid::Principal; - - use evm_canister_client::{EvmCanisterClient, IcCanisterClient}; + use ethereum_json_rpc_client::reqwest::ReqwestClient; use reth_chain_state::test_utils::TestBlockBuilder; use reth_chainspec::ChainSpec; use reth_db::test_utils::TempDatabase; use reth_db::DatabaseEnv; use reth_db_common::init::init_genesis; use reth_ethereum_engine_primitives::EthEngineTypes; + use std::sync::Arc; use reth_node_types::{AnyNodeTypesWithEngine, NodeTypesWithDBAdapter}; use reth_primitives::{EthPrimitives, SealedBlockWithSenders}; @@ -238,8 +241,8 @@ mod tests { // Common test setup function to initialize the test environment. fn setup_test_block_validator() -> ( - BitfinityBlockValidator< - IcCanisterClient, + BitfinityBlockConfirmation< + ReqwestClient, NodeTypesWithDBAdapter< AnyNodeTypesWithEngine< EthPrimitives, @@ -266,9 +269,9 @@ mod tests { provider_rw.insert_block(genesis_block.clone(), StorageLocation::Database).unwrap(); provider_rw.commit().unwrap(); - let canister_client = EvmCanisterClient::new(IcCanisterClient::new(Principal::anonymous())); + let canister_client = EthJsonRpcClient::new(ReqwestClient::new("".to_string())); let block_validator = - BitfinityBlockValidator::new(canister_client, provider_factory.clone()); + BitfinityBlockConfirmation::new(canister_client, provider_factory.clone()); (block_validator, genesis_block) } From df7381fee7f961a81f5203307f84c44885a02d62 Mon Sep 17 00:00:00 2001 From: Francesco Date: Thu, 20 Feb 2025 11:27:08 +0100 Subject: [PATCH 19/38] use EPROD-1132 dependencies --- Cargo.lock | 12 ++++++------ Cargo.toml | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index a36953a3710..17b65c37cfb 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2807,8 +2807,8 @@ dependencies = [ [[package]] name = "did" -version = "0.42.0" -source = "git+https://github.com/bitfinity-network/bitfinity-evm-sdk?branch=feat/ephermal-tx#49ec54d7298472f7617733af6deb9d486f453acb" +version = "0.43.0" +source = "git+https://github.com/bitfinity-network/bitfinity-evm-sdk?branch=EPROD-1132_block_validation#11347d854dafeb21273870b5ae8a031eb21bb39e" dependencies = [ "alloy", "bincode", @@ -3162,8 +3162,8 @@ dependencies = [ [[package]] name = "ethereum-json-rpc-client" -version = "0.42.0" -source = "git+https://github.com/bitfinity-network/bitfinity-evm-sdk?branch=feat/ephermal-tx#49ec54d7298472f7617733af6deb9d486f453acb" +version = "0.43.0" +source = "git+https://github.com/bitfinity-network/bitfinity-evm-sdk?branch=EPROD-1132_block_validation#11347d854dafeb21273870b5ae8a031eb21bb39e" dependencies = [ "alloy", "anyhow", @@ -3248,8 +3248,8 @@ dependencies = [ [[package]] name = "evm-canister-client" -version = "0.42.0" -source = "git+https://github.com/bitfinity-network/bitfinity-evm-sdk?branch=feat/ephermal-tx#49ec54d7298472f7617733af6deb9d486f453acb" +version = "0.43.0" +source = "git+https://github.com/bitfinity-network/bitfinity-evm-sdk?branch=EPROD-1132_block_validation#11347d854dafeb21273870b5ae8a031eb21bb39e" dependencies = [ "candid", "did", diff --git a/Cargo.toml b/Cargo.toml index 383adcce0a0..9ad30f54d4c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -652,14 +652,14 @@ tracy-client = "0.17.3" async-channel = "2" bitfinity-block-confirmation = { path = "crates/bitfinity-block-confirmation" } candid = "0.10" -did = { git = "https://github.com/bitfinity-network/bitfinity-evm-sdk", package = "did", branch= "feat/ephermal-tx" } +did = { git = "https://github.com/bitfinity-network/bitfinity-evm-sdk", package = "did", branch= "EPROD-1132_block_validation" } dirs = "5.0.1" -ethereum-json-rpc-client = { git = "https://github.com/bitfinity-network/bitfinity-evm-sdk", package = "ethereum-json-rpc-client", branch= "feat/ephermal-tx", features = [ +ethereum-json-rpc-client = { git = "https://github.com/bitfinity-network/bitfinity-evm-sdk", package = "ethereum-json-rpc-client", branch= "EPROD-1132_block_validation", features = [ "reqwest", ] } evm-canister-client = { git = "https://github.com/bitfinity-network/bitfinity-evm-sdk", package = "evm-canister-client", features = [ "ic-agent-client", -], branch= "feat/ephermal-tx" } +], branch= "EPROD-1132_block_validation" } ic-cbor = "3" ic-certificate-verification = "3" ic-certification = "3" From 508efa55f36f51cae1bfe3a6f59c2c2b1927db24 Mon Sep 17 00:00:00 2001 From: Yasir Date: Fri, 28 Feb 2025 10:37:55 +0300 Subject: [PATCH 20/38] chore: update dependencies in Cargo.toml and Cargo.lock --- Cargo.lock | 121 +---------------- Cargo.toml | 8 +- .../bitfinity-block-confirmation/Cargo.toml | 3 + .../bitfinity-block-confirmation/src/lib.rs | 128 +++++++++++++++--- 4 files changed, 122 insertions(+), 138 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 17b65c37cfb..733c92f5ad2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -113,13 +113,9 @@ dependencies = [ "alloy-consensus", "alloy-core", "alloy-eips", - "alloy-genesis", "alloy-network", - "alloy-provider", - "alloy-rpc-client", "alloy-rpc-types", "alloy-serde", - "alloy-transport-http", ] [[package]] @@ -198,11 +194,8 @@ version = "0.8.21" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "482f377cebceed4bb1fb5e7970f0805e2ab123d06701be9351b67ed6341e74aa" dependencies = [ - "alloy-dyn-abi", - "alloy-json-abi", "alloy-primitives", "alloy-rlp", - "alloy-sol-types", ] [[package]] @@ -1465,6 +1458,7 @@ dependencies = [ "alloy-primitives", "alloy-signer", "alloy-signer-local", + "anyhow", "async-trait", "candid", "did", @@ -1472,6 +1466,7 @@ dependencies = [ "evm-canister-client", "eyre", "itertools 0.13.0", + "jsonrpc-core", "reth-chain-state", "reth-chainspec", "reth-db", @@ -1490,6 +1485,7 @@ dependencies = [ "reth-trie", "reth-trie-db", "serde", + "serde_json", "tempfile", "tokio", "tracing", @@ -2808,7 +2804,7 @@ dependencies = [ [[package]] name = "did" version = "0.43.0" -source = "git+https://github.com/bitfinity-network/bitfinity-evm-sdk?branch=EPROD-1132_block_validation#11347d854dafeb21273870b5ae8a031eb21bb39e" +source = "git+https://github.com/bitfinity-network/bitfinity-evm-sdk?branch=EPROD-1132_block_validation#5a78caa97432afef74674d3f2cdc8a13fed5ee8f" dependencies = [ "alloy", "bincode", @@ -3163,7 +3159,7 @@ dependencies = [ [[package]] name = "ethereum-json-rpc-client" version = "0.43.0" -source = "git+https://github.com/bitfinity-network/bitfinity-evm-sdk?branch=EPROD-1132_block_validation#11347d854dafeb21273870b5ae8a031eb21bb39e" +source = "git+https://github.com/bitfinity-network/bitfinity-evm-sdk?branch=EPROD-1132_block_validation#5a78caa97432afef74674d3f2cdc8a13fed5ee8f" dependencies = [ "alloy", "anyhow", @@ -3249,7 +3245,7 @@ dependencies = [ [[package]] name = "evm-canister-client" version = "0.43.0" -source = "git+https://github.com/bitfinity-network/bitfinity-evm-sdk?branch=EPROD-1132_block_validation#11347d854dafeb21273870b5ae8a031eb21bb39e" +source = "git+https://github.com/bitfinity-network/bitfinity-evm-sdk?branch=EPROD-1132_block_validation#5a78caa97432afef74674d3f2cdc8a13fed5ee8f" dependencies = [ "candid", "did", @@ -3711,21 +3707,6 @@ version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a0d2fde1f7b3d48b8395d5f2de76c18a528bd6a9cdde438df747bfcba3e05d6f" -[[package]] -name = "foreign-types" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" -dependencies = [ - "foreign-types-shared", -] - -[[package]] -name = "foreign-types-shared" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" - [[package]] name = "form_urlencoded" version = "1.2.1" @@ -4364,22 +4345,6 @@ dependencies = [ "webpki-roots", ] -[[package]] -name = "hyper-tls" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0" -dependencies = [ - "bytes", - "http-body-util", - "hyper", - "hyper-util", - "native-tls", - "tokio", - "tokio-native-tls", - "tower-service", -] - [[package]] name = "hyper-util" version = "0.1.10" @@ -5912,23 +5877,6 @@ dependencies = [ "unsigned-varint", ] -[[package]] -name = "native-tls" -version = "0.2.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0dab59f8e050d5df8e4dd87d9206fb6f65a483e20ac9fda365ade4fab353196c" -dependencies = [ - "libc", - "log", - "openssl", - "openssl-probe", - "openssl-sys", - "schannel", - "security-framework 2.11.1", - "security-framework-sys", - "tempfile", -] - [[package]] name = "nix" version = "0.26.4" @@ -6213,50 +6161,12 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c08d65885ee38876c4f86fa503fb49d7b507c2b62552df7c70b2fce627e06381" -[[package]] -name = "openssl" -version = "0.10.71" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e14130c6a98cd258fdcb0fb6d744152343ff729cbfcb28c656a9d12b999fbcd" -dependencies = [ - "bitflags 2.8.0", - "cfg-if", - "foreign-types", - "libc", - "once_cell", - "openssl-macros", - "openssl-sys", -] - -[[package]] -name = "openssl-macros" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.98", -] - [[package]] name = "openssl-probe" version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d05e27ee213611ffe7d6348b942e8f942b37114c00cc03cec254295a4a17852e" -[[package]] -name = "openssl-sys" -version = "0.9.106" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8bb61ea9811cc39e3c2069f40b8b8e2e70d8569b361f879786cc7ed48b777cdd" -dependencies = [ - "cc", - "libc", - "pkg-config", - "vcpkg", -] - [[package]] name = "option-ext" version = "0.2.0" @@ -7213,13 +7123,11 @@ dependencies = [ "http-body-util", "hyper", "hyper-rustls", - "hyper-tls", "hyper-util", "ipnet", "js-sys", "log", "mime", - "native-tls", "once_cell", "percent-encoding", "pin-project-lite", @@ -7233,7 +7141,6 @@ dependencies = [ "serde_urlencoded", "sync_wrapper", "tokio", - "tokio-native-tls", "tokio-rustls", "tokio-util", "tower 0.5.2", @@ -11702,16 +11609,6 @@ dependencies = [ "syn 2.0.98", ] -[[package]] -name = "tokio-native-tls" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" -dependencies = [ - "native-tls", - "tokio", -] - [[package]] name = "tokio-rustls" version = "0.26.1" @@ -12224,12 +12121,6 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ba73ea9cf16a25df0c8caa16c51acb937d5712a8429db78a3ee29d5dcacd3a65" -[[package]] -name = "vcpkg" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" - [[package]] name = "vergen" version = "8.3.2" diff --git a/Cargo.toml b/Cargo.toml index 9ad30f54d4c..42aa5bafcc1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -652,16 +652,18 @@ tracy-client = "0.17.3" async-channel = "2" bitfinity-block-confirmation = { path = "crates/bitfinity-block-confirmation" } candid = "0.10" -did = { git = "https://github.com/bitfinity-network/bitfinity-evm-sdk", package = "did", branch= "EPROD-1132_block_validation" } +did = { git = "https://github.com/bitfinity-network/bitfinity-evm-sdk", package = "did", branch = "EPROD-1132_block_validation" } dirs = "5.0.1" -ethereum-json-rpc-client = { git = "https://github.com/bitfinity-network/bitfinity-evm-sdk", package = "ethereum-json-rpc-client", branch= "EPROD-1132_block_validation", features = [ +ethereum-json-rpc-client = { git = "https://github.com/bitfinity-network/bitfinity-evm-sdk", package = "ethereum-json-rpc-client", branch = "EPROD-1132_block_validation", features = [ "reqwest", ] } evm-canister-client = { git = "https://github.com/bitfinity-network/bitfinity-evm-sdk", package = "evm-canister-client", features = [ "ic-agent-client", -], branch= "EPROD-1132_block_validation" } +], branch = "EPROD-1132_block_validation" } ic-cbor = "3" ic-certificate-verification = "3" ic-certification = "3" hex = "0.4" lightspeed_scheduler = { version = "0.60.0", features = ["tracing"] } +anyhow = "1" +jsonrpc-core = "18.0.0" diff --git a/crates/bitfinity-block-confirmation/Cargo.toml b/crates/bitfinity-block-confirmation/Cargo.toml index 98082755a44..9b0fbac56fd 100644 --- a/crates/bitfinity-block-confirmation/Cargo.toml +++ b/crates/bitfinity-block-confirmation/Cargo.toml @@ -48,3 +48,6 @@ serde.workspace = true tempfile.workspace = true reth-testing-utils.workspace = true reth-ethereum-engine-primitives.workspace = true +anyhow.workspace = true +jsonrpc-core.workspace = true +serde_json.workspace = true diff --git a/crates/bitfinity-block-confirmation/src/lib.rs b/crates/bitfinity-block-confirmation/src/lib.rs index 7ee938d6845..43a973e8063 100644 --- a/crates/bitfinity-block-confirmation/src/lib.rs +++ b/crates/bitfinity-block-confirmation/src/lib.rs @@ -67,7 +67,8 @@ where let execution_result = self.execute_blocks(blocks)?; let last_block = blocks.iter().last().expect("no blocks"); - let confirmation_data = self.calculate_confirmation_data(last_block, execution_result)?; + let confirmation_data = + self.calculate_confirmation_data(last_block, execution_result).await?; self.send_confirmation_request(confirmation_data).await?; @@ -91,18 +92,19 @@ where } /// Calculates confirmation data for a block based on execution result. - fn calculate_confirmation_data( + async fn calculate_confirmation_data( &self, block: &Block, execution_result: ExecutionOutcome, ) -> eyre::Result { + let proof_of_work = self.compute_pow_hash(block, execution_result).await?; Ok(BlockConfirmationData { block_number: block.number, hash: block.hash_slow().into(), state_root: block.state_root.into(), transactions_root: block.transactions_root.into(), receipts_root: block.receipts_root.into(), - proof_of_work: self.compute_pow_hash(&block, execution_result)?, + proof_of_work, }) } @@ -149,7 +151,7 @@ where } /// Calculates POW hash - fn compute_pow_hash( + async fn compute_pow_hash( &self, block: &Block, execution_result: ExecutionOutcome, @@ -169,12 +171,18 @@ where let chain_spec = self.provider_factory.chain_spec(); let evm_config = EthEvmConfig::new(chain_spec); - let EvmEnv { mut cfg_env_with_handler_cfg, block_env } = + let EvmEnv { cfg_env_with_handler_cfg, block_env } = evm_config.cfg_and_block_env(&block.header); - cfg_env_with_handler_cfg.cfg_env.disable_balance_check = true; - let base_fee = block.base_fee_per_gas; - let pow_tx = did::utils::block_confirmation_pow_transaction(base_fee.map(Into::into)); + let base_fee = block.base_fee_per_gas.map(Into::into); + + let genesis_accounts = + self.evm_client.get_genesis_balances().await.map_err(|e| eyre!("{e}"))?; + + let (from, _) = genesis_accounts.first().ok_or_else(|| eyre!("no genesis accounts"))?; + + let pow_tx = did::utils::block_confirmation_pow_transaction(from.clone(), base_fee); + // Simple transaction let to = match pow_tx.to { Some(to) => TxKind::Call(to.0), @@ -216,18 +224,24 @@ where #[cfg(test)] mod tests { - use ethereum_json_rpc_client::reqwest::ReqwestClient; + use alloy_genesis::{Genesis, GenesisAccount}; + use alloy_primitives::Address; + use did::U256; + use jsonrpc_core::{Output, Request, Response, Success, Version}; use reth_chain_state::test_utils::TestBlockBuilder; - use reth_chainspec::ChainSpec; + use reth_chainspec::{Chain, ChainSpec}; use reth_db::test_utils::TempDatabase; use reth_db::DatabaseEnv; use reth_db_common::init::init_genesis; use reth_ethereum_engine_primitives::EthEngineTypes; + use std::collections::BTreeMap; + use std::future::Future; use std::sync::Arc; + use super::*; use reth_node_types::{AnyNodeTypesWithEngine, NodeTypesWithDBAdapter}; use reth_primitives::{EthPrimitives, SealedBlockWithSenders}; - use reth_provider::test_utils::create_test_provider_factory; + use reth_provider::test_utils::create_test_provider_factory_with_chain_spec; use reth_provider::{ BlockReader, BlockWriter, DatabaseProviderFactory, EthStorage, StorageLocation, TransactionVariant, @@ -237,12 +251,40 @@ mod tests { use reth_trie::StateRoot; use reth_trie_db::{DatabaseStateRoot, MerklePatriciaTrie}; - use super::*; + #[derive(Clone)] + struct MockClient { + pub genesis_accounts: Vec<(did::H160, U256)>, + } + + impl MockClient { + fn new(genesis_accounts: Vec<(did::H160, U256)>) -> Self { + Self { genesis_accounts } + } + } + + impl Client for MockClient { + fn send_rpc_request( + &self, + _request: Request, + ) -> std::pin::Pin> + Send>> { + let genesis_accounts = self.genesis_accounts.clone(); + + Box::pin(async move { + let response = Response::Single(Output::Success(Success { + jsonrpc: Some(Version::V2), + result: serde_json::json!(genesis_accounts), + id: jsonrpc_core::Id::Null, + })); + + anyhow::Ok(response) + }) + } + } // Common test setup function to initialize the test environment. fn setup_test_block_validator() -> ( BitfinityBlockConfirmation< - ReqwestClient, + MockClient, NodeTypesWithDBAdapter< AnyNodeTypesWithEngine< EthPrimitives, @@ -256,7 +298,20 @@ mod tests { >, SealedBlockWithSenders, ) { - let provider_factory = create_test_provider_factory(); + let chain_spec = Arc::new(ChainSpec { + chain: Chain::from_id(1), + genesis: Genesis { + alloc: BTreeMap::from([( + Address::ZERO, + GenesisAccount { balance: U256::max_value().into(), ..Default::default() }, + )]), + ..Default::default() + }, + ..(**reth_chainspec::MAINNET).clone() + }); + + let provider_factory = create_test_provider_factory_with_chain_spec(chain_spec); + let genesis_hash = init_genesis(&provider_factory).unwrap(); let genesis_block = provider_factory .sealed_block_with_senders(genesis_hash.into(), TransactionVariant::NoHash) @@ -266,10 +321,13 @@ mod tests { // Insert genesis block into the underlying database. let provider_rw = provider_factory.database_provider_rw().unwrap(); + provider_rw.insert_block(genesis_block.clone(), StorageLocation::Database).unwrap(); provider_rw.commit().unwrap(); - let canister_client = EthJsonRpcClient::new(ReqwestClient::new("".to_string())); + let canister_client = + EthJsonRpcClient::new(MockClient::new(vec![(did::H160::zero(), U256::from(u64::MAX))])); + let block_validator = BitfinityBlockConfirmation::new(canister_client, provider_factory.clone()); @@ -312,7 +370,8 @@ mod tests { .unwrap(); // Calculate the POW hash. - let pow = block_validator.compute_pow_hash(&block1, ExecutionOutcome::default()).unwrap(); + let pow = + block_validator.compute_pow_hash(&block1, ExecutionOutcome::default()).await.unwrap(); assert_ne!(pow.0, KECCAK_EMPTY, "Proof of work hash should not be empty"); @@ -338,7 +397,7 @@ mod tests { let block = block.block().clone().seal_with_senders::().unwrap().unseal(); - let pow_res = block_validator.compute_pow_hash(&block.block, outcome.clone()); + let pow_res = block_validator.compute_pow_hash(&block.block, outcome.clone()).await; assert!(pow_res.is_ok()); @@ -357,8 +416,8 @@ mod tests { block.block().clone().seal_with_senders::().unwrap().unseal(); // Compute POW hash twice with the same input - let pow1 = block_validator.compute_pow_hash(&block.block, outcome.clone()).unwrap(); - let pow2 = block_validator.compute_pow_hash(&block.block, outcome.clone()).unwrap(); + let pow1 = block_validator.compute_pow_hash(&block.block, outcome.clone()).await.unwrap(); + let pow2 = block_validator.compute_pow_hash(&block.block, outcome.clone()).await.unwrap(); // Results should be deterministic assert_eq!(pow1, pow2, "POW hash computation should be deterministic"); @@ -383,7 +442,7 @@ mod tests { // Compute POW multiple times for _ in 0..3 { - let _ = block_validator.compute_pow_hash(&block.block, outcome.clone()).unwrap(); + let _ = block_validator.compute_pow_hash(&block.block, outcome.clone()).await.unwrap(); // Check state after each computation let current_state = @@ -397,4 +456,33 @@ mod tests { ); } } + + #[tokio::test] + async fn test_pow_hash_deterministic_with_different_blocks() { + let (block_validator, genesis_block) = setup_test_block_validator(); + let mut block_builder = TestBlockBuilder::eth(); + let block1 = block_builder + .get_executed_block_with_number(genesis_block.number + 1, genesis_block.hash_slow()); + let block2 = block_builder + .get_executed_block_with_number(genesis_block.number + 2, genesis_block.hash_slow()); + + let outcome1 = block1.execution_outcome(); + let outcome2 = block2.execution_outcome(); + + let block1 = + block1.block().clone().seal_with_senders::().unwrap().unseal(); + let block2 = + block2.block().clone().seal_with_senders::().unwrap().unseal(); + + // Compute POW hash for two different blocks + let pow1 = block_validator.compute_pow_hash(&block1.block, outcome1.clone()).await.unwrap(); + let pow2 = block_validator.compute_pow_hash(&block2.block, outcome2.clone()).await.unwrap(); + + // Results should be deterministic for each block + assert_eq!(pow1, pow1, "POW hash computation should be deterministic"); + assert_eq!(pow2, pow2, "POW hash computation should be deterministic"); + + // Results should be different for different blocks + assert_ne!(pow1, pow2, "POW hash should differ for different blocks"); + } } From c02ee8443128d090891b9fe64306a9b7e42cba62 Mon Sep 17 00:00:00 2001 From: Yasir Date: Fri, 28 Feb 2025 15:05:47 +0300 Subject: [PATCH 21/38] feat: add alloy-network dependency and update tests for block confirmation --- Cargo.lock | 1 + .../bitfinity-block-confirmation/Cargo.toml | 1 + .../bitfinity-block-confirmation/src/lib.rs | 106 ++++++++++++++---- 3 files changed, 85 insertions(+), 23 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 733c92f5ad2..77daec2c274 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1455,6 +1455,7 @@ version = "1.1.5" dependencies = [ "alloy-consensus", "alloy-genesis", + "alloy-network", "alloy-primitives", "alloy-signer", "alloy-signer-local", diff --git a/crates/bitfinity-block-confirmation/Cargo.toml b/crates/bitfinity-block-confirmation/Cargo.toml index 9b0fbac56fd..f5b564a33df 100644 --- a/crates/bitfinity-block-confirmation/Cargo.toml +++ b/crates/bitfinity-block-confirmation/Cargo.toml @@ -51,3 +51,4 @@ reth-ethereum-engine-primitives.workspace = true anyhow.workspace = true jsonrpc-core.workspace = true serde_json.workspace = true +alloy-network.workspace = true diff --git a/crates/bitfinity-block-confirmation/src/lib.rs b/crates/bitfinity-block-confirmation/src/lib.rs index 43a973e8063..38e6977fffd 100644 --- a/crates/bitfinity-block-confirmation/src/lib.rs +++ b/crates/bitfinity-block-confirmation/src/lib.rs @@ -224,12 +224,19 @@ where #[cfg(test)] mod tests { + use alloy_consensus::constants::ETH_TO_WEI; + use alloy_consensus::{Block, Header, SignableTransaction, TxEip2930}; use alloy_genesis::{Genesis, GenesisAccount}; - use alloy_primitives::Address; + use alloy_network::TxSignerSync; + use alloy_primitives::{b256, Address}; + use alloy_signer::k256::ecdsa::signature::Keypair; + use alloy_signer::k256::Secp256k1; + use alloy_signer::Signer; use did::U256; + use eyre::OptionExt; use jsonrpc_core::{Output, Request, Response, Success, Version}; use reth_chain_state::test_utils::TestBlockBuilder; - use reth_chainspec::{Chain, ChainSpec}; + use reth_chainspec::{Chain, ChainSpec, EthereumHardfork, MIN_TRANSACTION_GAS}; use reth_db::test_utils::TempDatabase; use reth_db::DatabaseEnv; use reth_db_common::init::init_genesis; @@ -239,15 +246,18 @@ mod tests { use std::sync::Arc; use super::*; + use alloy_network::TxSigner; use reth_node_types::{AnyNodeTypesWithEngine, NodeTypesWithDBAdapter}; - use reth_primitives::{EthPrimitives, SealedBlockWithSenders}; + use reth_primitives::{ + BlockBody, BlockExt, EthPrimitives, SealedBlockWithSenders, Transaction, TransactionSigned, + }; use reth_provider::test_utils::create_test_provider_factory_with_chain_spec; use reth_provider::{ BlockReader, BlockWriter, DatabaseProviderFactory, EthStorage, StorageLocation, TransactionVariant, }; use reth_revm::primitives::KECCAK_EMPTY; - use reth_testing_utils::generators::{self, random_block, BlockParams}; + use reth_testing_utils::generators::{self, random_block, sign_tx_with_key_pair, BlockParams}; use reth_trie::StateRoot; use reth_trie_db::{DatabaseStateRoot, MerklePatriciaTrie}; @@ -281,6 +291,54 @@ mod tests { } } + fn make_block( + block_number: u64, + parent_hash: did::H256, + provider_factory: ProviderFactory, + ) -> BlockWithSenders + where + DB: NodeTypesWithDB + ProviderNodeTypes + Clone, + { + let chain_spec = provider_factory.chain_spec(); + let mut signer = + alloy_signer_local::PrivateKeySigner::from_slice(&[1; 32]).expect("valid keypair"); + signer.set_chain_id(Some(chain_spec.chain.id())); + + let tx = TxEip2930 { + chain_id: chain_spec.chain.id(), + nonce: 0, + gas_limit: MIN_TRANSACTION_GAS, + gas_price: 1_500_000_000, + to: TxKind::Call(Address::ZERO), + value: alloy_primitives::U256::from(0.1 * ETH_TO_WEI as f64).into(), + ..Default::default() + }; + + let signed_tx = signer.sign_transaction_sync(&mut tx.clone()).expect("valid signature"); + let tx = tx.into_signed(signed_tx); + let transaction_signed = TransactionSigned::from(tx); + + // First block has a transaction that transfers some ETH to zero address + let block1 = Block { + header: Header { + parent_hash: chain_spec.genesis_hash(), + receipts_root: b256!( + "d3a6acf9a244d78b33831df95d472c4128ea85bf079a1d41e32ed0b7d2244c9e" + ), + difficulty: chain_spec.fork(EthereumHardfork::Paris).ttd().expect("Paris TTD"), + number: 1, + gas_limit: MIN_TRANSACTION_GAS, + gas_used: MIN_TRANSACTION_GAS, + ..Default::default() + }, + + body: BlockBody { transactions: vec![transaction_signed], ..Default::default() }, + } + .with_recovered_senders() + .expect("failed to recover senders"); + + block1 + } // Common test setup function to initialize the test environment. fn setup_test_block_validator() -> ( BitfinityBlockConfirmation< @@ -460,29 +518,31 @@ mod tests { #[tokio::test] async fn test_pow_hash_deterministic_with_different_blocks() { let (block_validator, genesis_block) = setup_test_block_validator(); - let mut block_builder = TestBlockBuilder::eth(); - let block1 = block_builder - .get_executed_block_with_number(genesis_block.number + 1, genesis_block.hash_slow()); - let block2 = block_builder - .get_executed_block_with_number(genesis_block.number + 2, genesis_block.hash_slow()); + // let mut block_builder = TestBlockBuilder::eth(); + // let block1 = block_builder + // .get_executed_block_with_number(genesis_block.number + 1, genesis_block.hash_slow()); + // let block2 = block_builder + // .get_executed_block_with_number(genesis_block.number + 2, genesis_block.hash_slow()); + + // let outcome1 = block1.execution_outcome(); + // let outcome2 = block2.execution_outcome(); - let outcome1 = block1.execution_outcome(); - let outcome2 = block2.execution_outcome(); + // let block1 = + // block1.block().clone().seal_with_senders::().unwrap().unseal(); + // let block2 = + // block2.block().clone().seal_with_senders::().unwrap().unseal(); - let block1 = - block1.block().clone().seal_with_senders::().unwrap().unseal(); - let block2 = - block2.block().clone().seal_with_senders::().unwrap().unseal(); + // // Compute POW hash for two different blocks + // let pow1 = block_validator.compute_pow_hash(&block1.block, outcome1.clone()).await.unwrap(); + // let pow2 = block_validator.compute_pow_hash(&block2.block, outcome2.clone()).await.unwrap(); - // Compute POW hash for two different blocks - let pow1 = block_validator.compute_pow_hash(&block1.block, outcome1.clone()).await.unwrap(); - let pow2 = block_validator.compute_pow_hash(&block2.block, outcome2.clone()).await.unwrap(); + // // Results should be deterministic for each block + // assert_eq!(pow1, pow1, "POW hash computation should be deterministic"); + // assert_eq!(pow2, pow2, "POW hash computation should be deterministic"); - // Results should be deterministic for each block - assert_eq!(pow1, pow1, "POW hash computation should be deterministic"); - assert_eq!(pow2, pow2, "POW hash computation should be deterministic"); + // // Results should be different for different blocks + // assert_ne!(pow1, pow2, "POW hash should differ for different blocks"); - // Results should be different for different blocks - assert_ne!(pow1, pow2, "POW hash should differ for different blocks"); + // Create dummy blocks } } From bf99181fe32ecad956cfe4e265d7e70298391ea6 Mon Sep 17 00:00:00 2001 From: Yasir Date: Thu, 6 Mar 2025 10:34:18 +0300 Subject: [PATCH 22/38] Added more tests --- .../bitfinity-block-confirmation/src/lib.rs | 460 ++++++++++++++---- 1 file changed, 352 insertions(+), 108 deletions(-) diff --git a/crates/bitfinity-block-confirmation/src/lib.rs b/crates/bitfinity-block-confirmation/src/lib.rs index 38e6977fffd..db15cd9255b 100644 --- a/crates/bitfinity-block-confirmation/src/lib.rs +++ b/crates/bitfinity-block-confirmation/src/lib.rs @@ -15,7 +15,7 @@ use reth_evm_ethereum::{ }; use reth_node_types::NodeTypesWithDB; use reth_primitives::{Block, BlockWithSenders}; -use reth_provider::StateRootProvider; + use reth_provider::{ providers::ProviderNodeTypes, ChainSpecProvider as _, ExecutionOutcome, ProviderFactory, }; @@ -26,7 +26,8 @@ use reth_revm::{batch::BlockBatchRecord, database::StateProviderDatabase}; use reth_revm::{DatabaseCommit, StateBuilder}; use reth_rpc_eth_types::cache::db::StateProviderTraitObjWrapper; use reth_rpc_eth_types::StateCacheDb; -use reth_trie::{HashedPostState, KeccakKeyHasher}; +use reth_trie::{HashedPostState, KeccakKeyHasher, StateRoot}; +use reth_trie_db::DatabaseStateRoot; use std::collections::HashSet; @@ -156,15 +157,16 @@ where block: &Block, execution_result: ExecutionOutcome, ) -> eyre::Result>> { - let state = execution_result.bundle; - let state_provider = self.provider_factory.latest().expect("no latest provider"); + let exec_state = execution_result.bundle; + + let state_provider = self.provider_factory.latest()?; let cache = StateCacheDb::new(StateProviderDatabase::new(StateProviderTraitObjWrapper( &state_provider, ))); let mut state = StateBuilder::new() .with_database_ref(&cache) - .with_bundle_prestate(state) + .with_bundle_prestate(exec_state) .with_bundle_update() .build(); @@ -194,7 +196,6 @@ where gas_price: pow_tx.gas_price.unwrap_or_default().0, transact_to: to, value: pow_tx.value.0, - nonce: Some(pow_tx.nonce.0.to()), ..Default::default() }; @@ -207,8 +208,9 @@ where let res = evm.transact()?; + eyre::ensure!(res.result.is_success(), "POW transaction failed: {:?}", res.result); + evm.db_mut().commit(res.state); - assert!(res.result.is_success()); } state.merge_transitions(BundleRetention::PlainState); let bundle = state.take_bundle(); @@ -216,7 +218,8 @@ where let post_hashed_state = HashedPostState::from_bundle_state::(bundle.state()); - let state_root = cache.db.state_root(post_hashed_state)?; + let state_root = + StateRoot::overlay_root(self.provider_factory.provider()?.tx_ref(), post_hashed_state)?; Ok(state_root.into()) } @@ -224,40 +227,46 @@ where #[cfg(test)] mod tests { - use alloy_consensus::constants::ETH_TO_WEI; - use alloy_consensus::{Block, Header, SignableTransaction, TxEip2930}; + + use alloy_consensus::{Block, BlockHeader, Header, SignableTransaction, TxEip2930}; use alloy_genesis::{Genesis, GenesisAccount}; + use alloy_network::TxSignerSync; - use alloy_primitives::{b256, Address}; - use alloy_signer::k256::ecdsa::signature::Keypair; - use alloy_signer::k256::Secp256k1; + use alloy_primitives::hex::FromHex; + use alloy_primitives::Address; + use alloy_signer::Signer; + use did::constant::EIP1559_INITIAL_BASE_FEE; use did::U256; - use eyre::OptionExt; + use jsonrpc_core::{Output, Request, Response, Success, Version}; use reth_chain_state::test_utils::TestBlockBuilder; - use reth_chainspec::{Chain, ChainSpec, EthereumHardfork, MIN_TRANSACTION_GAS}; + use reth_chainspec::{ + BaseFeeParams, ChainSpec, ChainSpecBuilder, EthereumHardfork, MAINNET, MIN_TRANSACTION_GAS, + }; use reth_db::test_utils::TempDatabase; use reth_db::DatabaseEnv; use reth_db_common::init::init_genesis; use reth_ethereum_engine_primitives::EthEngineTypes; - use std::collections::BTreeMap; + use reth_evm::execute::{BlockExecutorProvider, Executor}; + use reth_evm_ethereum::execute::EthExecutorProvider; + use std::future::Future; use std::sync::Arc; use super::*; - use alloy_network::TxSigner; - use reth_node_types::{AnyNodeTypesWithEngine, NodeTypesWithDBAdapter}; + + use reth_node_types::{AnyNodeTypesWithEngine, FullNodePrimitives, NodeTypesWithDBAdapter}; use reth_primitives::{ - BlockBody, BlockExt, EthPrimitives, SealedBlockWithSenders, Transaction, TransactionSigned, + BlockBody, BlockExt, EthPrimitives, Receipt, SealedBlockWithSenders, TransactionSigned, }; use reth_provider::test_utils::create_test_provider_factory_with_chain_spec; use reth_provider::{ - BlockReader, BlockWriter, DatabaseProviderFactory, EthStorage, StorageLocation, - TransactionVariant, + BlockExecutionOutput, BlockReader, BlockWriter, DatabaseProviderFactory, EthStorage, + HashedPostStateProvider, LatestStateProviderRef, StorageLocation, TransactionVariant, }; use reth_revm::primitives::KECCAK_EMPTY; - use reth_testing_utils::generators::{self, random_block, sign_tx_with_key_pair, BlockParams}; + use reth_trie::StateRoot; use reth_trie_db::{DatabaseStateRoot, MerklePatriciaTrie}; @@ -294,53 +303,155 @@ mod tests { fn make_block( block_number: u64, parent_hash: did::H256, - provider_factory: ProviderFactory, - ) -> BlockWithSenders + provider_factory: &ProviderFactory, + gas_used: u64, + transactions: Vec, + ) -> eyre::Result + where + DB: NodeTypesWithDB + ProviderNodeTypes + Clone, + { + use reth_primitives_traits::Block as _; + let parent_block = provider_factory + .provider() + .unwrap() + .block_by_hash(parent_hash.clone().into()) + .unwrap() + .unwrap(); + + let header = parent_block.header(); + + let base_fee_per_gas = header.next_block_base_fee(BaseFeeParams::ethereum()); + let state_root = + StateRoot::from_tx(provider_factory.provider().unwrap().tx_ref()).root().unwrap(); + + let chain_spec = provider_factory.chain_spec(); + let block = Block { + header: Header { + parent_hash: parent_hash.into(), + state_root, + difficulty: chain_spec.fork(EthereumHardfork::Paris).ttd().expect("Paris TTD"), + number: block_number, + gas_limit: 8_000_000, + gas_used, + base_fee_per_gas, + ..Default::default() + }, + body: BlockBody { transactions, ..Default::default() }, + } + .with_recovered_senders() + .expect("failed to recover senders"); + + Ok(block) + } + + /// Creates an empty block without transactions + fn make_empty_block( + block_number: u64, + parent_hash: did::H256, + provider_factory: &ProviderFactory, + ) -> eyre::Result + where + DB: NodeTypesWithDB + ProviderNodeTypes + Clone, + { + make_block(block_number, parent_hash, provider_factory, 0, vec![]) + } + + /// Creates a block with a single transaction + fn make_block_with_transaction( + block_number: u64, + parent_hash: did::H256, + provider_factory: &ProviderFactory, + nonce: u64, + ) -> eyre::Result where DB: NodeTypesWithDB + ProviderNodeTypes + Clone, { let chain_spec = provider_factory.chain_spec(); - let mut signer = - alloy_signer_local::PrivateKeySigner::from_slice(&[1; 32]).expect("valid keypair"); + let mut signer = alloy_signer_local::PrivateKeySigner::from_slice(&[1; 32])?; signer.set_chain_id(Some(chain_spec.chain.id())); let tx = TxEip2930 { chain_id: chain_spec.chain.id(), - nonce: 0, + nonce, gas_limit: MIN_TRANSACTION_GAS, - gas_price: 1_500_000_000, + gas_price: EIP1559_INITIAL_BASE_FEE, to: TxKind::Call(Address::ZERO), - value: alloy_primitives::U256::from(0.1 * ETH_TO_WEI as f64).into(), + value: alloy_primitives::U256::from(1.0 as f64).into(), ..Default::default() }; - let signed_tx = signer.sign_transaction_sync(&mut tx.clone()).expect("valid signature"); + let signed_tx = signer.sign_transaction_sync(&mut tx.clone())?; let tx = tx.into_signed(signed_tx); let transaction_signed = TransactionSigned::from(tx); - // First block has a transaction that transfers some ETH to zero address - let block1 = Block { - header: Header { - parent_hash: chain_spec.genesis_hash(), - receipts_root: b256!( - "d3a6acf9a244d78b33831df95d472c4128ea85bf079a1d41e32ed0b7d2244c9e" - ), - difficulty: chain_spec.fork(EthereumHardfork::Paris).ttd().expect("Paris TTD"), - number: 1, - gas_limit: MIN_TRANSACTION_GAS, - gas_used: MIN_TRANSACTION_GAS, - ..Default::default() - }, + make_block(block_number, parent_hash, provider_factory, 21_000, vec![transaction_signed]) + } - body: BlockBody { transactions: vec![transaction_signed], ..Default::default() }, + /// Converts block execution output to execution outcome for testing + fn to_execution_outcome( + block_number: u64, + block_execution_output: &BlockExecutionOutput, + ) -> ExecutionOutcome { + ExecutionOutcome { + bundle: block_execution_output.state.clone(), + receipts: block_execution_output.receipts.clone().into(), + first_block: block_number, + requests: vec![block_execution_output.requests.clone()], } - .with_recovered_senders() - .expect("failed to recover senders"); + } - block1 + /// Executes a block and commits it to the test database + fn execute_block_and_commit_to_database( + provider_factory: &ProviderFactory, + chain_spec: Arc, + block: &BlockWithSenders, + ) -> eyre::Result> + where + N: ProviderNodeTypes< + Primitives: FullNodePrimitives< + Block = reth_primitives::Block, + BlockBody = reth_primitives::BlockBody, + Receipt = reth_primitives::Receipt, + >, + >, + { + let provider = provider_factory.provider()?; + + // Execute the block to produce a block execution output + let mut block_execution_output = EthExecutorProvider::ethereum(chain_spec) + .executor(StateProviderDatabase::new(LatestStateProviderRef::new(&provider))) + .execute(block)?; + block_execution_output.state.reverts.sort(); + + // Convert the block execution output to an execution outcome for committing to the database + let execution_outcome = to_execution_outcome(block.number, &block_execution_output); + + let hashed_post_state = provider_factory.hashed_post_state(execution_outcome.state()); + + let hashed_state_sorted = hashed_post_state.clone().into_sorted(); + + let (_, trie_updates) = StateRoot::overlay_root_with_updates( + provider_factory.provider()?.tx_ref(), + hashed_post_state, + )?; + + // Commit the block's execution outcome to the database + let provider_rw = provider_factory.provider_rw()?; + let block = block.clone().seal_slow(); + provider_rw.append_blocks_with_state( + vec![block], + execution_outcome, + hashed_state_sorted, + trie_updates, + )?; + provider_rw.commit()?; + + Ok(block_execution_output) } - // Common test setup function to initialize the test environment. - fn setup_test_block_validator() -> ( + + fn setup_test_block_validator( + extended_genesis: Option<(Address, did::U256)>, + ) -> ( BitfinityBlockConfirmation< MockClient, NodeTypesWithDBAdapter< @@ -356,17 +467,45 @@ mod tests { >, SealedBlockWithSenders, ) { - let chain_spec = Arc::new(ChainSpec { - chain: Chain::from_id(1), - genesis: Genesis { - alloc: BTreeMap::from([( - Address::ZERO, - GenesisAccount { balance: U256::max_value().into(), ..Default::default() }, - )]), - ..Default::default() - }, - ..(**reth_chainspec::MAINNET).clone() - }); + // EVM genesis accounts + let mut genesis_accounts = vec![ + ( + Address::from_hex("0x756f45e3fa69347a9a973a725e3c98bc4db0b5a0").unwrap(), + GenesisAccount { + balance: U256::from_hex_str("0xad78ebc5ac6200000").unwrap().into(), + ..Default::default() + }, + ), + ( + Address::from_hex("0xf42f905231c770f0a406f2b768877fb49eee0f21").unwrap(), + GenesisAccount { + balance: U256::from_hex_str("0xaadec983fcff40000").unwrap().into(), + ..Default::default() + }, + ), + ]; + + if let Some((address, balance)) = extended_genesis { + genesis_accounts.push(( + address.into(), + GenesisAccount { balance: balance.into(), ..Default::default() }, + )); + } + + let chain_spec = Arc::new( + ChainSpecBuilder::default() + .chain(MAINNET.chain) + .genesis(Genesis { + alloc: genesis_accounts + .clone() + .iter() + .map(|(address, account)| (*address, account.clone())) + .collect(), + ..MAINNET.genesis.clone() + }) + .paris_activated() + .build(), + ); let provider_factory = create_test_provider_factory_with_chain_spec(chain_spec); @@ -383,8 +522,13 @@ mod tests { provider_rw.insert_block(genesis_block.clone(), StorageLocation::Database).unwrap(); provider_rw.commit().unwrap(); - let canister_client = - EthJsonRpcClient::new(MockClient::new(vec![(did::H160::zero(), U256::from(u64::MAX))])); + // genesis_accounts.reverse(); + let mut genesis = vec![]; + for (address, account) in genesis_accounts { + genesis.push((address.into(), account.balance.into())); + } + + let canister_client = EthJsonRpcClient::new(MockClient::new(genesis)); let block_validator = BitfinityBlockConfirmation::new(canister_client, provider_factory.clone()); @@ -393,26 +537,19 @@ mod tests { } #[tokio::test] - async fn test_execute_and_calculate_pow_with_empty_execution() { - let mut rng = generators::rng(); - let (block_validator, genesis_block) = setup_test_block_validator(); + async fn test_pow_hash_with_empty_execution() { + let (block_validator, genesis_block) = setup_test_block_validator(None); let block1 = { // Create a test block based on genesis. - let test_block = random_block( - &mut rng, + let test_block = make_empty_block( genesis_block.number + 1, - BlockParams { - parent: Some(genesis_block.hash_slow()), - tx_count: Some(10), - ..Default::default() - }, + genesis_block.hash_slow().into(), + &block_validator.provider_factory, ) - .seal_with_senders::() - .unwrap() - .unseal(); + .unwrap(); - //Insert the test block into the database. + // Insert the test block into the database. let provider_rw = block_validator.provider_factory.database_provider_rw().unwrap(); provider_rw .insert_block(test_block.clone().seal_slow(), StorageLocation::Database) @@ -444,8 +581,8 @@ mod tests { } #[tokio::test] - async fn test_pow_hash_with_execution_outcome() { - let (block_validator, genesis_block) = setup_test_block_validator(); + async fn test_pow_hash_basic_validation() { + let (block_validator, genesis_block) = setup_test_block_validator(None); let mut block_builder = TestBlockBuilder::eth(); let block = block_builder @@ -464,7 +601,7 @@ mod tests { #[tokio::test] async fn test_pow_hash_deterministic() { - let (block_validator, genesis_block) = setup_test_block_validator(); + let (block_validator, genesis_block) = setup_test_block_validator(None); let mut block_builder = TestBlockBuilder::eth(); let block = block_builder .get_executed_block_with_number(genesis_block.number + 1, genesis_block.hash_slow()); @@ -483,7 +620,7 @@ mod tests { #[tokio::test] async fn test_pow_hash_state_independence() { - let (block_validator, genesis_block) = setup_test_block_validator(); + let (block_validator, genesis_block) = setup_test_block_validator(None); let mut block_builder = TestBlockBuilder::eth(); let block = block_builder .get_executed_block_with_number(genesis_block.number + 1, genesis_block.hash_slow()); @@ -516,33 +653,140 @@ mod tests { } #[tokio::test] - async fn test_pow_hash_deterministic_with_different_blocks() { - let (block_validator, genesis_block) = setup_test_block_validator(); - // let mut block_builder = TestBlockBuilder::eth(); - // let block1 = block_builder - // .get_executed_block_with_number(genesis_block.number + 1, genesis_block.hash_slow()); - // let block2 = block_builder - // .get_executed_block_with_number(genesis_block.number + 2, genesis_block.hash_slow()); - - // let outcome1 = block1.execution_outcome(); - // let outcome2 = block2.execution_outcome(); - - // let block1 = - // block1.block().clone().seal_with_senders::().unwrap().unseal(); - // let block2 = - // block2.block().clone().seal_with_senders::().unwrap().unseal(); - - // // Compute POW hash for two different blocks - // let pow1 = block_validator.compute_pow_hash(&block1.block, outcome1.clone()).await.unwrap(); - // let pow2 = block_validator.compute_pow_hash(&block2.block, outcome2.clone()).await.unwrap(); - - // // Results should be deterministic for each block - // assert_eq!(pow1, pow1, "POW hash computation should be deterministic"); - // assert_eq!(pow2, pow2, "POW hash computation should be deterministic"); - - // // Results should be different for different blocks - // assert_ne!(pow1, pow2, "POW hash should differ for different blocks"); - - // Create dummy blocks + async fn test_pow_hash_deterministic_with_empty_blocks() { + // Expected final PoW hash + let expected_pow_hash = did::H256::from_hex_str( + "0xe66caa3a5bf8a22c38c33e5fb4cab1bd1b34e9734526a8723c615e9d36ccc45b", + ) + .unwrap(); + + let (block_validator, genesis_block) = setup_test_block_validator(None); + + let block1 = { + let block = make_empty_block( + 1, + genesis_block.hash_slow().into(), + &block_validator.provider_factory, + ) + .unwrap(); + execute_block_and_commit_to_database( + &block_validator.provider_factory, + block_validator.provider_factory.chain_spec().clone(), + &block, + ) + .unwrap(); + + block + }; + + let block2 = { + let block = + make_empty_block(2, block1.hash_slow().into(), &block_validator.provider_factory) + .unwrap(); + + execute_block_and_commit_to_database( + &block_validator.provider_factory, + block_validator.provider_factory.chain_spec().clone(), + &block, + ) + .unwrap(); + + block + }; + + let block = + make_empty_block(3, block2.hash_slow().into(), &block_validator.provider_factory) + .unwrap(); + + let block_output = execute_block_and_commit_to_database( + &block_validator.provider_factory, + block_validator.provider_factory.chain_spec().clone(), + &block, + ) + .unwrap(); + let outcome = to_execution_outcome(block.number, &block_output); + + // Compute POW hash for two different blocks + let computed_pow = + block_validator.compute_pow_hash(&block.block, outcome.clone()).await.unwrap(); + + assert_eq!( + expected_pow_hash, computed_pow, + "POW hash should be deterministic given the same state" + ) + } + + #[tokio::test] + async fn test_pow_hash_deterministic_with_transactions() { + // Expected final PoW hash + let expected_pow_hash = did::H256::from_hex_str( + "0xe9b9e2ac5360f0cffe8711037c8f7c11b5944b5b5105f24dd51c65b2b785a42e", + ) + .unwrap(); + + let signer = alloy_signer_local::PrivateKeySigner::from_slice(&[1; 32]).unwrap(); + + let (block_validator, genesis_block) = + setup_test_block_validator(Some((signer.address(), U256::max_value()))); + + let block1 = { + let block = make_block_with_transaction( + 1, + genesis_block.hash_slow().into(), + &block_validator.provider_factory, + 0, + ) + .unwrap(); + execute_block_and_commit_to_database( + &block_validator.provider_factory, + block_validator.provider_factory.chain_spec().clone(), + &block, + ) + .unwrap(); + block + }; + + let block2 = { + let block = make_block_with_transaction( + 2, + block1.hash_slow().into(), + &block_validator.provider_factory, + 1, + ) + .unwrap(); + let out = execute_block_and_commit_to_database( + &block_validator.provider_factory, + block_validator.provider_factory.chain_spec().clone(), + &block, + ) + .unwrap(); + + to_execution_outcome(block.number, &out); + block + }; + + let block = make_block_with_transaction( + 3, + block2.hash_slow().into(), + &block_validator.provider_factory, + 2, + ) + .unwrap(); + let block_output = execute_block_and_commit_to_database( + &block_validator.provider_factory, + block_validator.provider_factory.chain_spec().clone(), + &block, + ) + .unwrap(); + + let outcome = to_execution_outcome(block.number, &block_output); + + let computed_pow = + block_validator.compute_pow_hash(&block.block, outcome.clone()).await.unwrap(); + + assert_eq!( + expected_pow_hash, computed_pow, + "POW hash should be deterministic given the same state" + ); } } From 9a70d0713c10e167754539c40c299778a90b6f4d Mon Sep 17 00:00:00 2001 From: Yasir Date: Thu, 6 Mar 2025 16:00:47 +0300 Subject: [PATCH 23/38] fix: final tests --- .../bitfinity-block-confirmation/src/lib.rs | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/crates/bitfinity-block-confirmation/src/lib.rs b/crates/bitfinity-block-confirmation/src/lib.rs index db15cd9255b..568db6fea2b 100644 --- a/crates/bitfinity-block-confirmation/src/lib.rs +++ b/crates/bitfinity-block-confirmation/src/lib.rs @@ -467,8 +467,8 @@ mod tests { >, SealedBlockWithSenders, ) { - // EVM genesis accounts - let mut genesis_accounts = vec![ + // EVM genesis accounts (similar to the test genesis in EVM) + let mut original_genesis = vec![ ( Address::from_hex("0x756f45e3fa69347a9a973a725e3c98bc4db0b5a0").unwrap(), GenesisAccount { @@ -486,17 +486,15 @@ mod tests { ]; if let Some((address, balance)) = extended_genesis { - genesis_accounts.push(( - address.into(), - GenesisAccount { balance: balance.into(), ..Default::default() }, - )); + original_genesis + .push((address, GenesisAccount { balance: balance.into(), ..Default::default() })); } let chain_spec = Arc::new( ChainSpecBuilder::default() .chain(MAINNET.chain) .genesis(Genesis { - alloc: genesis_accounts + alloc: original_genesis .clone() .iter() .map(|(address, account)| (*address, account.clone())) @@ -522,9 +520,10 @@ mod tests { provider_rw.insert_block(genesis_block.clone(), StorageLocation::Database).unwrap(); provider_rw.commit().unwrap(); - // genesis_accounts.reverse(); + {} + let mut genesis = vec![]; - for (address, account) in genesis_accounts { + for (address, account) in original_genesis { genesis.push((address.into(), account.balance.into())); } @@ -720,7 +719,7 @@ mod tests { async fn test_pow_hash_deterministic_with_transactions() { // Expected final PoW hash let expected_pow_hash = did::H256::from_hex_str( - "0xe9b9e2ac5360f0cffe8711037c8f7c11b5944b5b5105f24dd51c65b2b785a42e", + "0xa349b3ca25925decd1c225b8bc3a133c436f3989eb8048e93ee1389c78a1d6a4", ) .unwrap(); @@ -743,6 +742,7 @@ mod tests { &block, ) .unwrap(); + block }; From 39484216410702f6b1221bd76cb0f4bf6094dfd8 Mon Sep 17 00:00:00 2001 From: Yasir Date: Thu, 6 Mar 2025 23:22:22 +0300 Subject: [PATCH 24/38] add bitfinity prefix to the tests --- crates/bitfinity-block-confirmation/src/lib.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/crates/bitfinity-block-confirmation/src/lib.rs b/crates/bitfinity-block-confirmation/src/lib.rs index 568db6fea2b..9110037ad13 100644 --- a/crates/bitfinity-block-confirmation/src/lib.rs +++ b/crates/bitfinity-block-confirmation/src/lib.rs @@ -536,7 +536,7 @@ mod tests { } #[tokio::test] - async fn test_pow_hash_with_empty_execution() { + async fn bitfinity_test_pow_hash_with_empty_execution() { let (block_validator, genesis_block) = setup_test_block_validator(None); let block1 = { @@ -580,7 +580,7 @@ mod tests { } #[tokio::test] - async fn test_pow_hash_basic_validation() { + async fn bitfinity_test_pow_hash_basic_validation() { let (block_validator, genesis_block) = setup_test_block_validator(None); let mut block_builder = TestBlockBuilder::eth(); @@ -599,7 +599,7 @@ mod tests { } #[tokio::test] - async fn test_pow_hash_deterministic() { + async fn bitfinity_test_pow_hash_deterministic() { let (block_validator, genesis_block) = setup_test_block_validator(None); let mut block_builder = TestBlockBuilder::eth(); let block = block_builder @@ -618,7 +618,7 @@ mod tests { } #[tokio::test] - async fn test_pow_hash_state_independence() { + async fn bitfinity_test_pow_hash_state_independence() { let (block_validator, genesis_block) = setup_test_block_validator(None); let mut block_builder = TestBlockBuilder::eth(); let block = block_builder @@ -652,7 +652,7 @@ mod tests { } #[tokio::test] - async fn test_pow_hash_deterministic_with_empty_blocks() { + async fn bitfinity_test_pow_hash_deterministic_with_empty_blocks() { // Expected final PoW hash let expected_pow_hash = did::H256::from_hex_str( "0xe66caa3a5bf8a22c38c33e5fb4cab1bd1b34e9734526a8723c615e9d36ccc45b", @@ -716,7 +716,7 @@ mod tests { } #[tokio::test] - async fn test_pow_hash_deterministic_with_transactions() { + async fn bitfinity_test_pow_hash_deterministic_with_transactions() { // Expected final PoW hash let expected_pow_hash = did::H256::from_hex_str( "0xa349b3ca25925decd1c225b8bc3a133c436f3989eb8048e93ee1389c78a1d6a4", From 689b9b094961034acc93d32f50830f99f8169ff3 Mon Sep 17 00:00:00 2001 From: Yasir Date: Fri, 7 Mar 2025 11:58:11 +0300 Subject: [PATCH 25/38] chore: fix tests --- Cargo.lock | 1 + bin/reth/Cargo.toml | 1 + bin/reth/src/commands/bitfinity_import.rs | 4 +- .../tests/commands/bitfinity_import_it.rs | 59 ++++++++++++++++++- bin/reth/tests/commands/bitfinity_node_it.rs | 41 +++++++++---- .../bitfinity-block-confirmation/src/lib.rs | 16 ++++- 6 files changed, 104 insertions(+), 18 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 77daec2c274..3f183b8c327 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -7171,6 +7171,7 @@ version = "1.1.5" dependencies = [ "alloy-consensus", "alloy-eips", + "alloy-genesis", "alloy-primitives", "alloy-rlp", "alloy-rpc-types", diff --git a/bin/reth/Cargo.toml b/bin/reth/Cargo.toml index 240d7f4fabb..bd8086e38d3 100644 --- a/bin/reth/Cargo.toml +++ b/bin/reth/Cargo.toml @@ -110,6 +110,7 @@ lightspeed_scheduler = { workspace = true, features = ["tracing"] } tempfile.workspace = true # bitfinity dev dependencies +alloy-genesis.workspace = true async-trait = { workspace = true } dirs.workspace = true ethereum-json-rpc-client = { workspace = true, features = ["reqwest"] } diff --git a/bin/reth/src/commands/bitfinity_import.rs b/bin/reth/src/commands/bitfinity_import.rs index 2bee03ce801..be920a742d7 100644 --- a/bin/reth/src/commands/bitfinity_import.rs +++ b/bin/reth/src/commands/bitfinity_import.rs @@ -228,10 +228,10 @@ impl BitfinityImportCommand { let config = self.rpc_config(); let client = BitfinityEvmClient::client(config).await?; - let confirmator = BitfinityBlockConfirmation::new(client, provider_factory); + let confirmer = BitfinityBlockConfirmation::new(client, provider_factory); let blocks = remote_client.unsafe_blocks(block)?; - confirmator.confirm_blocks(&blocks).await + confirmer.confirm_blocks(&blocks).await } /// Imports the blocks up to the given block hash of the `remove_client`. diff --git a/bin/reth/tests/commands/bitfinity_import_it.rs b/bin/reth/tests/commands/bitfinity_import_it.rs index b8ea1e5d25c..0892934d5a4 100644 --- a/bin/reth/tests/commands/bitfinity_import_it.rs +++ b/bin/reth/tests/commands/bitfinity_import_it.rs @@ -13,11 +13,16 @@ use super::{ }; use alloy_eips::BlockNumberOrTag; +use did::H256; use ethereum_json_rpc_client::{reqwest::ReqwestClient, EthJsonRpcClient}; use reth::commands::bitfinity_import::BitfinityImportCommand; use reth_provider::{BlockNumReader, BlockReader, BlockReaderIdExt}; +use reth_trie::StateRoot; +use reth_trie_db::DatabaseStateRoot; +use revm_primitives::{Address, U256}; +use std::sync::Arc; use std::time::Duration; #[tokio::test] @@ -374,7 +379,15 @@ async fn bitfinity_test_should_confirm_and_import_unsafe_blocks() { const UNSAFE_BLOCKS: u64 = 3; const MAX_BLOCKS: u64 = 10; - let mut eth_server = EthImpl::new_with_max_block(MAX_BLOCKS); + let genesis_balances = + vec![(Address::from_slice(&[0u8; 20]).into(), U256::from(1_000_000_u64))]; + + let state_root = compute_state_root(&genesis_balances); + + let mut eth_server = EthImpl::new_with_max_block(MAX_BLOCKS) + .with_genesis_balances(genesis_balances) + .with_state_root(state_root.into()); + let bf_evm_server = eth_server.bf_impl(UNSAFE_BLOCKS); let (_server, eth_server_address) = mock_multi_server_start([ @@ -422,8 +435,14 @@ async fn bitfinity_test_should_import_until_last_confirmed() { const UNSAFE_BLOCKS: u64 = 3; const MAX_BLOCKS: u64 = 10; const CONFIRM_UNTIL: u64 = 8; + let genesis_balances = + vec![(Address::from_slice(&[0u8; 20]).into(), U256::from(1_000_000_u64))]; - let mut eth_server = EthImpl::new_with_max_block(MAX_BLOCKS); + let state_root = compute_state_root(&genesis_balances); + + let mut eth_server = EthImpl::new_with_max_block(MAX_BLOCKS) + .with_genesis_balances(genesis_balances) + .with_state_root(state_root.into()); let mut bf_evm_server = eth_server.bf_impl(UNSAFE_BLOCKS); bf_evm_server.confirm_until = CONFIRM_UNTIL; @@ -463,3 +482,39 @@ async fn bitfinity_test_should_import_until_last_confirmed() { let last_imported_block = provider.last_block_number().unwrap(); assert_eq!(last_imported_block, CONFIRM_UNTIL); } + +/// Compute state root for genesis Balances +fn compute_state_root(genesis_balances: &[(Address, U256)]) -> H256 { + use alloy_genesis::Genesis; + use alloy_genesis::GenesisAccount; + use reth_chainspec::ChainSpec; + use reth_db_common::init::init_genesis; + use reth_provider::test_utils::create_test_provider_factory_with_chain_spec; + + let chain_spec = Arc::new(ChainSpec { + chain: 1_u64.into(), + genesis: Genesis { + alloc: genesis_balances + .iter() + .map(|(address, balance)| { + (*address, GenesisAccount { balance: *balance, ..Default::default() }) + }) + .collect(), + ..Default::default() + }, + hardforks: Default::default(), + genesis_hash: Default::default(), + paris_block_and_final_difficulty: None, + deposit_contract: None, + ..Default::default() + }); + + let factory = create_test_provider_factory_with_chain_spec(chain_spec); + init_genesis(&factory).unwrap(); + + let provider = factory.provider().unwrap(); + + let tx = provider.tx_ref(); + + StateRoot::from_tx(tx).root().unwrap().into() +} diff --git a/bin/reth/tests/commands/bitfinity_node_it.rs b/bin/reth/tests/commands/bitfinity_node_it.rs index 6e141f795e4..a848a35aa60 100644 --- a/bin/reth/tests/commands/bitfinity_node_it.rs +++ b/bin/reth/tests/commands/bitfinity_node_it.rs @@ -118,7 +118,7 @@ async fn bitfinity_test_node_forward_eth_get_genesis_balances() { // Arrange let _log = init_logs(); - let eth_server = EthImpl::with_genesis_balances(vec![ + let eth_server = EthImpl::new().with_genesis_balances(vec![ (Address::from_slice(&[1u8; 20]), U256::from(10)), (Address::from_slice(&[2u8; 20]), U256::from(20)), (Address::from_slice(&[3u8; 20]), U256::from(30)), @@ -156,7 +156,7 @@ async fn bitfinity_test_node_forward_ic_get_genesis_balances() { // Arrange let _log = init_logs(); - let eth_server = EthImpl::with_genesis_balances(vec![ + let eth_server = EthImpl::new().with_genesis_balances(vec![ (Address::from_slice(&[1u8; 20]), U256::from(10)), (Address::from_slice(&[2u8; 20]), U256::from(20)), (Address::from_slice(&[3u8; 20]), U256::from(30)), @@ -347,7 +347,9 @@ pub async fn mock_eth_server_start(methods: impl Into) -> (ServerHandle } /// Starts a local mock server that combines methods from different sources. -pub async fn mock_multi_server_start(methods: impl IntoIterator) -> (ServerHandle, SocketAddr) { +pub async fn mock_multi_server_start( + methods: impl IntoIterator, +) -> (ServerHandle, SocketAddr) { let addr = SocketAddr::from(([127, 0, 0, 1], 0)); let server = Server::builder().build(addr).await.unwrap(); @@ -373,6 +375,7 @@ pub mod eth_server { use did::{keccak, BlockConfirmationData, BlockConfirmationResult, BlockNumber, H256, U64}; use ethereum_json_rpc_client::CertifiedResult; use jsonrpsee::{core::RpcResult, proc_macros::rpc}; + use reth_trie::EMPTY_ROOT_HASH; use revm_primitives::{Address, B256, U256}; @@ -424,7 +427,10 @@ pub mod eth_server { trait BfEvm { /// Send block confirmation request. #[method(name = "sendConfirmBlock")] - async fn confirm_block(&self, data: BlockConfirmationData) -> RpcResult; + async fn confirm_block( + &self, + data: BlockConfirmationData, + ) -> RpcResult; } /// Eth server implementation for local testing @@ -447,6 +453,8 @@ pub mod eth_server { pub genesis_balances: Vec<(Address, U256)>, /// Unsafe blocks count pub unsafe_blocks_count: u64, + /// Custom state root hash + pub custom_state_root: H256, } impl EthImpl { @@ -483,6 +491,7 @@ pub mod eth_server { block_task, genesis_balances: vec![], unsafe_blocks_count: 0, + custom_state_root: EMPTY_ROOT_HASH.into(), } } @@ -494,18 +503,21 @@ pub mod eth_server { } /// Set the genesis balances - pub fn with_genesis_balances(balances: Vec<(Address, U256)>) -> Self { - let mut instance = Self::new(); - instance.genesis_balances = balances; - instance + pub fn with_genesis_balances(mut self, balances: Vec<(Address, U256)>) -> Self { + self.genesis_balances = balances; + self + } + + /// Set a custom state root hash + pub fn with_state_root(mut self, state_root: did::H256) -> Self { + self.custom_state_root = state_root; + self } /// Returns an implementation of Bitfinity EVM canister API pub fn bf_impl(&mut self, unsafe_blocks_count: u64) -> BfEvmImpl { self.unsafe_blocks_count = unsafe_blocks_count; - BfEvmImpl { - confirm_until: u64::MAX, - } + BfEvmImpl { confirm_until: u64::MAX } } } @@ -550,7 +562,7 @@ pub mod eth_server { timestamp: did::U256::from(1234567890_u64 + block_num), gas_limit: did::U256::from(30_000_000_u64), base_fee_per_gas: Some(did::U256::from(7_u64)), - state_root: EMPTY_ROOT_HASH.into(), + state_root: self.custom_state_root.clone(), receipts_root: EMPTY_RECEIPTS.into(), transactions_root: EMPTY_TRANSACTIONS.into(), parent_hash: if block_num == 0 { @@ -625,7 +637,10 @@ pub mod eth_server { #[async_trait::async_trait] impl BfEvmServer for BfEvmImpl { - async fn confirm_block(&self, data: BlockConfirmationData) -> RpcResult { + async fn confirm_block( + &self, + data: BlockConfirmationData, + ) -> RpcResult { if data.block_number > self.confirm_until { Ok(BlockConfirmationResult::NotConfirmed) } else { diff --git a/crates/bitfinity-block-confirmation/src/lib.rs b/crates/bitfinity-block-confirmation/src/lib.rs index 9110037ad13..fcebeedfebf 100644 --- a/crates/bitfinity-block-confirmation/src/lib.rs +++ b/crates/bitfinity-block-confirmation/src/lib.rs @@ -323,7 +323,6 @@ mod tests { let base_fee_per_gas = header.next_block_base_fee(BaseFeeParams::ethereum()); let state_root = StateRoot::from_tx(provider_factory.provider().unwrap().tx_ref()).root().unwrap(); - let chain_spec = provider_factory.chain_spec(); let block = Block { header: Header { @@ -781,12 +780,27 @@ mod tests { let outcome = to_execution_outcome(block.number, &block_output); + let inital_state = + StateRoot::from_tx(block_validator.provider_factory.provider().unwrap().tx_ref()) + .root() + .unwrap(); + let computed_pow = block_validator.compute_pow_hash(&block.block, outcome.clone()).await.unwrap(); + let post_execution_state = + StateRoot::from_tx(block_validator.provider_factory.provider().unwrap().tx_ref()) + .root() + .unwrap(); + assert_eq!( expected_pow_hash, computed_pow, "POW hash should be deterministic given the same state" ); + + assert_eq!( + inital_state, post_execution_state, + "State should remain unchanged after block execution" + ); } } From cc7ffa0229b5f82d4518f514b99538612b0b80c0 Mon Sep 17 00:00:00 2001 From: Yasir Date: Fri, 7 Mar 2025 15:20:28 +0300 Subject: [PATCH 26/38] fix: add extra args --- crates/bitfinity-block-confirmation/src/lib.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/crates/bitfinity-block-confirmation/src/lib.rs b/crates/bitfinity-block-confirmation/src/lib.rs index fcebeedfebf..8f177b6ca5e 100644 --- a/crates/bitfinity-block-confirmation/src/lib.rs +++ b/crates/bitfinity-block-confirmation/src/lib.rs @@ -183,7 +183,8 @@ where let (from, _) = genesis_accounts.first().ok_or_else(|| eyre!("no genesis accounts"))?; - let pow_tx = did::utils::block_confirmation_pow_transaction(from.clone(), base_fee); + let pow_tx = + did::utils::block_confirmation_pow_transaction(from.clone(), base_fee, None, None); // Simple transaction let to = match pow_tx.to { From d3a17fee56a789b0c83e98dedbbe094a17ef507d Mon Sep 17 00:00:00 2001 From: Francesco Date: Mon, 10 Mar 2025 10:07:31 +0100 Subject: [PATCH 27/38] fix cargo lock --- Cargo.lock | 867 ++++++++++++++++++++++++++++------------------------- 1 file changed, 466 insertions(+), 401 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 3f183b8c327..1584d258866 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -76,9 +76,9 @@ dependencies = [ [[package]] name = "aligned-vec" -version = "0.6.1" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e0966165eaf052580bd70eb1b32cb3d6245774c0104d1b2793e9650bf83b52a" +checksum = "af15ccceeacb9304119d97925de463bc97ae3555ee8dc8056f67b119f66e5934" dependencies = [ "equator", ] @@ -120,9 +120,9 @@ dependencies = [ [[package]] name = "alloy-chains" -version = "0.1.61" +version = "0.1.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a754dbb534198644cb8355b8c23f4aaecf03670fb9409242be1fa1e25897ee9" +checksum = "963fc7ac17f25d92c237448632330eb87b39ba8aa0209d4b517069a05b57db62" dependencies = [ "alloy-primitives", "alloy-rlp", @@ -130,7 +130,7 @@ dependencies = [ "num_enum", "proptest", "serde", - "strum", + "strum 0.27.1", ] [[package]] @@ -185,14 +185,14 @@ dependencies = [ "alloy-transport", "futures", "futures-util", - "thiserror 2.0.11", + "thiserror 2.0.12", ] [[package]] name = "alloy-core" -version = "0.8.21" +version = "0.8.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "482f377cebceed4bb1fb5e7970f0805e2ab123d06701be9351b67ed6341e74aa" +checksum = "45ef3546f382c07c7c2e1d24844ed593e1c9b272236aedf635e4a295fb3fc9d0" dependencies = [ "alloy-primitives", "alloy-rlp", @@ -200,16 +200,16 @@ dependencies = [ [[package]] name = "alloy-dyn-abi" -version = "0.8.21" +version = "0.8.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "555896f0b8578adb522b1453b6e6cc6704c3027bd0af20058befdde992cee8e9" +checksum = "00e08c581811006021970bf07f2ecf3213f6237c125f7fd99607004b23627b61" dependencies = [ "alloy-json-abi", "alloy-primitives", "alloy-sol-type-parser", "alloy-sol-types", "const-hex", - "derive_more 1.0.0", + "derive_more 2.0.1", "itoa", "serde", "serde_json", @@ -228,7 +228,7 @@ dependencies = [ "crc", "rand 0.8.5", "serde", - "thiserror 2.0.11", + "thiserror 2.0.12", ] [[package]] @@ -246,18 +246,18 @@ dependencies = [ [[package]] name = "alloy-eip7702" -version = "0.5.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cabf647eb4650c91a9d38cb6f972bb320009e7e9d61765fb688a86f1563b33e8" +checksum = "9b15b13d38b366d01e818fe8e710d4d702ef7499eacd44926a06171dd9585d0c" dependencies = [ "alloy-primitives", "alloy-rlp", "arbitrary", - "derive_more 1.0.0", "k256", "rand 0.8.5", "serde", "serde_with", + "thiserror 2.0.12", ] [[package]] @@ -296,9 +296,9 @@ dependencies = [ [[package]] name = "alloy-json-abi" -version = "0.8.21" +version = "0.8.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4012581681b186ba0882007ed873987cc37f86b1b488fe6b91d5efd0b585dc41" +checksum = "125601804507fef5ae7debcbf800906b12741f19800c1c05b953d0f1b990131a" dependencies = [ "alloy-primitives", "alloy-sol-type-parser", @@ -316,7 +316,7 @@ dependencies = [ "alloy-sol-types", "serde", "serde_json", - "thiserror 2.0.11", + "thiserror 2.0.12", "tracing", ] @@ -342,7 +342,7 @@ dependencies = [ "futures-utils-wasm", "serde", "serde_json", - "thiserror 2.0.11", + "thiserror 2.0.12", ] [[package]] @@ -370,16 +370,16 @@ dependencies = [ "rand 0.8.5", "serde_json", "tempfile", - "thiserror 2.0.11", + "thiserror 2.0.12", "tracing", "url", ] [[package]] name = "alloy-primitives" -version = "0.8.21" +version = "0.8.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "478bedf4d24e71ea48428d1bc278553bd7c6ae07c30ca063beb0b09fe58a9e74" +checksum = "8c66bb6715b7499ea755bde4c96223ae8eb74e05c014ab38b9db602879ffb825" dependencies = [ "alloy-rlp", "arbitrary", @@ -387,7 +387,7 @@ dependencies = [ "cfg-if", "const-hex", "derive_arbitrary", - "derive_more 1.0.0", + "derive_more 2.0.1", "foldhash", "getrandom 0.2.15", "hashbrown 0.15.2", @@ -440,7 +440,7 @@ dependencies = [ "schnellru", "serde", "serde_json", - "thiserror 2.0.11", + "thiserror 2.0.12", "tokio", "tracing", "url", @@ -485,7 +485,7 @@ checksum = "a40e1ef334153322fd878d07e86af7a529bcb86b2439525920a88eba87bcf943" dependencies = [ "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.100", ] [[package]] @@ -574,7 +574,7 @@ dependencies = [ "ethereum_ssz_derive", "serde", "serde_with", - "thiserror 2.0.11", + "thiserror 2.0.12", ] [[package]] @@ -605,7 +605,7 @@ dependencies = [ "jsonwebtoken", "rand 0.8.5", "serde", - "strum", + "strum 0.26.3", ] [[package]] @@ -627,7 +627,7 @@ dependencies = [ "jsonrpsee-types", "serde", "serde_json", - "thiserror 2.0.11", + "thiserror 2.0.12", ] [[package]] @@ -655,7 +655,7 @@ dependencies = [ "alloy-serde", "serde", "serde_json", - "thiserror 2.0.11", + "thiserror 2.0.12", ] [[package]] @@ -693,7 +693,7 @@ dependencies = [ "auto_impl", "elliptic-curve", "k256", - "thiserror 2.0.11", + "thiserror 2.0.12", ] [[package]] @@ -711,28 +711,28 @@ dependencies = [ "coins-bip39", "k256", "rand 0.8.5", - "thiserror 2.0.11", + "thiserror 2.0.12", ] [[package]] name = "alloy-sol-macro" -version = "0.8.21" +version = "0.8.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2708e27f58d747423ae21d31b7a6625159bd8d867470ddd0256f396a68efa11" +checksum = "c7f9c3c7bc1f4e334e5c5fc59ec8dac894973a71b11da09065affc6094025049" dependencies = [ "alloy-sol-macro-expander", "alloy-sol-macro-input", "proc-macro-error2", "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.100", ] [[package]] name = "alloy-sol-macro-expander" -version = "0.8.21" +version = "0.8.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6b7984d7e085dec382d2c5ef022b533fcdb1fe6129200af30ebf5afddb6a361" +checksum = "46ff7aa715eb2404cb87fa94390d2c5d5addd70d9617e20b2398ee6f48cb21f0" dependencies = [ "alloy-sol-macro-input", "const-hex", @@ -741,31 +741,31 @@ dependencies = [ "proc-macro-error2", "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.100", "syn-solidity", "tiny-keccak", ] [[package]] name = "alloy-sol-macro-input" -version = "0.8.21" +version = "0.8.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33d6a9fc4ed1a3c70bdb2357bec3924551c1a59f24e5a04a74472c755b37f87d" +checksum = "6f105fa700140c0cc6e2c3377adef650c389ac57b8ead8318a2e6bd52f1ae841" dependencies = [ "const-hex", "dunce", "heck", "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.100", "syn-solidity", ] [[package]] name = "alloy-sol-type-parser" -version = "0.8.21" +version = "0.8.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b1b3e9a48a6dd7bb052a111c8d93b5afc7956ed5e2cb4177793dc63bb1d2a36" +checksum = "c649acc6c9d3893e392c737faeadce30b4a1751eed148ae43bc2f27f29c4480c" dependencies = [ "serde", "winnow", @@ -773,9 +773,9 @@ dependencies = [ [[package]] name = "alloy-sol-types" -version = "0.8.21" +version = "0.8.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6044800da35c38118fd4b98e18306bd3b91af5dedeb54c1b768cf1b4fb68f549" +checksum = "5f819635439ebb06aa13c96beac9b2e7360c259e90f5160a6848ae0d94d10452" dependencies = [ "alloy-json-abi", "alloy-primitives", @@ -796,7 +796,7 @@ dependencies = [ "futures-utils-wasm", "serde", "serde_json", - "thiserror 2.0.11", + "thiserror 2.0.12", "tokio", "tower 0.5.2", "tracing", @@ -949,9 +949,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.95" +version = "1.0.97" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34ac096ce696dc2fcabef30516bb13c0a68a11d30131d3df6f04711467681b04" +checksum = "dcfed56ad506cb2c684a14971b8861fdc3baaaae314b9e5f9bb532cbe3ba7a4f" [[package]] name = "aquamarine" @@ -964,7 +964,7 @@ dependencies = [ "proc-macro-error2", "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.100", ] [[package]] @@ -1164,9 +1164,9 @@ dependencies = [ [[package]] name = "async-compression" -version = "0.4.18" +version = "0.4.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df895a515f70646414f4b45c0b79082783b80552b373a68283012928df56f522" +checksum = "310c9bcae737a48ef5cdee3174184e6d548b292739ede61a1f955ef76a738861" dependencies = [ "brotli", "flate2", @@ -1197,7 +1197,7 @@ checksum = "3b43422f69d8ff38f95f1b2bb76517c91589a924d1559a0e935d7c8ce0274c11" dependencies = [ "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.100", ] [[package]] @@ -1233,18 +1233,18 @@ checksum = "c7c24de15d275a1ecfd47a380fb4d5ec9bfe0933f309ed5e705b775596a3574d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.100", ] [[package]] name = "async-trait" -version = "0.1.86" +version = "0.1.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "644dd749086bf3771a2fbc5f256fdb982d53f011c7d5d560304eafeecebce79d" +checksum = "d556ec1359574147ec0c4fc5eb525f3f23263a592b1a9c07e0a75b427de55c97" dependencies = [ "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.100", ] [[package]] @@ -1291,7 +1291,7 @@ checksum = "e12882f59de5360c748c4cbf569a042d5fb0eb515f7bea9c1f470b47f6ffbd73" dependencies = [ "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.100", ] [[package]] @@ -1313,9 +1313,9 @@ dependencies = [ [[package]] name = "backon" -version = "1.3.0" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba5289ec98f68f28dd809fd601059e6aa908bb8f6108620930828283d4ee23d7" +checksum = "49fef586913a57ff189f25c9b3d034356a5bf6b3fa9a7f067588fe1698ba1f5d" dependencies = [ "fastrand 2.3.0", "tokio", @@ -1399,7 +1399,7 @@ version = "0.70.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f49d8fed880d473ea71efb9bf597651e77201bdd4893efe54c9e5d65ae04ce6f" dependencies = [ - "bitflags 2.8.0", + "bitflags 2.9.0", "cexpr", "clang-sys", "itertools 0.13.0", @@ -1408,7 +1408,7 @@ dependencies = [ "regex", "rustc-hash 1.1.0", "shlex", - "syn 2.0.98", + "syn 2.0.100", ] [[package]] @@ -1500,9 +1500,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.8.0" +version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f68f53c83ab957f72c32642f3868eec03eb974d1fb82e453128456482613d36" +checksum = "5c8214115b7bf84099f1309324e63141d4c5d7cc26862f97a0a857dbefe165bd" dependencies = [ "arbitrary", "serde", @@ -1566,7 +1566,7 @@ version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2c340fe0f0b267787095cbe35240c6786ff19da63ec7b69367ba338eace8169b" dependencies = [ - "bitflags 2.8.0", + "bitflags 2.9.0", "boa_interner", "boa_macros", "boa_string", @@ -1582,7 +1582,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f620c3f06f51e65c0504ddf04978be1b814ac6586f0b45f6019801ab5efd37f9" dependencies = [ "arrayvec 0.7.6", - "bitflags 2.8.0", + "bitflags 2.9.0", "boa_ast", "boa_gc", "boa_interner", @@ -1616,7 +1616,7 @@ dependencies = [ "static_assertions", "tap", "thin-vec", - "thiserror 2.0.11", + "thiserror 2.0.12", "time", ] @@ -1657,7 +1657,7 @@ checksum = "9fd3f870829131332587f607a7ff909f1af5fc523fd1b192db55fbbdf52e8d3c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.100", "synstructure", ] @@ -1667,7 +1667,7 @@ version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9cc142dac798cdc6e2dbccfddeb50f36d2523bb977a976e19bdb3ae19b740804" dependencies = [ - "bitflags 2.8.0", + "bitflags 2.9.0", "boa_ast", "boa_interner", "boa_macros", @@ -1758,15 +1758,15 @@ checksum = "1628fb46dfa0b37568d12e5edd512553eccf6a22a78e8bde00bb4aed84d5bdbf" [[package]] name = "byte-slice-cast" -version = "1.2.2" +version = "1.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3ac9f8b63eca6fd385229b3675f6cc0dc5c8a5c8a54a59d4f52ffd670d87b0c" +checksum = "7575182f7272186991736b70173b0ea045398f984bf5ebbb3804736ce1330c9d" [[package]] name = "bytemuck" -version = "1.21.0" +version = "1.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef657dfab802224e671f5818e9a4935f9b1957ed18e58292690cc39e7a4092a3" +checksum = "b6b1fc10dbac614ebc03540c9dbd60e83887fda27794998c6528f1782047d540" dependencies = [ "bytemuck_derive", ] @@ -1779,7 +1779,7 @@ checksum = "3fa76293b4f7bb636ab88fd78228235b5248b4d05cc589aed610f954af5d7c7a" dependencies = [ "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.100", ] [[package]] @@ -1790,9 +1790,9 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.10.0" +version = "1.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f61dac84819c6588b558454b194026eb1f09c293b9036ae9b159e74e73ab6cf9" +checksum = "d71b6127be86fdcfddb610f7182ac57211d4b18a3e9c82eb2d17662f2227ad6a" dependencies = [ "serde", ] @@ -1849,7 +1849,7 @@ dependencies = [ "darling", "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.100", ] [[package]] @@ -1899,7 +1899,7 @@ dependencies = [ "lazy_static", "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.100", ] [[package]] @@ -1919,7 +1919,7 @@ checksum = "2d886547e41f740c616ae73108f6eb70afe6d940c7bc697cb30f13daec073037" dependencies = [ "camino", "cargo-platform", - "semver 1.0.25", + "semver 1.0.26", "serde", "serde_json", "thiserror 1.0.69", @@ -1948,9 +1948,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.2.14" +version = "1.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c3d1b2e905a3a7b00a6141adb0e4c0bb941d11caf55349d863942a1cc44e3c9" +checksum = "be714c154be609ec7f5dad223a33bf1482fff90472de28f7362806e6d4832b8c" dependencies = [ "jobserver", "libc", @@ -1986,9 +1986,9 @@ checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" [[package]] name = "chrono" -version = "0.4.39" +version = "0.4.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e36cc9d416881d2e24f9a963be5fb1cd90966419ac844274161d10488b3e825" +checksum = "1a7964611d71df112cb1730f2ee67324fcf4d0fc6606acbbe9bfe06df124637c" dependencies = [ "android-tzdata", "iana-time-zone", @@ -1996,7 +1996,7 @@ dependencies = [ "num-traits", "serde", "wasm-bindgen", - "windows-targets 0.52.6", + "windows-link", ] [[package]] @@ -2070,9 +2070,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.29" +version = "4.5.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8acebd8ad879283633b343856142139f2da2317c96b05b4dd6181c61e2480184" +checksum = "027bb0d98429ae334a8698531da7077bdf906419543a35a55c2cb1b66437d767" dependencies = [ "clap_builder", "clap_derive", @@ -2080,9 +2080,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.29" +version = "4.5.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6ba32cbda51c7e1dfd49acc1457ba1a7dec5b64fe360e828acb13ca8dc9c2f9" +checksum = "5589e0cba072e0f3d23791efac0fd8627b49c829c196a492e88168e6a669d863" dependencies = [ "anstream", "anstyle", @@ -2099,7 +2099,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.100", ] [[package]] @@ -2110,9 +2110,9 @@ checksum = "f46ad14479a25103f283c0f10005961cf086d8dc42205bb44c46ac563475dca6" [[package]] name = "codspeed" -version = "2.8.0" +version = "2.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25d2f5a6570db487f5258e0bded6352fa2034c2aeb46bb5cc3ff060a0fcfba2f" +checksum = "de4b67ff8985f3993f06167d71cf4aec178b0a1580f91a987170c59d60021103" dependencies = [ "colored", "libc", @@ -2123,9 +2123,9 @@ dependencies = [ [[package]] name = "codspeed-criterion-compat" -version = "2.8.0" +version = "2.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f53a55558dedec742b14aae3c5fec389361b8b5ca28c1aadf09dd91faf710074" +checksum = "68403d768ed1def18a87e2306676781314448393ecf0d3057c4527cabf524a3d" dependencies = [ "codspeed", "colored", @@ -2198,7 +2198,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "117725a109d387c937a1533ce01b450cbde6b88abceea8473c4d7a85853cda3c" dependencies = [ "lazy_static", - "windows-sys 0.48.0", + "windows-sys 0.59.0", ] [[package]] @@ -2256,9 +2256,9 @@ dependencies = [ [[package]] name = "console" -version = "0.15.10" +version = "0.15.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea3c6ecd8059b57859df5c69830340ed3c41d30e3da0c1cbed90a96ac853041b" +checksum = "054ccb5b10f9f2cbf51eb355ca1d05c2d279ce1804688d0db74b4733a5aeafd8" dependencies = [ "encode_unicode", "libc", @@ -2486,11 +2486,11 @@ version = "0.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "829d955a0bb380ef178a640b91779e3987da38c9aea133b20614cfed8cdea9c6" dependencies = [ - "bitflags 2.8.0", + "bitflags 2.9.0", "crossterm_winapi", "mio 1.0.3", "parking_lot", - "rustix", + "rustix 0.38.44", "signal-hook", "signal-hook-mio", "winapi", @@ -2598,7 +2598,7 @@ checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.100", ] [[package]] @@ -2635,7 +2635,7 @@ dependencies = [ "proc-macro2", "quote", "strsim", - "syn 2.0.98", + "syn 2.0.100", ] [[package]] @@ -2646,7 +2646,7 @@ checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" dependencies = [ "darling_core", "quote", - "syn 2.0.98", + "syn 2.0.100", ] [[package]] @@ -2687,7 +2687,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "18e4fdb82bd54a12e42fb58a800dcae6b9e13982238ce2296dc3570b92148e1f" dependencies = [ "data-encoding", - "syn 2.0.98", + "syn 2.0.100", ] [[package]] @@ -2756,7 +2756,7 @@ checksum = "30542c1ad912e0e3d22a1935c290e12e8a29d704a420177a31faad4a601a0800" dependencies = [ "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.100", ] [[package]] @@ -2786,7 +2786,7 @@ dependencies = [ "convert_case", "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.100", "unicode-xid", ] @@ -2798,14 +2798,14 @@ checksum = "bda628edc44c4bb645fbe0f758797143e4e07926f7ebf4e9bdfbd3d2ce621df3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.100", "unicode-xid", ] [[package]] name = "did" -version = "0.43.0" -source = "git+https://github.com/bitfinity-network/bitfinity-evm-sdk?branch=EPROD-1132_block_validation#5a78caa97432afef74674d3f2cdc8a13fed5ee8f" +version = "0.44.0" +source = "git+https://github.com/bitfinity-network/bitfinity-evm-sdk?branch=EPROD-1132_block_validation#3e51b43de7ef5be1b001cdd9e629c06c19c049c8" dependencies = [ "alloy", "bincode", @@ -2822,7 +2822,7 @@ dependencies = [ "serde_with", "sha2 0.10.8", "sha3", - "thiserror 2.0.11", + "thiserror 2.0.12", ] [[package]] @@ -2935,7 +2935,7 @@ checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.100", ] [[package]] @@ -2952,9 +2952,9 @@ checksum = "92773504d58c093f6de2459af4af33faa518c13451eb8f2b5698ed3d36e7c813" [[package]] name = "dyn-clone" -version = "1.0.18" +version = "1.0.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "feeef44e73baff3a26d371801df019877a9866a8c493d315ab00177843314f35" +checksum = "1c7a8fb8a9fbf66c1f703fe16184d10ca0ee9d23be5b4436400408ba54a95005" [[package]] name = "ecdsa" @@ -3031,15 +3031,15 @@ dependencies = [ "revm", "serde", "serde_json", - "thiserror 2.0.11", + "thiserror 2.0.12", "walkdir", ] [[package]] name = "either" -version = "1.13.0" +version = "1.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" +checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719" [[package]] name = "elliptic-curve" @@ -3097,7 +3097,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.100", ] [[package]] @@ -3108,7 +3108,7 @@ checksum = "2f9ed6b3789237c8a0c1c505af1c7eb2c560df6186f01b098c3a1064ea532f38" dependencies = [ "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.100", ] [[package]] @@ -3123,22 +3123,22 @@ dependencies = [ [[package]] name = "equator" -version = "0.2.2" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c35da53b5a021d2484a7cc49b2ac7f2d840f8236a286f84202369bd338d761ea" +checksum = "4711b213838dfee0117e3be6ac926007d7f433d7bbe33595975d4190cb07e6fc" dependencies = [ "equator-macro", ] [[package]] name = "equator-macro" -version = "0.2.1" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3bf679796c0322556351f287a51b49e48f7c4986e727b5dd78c972d30e2e16cc" +checksum = "44f23cf4b44bfce11a86ace86f8a73ffdec849c9fd00a386a53d278bd9e81fb3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.100", ] [[package]] @@ -3159,8 +3159,8 @@ dependencies = [ [[package]] name = "ethereum-json-rpc-client" -version = "0.43.0" -source = "git+https://github.com/bitfinity-network/bitfinity-evm-sdk?branch=EPROD-1132_block_validation#5a78caa97432afef74674d3f2cdc8a13fed5ee8f" +version = "0.44.0" +source = "git+https://github.com/bitfinity-network/bitfinity-evm-sdk?branch=EPROD-1132_block_validation#3e51b43de7ef5be1b001cdd9e629c06c19c049c8" dependencies = [ "alloy", "anyhow", @@ -3213,7 +3213,7 @@ dependencies = [ "darling", "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.100", ] [[package]] @@ -3245,8 +3245,8 @@ dependencies = [ [[package]] name = "evm-canister-client" -version = "0.43.0" -source = "git+https://github.com/bitfinity-network/bitfinity-evm-sdk?branch=EPROD-1132_block_validation#5a78caa97432afef74674d3f2cdc8a13fed5ee8f" +version = "0.44.0" +source = "git+https://github.com/bitfinity-network/bitfinity-evm-sdk?branch=EPROD-1132_block_validation#3e51b43de7ef5be1b001cdd9e629c06c19c049c8" dependencies = [ "candid", "did", @@ -3269,7 +3269,7 @@ dependencies = [ "reth-node-ethereum", "serde", "serde_json", - "thiserror 2.0.11", + "thiserror 2.0.12", ] [[package]] @@ -3357,7 +3357,7 @@ dependencies = [ "reth-tracing", "reth-trie-db", "serde", - "thiserror 2.0.11", + "thiserror 2.0.12", "tokio", ] @@ -3624,6 +3624,17 @@ dependencies = [ "bytes", ] +[[package]] +name = "fastrlp" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce8dba4714ef14b8274c371879b175aa55b16b30f269663f19d576f380018dc4" +dependencies = [ + "arrayvec 0.7.6", + "auto_impl", + "bytes", +] + [[package]] name = "fdlimit" version = "0.3.0" @@ -3636,9 +3647,9 @@ dependencies = [ [[package]] name = "ff" -version = "0.13.0" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ded41244b729663b1e574f1b4fb731469f69f79c17667b5d776b16cda0479449" +checksum = "c0b50bfb653653f9ca9095b427bed08ab8d75a137839d9ad64eb11810d5b6393" dependencies = [ "rand_core 0.6.4", "subtle", @@ -3688,9 +3699,9 @@ dependencies = [ [[package]] name = "flate2" -version = "1.0.35" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c936bfdafb507ebbf50b8074c54fa31c5be9a1e7e5f467dd659697041407d07c" +checksum = "11faaf5a5236997af9848be0bef4db95824b1d534ebc64d0f0c6cf3e67bd38dc" dependencies = [ "crc32fast", "miniz_oxide", @@ -3803,7 +3814,7 @@ checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" dependencies = [ "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.100", ] [[package]] @@ -3994,9 +4005,9 @@ dependencies = [ [[package]] name = "h2" -version = "0.4.7" +version = "0.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ccae279728d634d083c00f6099cb58f01cc99c145b84b8be2f6c74618d79922e" +checksum = "5017294ff4bb30944501348f6f8e42e6ad28f42c8bbef7a74029aff064a4e3c2" dependencies = [ "atomic-waker", "bytes", @@ -4100,9 +4111,9 @@ checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" [[package]] name = "hermit-abi" -version = "0.4.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbf6a919d6cf397374f7dfeeea91d974c7c0a7221d0d0f4f20d859d329e53fcc" +checksum = "fbd780fe5cc30f81464441920d82ac8740e2e46b29a6fad543ddd075229ce37e" [[package]] name = "hex" @@ -4132,7 +4143,7 @@ dependencies = [ "once_cell", "rand 0.9.0", "serde", - "thiserror 2.0.11", + "thiserror 2.0.12", "tinyvec", "tokio", "tracing", @@ -4156,7 +4167,7 @@ dependencies = [ "resolv-conf", "serde", "smallvec", - "thiserror 2.0.11", + "thiserror 2.0.12", "tokio", "tracing", ] @@ -4273,9 +4284,9 @@ dependencies = [ [[package]] name = "httparse" -version = "1.10.0" +version = "1.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2d708df4e7140240a16cd6ab0ab65c972d7433ab77819ea693fde9c43811e2a" +checksum = "6dbf3de79e51f3d586ab4cb9d5c3e2c14aa28ed23d180cf89b4df0454a69cc87" [[package]] name = "httpdate" @@ -4429,7 +4440,7 @@ dependencies = [ "sha2 0.10.8", "simple_asn1", "stop-token", - "thiserror 2.0.11", + "thiserror 2.0.12", "time", "tokio", "tower-service", @@ -4446,7 +4457,7 @@ dependencies = [ "ic-agent", "ic-exports", "serde", - "thiserror 2.0.11", + "thiserror 2.0.12", ] [[package]] @@ -4486,7 +4497,7 @@ dependencies = [ "quote", "serde", "serde_tokenstream", - "syn 2.0.98", + "syn 2.0.100", ] [[package]] @@ -4587,9 +4598,9 @@ dependencies = [ [[package]] name = "ic-stable-structures" -version = "0.6.7" +version = "0.6.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b492c5a16455ae78623eaa12ead96dda6c69a83c535b1b00789f19b381c8a24c" +checksum = "f0f5684f577e0146738cd11afed789109c4f51ba963c75823c48c1501dc53278" dependencies = [ "ic_principal", ] @@ -4600,10 +4611,10 @@ version = "0.23.0" source = "git+https://github.com/bitfinity-network/canister-sdk?tag=v0.23.x#8e7672dbc3c21376051e9150d4ff982b3effe009" dependencies = [ "candid", - "ic-stable-structures 0.6.7", + "ic-stable-structures 0.6.8", "parking_lot", "schnellru", - "thiserror 2.0.11", + "thiserror 2.0.12", ] [[package]] @@ -4621,7 +4632,7 @@ dependencies = [ "serde_cbor", "serde_repr", "sha2 0.10.8", - "thiserror 2.0.11", + "thiserror 2.0.12", ] [[package]] @@ -4786,7 +4797,7 @@ checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.100", ] [[package]] @@ -4843,7 +4854,7 @@ checksum = "a0eb5a3343abf848c0984fe4604b2b105da9539376e24fc0a3b0007411ae4fd9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.100", ] [[package]] @@ -4896,9 +4907,9 @@ dependencies = [ [[package]] name = "indoc" -version = "2.0.5" +version = "2.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b248f5224d1d606005e02c97f5aa4e88eeb230488bcc03bc9ca4d7991399f2b5" +checksum = "f4c7245a08504955605670dbf141fceab975f15ca21570696aebe9d2e71576bd" [[package]] name = "infer" @@ -4946,9 +4957,9 @@ dependencies = [ [[package]] name = "inout" -version = "0.1.3" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0c10553d664a4d0bcff9f4215d0aac67a639cc68ef660840afe309b807bc9f5" +checksum = "879f10e63c20629ecabbb64a8010319738c66a5cd0c29b02d63d272b03751d01" dependencies = [ "block-padding", "generic-array", @@ -4964,7 +4975,7 @@ dependencies = [ "indoc", "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.100", ] [[package]] @@ -4978,9 +4989,9 @@ dependencies = [ [[package]] name = "interprocess" -version = "2.2.2" +version = "2.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "894148491d817cb36b6f778017b8ac46b17408d522dd90f539d677ea938362eb" +checksum = "d941b405bd2322993887859a8ee6ac9134945a24ec5ec763a8a962fc64dfec2d" dependencies = [ "doctest-file", "futures-core", @@ -5030,11 +5041,11 @@ dependencies = [ [[package]] name = "is-terminal" -version = "0.4.15" +version = "0.4.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e19b23d53f35ce9f56aebc7d1bb4e6ac1e9c0db7ac85c8d1760c04379edced37" +checksum = "e04d7f318608d35d4b61ddd75cbdaee86b023ebe2bd5a66ee0915f0bf93095a9" dependencies = [ - "hermit-abi 0.4.0", + "hermit-abi 0.5.0", "libc", "windows-sys 0.59.0", ] @@ -5074,9 +5085,9 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.14" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d75a2a4b1b190afb6f5425f10f6a8f959d2ea0b9c2b1d79553551850539e4674" +checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" [[package]] name = "jni" @@ -5237,7 +5248,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.100", ] [[package]] @@ -5389,9 +5400,9 @@ checksum = "884e2677b40cc8c339eaefcb701c32ef1fd2493d71118dc0ca4b6a736c93bd67" [[package]] name = "libc" -version = "0.2.169" +version = "0.2.170" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5aba8db14291edd000dfcc4d620c7ebfb122c613afb886ca8803fa4e128a20a" +checksum = "875b3680cb2f8f71bdcf9a30f38d48282f5d3c95cbf9b3fa57269bb5d5c06828" [[package]] name = "libloading" @@ -5400,9 +5411,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fc2f4eb4bc735547cfed7c0a4922cbd04a4655978c09b54f1f7b228750664c34" dependencies = [ "cfg-if", - "windows-targets 0.48.5", + "windows-targets 0.52.6", ] +[[package]] +name = "libm" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8355be11b20d696c8f18f6cc018c4e372165b1fa8126cef092399c9951984ffa" + [[package]] name = "libp2p-identity" version = "0.2.10" @@ -5439,7 +5456,7 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" dependencies = [ - "bitflags 2.8.0", + "bitflags 2.9.0", "libc", "redox_syscall", ] @@ -5530,11 +5547,17 @@ version = "0.4.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d26c52dbd32dccf2d10cac7725f8eae5296885fb5703b261f7d0a0739ec807ab" +[[package]] +name = "linux-raw-sys" +version = "0.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6db9c683daf087dc577b7506e9695b3d556a9f3849903fa28186283afd6809e9" + [[package]] name = "litemap" -version = "0.7.4" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ee93343901ab17bd981295f2cf0026d4ad018c7c31ba84549a4ddbb47a45104" +checksum = "23fb14cb19457329c82206317a5663005a4d404783dc74f4252769b0d5f42856" [[package]] name = "lock_api" @@ -5549,9 +5572,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.25" +version = "0.4.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04cbf5b083de1c7e0222a7a51dbfdba1cbe1c6ab0b15e29fff3f6c077fd9cd9f" +checksum = "30bde2b3dc3671ae49d8e2e9f044c7c005836e7a023ee57cffa25ab82764bb9e" [[package]] name = "loom" @@ -5648,7 +5671,7 @@ dependencies = [ "proc-macro2", "quote", "regex", - "syn 2.0.98", + "syn 2.0.100", ] [[package]] @@ -5755,9 +5778,9 @@ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" [[package]] name = "miniz_oxide" -version = "0.8.4" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3b1c9bd4fe1f0f8b387f6eb9eb3b4a1aa26185e5750efb9140301703f62cd1b" +checksum = "8e3e04debbb59698c15bacbb6d93584a8c0ca9cc3213cb423d31f760d8843ce5" dependencies = [ "adler2", ] @@ -5905,7 +5928,7 @@ version = "6.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6205bd8bb1e454ad2e27422015fb5e4f2bcc7e08fa8f27058670d208324a4d2d" dependencies = [ - "bitflags 2.8.0", + "bitflags 2.9.0", "filetime", "fsevent-sys", "inotify", @@ -6025,6 +6048,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" dependencies = [ "autocfg", + "libm", ] [[package]] @@ -6055,7 +6079,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.100", ] [[package]] @@ -6102,9 +6126,9 @@ dependencies = [ [[package]] name = "oorandom" -version = "11.1.4" +version = "11.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b410bbe7e14ab526a0e86877eb47c6996a2bd7746f027ba551028c925390e4e9" +checksum = "d6790f58c7ff633d8771f42965289203411a5e5c68388703c06e14f24770b41e" [[package]] name = "op-alloy-consensus" @@ -6121,7 +6145,7 @@ dependencies = [ "derive_more 1.0.0", "serde", "serde_with", - "thiserror 2.0.11", + "thiserror 2.0.12", ] [[package]] @@ -6153,7 +6177,7 @@ dependencies = [ "alloy-primitives", "alloy-rpc-types-engine", "op-alloy-consensus", - "thiserror 2.0.11", + "thiserror 2.0.12", ] [[package]] @@ -6247,7 +6271,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.100", ] [[package]] @@ -6306,9 +6330,9 @@ dependencies = [ [[package]] name = "pem" -version = "3.0.4" +version = "3.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e459365e590736a54c3fa561947c84837534b8e9af6fc5bf781307e82658fae" +checksum = "38af38e8470ac9dee3ce1bae1af9c1671fffc44ddfd8bd1d0a3445bf349a8ef3" dependencies = [ "base64 0.22.1", "serde", @@ -6336,7 +6360,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b7cafe60d6cf8e62e1b9b2ea516a089c008945bb5a275416789e7db0bc199dc" dependencies = [ "memchr", - "thiserror 2.0.11", + "thiserror 2.0.12", "ucd-trie", ] @@ -6390,7 +6414,7 @@ dependencies = [ "phf_shared", "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.100", ] [[package]] @@ -6404,22 +6428,22 @@ dependencies = [ [[package]] name = "pin-project" -version = "1.1.9" +version = "1.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfe2e71e1471fe07709406bf725f710b02927c9c54b2b5b2ec0e8087d97c327d" +checksum = "677f1add503faace112b9f1373e43e9e054bfdd22ff1a63c1bc485eaec6a6a8a" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.1.9" +version = "1.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6e859e6e5bd50440ab63c47e3ebabc90f26251f7c73c3d3e837b74a1cc3fa67" +checksum = "6e918e4ff8c4549eb882f14b3a4bc8c8bc93de829416eacf579f1207a8fbf861" dependencies = [ "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.100", ] [[package]] @@ -6446,9 +6470,9 @@ dependencies = [ [[package]] name = "pkg-config" -version = "0.3.31" +version = "0.3.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" +checksum = "7edddbd0b52d732b21ad9a5fab5c704c14cd949e5e9a1ec5929a24fded1b904c" [[package]] name = "plain_hasher" @@ -6507,9 +6531,9 @@ dependencies = [ [[package]] name = "portable-atomic" -version = "1.10.0" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "280dc24453071f1b63954171985a0b0d30058d287960968b9b2aca264c8d4ee6" +checksum = "350e9b48cbc6b0e028b0473b114454c6316e57336ee184ceab6e53f72c178b3e" [[package]] name = "powerfmt" @@ -6542,11 +6566,11 @@ dependencies = [ [[package]] name = "ppv-lite86" -version = "0.2.20" +version = "0.2.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77957b295656769bb8ad2b6a6b09d897d94f05c41b069aede1fcdaa675eaea04" +checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9" dependencies = [ - "zerocopy 0.7.35", + "zerocopy 0.8.23", ] [[package]] @@ -6572,12 +6596,12 @@ dependencies = [ [[package]] name = "prettyplease" -version = "0.2.29" +version = "0.2.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6924ced06e1f7dfe3fa48d57b9f74f55d8915f5036121bef647ef4b204895fac" +checksum = "f1ccf34da56fc294e7d4ccf69a85992b7dfb826b7cf57bac6a70bba3494cc08a" dependencies = [ "proc-macro2", - "syn 2.0.98", + "syn 2.0.100", ] [[package]] @@ -6602,9 +6626,9 @@ dependencies = [ [[package]] name = "proc-macro-crate" -version = "3.2.0" +version = "3.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ecf48c7ca261d60b74ab1a7b20da18bede46776b2e55535cb958eb595c5fa7b" +checksum = "edce586971a4dfaa28950c6f18ed55e0406c1ab88bbce2c6f6293a7aaba73d35" dependencies = [ "toml_edit", ] @@ -6628,14 +6652,14 @@ dependencies = [ "proc-macro-error-attr2", "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.100", ] [[package]] name = "proc-macro2" -version = "1.0.93" +version = "1.0.94" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60946a68e5f9d28b0dc1c21bb8a97ee7d018a8b322fa57838ba31cc878e22d99" +checksum = "a31971752e70b8b2686d7e46ec17fb38dad4051d94024c88df49b667caea9c84" dependencies = [ "unicode-ident", ] @@ -6646,13 +6670,13 @@ version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "731e0d9356b0c25f16f33b5be79b1c57b562f141ebfcdb0ad8ac2c13a24293b4" dependencies = [ - "bitflags 2.8.0", + "bitflags 2.9.0", "chrono", "flate2", "hex", "lazy_static", "procfs-core 0.16.0", - "rustix", + "rustix 0.38.44", ] [[package]] @@ -6661,10 +6685,10 @@ version = "0.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cc5b72d8145275d844d4b5f6d4e1eef00c8cd889edb6035c21675d1bb1f45c9f" dependencies = [ - "bitflags 2.8.0", + "bitflags 2.9.0", "hex", "procfs-core 0.17.0", - "rustix", + "rustix 0.38.44", ] [[package]] @@ -6673,7 +6697,7 @@ version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2d3554923a69f4ce04c4a754260c338f505ce22642d3830e049a399fc2059a29" dependencies = [ - "bitflags 2.8.0", + "bitflags 2.9.0", "chrono", "hex", ] @@ -6684,7 +6708,7 @@ version = "0.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "239df02d8349b06fc07398a3a1697b06418223b1c7725085e801e7c0fc6a12ec" dependencies = [ - "bitflags 2.8.0", + "bitflags 2.9.0", "hex", ] @@ -6696,7 +6720,7 @@ checksum = "14cae93065090804185d3b75f0bf93b8eeda30c7a9b4a33d3bdb3988d6229e50" dependencies = [ "bit-set", "bit-vec", - "bitflags 2.8.0", + "bitflags 2.9.0", "lazy_static", "num-traits", "rand 0.8.5", @@ -6726,7 +6750,7 @@ checksum = "4ee1c9ac207483d5e7db4940700de86a9aae46ef90c48b57f99fe7edb8345e49" dependencies = [ "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.100", ] [[package]] @@ -6790,7 +6814,7 @@ dependencies = [ "rustc-hash 2.1.1", "rustls", "socket2", - "thiserror 2.0.11", + "thiserror 2.0.12", "tokio", "tracing", ] @@ -6809,7 +6833,7 @@ dependencies = [ "rustls", "rustls-pki-types", "slab", - "thiserror 2.0.11", + "thiserror 2.0.12", "tinyvec", "tracing", "web-time", @@ -6831,9 +6855,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.38" +version = "1.0.39" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e4dccaaaf89514f546c693ddc140f729f958c247918a13380cccc6078391acc" +checksum = "c1f1914ce909e1658d9907913b4b91947430c7d9be598b15a1912935b8c04801" dependencies = [ "proc-macro2", ] @@ -6876,8 +6900,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3779b94aeb87e8bd4e834cee3650289ee9e0d5677f976ecdb6d219e5f4f6cd94" dependencies = [ "rand_chacha 0.9.0", - "rand_core 0.9.1", - "zerocopy 0.8.18", + "rand_core 0.9.3", + "zerocopy 0.8.23", ] [[package]] @@ -6907,7 +6931,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d3022b5f1df60f26e1ffddd6c66e8aa15de382ae63b3a0c1bfc0e4d3e3f325cb" dependencies = [ "ppv-lite86", - "rand_core 0.9.1", + "rand_core 0.9.3", ] [[package]] @@ -6930,12 +6954,11 @@ dependencies = [ [[package]] name = "rand_core" -version = "0.9.1" +version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a88e0da7a2c97baa202165137c158d0a2e824ac465d13d81046727b34cb247d3" +checksum = "99d9a13982dcf210057a8a78572b2217b667c3beacbf3a0d8b454f6f82837d38" dependencies = [ "getrandom 0.3.1", - "zerocopy 0.8.18", ] [[package]] @@ -6977,7 +7000,7 @@ version = "0.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fdef7f9be5c0122f890d58bdf4d964349ba6a6161f705907526d891efabba57d" dependencies = [ - "bitflags 2.8.0", + "bitflags 2.9.0", "cassowary", "compact_str", "crossterm", @@ -6985,8 +7008,8 @@ dependencies = [ "itertools 0.13.0", "lru", "paste", - "strum", - "strum_macros", + "strum 0.26.3", + "strum_macros 0.26.4", "unicode-segmentation", "unicode-truncate", "unicode-width 0.1.14", @@ -6994,11 +7017,11 @@ dependencies = [ [[package]] name = "raw-cpuid" -version = "11.3.0" +version = "11.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6928fa44c097620b706542d428957635951bade7143269085389d42c8a4927e" +checksum = "c6df7ab838ed27997ba19a4664507e6f82b41fe6e20be42929332156e5e85146" dependencies = [ - "bitflags 2.8.0", + "bitflags 2.9.0", ] [[package]] @@ -7029,11 +7052,11 @@ checksum = "d3edd4d5d42c92f0a659926464d4cce56b562761267ecf0f469d85b7de384175" [[package]] name = "redox_syscall" -version = "0.5.8" +version = "0.5.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03a862b389f93e68874fbf580b9de08dd02facb9a788ebadaf4a3fd33cf58834" +checksum = "0b8c0c260b63a8219631167be35e6a988e9554dbd323f8bd08439c8ed1302bd1" dependencies = [ - "bitflags 2.8.0", + "bitflags 2.9.0", ] [[package]] @@ -7331,7 +7354,7 @@ dependencies = [ "reth-tokio-util", "reth-tracing", "schnellru", - "thiserror 2.0.11", + "thiserror 2.0.12", "tokio", "tokio-stream", "tracing", @@ -7367,7 +7390,7 @@ dependencies = [ "reth-rpc-types-compat", "reth-tracing", "serde", - "thiserror 2.0.11", + "thiserror 2.0.12", "tokio", "tower 0.4.13", "tracing", @@ -7423,7 +7446,7 @@ dependencies = [ "reth-primitives", "reth-primitives-traits", "reth-storage-errors", - "thiserror 2.0.11", + "thiserror 2.0.12", ] [[package]] @@ -7578,7 +7601,7 @@ dependencies = [ "reth-fs-util", "secp256k1", "serde", - "thiserror 2.0.11", + "thiserror 2.0.12", "tikv-jemallocator", "tracy-client", ] @@ -7614,7 +7637,7 @@ dependencies = [ "proc-macro2", "quote", "similar-asserts", - "syn 2.0.98", + "syn 2.0.100", ] [[package]] @@ -7716,11 +7739,11 @@ dependencies = [ "rustc-hash 2.1.1", "serde", "serde_json", - "strum", + "strum 0.26.3", "sysinfo", "tempfile", "test-fuzz", - "thiserror 2.0.11", + "thiserror 2.0.12", ] [[package]] @@ -7778,7 +7801,7 @@ dependencies = [ "reth-trie-db", "serde", "serde_json", - "thiserror 2.0.11", + "thiserror 2.0.12", "tracing", ] @@ -7820,7 +7843,7 @@ dependencies = [ "schnellru", "secp256k1", "serde", - "thiserror 2.0.11", + "thiserror 2.0.12", "tokio", "tokio-stream", "tracing", @@ -7845,7 +7868,7 @@ dependencies = [ "reth-network-peers", "reth-tracing", "secp256k1", - "thiserror 2.0.11", + "thiserror 2.0.12", "tokio", "tracing", ] @@ -7872,7 +7895,7 @@ dependencies = [ "secp256k1", "serde", "serde_with", - "thiserror 2.0.11", + "thiserror 2.0.12", "tokio", "tokio-stream", "tracing", @@ -7922,7 +7945,7 @@ dependencies = [ "reth-tracing", "serde_json", "tempfile", - "thiserror 2.0.11", + "thiserror 2.0.12", "tokio", "tokio-stream", "tokio-util", @@ -7999,7 +8022,7 @@ dependencies = [ "secp256k1", "sha2 0.10.8", "sha3", - "thiserror 2.0.11", + "thiserror 2.0.12", "tokio", "tokio-stream", "tokio-util", @@ -8054,7 +8077,7 @@ dependencies = [ "reth-primitives-traits", "reth-trie", "serde", - "thiserror 2.0.11", + "thiserror 2.0.12", "tokio", ] @@ -8081,7 +8104,7 @@ dependencies = [ "reth-prune", "reth-stages-api", "reth-tasks", - "thiserror 2.0.11", + "thiserror 2.0.12", "tokio", "tokio-stream", ] @@ -8139,7 +8162,7 @@ dependencies = [ "reth-trie-parallel", "reth-trie-sparse", "revm-primitives", - "thiserror 2.0.11", + "thiserror 2.0.12", "tokio", "tracing", ] @@ -8185,7 +8208,7 @@ dependencies = [ "reth-execution-errors", "reth-fs-util", "reth-storage-errors", - "thiserror 2.0.11", + "thiserror 2.0.12", ] [[package]] @@ -8218,7 +8241,7 @@ dependencies = [ "serde", "snap", "test-fuzz", - "thiserror 2.0.11", + "thiserror 2.0.12", "tokio", "tokio-stream", "tokio-util", @@ -8247,7 +8270,7 @@ dependencies = [ "reth-primitives", "reth-primitives-traits", "serde", - "thiserror 2.0.11", + "thiserror 2.0.12", ] [[package]] @@ -8434,7 +8457,7 @@ dependencies = [ "reth-prune-types", "reth-storage-errors", "revm-primitives", - "thiserror 2.0.11", + "thiserror 2.0.12", ] [[package]] @@ -8530,7 +8553,7 @@ dependencies = [ "reth-transaction-pool", "reth-trie-db", "tempfile", - "thiserror 2.0.11", + "thiserror 2.0.12", "tokio", ] @@ -8557,7 +8580,7 @@ version = "1.1.5" dependencies = [ "serde", "serde_json", - "thiserror 2.0.11", + "thiserror 2.0.12", ] [[package]] @@ -8600,7 +8623,7 @@ dependencies = [ "rand 0.8.5", "reth-tracing", "serde_json", - "thiserror 2.0.11", + "thiserror 2.0.12", "tokio", "tokio-stream", "tokio-util", @@ -8612,7 +8635,7 @@ dependencies = [ name = "reth-libmdbx" version = "1.1.5" dependencies = [ - "bitflags 2.8.0", + "bitflags 2.9.0", "byteorder", "codspeed-criterion-compat", "dashmap", @@ -8625,7 +8648,7 @@ dependencies = [ "reth-mdbx-sys", "smallvec", "tempfile", - "thiserror 2.0.11", + "thiserror 2.0.12", "tracing", ] @@ -8664,7 +8687,7 @@ dependencies = [ "reqwest", "reth-tracing", "serde_with", - "thiserror 2.0.11", + "thiserror 2.0.12", "tokio", "tracing", ] @@ -8724,7 +8747,7 @@ dependencies = [ "serial_test", "smallvec", "tempfile", - "thiserror 2.0.11", + "thiserror 2.0.12", "tokio", "tokio-stream", "tokio-util", @@ -8749,7 +8772,7 @@ dependencies = [ "reth-network-types", "reth-tokio-util", "serde", - "thiserror 2.0.11", + "thiserror 2.0.12", "tokio", "tokio-stream", ] @@ -8787,7 +8810,7 @@ dependencies = [ "secp256k1", "serde_json", "serde_with", - "thiserror 2.0.11", + "thiserror 2.0.12", "tokio", "url", ] @@ -8818,7 +8841,7 @@ dependencies = [ "reth-fs-util", "serde", "tempfile", - "thiserror 2.0.11", + "thiserror 2.0.12", "tracing", "zstd", ] @@ -8951,8 +8974,8 @@ dependencies = [ "secp256k1", "serde", "shellexpand", - "strum", - "thiserror 2.0.11", + "strum 0.26.3", + "thiserror 2.0.12", "tokio", "toml", "tracing", @@ -9143,7 +9166,7 @@ dependencies = [ "reth-primitives", "revm-primitives", "serde", - "thiserror 2.0.11", + "thiserror 2.0.12", "tokio", ] @@ -9242,7 +9265,7 @@ dependencies = [ "serde_json", "serde_with", "test-fuzz", - "thiserror 2.0.11", + "thiserror 2.0.12", ] [[package]] @@ -9289,7 +9312,7 @@ dependencies = [ "reth-trie", "reth-trie-db", "revm", - "strum", + "strum 0.26.3", "tempfile", "tokio", "tracing", @@ -9322,7 +9345,7 @@ dependencies = [ "reth-tokio-util", "reth-tracing", "rustc-hash 2.1.1", - "thiserror 2.0.11", + "thiserror 2.0.12", "tokio", "tracing", ] @@ -9342,7 +9365,7 @@ dependencies = [ "serde", "serde_json", "test-fuzz", - "thiserror 2.0.11", + "thiserror 2.0.12", "toml", ] @@ -9427,7 +9450,7 @@ dependencies = [ "revm-primitives", "serde", "serde_json", - "thiserror 2.0.11", + "thiserror 2.0.12", "tokio", "tokio-stream", "tower 0.4.13", @@ -9520,7 +9543,7 @@ dependencies = [ "reth-transaction-pool", "serde", "serde_json", - "thiserror 2.0.11", + "thiserror 2.0.12", "tokio", "tokio-util", "tower 0.4.13", @@ -9560,7 +9583,7 @@ dependencies = [ "reth-tokio-util", "reth-transaction-pool", "serde", - "thiserror 2.0.11", + "thiserror 2.0.12", "tokio", "tracing", ] @@ -9646,7 +9669,7 @@ dependencies = [ "schnellru", "serde", "serde_json", - "thiserror 2.0.11", + "thiserror 2.0.12", "tokio", "tokio-stream", "tracing", @@ -9681,7 +9704,7 @@ dependencies = [ "reth-errors", "reth-network-api", "serde", - "strum", + "strum 0.26.3", ] [[package]] @@ -9746,7 +9769,7 @@ dependencies = [ "reth-trie", "reth-trie-db", "tempfile", - "thiserror 2.0.11", + "thiserror 2.0.12", "tokio", "tracing", ] @@ -9774,7 +9797,7 @@ dependencies = [ "reth-static-file-types", "reth-testing-utils", "reth-tokio-util", - "thiserror 2.0.11", + "thiserror 2.0.12", "tokio", "tokio-stream", "tracing", @@ -9830,7 +9853,7 @@ dependencies = [ "derive_more 1.0.0", "reth-nippy-jar", "serde", - "strum", + "strum 0.26.3", ] [[package]] @@ -9868,7 +9891,7 @@ dependencies = [ "reth-fs-util", "reth-primitives-traits", "reth-static-file-types", - "thiserror 2.0.11", + "thiserror 2.0.12", ] [[package]] @@ -9882,7 +9905,7 @@ dependencies = [ "pin-project", "rayon", "reth-metrics", - "thiserror 2.0.11", + "thiserror 2.0.12", "tokio", "tracing", "tracing-futures", @@ -9936,7 +9959,7 @@ dependencies = [ "aquamarine", "assert_matches", "auto_impl", - "bitflags 2.8.0", + "bitflags 2.9.0", "codspeed-criterion-compat", "futures-util", "metrics", @@ -9967,7 +9990,7 @@ dependencies = [ "serde_json", "smallvec", "tempfile", - "thiserror 2.0.11", + "thiserror 2.0.12", "tokio", "tokio-stream", "tracing", @@ -10082,7 +10105,7 @@ dependencies = [ "reth-trie", "reth-trie-common", "reth-trie-db", - "thiserror 2.0.11", + "thiserror 2.0.12", "tracing", ] @@ -10107,7 +10130,7 @@ dependencies = [ "reth-trie", "reth-trie-common", "smallvec", - "thiserror 2.0.11", + "thiserror 2.0.12", ] [[package]] @@ -10149,7 +10172,7 @@ dependencies = [ "colorchoice", "revm", "serde_json", - "thiserror 2.0.11", + "thiserror 2.0.12", ] [[package]] @@ -10192,7 +10215,7 @@ dependencies = [ "alloy-eip7702", "alloy-primitives", "auto_impl", - "bitflags 2.8.0", + "bitflags 2.9.0", "bitvec", "c-kzg", "cfg-if", @@ -10223,9 +10246,9 @@ dependencies = [ [[package]] name = "ring" -version = "0.17.9" +version = "0.17.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e75ec5e92c4d8aede845126adc388046234541629e76029599ed35a003c7ed24" +checksum = "70ac5d832aa16abd7d1def883a8545280c20a60f523a370aa3a9617c2b8550ee" dependencies = [ "cc", "cfg-if", @@ -10342,23 +10365,25 @@ dependencies = [ "regex", "relative-path", "rustc_version 0.4.1", - "syn 2.0.98", + "syn 2.0.100", "unicode-ident", ] [[package]] name = "ruint" -version = "1.12.3" +version = "1.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c3cc4c2511671f327125da14133d0c5c5d137f006a1017a16f557bc85b16286" +checksum = "825df406ec217a8116bd7b06897c6cc8f65ffefc15d030ae2c9540acc9ed50b6" dependencies = [ "alloy-rlp", "arbitrary", "ark-ff 0.3.0", "ark-ff 0.4.2", "bytes", - "fastrlp", + "fastrlp 0.3.1", + "fastrlp 0.4.0", "num-bigint", + "num-integer", "num-traits", "parity-scale-codec", "primitive-types", @@ -10419,7 +10444,7 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" dependencies = [ - "semver 1.0.25", + "semver 1.0.26", ] [[package]] @@ -10428,10 +10453,23 @@ version = "0.38.44" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fdb5bc1ae2baa591800df16c9ca78619bf65c0488b41b96ccec5d11220d8c154" dependencies = [ - "bitflags 2.8.0", + "bitflags 2.9.0", "errno", "libc", - "linux-raw-sys", + "linux-raw-sys 0.4.15", + "windows-sys 0.59.0", +] + +[[package]] +name = "rustix" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dade4812df5c384711475be5fcd8c162555352945401aed22a35bffeab61f657" +dependencies = [ + "bitflags 2.9.0", + "errno", + "libc", + "linux-raw-sys 0.9.2", "windows-sys 0.59.0", ] @@ -10533,9 +10571,9 @@ dependencies = [ [[package]] name = "rustversion" -version = "1.0.19" +version = "1.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7c45b9784283f1b2e7fb61b42047c2fd678ef0960d4f6f1eba131594cc369d4" +checksum = "eded382c5f5f786b989652c49544c4877d9f015cc22e145a5ea8ea66c2921cd2" [[package]] name = "rusty-fork" @@ -10551,9 +10589,9 @@ dependencies = [ [[package]] name = "ryu" -version = "1.0.19" +version = "1.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ea1a2d0a644769cc99faa24c3ad26b379b786fe7c36fd3c546254801650e6dd" +checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f" [[package]] name = "ryu-js" @@ -10613,9 +10651,9 @@ checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] name = "sdd" -version = "3.0.7" +version = "3.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b07779b9b918cc05650cb30f404d4d7835d26df37c235eded8a6832e2fb82cca" +checksum = "584e070911c7017da6cb2eb0788d09f43d789029b5877d3e5ecc8acf86ceee21" [[package]] name = "sec1" @@ -10658,7 +10696,7 @@ version = "2.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" dependencies = [ - "bitflags 2.8.0", + "bitflags 2.9.0", "core-foundation 0.9.4", "core-foundation-sys", "libc", @@ -10672,7 +10710,7 @@ version = "3.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "271720403f46ca04f7ba6f55d438f8bd878d6b8ca0a1046e8228c4145bcbb316" dependencies = [ - "bitflags 2.8.0", + "bitflags 2.9.0", "core-foundation 0.10.0", "core-foundation-sys", "libc", @@ -10700,9 +10738,9 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.25" +version = "1.0.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f79dfe2d285b0488816f30e700a7438c5a73d816b5b7d3ac72fbc48b0d185e03" +checksum = "56e6fa9c48d24d85fb3de5ad847117517440f6beceb7798af16b4a87d616b8d0" dependencies = [ "serde", ] @@ -10730,18 +10768,18 @@ checksum = "cd0b0ec5f1c1ca621c432a25813d8d60c88abe6d3e08a3eb9cf37d97a0fe3d73" [[package]] name = "serde" -version = "1.0.217" +version = "1.0.219" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02fc4265df13d6fa1d00ecff087228cc0a2b5f3c0e87e258d8b94a156e984c70" +checksum = "5f0e2c6ed6606019b4e29e69dbaba95b11854410e5347d525002456dbbb786b6" dependencies = [ "serde_derive", ] [[package]] name = "serde_bytes" -version = "0.11.15" +version = "0.11.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "387cc504cb06bb40a96c8e04e951fe01854cf6bc921053c954e4a606d9675c6a" +checksum = "8437fd221bde2d4ca316d61b90e337e9e702b3820b87d63caa9ba6c02bd06d96" dependencies = [ "serde", ] @@ -10758,20 +10796,20 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.217" +version = "1.0.219" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a9bf7cf98d04a2b28aead066b7496853d4779c9cc183c440dbac457641e19a0" +checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00" dependencies = [ "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.100", ] [[package]] name = "serde_json" -version = "1.0.138" +version = "1.0.140" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d434192e7da787e94a6ea7e9670b26a036d0ca41e0b7efb2676dd32bae872949" +checksum = "20068b6e96dc6c9bd23e01df8827e6c7e1f2fddd43c21810382803c136b99373" dependencies = [ "indexmap 2.7.1", "itoa", @@ -10793,13 +10831,13 @@ dependencies = [ [[package]] name = "serde_repr" -version = "0.1.19" +version = "0.1.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c64451ba24fc7a6a2d60fc75dd9c83c90903b19028d4eff35e88fc1e86564e9" +checksum = "175ee3e80ae9982737ca543e96133087cbd9a485eecc3bc4de9c1a37b47ea59c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.100", ] [[package]] @@ -10820,7 +10858,7 @@ dependencies = [ "proc-macro2", "quote", "serde", - "syn 2.0.98", + "syn 2.0.100", ] [[package]] @@ -10862,7 +10900,7 @@ dependencies = [ "darling", "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.100", ] [[package]] @@ -10895,7 +10933,7 @@ checksum = "5d69265a08751de7844521fd15003ae0a888e035773ba05695c5c759a6f89eef" dependencies = [ "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.100", ] [[package]] @@ -11029,9 +11067,9 @@ dependencies = [ [[package]] name = "similar-asserts" -version = "1.6.1" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f08357795f0d604ea7d7130f22c74b03838c959bdb14adde3142aab4d18a293" +checksum = "b5b441962c817e33508847a22bd82f03a30cff43642dc2fae8b050566121eb9a" dependencies = [ "console", "serde", @@ -11046,7 +11084,7 @@ checksum = "297f631f50729c8c99b84667867963997ec0b50f32b2a7dbcab828ef0541e8bb" dependencies = [ "num-bigint", "num-traits", - "thiserror 2.0.11", + "thiserror 2.0.12", "time", ] @@ -11152,9 +11190,9 @@ checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" [[package]] name = "stacker" -version = "0.1.18" +version = "0.1.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d08feb8f695b465baed819b03c128dc23f57a694510ab1f06c77f763975685e" +checksum = "d9156ebd5870ef293bfb43f91c7a74528d363ec0d424afe24160ed5a4343d08a" dependencies = [ "cc", "cfg-if", @@ -11199,7 +11237,16 @@ version = "0.26.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8fec0f0aef304996cf250b31b5a10dee7980c85da9d759361292b8bca5a18f06" dependencies = [ - "strum_macros", + "strum_macros 0.26.4", +] + +[[package]] +name = "strum" +version = "0.27.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f64def088c51c9510a8579e3c5d67c65349dcf755e5479ad3d010aa6454e2c32" +dependencies = [ + "strum_macros 0.27.1", ] [[package]] @@ -11212,7 +11259,20 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.98", + "syn 2.0.100", +] + +[[package]] +name = "strum_macros" +version = "0.27.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c77a8c5abcaf0f9ce05d62342b7d298c346515365c36b673df4ebe3ced01fde8" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "rustversion", + "syn 2.0.100", ] [[package]] @@ -11242,9 +11302,9 @@ checksum = "734676eb262c623cec13c3155096e08d1f8f29adce39ba17948b18dad1e54142" [[package]] name = "symbolic-common" -version = "12.13.4" +version = "12.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6189977df1d6ec30c920647919d76f29fb8d8f25e8952e835b0fcda25e8f792" +checksum = "66135c8273581acaab470356f808a1c74a707fe7ec24728af019d7247e089e71" dependencies = [ "debugid", "memmap2", @@ -11254,9 +11314,9 @@ dependencies = [ [[package]] name = "symbolic-demangle" -version = "12.13.4" +version = "12.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d234917f7986498e7f62061438cee724bafb483fe84cfbe2486f68dce48240d7" +checksum = "42bcacd080282a72e795864660b148392af7babd75691d5ae9a3b77e29c98c77" dependencies = [ "cpp_demangle", "rustc-demangle", @@ -11276,9 +11336,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.98" +version = "2.0.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36147f1a48ae0ec2b5b3bc5b537d267457555a10dc06f3dbc8cb11ba3006d3b1" +checksum = "b09a44accad81e1ba1cd74a32461ba89dee89095ba17b32f5d03683b1b1fc2a0" dependencies = [ "proc-macro2", "quote", @@ -11287,14 +11347,14 @@ dependencies = [ [[package]] name = "syn-solidity" -version = "0.8.21" +version = "0.8.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c2de690018098e367beeb793991c7d4dc7270f42c9d2ac4ccc876c1368ca430" +checksum = "ac9f9798a84bca5cd4d1760db691075fda8f2c3a5d9647e8bfd29eb9b3fabb87" dependencies = [ "paste", "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.100", ] [[package]] @@ -11314,7 +11374,7 @@ checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" dependencies = [ "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.100", ] [[package]] @@ -11344,15 +11404,15 @@ checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" [[package]] name = "tempfile" -version = "3.17.0" +version = "3.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a40f762a77d2afa88c2d919489e390a12bdd261ed568e60cfa7e48d4e20f0d33" +checksum = "2c317e0a526ee6120d8dabad239c8dadca62b24b6f168914bbbc8e2fb1f0e567" dependencies = [ "cfg-if", "fastrand 2.3.0", "getrandom 0.3.1", "once_cell", - "rustix", + "rustix 1.0.1", "windows-sys 0.59.0", ] @@ -11392,7 +11452,7 @@ dependencies = [ "prettyplease", "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.100", ] [[package]] @@ -11425,11 +11485,11 @@ dependencies = [ [[package]] name = "thiserror" -version = "2.0.11" +version = "2.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d452f284b73e6d76dd36758a0c8684b1d5be31f92b89d07fd5822175732206fc" +checksum = "567b8a2dae586314f7be2a752ec7474332959c6460e02bde30d702a66d488708" dependencies = [ - "thiserror-impl 2.0.11", + "thiserror-impl 2.0.12", ] [[package]] @@ -11440,18 +11500,18 @@ checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.100", ] [[package]] name = "thiserror-impl" -version = "2.0.11" +version = "2.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26afc1baea8a989337eeb52b6e72a039780ce45c3edfcc9c5b9d112feeb173c2" +checksum = "7f7cf42b4507d8ea322120659672cf1b9dbb93f8f2d4ecfd6e51350ff5b17a1d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.100", ] [[package]] @@ -11506,9 +11566,9 @@ dependencies = [ [[package]] name = "time" -version = "0.3.37" +version = "0.3.39" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35e7868883861bd0e56d9ac6efcaaca0d6d5d82a2a7ec8209ff492c07cf37b21" +checksum = "dad298b01a40a23aac4580b67e3dbedb7cc8402f3592d7f49469de2ea4aecdd8" dependencies = [ "deranged", "itoa", @@ -11524,15 +11584,15 @@ dependencies = [ [[package]] name = "time-core" -version = "0.1.2" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" +checksum = "765c97a5b985b7c11d7bc27fa927dc4fe6af3a6dfb021d28deb60d3bf51e76ef" [[package]] name = "time-macros" -version = "0.2.19" +version = "0.2.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2834e6017e3e5e4b9834939793b282bc03b37a3336245fa820e35e233e2a85de" +checksum = "e8093bc3e81c3bc5f7879de09619d06c9a5a5e45ca44dfeeb7225bae38005c5c" dependencies = [ "num-conv", "time-core", @@ -11569,9 +11629,9 @@ dependencies = [ [[package]] name = "tinyvec" -version = "1.8.1" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "022db8904dfa342efe721985167e9fcd16c29b226db4397ed752a761cfce81e8" +checksum = "09b3661f17e86524eccd4371ab0429194e0d7c008abb45f7a7495b1719463c71" dependencies = [ "tinyvec_macros", ] @@ -11584,9 +11644,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.43.0" +version = "1.44.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d61fa4ffa3de412bfea335c6ecff681de2b609ba3c77ef3e00e521813a9ed9e" +checksum = "9975ea0f48b5aa3972bf2d888c238182458437cc2a19374b81b25cdf1023fb3a" dependencies = [ "backtrace", "bytes", @@ -11608,14 +11668,14 @@ checksum = "6e06d43f1345a3bcd39f6a56dbb7dcab2ba47e68e8ac134855e7e2bdbaf8cab8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.100", ] [[package]] name = "tokio-rustls" -version = "0.26.1" +version = "0.26.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f6d0975eaace0cf0fcadee4e4aaa5da15b5c079146f2cffb67c113be122bf37" +checksum = "8e727b36a1a0e8b74c376ac2211e40c2c8af09fb4013c60d910495810f008e9b" dependencies = [ "rustls", "tokio", @@ -11742,7 +11802,7 @@ checksum = "403fa3b783d4b626a8ad51d766ab03cb6d2dbfc46b1c5d4448395e6628dc9697" dependencies = [ "async-compression", "base64 0.22.1", - "bitflags 2.8.0", + "bitflags 2.9.0", "bytes", "futures-core", "futures-util", @@ -11809,7 +11869,7 @@ checksum = "395ae124c09f9e6918a2310af6038fba074bcf474ac352496d5910dd59a2226d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.100", ] [[package]] @@ -11916,7 +11976,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "69fff37da548239c3bf9e64a12193d261e8b22b660991c6fd2df057c168f435f" dependencies = [ "cc", - "windows-targets 0.48.5", + "windows-targets 0.52.6", ] [[package]] @@ -11963,9 +12023,9 @@ checksum = "6af6ae20167a9ece4bcb41af5b80f8a1f1df981f6391189ce00fd257af04126a" [[package]] name = "typenum" -version = "1.17.0" +version = "1.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" +checksum = "1dccffe3ce07af9386bfd29e80c0ab1a8205a2fc34e4bcd40364df902cfa8f3f" [[package]] name = "ucd-trie" @@ -12011,9 +12071,9 @@ checksum = "75b844d17643ee918803943289730bec8aac480150456169e647ed0b576ba539" [[package]] name = "unicode-ident" -version = "1.0.16" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a210d160f08b701c8721ba1c726c11662f877ea6b7094007e1ca9a1041945034" +checksum = "5a5f39404a5da50712a4c1eecf25e90dd62b613502b7e925fd4e4d19b5c96512" [[package]] name = "unicode-segmentation" @@ -12110,9 +12170,9 @@ checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" [[package]] name = "uuid" -version = "1.13.1" +version = "1.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ced87ca4be083373936a67f8de945faa23b6b42384bd5b64434850802c6dccd0" +checksum = "e0f540e3240398cce6128b64ba83fdbdd86129c16a3aa1a3a252efd66eb3d587" dependencies = [ "getrandom 0.3.1", ] @@ -12151,7 +12211,7 @@ checksum = "d674d135b4a8c1d7e813e2f8d1c9a58308aee4a680323066025e53132218bd91" dependencies = [ "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.100", ] [[package]] @@ -12231,7 +12291,7 @@ dependencies = [ "log", "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.100", "wasm-bindgen-shared", ] @@ -12266,7 +12326,7 @@ checksum = "8ae87ea40c9f689fc23f209965b6fb8a99ad69aeeb0231408be24920604395de" dependencies = [ "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.100", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -12364,7 +12424,7 @@ version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" dependencies = [ - "windows-sys 0.48.0", + "windows-sys 0.59.0", ] [[package]] @@ -12435,7 +12495,7 @@ checksum = "9107ddc059d5b6fbfbffdfa7a7fe3e22a226def0b2608f72e9d552763d3e1ad7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.100", ] [[package]] @@ -12446,7 +12506,7 @@ checksum = "2bbd5b46c938e506ecbce286b6628a02171d56153ba733b6c741fc627ec9579b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.100", ] [[package]] @@ -12457,7 +12517,7 @@ checksum = "29bee4b38ea3cde66011baa44dba677c432a78593e202392d1e9070cf2a7fca7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.100", ] [[package]] @@ -12468,9 +12528,15 @@ checksum = "053c4c462dc91d3b1504c6fe5a726dd15e216ba718e84a0e46a88fbe5ded3515" dependencies = [ "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.100", ] +[[package]] +name = "windows-link" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6dccfd733ce2b1753b03b6d3c65edf020262ea35e20ccdf3e288043e6dd620e3" + [[package]] name = "windows-registry" version = "0.2.0" @@ -12660,9 +12726,9 @@ checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] name = "winnow" -version = "0.7.2" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59690dea168f2198d1a3b0cac23b8063efcd11012f10ae4698f284808c8ef603" +checksum = "0e7f4ea97f6f78012141bcdb6a216b2609f0979ada50b20ca5b52dde2eac2bb1" dependencies = [ "memchr", ] @@ -12683,7 +12749,7 @@ version = "0.33.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3268f3d866458b787f390cf61f4bbb563b922d091359f9608842999eaee3943c" dependencies = [ - "bitflags 2.8.0", + "bitflags 2.9.0", ] [[package]] @@ -12752,7 +12818,7 @@ checksum = "2380878cad4ac9aac1e2435f3eb4020e8374b5f13c296cb75b4620ff8e229154" dependencies = [ "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.100", "synstructure", ] @@ -12762,17 +12828,16 @@ version = "0.7.35" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" dependencies = [ - "byteorder", "zerocopy-derive 0.7.35", ] [[package]] name = "zerocopy" -version = "0.8.18" +version = "0.8.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79386d31a42a4996e3336b0919ddb90f81112af416270cff95b5f5af22b839c2" +checksum = "fd97444d05a4328b90e75e503a34bad781f14e28a823ad3557f0750df1ebcbc6" dependencies = [ - "zerocopy-derive 0.8.18", + "zerocopy-derive 0.8.23", ] [[package]] @@ -12783,38 +12848,38 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.100", ] [[package]] name = "zerocopy-derive" -version = "0.8.18" +version = "0.8.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76331675d372f91bf8d17e13afbd5fe639200b73d01f0fc748bb059f9cca2db7" +checksum = "6352c01d0edd5db859a63e2605f4ea3183ddbd15e2c4a9e7d32184df75e4f154" dependencies = [ "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.100", ] [[package]] name = "zerofrom" -version = "0.1.5" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cff3ee08c995dee1859d998dea82f7374f2826091dd9cd47def953cae446cd2e" +checksum = "50cc42e0333e05660c3587f3bf9d0478688e15d870fab3346451ce7f8c9fbea5" dependencies = [ "zerofrom-derive", ] [[package]] name = "zerofrom-derive" -version = "0.1.5" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "595eed982f7d355beb85837f651fa22e90b3c044842dc7f2c2842c086f295808" +checksum = "d71e5d6e06ab090c67b5e44993ec16b72dcbaabc526db883a360057678b48502" dependencies = [ "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.100", "synstructure", ] @@ -12835,7 +12900,7 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.100", ] [[package]] @@ -12857,32 +12922,32 @@ checksum = "6eafa6dfb17584ea3e2bd6e76e0cc15ad7af12b09abdd1ca55961bed9b1063c6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.100", ] [[package]] name = "zstd" -version = "0.13.2" +version = "0.13.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcf2b778a664581e31e389454a7072dab1647606d44f7feea22cd5abb9c9f3f9" +checksum = "e91ee311a569c327171651566e07972200e76fcfe2242a4fa446149a3881c08a" dependencies = [ "zstd-safe", ] [[package]] name = "zstd-safe" -version = "7.2.1" +version = "7.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54a3ab4db68cea366acc5c897c7b4d4d1b8994a9cd6e6f841f8964566a419059" +checksum = "f3051792fbdc2e1e143244dc28c60f73d8470e93f3f9cbd0ead44da5ed802722" dependencies = [ "zstd-sys", ] [[package]] name = "zstd-sys" -version = "2.0.13+zstd.1.5.6" +version = "2.0.14+zstd.1.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38ff0f21cfee8f97d94cef41359e0c89aa6113028ab0291aa8ca0038995a95aa" +checksum = "8fb060d4926e4ac3a3ad15d864e99ceb5f343c6b34f5bd6d81ae6ed417311be5" dependencies = [ "cc", "pkg-config", From 2bcd142e1bc35fbc1a4423d1340922eea7b32c27 Mon Sep 17 00:00:00 2001 From: Maxim Date: Tue, 11 Mar 2025 17:23:04 +0900 Subject: [PATCH 28/38] Fix getting safe block number in the import --- bin/reth/src/commands/bitfinity_import.rs | 42 +++++++++++++------ .../downloaders/src/bitfinity_evm_client.rs | 7 +++- 2 files changed, 35 insertions(+), 14 deletions(-) diff --git a/bin/reth/src/commands/bitfinity_import.rs b/bin/reth/src/commands/bitfinity_import.rs index be920a742d7..1a67b5eb072 100644 --- a/bin/reth/src/commands/bitfinity_import.rs +++ b/bin/reth/src/commands/bitfinity_import.rs @@ -2,6 +2,7 @@ use crate::{dirs::DataDirPath, version::SHORT_VERSION}; use bitfinity_block_confirmation::BitfinityBlockConfirmation; +use eyre::eyre; use futures::{Stream, StreamExt}; use lightspeed_scheduler::{job::Job, scheduler::Scheduler, JobExecutor}; use reth_beacon_consensus::EthBeaconConsensus; @@ -23,8 +24,8 @@ use reth_node_ethereum::{EthExecutorProvider, EthereumNode}; use reth_node_events::node::NodeEvent; use reth_primitives::{EthPrimitives, SealedHeader}; use reth_provider::{ - providers::BlockchainProvider, BlockNumReader, CanonChainTracker, ChainSpecProvider, - DatabaseProviderFactory, HeaderProvider, ProviderError, ProviderFactory, + providers::BlockchainProvider, BlockHashReader, BlockNumReader, BlockReader, CanonChainTracker, + ChainSpecProvider, DatabaseProviderFactory, HeaderProvider, ProviderError, ProviderFactory, }; use reth_prune::PruneModes; use reth_stages::{ @@ -146,7 +147,8 @@ impl BitfinityImportCommand { let provider_factory = self.provider_factory.clone(); // Get the local block number - let start_block = provider_factory.provider()?.last_block_number()? + 1; + let last_imported_block = provider_factory.provider()?.last_block_number()?; + let start_block = last_imported_block + 1; debug!(target: "reth::cli - BitfinityImportCommand", "Starting block: {}", start_block); @@ -168,20 +170,34 @@ impl BitfinityImportCommand { // override the tip let safe_block = if let Some(safe_block) = remote_client.safe_block() { + self.import_to_block( + safe_block, + remote_client.clone(), + provider_factory.clone(), + consensus.clone(), + ) + .await?; + safe_block } else { - error!(target: "reth::cli - BitfinityImportCommand", "No safe block found, skipping import"); - return Ok(()); + // Safe block is not in the client, meaning that the last block in the provider is the + // safe one. + let safe_block_number = remote_client.safe_block_number(); + match safe_block_number == last_imported_block { + true => match provider_factory.provider()?.block_hash(safe_block_number)? { + Some(v) => v, + None => { + error!(target: "reth::cli - BitfinityImportCommand", "Hash of latest safe block ({}) is not in the blockchain state", safe_block_number); + return Err(eyre!("Hash of latest safe block ({}) is not in the blockchain state", safe_block_number)); + } + }, + false => { + error!(target: "reth::cli - BitfinityImportCommand", "Last imported block ({}) is not the last safe block ({})", last_imported_block, safe_block_number); + return Err(eyre!("Last imported block ({}) is not the last safe block ({})", last_imported_block, safe_block_number)); + } + } }; - self.import_to_block( - safe_block, - remote_client.clone(), - provider_factory.clone(), - consensus.clone(), - ) - .await?; - if self.bitfinity.confirm_unsafe_blocks { let Some(mut tip) = remote_client.tip() else { warn!(target: "reth::cli - BitfinityImportCommand", "Cannot find block for confirmation. Skipping."); diff --git a/crates/net/downloaders/src/bitfinity_evm_client.rs b/crates/net/downloaders/src/bitfinity_evm_client.rs index abbecbe4f5b..90b67a720c3 100644 --- a/crates/net/downloaders/src/bitfinity_evm_client.rs +++ b/crates/net/downloaders/src/bitfinity_evm_client.rs @@ -283,7 +283,12 @@ impl BitfinityEvmClient { self.headers.get(&(self.safe_block_number + 1)).map(|h| h.hash_slow()) } - /// Returns the has of the last safe block in the chain. + /// Returns the block number of the last safe block in the chain. + pub fn safe_block_number(&self) -> u64 { + self.safe_block_number + } + + /// Returns the hash of the last safe block in the chain. pub fn safe_block(&self) -> Option { self.headers.get(&self.safe_block_number).map(|h| h.hash_slow()) } From 0fc76d07d11e319c6a5eb0babd1b6d0f3e6d7d1e Mon Sep 17 00:00:00 2001 From: Maxim Date: Tue, 11 Mar 2025 17:29:01 +0900 Subject: [PATCH 29/38] Fix a warning --- bin/reth/src/commands/bitfinity_import.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/reth/src/commands/bitfinity_import.rs b/bin/reth/src/commands/bitfinity_import.rs index 1a67b5eb072..e6b63ebeb47 100644 --- a/bin/reth/src/commands/bitfinity_import.rs +++ b/bin/reth/src/commands/bitfinity_import.rs @@ -24,7 +24,7 @@ use reth_node_ethereum::{EthExecutorProvider, EthereumNode}; use reth_node_events::node::NodeEvent; use reth_primitives::{EthPrimitives, SealedHeader}; use reth_provider::{ - providers::BlockchainProvider, BlockHashReader, BlockNumReader, BlockReader, CanonChainTracker, + providers::BlockchainProvider, BlockHashReader, BlockNumReader, CanonChainTracker, ChainSpecProvider, DatabaseProviderFactory, HeaderProvider, ProviderError, ProviderFactory, }; use reth_prune::PruneModes; From 14ecd0a90b093862c8b46f30cd0ad00a07a69287 Mon Sep 17 00:00:00 2001 From: Maxim Date: Tue, 11 Mar 2025 19:57:41 +0900 Subject: [PATCH 30/38] Fix importing the last block with local EVM --- Cargo.lock | 1 + Cargo.toml | 1 + bin/reth/Cargo.toml | 1 + bin/reth/src/commands/bitfinity_import.rs | 17 ++++++++++++++--- .../net/downloaders/src/bitfinity_evm_client.rs | 7 ++----- crates/node/core/src/args/bitfinity_args.rs | 11 +++++------ 6 files changed, 24 insertions(+), 14 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 1584d258866..34a5c2d6e72 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -7212,6 +7212,7 @@ dependencies = [ "eyre", "futures", "hex", + "ic-agent", "jsonrpsee", "lightspeed_scheduler", "parking_lot", diff --git a/Cargo.toml b/Cargo.toml index 42aa5bafcc1..9dfbd4e21a8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -660,6 +660,7 @@ ethereum-json-rpc-client = { git = "https://github.com/bitfinity-network/bitfini evm-canister-client = { git = "https://github.com/bitfinity-network/bitfinity-evm-sdk", package = "evm-canister-client", features = [ "ic-agent-client", ], branch = "EPROD-1132_block_validation" } +ic-agent = "0.39" ic-cbor = "3" ic-certificate-verification = "3" ic-certification = "3" diff --git a/bin/reth/Cargo.toml b/bin/reth/Cargo.toml index bd8086e38d3..4a477f77aac 100644 --- a/bin/reth/Cargo.toml +++ b/bin/reth/Cargo.toml @@ -103,6 +103,7 @@ candid.workspace = true did.workspace = true evm-canister-client = { workspace = true, features = ["ic-agent-client"] } hex.workspace = true +ic-agent.workspace = true lightspeed_scheduler = { workspace = true, features = ["tracing"] } # rlp = { workspace = true } diff --git a/bin/reth/src/commands/bitfinity_import.rs b/bin/reth/src/commands/bitfinity_import.rs index e6b63ebeb47..d13f1e82c7c 100644 --- a/bin/reth/src/commands/bitfinity_import.rs +++ b/bin/reth/src/commands/bitfinity_import.rs @@ -4,6 +4,7 @@ use crate::{dirs::DataDirPath, version::SHORT_VERSION}; use bitfinity_block_confirmation::BitfinityBlockConfirmation; use eyre::eyre; use futures::{Stream, StreamExt}; +use ic_agent::Agent; use lightspeed_scheduler::{job::Job, scheduler::Scheduler, JobExecutor}; use reth_beacon_consensus::EthBeaconConsensus; use reth_chainspec::ChainSpec; @@ -19,7 +20,7 @@ use reth_downloaders::{ }; use reth_exex::ExExManagerHandle; use reth_node_api::NodeTypesWithDBAdapter; -use reth_node_core::{args::BitfinityImportArgs, dirs::ChainPath}; +use reth_node_core::{args::{BitfinityImportArgs, IC_MAINNET_URL}, dirs::ChainPath}; use reth_node_ethereum::{EthExecutorProvider, EthereumNode}; use reth_node_events::node::NodeEvent; use reth_primitives::{EthPrimitives, SealedHeader}; @@ -117,7 +118,11 @@ impl BitfinityImportCommand { Job::new("import", "block importer", None, move || { let import = self.clone(); Box::pin(async move { - import.single_execution().await?; + import.single_execution().await.inspect_err(|err| { + // The scheduler doesn't output the returned errors, so we must log + // them before finishing the job + error!(target: "reth::cli - BitfinityImportCommand", "import failed: {err:?}"); + })?; import.update_chain_info()?; Ok(()) }) @@ -152,6 +157,12 @@ impl BitfinityImportCommand { debug!(target: "reth::cli - BitfinityImportCommand", "Starting block: {}", start_block); + let ic_url = self.bitfinity.ic_url.clone().unwrap_or_else(|| IC_MAINNET_URL.into()); + let ic_agent = Agent::builder().with_url(ic_url).build()?; + if self.bitfinity.fetch_ic_root_key { + ic_agent.fetch_root_key().await?; + } + let remote_client = Arc::new( BitfinityEvmClient::from_rpc_url( self.rpc_config(), @@ -161,7 +172,7 @@ impl BitfinityImportCommand { self.bitfinity.max_fetch_blocks, Some(CertificateCheckSettings { evmc_principal: self.bitfinity.evmc_principal.clone(), - ic_root_key: self.bitfinity.ic_root_key.clone(), + ic_root_key: ic_agent.read_root_key(), }), self.bitfinity.check_evm_state_before_importing, ) diff --git a/crates/net/downloaders/src/bitfinity_evm_client.rs b/crates/net/downloaders/src/bitfinity_evm_client.rs index 90b67a720c3..30396e954ae 100644 --- a/crates/net/downloaders/src/bitfinity_evm_client.rs +++ b/crates/net/downloaders/src/bitfinity_evm_client.rs @@ -94,7 +94,7 @@ pub struct CertificateCheckSettings { /// Principal of the EVM canister pub evmc_principal: String, /// Root key of the IC network - pub ic_root_key: String, + pub ic_root_key: Vec, } impl BitfinityEvmClient { @@ -560,14 +560,11 @@ impl BlockCertificateChecker { Principal::from_text(certificate_settings.evmc_principal).map_err(|e| { RemoteClientError::CertificateError(format!("failed to parse principal: {e}")) })?; - let ic_root_key = hex::decode(&certificate_settings.ic_root_key).map_err(|e| { - RemoteClientError::CertificateError(format!("failed to parse IC root key: {e}")) - })?; let certified_data = client .get_last_certified_block() .await .map_err(|e| RemoteClientError::ProviderError(e.to_string()))?; - Ok(Self { certified_data, evmc_principal, ic_root_key }) + Ok(Self { certified_data, evmc_principal, ic_root_key: certificate_settings.ic_root_key }) } fn get_block_number(&self) -> u64 { diff --git a/crates/node/core/src/args/bitfinity_args.rs b/crates/node/core/src/args/bitfinity_args.rs index 9e85ed1ed44..dc4da204940 100644 --- a/crates/node/core/src/args/bitfinity_args.rs +++ b/crates/node/core/src/args/bitfinity_args.rs @@ -1,9 +1,5 @@ use clap::{arg, Args}; -/// Public key of the IC main net. -/// IC advices to use a hardcoded value instead of querying it to avoid main-in-the middle attacks. -pub const IC_MAINNET_KEY: &str = "308182301d060d2b0601040182dc7c0503010201060c2b0601040182dc7c05030201036100814c0e6ec71fab583b08bd81373c255c3c371b2e84863c98a4f1e08b74235d14fb5d9c0cd546d9685f913a0c0b2cc5341583bf4b4392e467db96d65b9bb4cb717112f8472e0d5a4d14505ffd7484b01291091c5f87b98883463f98091a0baaae"; - /// URL of the IC mainnet. pub const IC_MAINNET_URL: &str = "https://ic0.app"; @@ -62,8 +58,11 @@ pub struct BitfinityImportArgs { pub evmc_principal: String, /// Root key for the IC network - #[arg(long, value_name = "IC_ROOT_KEY", default_value = IC_MAINNET_KEY)] - pub ic_root_key: String, + #[arg(long)] + pub fetch_ic_root_key: bool, + + #[arg(long, value_name = "IC_URL")] + pub ic_url: Option, /// A flag to check the EVM state before importing blocks #[arg(long, default_value = "true")] From 0031df91eaa4364bf99a74a045bbaddb6aa5c9f9 Mon Sep 17 00:00:00 2001 From: Maxim Date: Tue, 11 Mar 2025 20:16:20 +0900 Subject: [PATCH 31/38] Documentation for new arguments --- crates/node/core/src/args/bitfinity_args.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/crates/node/core/src/args/bitfinity_args.rs b/crates/node/core/src/args/bitfinity_args.rs index dc4da204940..ffdc527b021 100644 --- a/crates/node/core/src/args/bitfinity_args.rs +++ b/crates/node/core/src/args/bitfinity_args.rs @@ -57,10 +57,17 @@ pub struct BitfinityImportArgs { #[arg(long, value_name = "EVMC_PRINCIPAL", default_value = "4fe7g-7iaaa-aaaak-aegcq-cai")] pub evmc_principal: String, - /// Root key for the IC network + /// If set to true, the importer will fetch root certificate key from IC to validate EVM blocks + /// signed data. + /// + /// Set this flag to true for local deployment. For IC mainnet well known value must be used for + /// secure certificate validation. #[arg(long)] pub fetch_ic_root_key: bool, + /// Url of the ic the EVM is deployed into. + /// + /// If not set, mainnet IC connection is assumed. #[arg(long, value_name = "IC_URL")] pub ic_url: Option, From 48205747b9bd4a359fb8da0a68c5e9b390df70a2 Mon Sep 17 00:00:00 2001 From: Yasir Date: Tue, 11 Mar 2025 15:53:20 +0300 Subject: [PATCH 32/38] chore: add logging --- .../bitfinity-block-confirmation/src/lib.rs | 115 ++++++++++++++++-- 1 file changed, 105 insertions(+), 10 deletions(-) diff --git a/crates/bitfinity-block-confirmation/src/lib.rs b/crates/bitfinity-block-confirmation/src/lib.rs index 8f177b6ca5e..73239fdb0b8 100644 --- a/crates/bitfinity-block-confirmation/src/lib.rs +++ b/crates/bitfinity-block-confirmation/src/lib.rs @@ -15,6 +15,7 @@ use reth_evm_ethereum::{ }; use reth_node_types::NodeTypesWithDB; use reth_primitives::{Block, BlockWithSenders}; +use tracing::{debug, error, info, trace}; use reth_provider::{ providers::ProviderNodeTypes, ChainSpecProvider as _, ExecutionOutcome, ProviderFactory, @@ -62,15 +63,24 @@ where /// Execute the block and send the confirmation request to the EVM. pub async fn confirm_blocks(&self, blocks: &[Block]) -> eyre::Result<()> { if blocks.is_empty() { + debug!(target: "bitfinity_block_confirmation::BitfinityBlokConfirmation", "No blocks to confirm"); return Ok(()); } let execution_result = self.execute_blocks(blocks)?; let last_block = blocks.iter().last().expect("no blocks"); + debug!( + target: "bitfinity_block_confirmation::BitfinityBlokConfirmation", + "Calculating confirmation data for block: {}", last_block.number + ); let confirmation_data = self.calculate_confirmation_data(last_block, execution_result).await?; + info!( + target: "bitfinity_block_confirmation::BitfinityBlokConfirmation", + "Sending confirmation request for block: {}", last_block.number + ); self.send_confirmation_request(confirmation_data).await?; Ok(()) @@ -81,14 +91,31 @@ where &self, confirmation_data: BlockConfirmationData, ) -> eyre::Result<()> { + let block_number = confirmation_data.block_number; + debug!( + target: "bitfinity_block_confirmation::BitfinityBlokConfirmation", + "Sending confirmation request for block: {}", block_number + ); match self .evm_client .send_confirm_block(confirmation_data) .await .map_err(|e| eyre!("{e}"))? { - BlockConfirmationResult::NotConfirmed => Err(eyre!("confirmation request rejected")), - _ => Ok(()), + BlockConfirmationResult::NotConfirmed => { + error!( + target: "bitfinity_block_confirmation::BitfinityBlokConfirmation", + "Block confirmation request rejected for block: {}", block_number + ); + Err(eyre!("confirmation request rejected")) + } + result => { + debug!( + target: "bitfinity_block_confirmation::BitfinityBlokConfirmation", + "Block confirmation request accepted with result: {:?}", result + ); + Ok(()) + } } } @@ -98,7 +125,15 @@ where block: &Block, execution_result: ExecutionOutcome, ) -> eyre::Result { + debug!( + target: "bitfinity_block_confirmation::BitfinityBlokConfirmation", + "Computing PoW hash for block: {}", block.number + ); let proof_of_work = self.compute_pow_hash(block, execution_result).await?; + debug!( + target: "bitfinity_block_confirmation::BitfinityBlokConfirmation", + "PoW hash computed successfully for block: {}", block.number + ); Ok(BlockConfirmationData { block_number: block.number, hash: block.hash_slow().into(), @@ -111,10 +146,18 @@ where /// Execute block and return execution result. fn execute_blocks(&self, blocks: &[Block]) -> eyre::Result { + debug!( + target: "bitfinity_block_confirmation::BitfinityBlokConfirmation", + "Executing {} blocks", blocks.len() + ); let executor = self.executor(); let blocks_with_senders: Vec<_> = blocks.iter().map(Self::convert_block).collect(); let output = executor.execute_and_verify_batch(&blocks_with_senders)?; + debug!( + target: "bitfinity_block_confirmation::BitfinityBlokConfirmation", + "Blocks executed successfully" + ); Ok(output) } @@ -125,7 +168,11 @@ where let senders: HashSet<_> = block.body.transactions.iter().filter_map(|tx| tx.recover_signer()).collect(); - tracing::debug!("Found {} unique senders in block", senders.len()); + debug!( + target: "bitfinity_block_confirmation::BitfinityBlokConfirmation", + "Block {}: Found {} unique senders in block with {} transactions", + block.number, senders.len(), block.body.transactions.len() + ); BlockWithSenders { block: block.clone(), senders: senders.into_iter().collect() } } @@ -157,6 +204,11 @@ where block: &Block, execution_result: ExecutionOutcome, ) -> eyre::Result>> { + debug!( + target: "bitfinity_block_confirmation::BitfinityBlokConfirmation", + "Computing PoW hash for block: {}, hash: {}", + block.number, block.hash_slow() + ); let exec_state = execution_result.bundle; let state_provider = self.provider_factory.latest()?; @@ -164,6 +216,10 @@ where &state_provider, ))); + trace!( + target: "bitfinity_block_confirmation::BitfinityBlokConfirmation", + "Building state with bundle prestate for block: {}", block.number + ); let mut state = StateBuilder::new() .with_database_ref(&cache) .with_bundle_prestate(exec_state) @@ -178,6 +234,10 @@ where let base_fee = block.base_fee_per_gas.map(Into::into); + trace!( + target: "bitfinity_block_confirmation::BitfinityBlokConfirmation", + "Fetching genesis balances for PoW calculation" + ); let genesis_accounts = self.evm_client.get_genesis_balances().await.map_err(|e| eyre!("{e}"))?; @@ -202,26 +262,61 @@ where { // Setup EVM + trace!( + target: "bitfinity_block_confirmation::BitfinityBlokConfirmation", + "Setting up EVM for PoW transaction execution" + ); let mut evm = evm_config.evm_with_env( &mut state, EnvWithHandlerCfg::new_with_cfg_env(cfg_env_with_handler_cfg, block_env, tx), ); + debug!( + target: "bitfinity_block_confirmation::BitfinityBlokConfirmation", + "Executing PoW transaction for block: {}", block.number + ); let res = evm.transact()?; - eyre::ensure!(res.result.is_success(), "POW transaction failed: {:?}", res.result); - + if !res.result.is_success() { + error!( + target: "bitfinity_block_confirmation::BitfinityBlokConfirmation", + "PoW transaction failed for block {}: {:?}", block.number, res.result + ); + eyre::bail!("PoW transaction failed: {:?}", res.result); + } + + trace!( + target: "bitfinity_block_confirmation::BitfinityBlokConfirmation", + "Committing PoW transaction state changes" + ); evm.db_mut().commit(res.state); } + + trace!( + target: "bitfinity_block_confirmation::BitfinityBlokConfirmation", + "Merging state transitions for block: {}", block.number + ); state.merge_transitions(BundleRetention::PlainState); let bundle = state.take_bundle(); + trace!( + target: "bitfinity_block_confirmation::BitfinityBlokConfirmation", + "Creating hashed post state from bundle state" + ); let post_hashed_state = HashedPostState::from_bundle_state::(bundle.state()); + debug!( + target: "bitfinity_block_confirmation::BitfinityBlokConfirmation", + "Calculating state root for block: {}", block.number + ); let state_root = StateRoot::overlay_root(self.provider_factory.provider()?.tx_ref(), post_hashed_state)?; + info!( + target: "bitfinity_block_confirmation::BitfinityBlokConfirmation", + "PoW hash computed successfully for block: {}", block.number + ); Ok(state_root.into()) } } @@ -789,16 +884,16 @@ mod tests { let computed_pow = block_validator.compute_pow_hash(&block.block, outcome.clone()).await.unwrap(); - let post_execution_state = - StateRoot::from_tx(block_validator.provider_factory.provider().unwrap().tx_ref()) - .root() - .unwrap(); - assert_eq!( expected_pow_hash, computed_pow, "POW hash should be deterministic given the same state" ); + let post_execution_state = + StateRoot::from_tx(block_validator.provider_factory.provider().unwrap().tx_ref()) + .root() + .unwrap(); + assert_eq!( inital_state, post_execution_state, "State should remain unchanged after block execution" From fabde46f0128f39fc608f2eaa9fee89e1a4fec71 Mon Sep 17 00:00:00 2001 From: Maxim Date: Tue, 11 Mar 2025 22:19:12 +0900 Subject: [PATCH 33/38] Fix confirming blocks when multiple transactions in block --- Cargo.lock | 1 - bin/reth/Cargo.toml | 1 - bin/reth/src/commands/bitfinity_import.rs | 2 +- .../bitfinity-block-confirmation/src/lib.rs | 66 +++++++++++-------- 4 files changed, 38 insertions(+), 32 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 34a5c2d6e72..c62b55af96a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -7211,7 +7211,6 @@ dependencies = [ "evm-canister-client", "eyre", "futures", - "hex", "ic-agent", "jsonrpsee", "lightspeed_scheduler", diff --git a/bin/reth/Cargo.toml b/bin/reth/Cargo.toml index 4a477f77aac..c8f9ad149af 100644 --- a/bin/reth/Cargo.toml +++ b/bin/reth/Cargo.toml @@ -102,7 +102,6 @@ bitfinity-block-confirmation.workspace = true candid.workspace = true did.workspace = true evm-canister-client = { workspace = true, features = ["ic-agent-client"] } -hex.workspace = true ic-agent.workspace = true lightspeed_scheduler = { workspace = true, features = ["tracing"] } # rlp = { workspace = true } diff --git a/bin/reth/src/commands/bitfinity_import.rs b/bin/reth/src/commands/bitfinity_import.rs index d13f1e82c7c..86cebed7b4e 100644 --- a/bin/reth/src/commands/bitfinity_import.rs +++ b/bin/reth/src/commands/bitfinity_import.rs @@ -250,7 +250,7 @@ impl BitfinityImportCommand { remote_client: Arc, provider_factory: ProviderFactory>>, ) -> eyre::Result<()> { - debug!(target: "reth::cli - BitfinityImportCommand", "Configurming block {block}"); + debug!(target: "reth::cli - BitfinityImportCommand", "Confirming block {block}"); let config = self.rpc_config(); let client = BitfinityEvmClient::client(config).await?; diff --git a/crates/bitfinity-block-confirmation/src/lib.rs b/crates/bitfinity-block-confirmation/src/lib.rs index 8f177b6ca5e..ea1028d1f76 100644 --- a/crates/bitfinity-block-confirmation/src/lib.rs +++ b/crates/bitfinity-block-confirmation/src/lib.rs @@ -3,12 +3,13 @@ use alloy_primitives::TxKind; use did::{BlockConfirmationData, BlockConfirmationResult}; use ethereum_json_rpc_client::{Client, EthJsonRpcClient}; -use eyre::eyre; -use eyre::Ok; +use eyre::{eyre, Ok}; use reth_chain_state::MemoryOverlayStateProvider; -use reth_evm::env::EvmEnv; -use reth_evm::execute::{BasicBatchExecutor, BatchExecutor}; -use reth_evm::{ConfigureEvm, ConfigureEvmEnv}; +use reth_evm::{ + env::EvmEnv, + execute::{BasicBatchExecutor, BatchExecutor}, + ConfigureEvm, ConfigureEvmEnv, +}; use reth_evm_ethereum::{ execute::{EthExecutionStrategy, EthExecutionStrategyFactory}, EthEvmConfig, @@ -21,16 +22,16 @@ use reth_provider::{ }; use reth_revm::db::states::bundle_state::BundleRetention; -use reth_revm::primitives::{EnvWithHandlerCfg, TxEnv}; -use reth_revm::{batch::BlockBatchRecord, database::StateProviderDatabase}; -use reth_revm::{DatabaseCommit, StateBuilder}; -use reth_rpc_eth_types::cache::db::StateProviderTraitObjWrapper; -use reth_rpc_eth_types::StateCacheDb; +use reth_revm::{ + batch::BlockBatchRecord, + database::StateProviderDatabase, + primitives::{EnvWithHandlerCfg, TxEnv}, + DatabaseCommit, StateBuilder, +}; +use reth_rpc_eth_types::{cache::db::StateProviderTraitObjWrapper, StateCacheDb}; use reth_trie::{HashedPostState, KeccakKeyHasher, StateRoot}; use reth_trie_db::DatabaseStateRoot; -use std::collections::HashSet; - /// Block confirmation for Bitfinity. /// /// Uses custom Bitfinity logic to prove that the block was executed and sends confirmation request @@ -112,22 +113,33 @@ where /// Execute block and return execution result. fn execute_blocks(&self, blocks: &[Block]) -> eyre::Result { let executor = self.executor(); - let blocks_with_senders: Vec<_> = blocks.iter().map(Self::convert_block).collect(); + let blocks_with_senders: eyre::Result> = blocks.iter().map(Self::convert_block).collect(); + let blocks_with_senders = blocks_with_senders?; let output = executor.execute_and_verify_batch(&blocks_with_senders)?; + tracing::debug!("Blocks executed"); Ok(output) } /// Convert [`Block`] to [`BlockWithSenders`]. - fn convert_block(block: &Block) -> BlockWithSenders { + fn convert_block(block: &Block) -> eyre::Result { use reth_primitives_traits::SignedTransaction; - let senders: HashSet<_> = - block.body.transactions.iter().filter_map(|tx| tx.recover_signer()).collect(); - tracing::debug!("Found {} unique senders in block", senders.len()); + let senders: eyre::Result> = block + .body + .transactions + .iter() + .enumerate() + .map(|(index, tx)| { + tx.recover_signer().ok_or_else(|| { + eyre!("Failed to recover sender for transaction {index} with hash {:?}", tx.hash) + }) + }) + .collect(); + let senders = senders?; - BlockWithSenders { block: block.clone(), senders: senders.into_iter().collect() } + Ok(BlockWithSenders { block: block.clone(), senders }) } /// Get the block executor for the latest block. @@ -233,27 +245,23 @@ mod tests { use alloy_genesis::{Genesis, GenesisAccount}; use alloy_network::TxSignerSync; - use alloy_primitives::hex::FromHex; - use alloy_primitives::Address; + use alloy_primitives::{hex::FromHex, Address}; use alloy_signer::Signer; - use did::constant::EIP1559_INITIAL_BASE_FEE; - use did::U256; + use did::{constant::EIP1559_INITIAL_BASE_FEE, U256}; use jsonrpc_core::{Output, Request, Response, Success, Version}; use reth_chain_state::test_utils::TestBlockBuilder; use reth_chainspec::{ BaseFeeParams, ChainSpec, ChainSpecBuilder, EthereumHardfork, MAINNET, MIN_TRANSACTION_GAS, }; - use reth_db::test_utils::TempDatabase; - use reth_db::DatabaseEnv; + use reth_db::{test_utils::TempDatabase, DatabaseEnv}; use reth_db_common::init::init_genesis; use reth_ethereum_engine_primitives::EthEngineTypes; use reth_evm::execute::{BlockExecutorProvider, Executor}; use reth_evm_ethereum::execute::EthExecutorProvider; - use std::future::Future; - use std::sync::Arc; + use std::{future::Future, sync::Arc}; use super::*; @@ -261,10 +269,10 @@ mod tests { use reth_primitives::{ BlockBody, BlockExt, EthPrimitives, Receipt, SealedBlockWithSenders, TransactionSigned, }; - use reth_provider::test_utils::create_test_provider_factory_with_chain_spec; use reth_provider::{ - BlockExecutionOutput, BlockReader, BlockWriter, DatabaseProviderFactory, EthStorage, - HashedPostStateProvider, LatestStateProviderRef, StorageLocation, TransactionVariant, + test_utils::create_test_provider_factory_with_chain_spec, BlockExecutionOutput, + BlockReader, BlockWriter, DatabaseProviderFactory, EthStorage, HashedPostStateProvider, + LatestStateProviderRef, StorageLocation, TransactionVariant, }; use reth_revm::primitives::KECCAK_EMPTY; From 210465fcf70856a7efbea5bcf7be82a8b0b6a17c Mon Sep 17 00:00:00 2001 From: Maxim Date: Fri, 14 Mar 2025 18:33:29 +0900 Subject: [PATCH 34/38] Fix bitfinity tests --- bin/reth/tests/commands/utils.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bin/reth/tests/commands/utils.rs b/bin/reth/tests/commands/utils.rs index 532a5e3615e..c7f1abedba0 100644 --- a/bin/reth/tests/commands/utils.rs +++ b/bin/reth/tests/commands/utils.rs @@ -1,6 +1,5 @@ //! //! Utils for bitfinity integration tests -//! use std::{ fmt::{Debug, Display, Formatter}, path::PathBuf, @@ -14,7 +13,7 @@ use alloy_primitives::BlockNumber; use lightspeed_scheduler::JobExecutor; use parking_lot::Mutex; use reth::{ - args::{BitfinityImportArgs, IC_MAINNET_KEY}, + args::BitfinityImportArgs, commands::bitfinity_import::BitfinityImportCommand, dirs::{ChainPath, DataDirPath, PlatformPath}, }; @@ -166,13 +165,14 @@ pub async fn bitfinity_import_config_data( batch_size: 1000, max_fetch_blocks: 10000, evmc_principal: LOCAL_EVM_CANISTER_ID.to_string(), - ic_root_key: IC_MAINNET_KEY.to_string(), backup_rpc_url: backup_evm_datasource_url, max_retries: 3, retry_delay_secs: 3, check_evm_state_before_importing: false, max_block_age_secs: 600, confirm_unsafe_blocks: false, + fetch_ic_root_key: false, + ic_url: None, }; Ok(( From e1998d6060638ae0de8d3f5fc5b69496facb9bf2 Mon Sep 17 00:00:00 2001 From: Francesco Date: Fri, 14 Mar 2025 11:11:06 +0100 Subject: [PATCH 35/38] Revert "Fix importing the last block with local EVM" This reverts commit 14ecd0a90b093862c8b46f30cd0ad00a07a69287. --- Cargo.lock | 381 ++++++++++++------ Cargo.toml | 1 - bin/reth/Cargo.toml | 2 +- bin/reth/src/commands/bitfinity_import.rs | 17 +- .../downloaders/src/bitfinity_evm_client.rs | 7 +- crates/node/core/src/args/bitfinity_args.rs | 20 +- 6 files changed, 268 insertions(+), 160 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index c62b55af96a..c86de68df81 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -190,9 +190,9 @@ dependencies = [ [[package]] name = "alloy-core" -version = "0.8.22" +version = "0.8.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45ef3546f382c07c7c2e1d24844ed593e1c9b272236aedf635e4a295fb3fc9d0" +checksum = "ca1380cc3c81b83d5234865779494970c83b5893b423c59cdd68c3cd1ed0b671" dependencies = [ "alloy-primitives", "alloy-rlp", @@ -200,9 +200,9 @@ dependencies = [ [[package]] name = "alloy-dyn-abi" -version = "0.8.22" +version = "0.8.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00e08c581811006021970bf07f2ecf3213f6237c125f7fd99607004b23627b61" +checksum = "7078bef2bc353c1d1a97b44981d0186198be320038fbfbb0b37d1dd822a555d3" dependencies = [ "alloy-json-abi", "alloy-primitives", @@ -296,9 +296,9 @@ dependencies = [ [[package]] name = "alloy-json-abi" -version = "0.8.22" +version = "0.8.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "125601804507fef5ae7debcbf800906b12741f19800c1c05b953d0f1b990131a" +checksum = "ec80745c33797e8baf547a8cfeb850e60d837fe9b9e67b3f579c1fcd26f527e9" dependencies = [ "alloy-primitives", "alloy-sol-type-parser", @@ -377,9 +377,9 @@ dependencies = [ [[package]] name = "alloy-primitives" -version = "0.8.22" +version = "0.8.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c66bb6715b7499ea755bde4c96223ae8eb74e05c014ab38b9db602879ffb825" +checksum = "eacedba97e65cdc7ab592f2b22ef5d3ab8d60b2056bc3a6e6363577e8270ec6f" dependencies = [ "alloy-rlp", "arbitrary", @@ -391,7 +391,7 @@ dependencies = [ "foldhash", "getrandom 0.2.15", "hashbrown 0.15.2", - "indexmap 2.7.1", + "indexmap 2.8.0", "itoa", "k256", "keccak-asm", @@ -716,9 +716,9 @@ dependencies = [ [[package]] name = "alloy-sol-macro" -version = "0.8.22" +version = "0.8.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7f9c3c7bc1f4e334e5c5fc59ec8dac894973a71b11da09065affc6094025049" +checksum = "3637022e781bc73a9e300689cd91105a0e6be00391dd4e2110a71cc7e9f20a94" dependencies = [ "alloy-sol-macro-expander", "alloy-sol-macro-input", @@ -730,14 +730,14 @@ dependencies = [ [[package]] name = "alloy-sol-macro-expander" -version = "0.8.22" +version = "0.8.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46ff7aa715eb2404cb87fa94390d2c5d5addd70d9617e20b2398ee6f48cb21f0" +checksum = "3b9bd22d0bba90e40f40c625c33d39afb7d62b22192476a2ce1dcf8409dce880" dependencies = [ "alloy-sol-macro-input", "const-hex", "heck", - "indexmap 2.7.1", + "indexmap 2.8.0", "proc-macro-error2", "proc-macro2", "quote", @@ -748,13 +748,14 @@ dependencies = [ [[package]] name = "alloy-sol-macro-input" -version = "0.8.22" +version = "0.8.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f105fa700140c0cc6e2c3377adef650c389ac57b8ead8318a2e6bd52f1ae841" +checksum = "05ae4646e8123ec2fd10f9c22e361ffe4365c42811431829c2eabae528546bcc" dependencies = [ "const-hex", "dunce", "heck", + "macro-string", "proc-macro2", "quote", "syn 2.0.100", @@ -763,9 +764,9 @@ dependencies = [ [[package]] name = "alloy-sol-type-parser" -version = "0.8.22" +version = "0.8.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c649acc6c9d3893e392c737faeadce30b4a1751eed148ae43bc2f27f29c4480c" +checksum = "488a747fdcefeec5c1ed5aa9e08becd775106777fdeae2a35730729fc8a95910" dependencies = [ "serde", "winnow", @@ -773,9 +774,9 @@ dependencies = [ [[package]] name = "alloy-sol-types" -version = "0.8.22" +version = "0.8.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f819635439ebb06aa13c96beac9b2e7360c259e90f5160a6848ae0d94d10452" +checksum = "767957235807b021126dca1598ac3ef477007eace07961607dc5f490550909c7" dependencies = [ "alloy-json-abi", "alloy-primitives", @@ -1368,9 +1369,9 @@ checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" [[package]] name = "base64ct" -version = "1.6.0" +version = "1.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" +checksum = "89e25b6adfb930f02d1981565a6e5d9c547ac15a96606256d3b59040e5cd4ca3" [[package]] name = "bech32" @@ -1570,7 +1571,7 @@ dependencies = [ "boa_interner", "boa_macros", "boa_string", - "indexmap 2.7.1", + "indexmap 2.8.0", "num-bigint", "rustc-hash 2.1.1", ] @@ -1596,7 +1597,7 @@ dependencies = [ "fast-float2", "hashbrown 0.15.2", "icu_normalizer", - "indexmap 2.7.1", + "indexmap 2.8.0", "intrusive-collections", "itertools 0.13.0", "num-bigint", @@ -1642,7 +1643,7 @@ dependencies = [ "boa_gc", "boa_macros", "hashbrown 0.15.2", - "indexmap 2.7.1", + "indexmap 2.8.0", "once_cell", "phf", "rustc-hash 2.1.1", @@ -2044,7 +2045,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "57663b653d948a338bfb3eeba9bb2fd5fcfaecb9e199e87e1eda4d9e8b240fd9" dependencies = [ "ciborium-io", - "half 2.4.1", + "half 2.5.0", ] [[package]] @@ -2070,9 +2071,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.31" +version = "4.5.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "027bb0d98429ae334a8698531da7077bdf906419543a35a55c2cb1b66437d767" +checksum = "6088f3ae8c3608d19260cd7445411865a485688711b78b5be70d78cd96136f83" dependencies = [ "clap_builder", "clap_derive", @@ -2080,9 +2081,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.31" +version = "4.5.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5589e0cba072e0f3d23791efac0fd8627b49c829c196a492e88168e6a669d863" +checksum = "22a7ef7f676155edfb82daa97f99441f3ebf4a58d5e32f295a56259f1b6facc8" dependencies = [ "anstream", "anstyle", @@ -2092,9 +2093,9 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.5.28" +version = "4.5.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf4ced95c6f4a675af3da73304b9ac4ed991640c36374e4b46795c49e17cf1ed" +checksum = "09176aae279615badda0765c0c0b3f6ed53f4709118af73cf4655d85d1530cd7" dependencies = [ "heck", "proc-macro2", @@ -2110,9 +2111,9 @@ checksum = "f46ad14479a25103f283c0f10005961cf086d8dc42205bb44c46ac563475dca6" [[package]] name = "codspeed" -version = "2.8.1" +version = "2.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de4b67ff8985f3993f06167d71cf4aec178b0a1580f91a987170c59d60021103" +checksum = "60e744216bfa9add3b1f2505587cbbb837923232ed10963609f4a6e3cbd99c3e" dependencies = [ "colored", "libc", @@ -2123,17 +2124,46 @@ dependencies = [ [[package]] name = "codspeed-criterion-compat" -version = "2.8.1" +version = "2.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68403d768ed1def18a87e2306676781314448393ecf0d3057c4527cabf524a3d" +checksum = "d5926ca63222a35b9a2299adcaafecf596efe20a9a2048e4a81cb2fc3463b4a8" dependencies = [ "codspeed", + "codspeed-criterion-compat-walltime", "colored", - "criterion", "futures", "tokio", ] +[[package]] +name = "codspeed-criterion-compat-walltime" +version = "2.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dbae4da05076cbc673e242400ac8f4353bdb686e48020edc6e36a5c36ae0878e" +dependencies = [ + "anes", + "cast", + "ciborium", + "clap", + "codspeed", + "criterion-plot", + "futures", + "is-terminal", + "itertools 0.10.5", + "num-traits", + "once_cell", + "oorandom", + "plotters", + "rayon", + "regex", + "serde", + "serde_derive", + "serde_json", + "tinytemplate", + "tokio", + "walkdir", +] + [[package]] name = "coins-bip32" version = "0.12.0" @@ -2402,7 +2432,6 @@ dependencies = [ "ciborium", "clap", "criterion-plot", - "futures", "is-terminal", "itertools 0.10.5", "num-traits", @@ -2415,7 +2444,6 @@ dependencies = [ "serde_derive", "serde_json", "tinytemplate", - "tokio", "walkdir", ] @@ -2804,8 +2832,8 @@ dependencies = [ [[package]] name = "did" -version = "0.44.0" -source = "git+https://github.com/bitfinity-network/bitfinity-evm-sdk?branch=EPROD-1132_block_validation#3e51b43de7ef5be1b001cdd9e629c06c19c049c8" +version = "0.45.0" +source = "git+https://github.com/bitfinity-network/bitfinity-evm-sdk?branch=EPROD-1132_block_validation#d2ade5d94f3a6d30124ac1373dae76b953c6acde" dependencies = [ "alloy", "bincode", @@ -2813,7 +2841,7 @@ dependencies = [ "candid", "derive_more 2.0.1", "ic-log", - "ic-stable-structures 0.23.0", + "ic-stable-structures 0.24.0", "jsonrpc-core", "log", "num", @@ -3159,8 +3187,8 @@ dependencies = [ [[package]] name = "ethereum-json-rpc-client" -version = "0.44.0" -source = "git+https://github.com/bitfinity-network/bitfinity-evm-sdk?branch=EPROD-1132_block_validation#3e51b43de7ef5be1b001cdd9e629c06c19c049c8" +version = "0.45.0" +source = "git+https://github.com/bitfinity-network/bitfinity-evm-sdk?branch=EPROD-1132_block_validation#d2ade5d94f3a6d30124ac1373dae76b953c6acde" dependencies = [ "alloy", "anyhow", @@ -3245,8 +3273,8 @@ dependencies = [ [[package]] name = "evm-canister-client" -version = "0.44.0" -source = "git+https://github.com/bitfinity-network/bitfinity-evm-sdk?branch=EPROD-1132_block_validation#3e51b43de7ef5be1b001cdd9e629c06c19c049c8" +version = "0.45.0" +source = "git+https://github.com/bitfinity-network/bitfinity-evm-sdk?branch=EPROD-1132_block_validation#d2ade5d94f3a6d30124ac1373dae76b953c6acde" dependencies = [ "candid", "did", @@ -4015,7 +4043,7 @@ dependencies = [ "futures-core", "futures-sink", "http", - "indexmap 2.7.1", + "indexmap 2.8.0", "slab", "tokio", "tokio-util", @@ -4030,9 +4058,9 @@ checksum = "1b43ede17f21864e81be2fa654110bf1e793774238d86ef8555c37e6519c0403" [[package]] name = "half" -version = "2.4.1" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6dd08c532ae367adf81c312a4580bc67f1d0fe8bc9c460520283f4c0ff277888" +checksum = "7db2ff139bba50379da6aa0766b52fdcb62cb5b263009b09ed58ba604e14bbd1" dependencies = [ "cfg-if", "crunchy", @@ -4213,20 +4241,20 @@ dependencies = [ [[package]] name = "hostname" -version = "0.3.1" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c731c3e10504cc8ed35cfe2f1db4c9274c3d35fa486e3b31df46f068ef3e867" +checksum = "f9c7c7c8ac16c798734b8a24560c1362120597c40d5e1459f09498f8f6c8f2ba" dependencies = [ + "cfg-if", "libc", - "match_cfg", - "winapi", + "windows 0.52.0", ] [[package]] name = "http" -version = "1.2.0" +version = "1.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f16ca2af56261c99fba8bac40a10251ce8188205a4c448fbb745a2e4daa76fea" +checksum = "f4a85d31aea989eead29a3aaf9e1115a180df8282431156e533de47660892565" dependencies = [ "bytes", "fnv", @@ -4245,12 +4273,12 @@ dependencies = [ [[package]] name = "http-body-util" -version = "0.1.2" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "793429d76616a256bcb62c2a2ec2bed781c8307e797e2598c50010f2bee2544f" +checksum = "b021d93e26becf5dc7e1b75b1bed1fd93124b374ceb73f43d4d4eafec896a64a" dependencies = [ "bytes", - "futures-util", + "futures-core", "http", "http-body", "pin-project-lite", @@ -4302,9 +4330,9 @@ checksum = "91f255a4535024abf7640cb288260811fc14794f62b063652ed349f9a6c2348e" [[package]] name = "humantime" -version = "2.1.0" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" +checksum = "9b112acc8b3adf4b107a8ec20977da0273a8c386765a3ec0229bd500a1443f9f" [[package]] name = "humantime-serde" @@ -4449,8 +4477,8 @@ dependencies = [ [[package]] name = "ic-canister-client" -version = "0.23.0" -source = "git+https://github.com/bitfinity-network/canister-sdk?tag=v0.23.x#8e7672dbc3c21376051e9150d4ff982b3effe009" +version = "0.24.0" +source = "git+https://github.com/bitfinity-network/canister-sdk?tag=v0.24.x#b232bc7f34dc43b9061ea760af026351d26ebd3d" dependencies = [ "async-trait", "candid", @@ -4547,16 +4575,16 @@ dependencies = [ [[package]] name = "ic-crypto-getrandom-for-wasm" -version = "0.23.0" -source = "git+https://github.com/bitfinity-network/canister-sdk?tag=v0.23.x#8e7672dbc3c21376051e9150d4ff982b3effe009" +version = "0.24.0" +source = "git+https://github.com/bitfinity-network/canister-sdk?tag=v0.24.x#b232bc7f34dc43b9061ea760af026351d26ebd3d" dependencies = [ "getrandom 0.2.15", ] [[package]] name = "ic-exports" -version = "0.23.0" -source = "git+https://github.com/bitfinity-network/canister-sdk?tag=v0.23.x#8e7672dbc3c21376051e9150d4ff982b3effe009" +version = "0.24.0" +source = "git+https://github.com/bitfinity-network/canister-sdk?tag=v0.24.x#b232bc7f34dc43b9061ea760af026351d26ebd3d" dependencies = [ "candid", "ic-cdk", @@ -4569,8 +4597,8 @@ dependencies = [ [[package]] name = "ic-kit" -version = "0.23.0" -source = "git+https://github.com/bitfinity-network/canister-sdk?tag=v0.23.x#8e7672dbc3c21376051e9150d4ff982b3effe009" +version = "0.24.0" +source = "git+https://github.com/bitfinity-network/canister-sdk?tag=v0.24.x#b232bc7f34dc43b9061ea760af026351d26ebd3d" dependencies = [ "candid", "futures", @@ -4582,8 +4610,8 @@ dependencies = [ [[package]] name = "ic-log" -version = "0.23.0" -source = "git+https://github.com/bitfinity-network/canister-sdk?tag=v0.23.x#8e7672dbc3c21376051e9150d4ff982b3effe009" +version = "0.24.0" +source = "git+https://github.com/bitfinity-network/canister-sdk?tag=v0.24.x#b232bc7f34dc43b9061ea760af026351d26ebd3d" dependencies = [ "anyhow", "arc-swap", @@ -4607,8 +4635,8 @@ dependencies = [ [[package]] name = "ic-stable-structures" -version = "0.23.0" -source = "git+https://github.com/bitfinity-network/canister-sdk?tag=v0.23.x#8e7672dbc3c21376051e9150d4ff982b3effe009" +version = "0.24.0" +source = "git+https://github.com/bitfinity-network/canister-sdk?tag=v0.24.x#b232bc7f34dc43b9061ea760af026351d26ebd3d" dependencies = [ "candid", "ic-stable-structures 0.6.8", @@ -4657,9 +4685,9 @@ checksum = "8de254dd67bbd58073e23dc1c8553ba12fa1dc610a19de94ad2bbcd0460c067f" [[package]] name = "ic_bls12_381" -version = "0.10.0" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22c65787944f32af084dffd0c68c1e544237b76e215654ddea8cd9f527dd8b69" +checksum = "a1e828f9e804ccefe4b9b15b2195f474c60fd4f95ccd14fcb554eb6d7dfafde3" dependencies = [ "digest 0.10.7", "ff", @@ -4895,9 +4923,9 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.7.1" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c9c992b02b5b4c94ea26e32fe5bccb7aa7d9f390ab5c1221ff895bc7ea8b652" +checksum = "3954d50fe15b02142bf25d3b8bdadb634ec3948f103d04ffe3031bc8fe9d7058" dependencies = [ "arbitrary", "equivalent", @@ -4924,7 +4952,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "232929e1d75fe899576a3d5c7416ad0d88dbfbb3c3d6aa00873a7408a50ddb88" dependencies = [ "ahash", - "indexmap 2.7.1", + "indexmap 2.8.0", "is-terminal", "itoa", "log", @@ -5400,9 +5428,9 @@ checksum = "884e2677b40cc8c339eaefcb701c32ef1fd2493d71118dc0ca4b6a736c93bd67" [[package]] name = "libc" -version = "0.2.170" +version = "0.2.171" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "875b3680cb2f8f71bdcf9a30f38d48282f5d3c95cbf9b3fa57269bb5d5c06828" +checksum = "c19937216e9d3aa9956d9bb8dfc0b0c8beb6058fc4f7a4dc4d850edf86a237d6" [[package]] name = "libloading" @@ -5614,10 +5642,15 @@ dependencies = [ ] [[package]] -name = "match_cfg" -version = "0.1.0" +name = "macro-string" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffbee8634e0d45d258acb448e7eaab3fce7a0a467395d4d9f228e3c1f01fb2e4" +checksum = "1b27834086c65ec3f9387b096d66e99f221cf081c2b738042aa252bcd41204e3" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.100", +] [[package]] name = "matchers" @@ -5681,7 +5714,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dd7399781913e5393588a8d8c6a2867bf85fb38eaf2502fdce465aad2dc6f034" dependencies = [ "base64 0.22.1", - "indexmap 2.7.1", + "indexmap 2.8.0", "metrics", "metrics-util 0.19.0", "quanta", @@ -5713,7 +5746,7 @@ dependencies = [ "crossbeam-epoch", "crossbeam-utils", "hashbrown 0.15.2", - "indexmap 2.7.1", + "indexmap 2.8.0", "metrics", "ordered-float", ] @@ -6116,9 +6149,9 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.20.3" +version = "1.21.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "945462a4b81e43c4e3ba96bd7b49d834c6f61198356aa858733bc4acf3cbe62e" +checksum = "d75b0bedcc4fe52caa0e03d9f1151a323e4aa5e2d78ba3580400cd3c9e2bc4bc" dependencies = [ "critical-section", "portable-atomic", @@ -6575,9 +6608,9 @@ dependencies = [ [[package]] name = "pretty" -version = "0.12.3" +version = "0.12.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b55c4d17d994b637e2f4daf6e5dc5d660d209d5642377d675d7a1c3ab69fa579" +checksum = "ac98773b7109bc75f475ab5a134c9b64b87e59d776d31098d8f346922396a477" dependencies = [ "arrayvec 0.5.2", "typed-arena", @@ -6596,9 +6629,9 @@ dependencies = [ [[package]] name = "prettyplease" -version = "0.2.30" +version = "0.2.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1ccf34da56fc294e7d4ccf69a85992b7dfb826b7cf57bac6a70bba3494cc08a" +checksum = "5316f57387668042f561aae71480de936257848f9c43ce528e311d89a07cadeb" dependencies = [ "proc-macro2", "syn 2.0.100", @@ -6855,9 +6888,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.39" +version = "1.0.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1f1914ce909e1658d9907913b4b91947430c7d9be598b15a1912935b8c04801" +checksum = "1885c039570dc00dcb4ff087a89e185fd56bae234ddc7f056a945bf36467248d" dependencies = [ "proc-macro2", ] @@ -7132,9 +7165,9 @@ checksum = "ba39f3699c378cd8970968dcbff9c43159ea4cfbd88d43c00b22f2ef10a435d2" [[package]] name = "reqwest" -version = "0.12.12" +version = "0.12.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43e734407157c3c2034e0258f5e4473ddb361b1e85f95a66690d67264d7cd1da" +checksum = "989e327e510263980e231de548a33e63d34962d29ae61b467389a1a09627a254" dependencies = [ "async-compression", "base64 0.22.1", @@ -7180,12 +7213,11 @@ dependencies = [ [[package]] name = "resolv-conf" -version = "0.7.0" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52e44394d2086d010551b14b53b1f24e31647570cd1deb0379e2c21b329aba00" +checksum = "48375394603e3dd4b2d64371f7148fd8c7baa2680e28741f2cb8d23b59e3d4c4" dependencies = [ "hostname", - "quick-error", ] [[package]] @@ -7211,7 +7243,7 @@ dependencies = [ "evm-canister-client", "eyre", "futures", - "ic-agent", + "hex", "jsonrpsee", "lightspeed_scheduler", "parking_lot", @@ -8640,7 +8672,7 @@ dependencies = [ "codspeed-criterion-compat", "dashmap", "derive_more 1.0.0", - "indexmap 2.7.1", + "indexmap 2.8.0", "parking_lot", "pprof", "rand 0.8.5", @@ -10142,9 +10174,9 @@ dependencies = [ [[package]] name = "revm" -version = "19.5.0" +version = "19.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfc5bef3c95fadf3b6a24a253600348380c169ef285f9780a793bb7090c8990d" +checksum = "7b906766b7ba049b515848952b5ae74f363d456e98de2021048a513e442b4f42" dependencies = [ "auto_impl", "cfg-if", @@ -10246,9 +10278,9 @@ dependencies = [ [[package]] name = "ring" -version = "0.17.13" +version = "0.17.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70ac5d832aa16abd7d1def883a8545280c20a60f523a370aa3a9617c2b8550ee" +checksum = "a4689e6c2294d81e88dc6261c768b63bc4fcdb852be6d1352498b114f61383b7" dependencies = [ "cc", "cfg-if", @@ -10462,9 +10494,9 @@ dependencies = [ [[package]] name = "rustix" -version = "1.0.1" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dade4812df5c384711475be5fcd8c162555352945401aed22a35bffeab61f657" +checksum = "f7178faa4b75a30e269c71e61c353ce2748cf3d76f0c44c393f4e60abf49b825" dependencies = [ "bitflags 2.9.0", "errno", @@ -10811,7 +10843,7 @@ version = "1.0.140" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "20068b6e96dc6c9bd23e01df8827e6c7e1f2fddd43c21810382803c136b99373" dependencies = [ - "indexmap 2.7.1", + "indexmap 2.8.0", "itoa", "memchr", "ryu", @@ -10883,7 +10915,7 @@ dependencies = [ "chrono", "hex", "indexmap 1.9.3", - "indexmap 2.7.1", + "indexmap 2.8.0", "serde", "serde_derive", "serde_json", @@ -11347,9 +11379,9 @@ dependencies = [ [[package]] name = "syn-solidity" -version = "0.8.22" +version = "0.8.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac9f9798a84bca5cd4d1760db691075fda8f2c3a5d9647e8bfd29eb9b3fabb87" +checksum = "d975606bae72d8aad5b07d9342465e123a2cccf53a5a735aedf81ca92a709ecb" dependencies = [ "paste", "proc-macro2", @@ -11404,15 +11436,14 @@ checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" [[package]] name = "tempfile" -version = "3.18.0" +version = "3.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c317e0a526ee6120d8dabad239c8dadca62b24b6f168914bbbc8e2fb1f0e567" +checksum = "488960f40a3fd53d72c2a29a58722561dee8afdd175bd88e3db4677d7b2ba600" dependencies = [ - "cfg-if", "fastrand 2.3.0", "getrandom 0.3.1", "once_cell", - "rustix 1.0.1", + "rustix 1.0.2", "windows-sys 0.59.0", ] @@ -11644,9 +11675,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.44.0" +version = "1.44.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9975ea0f48b5aa3972bf2d888c238182458437cc2a19374b81b25cdf1023fb3a" +checksum = "f382da615b842244d4b8738c82ed1275e6c5dd90c459a30941cd07080b06c91a" dependencies = [ "backtrace", "bytes", @@ -11711,9 +11742,9 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.7.13" +version = "0.7.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7fcaa8d55a2bdd6b83ace262b016eca0d79ee02818c5c1bcdf0305114081078" +checksum = "6b9590b93e6fcc1739458317cccd391ad3955e2bde8913edf6f95f9e65a8f034" dependencies = [ "bytes", "futures-core", @@ -11751,7 +11782,7 @@ version = "0.22.24" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "17b4795ff5edd201c7cd6dca065ae59972ce77d1b80fa0a84d94950ece7d1474" dependencies = [ - "indexmap 2.7.1", + "indexmap 2.8.0", "serde", "serde_spanned", "toml_datetime", @@ -12170,9 +12201,9 @@ checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" [[package]] name = "uuid" -version = "1.15.1" +version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0f540e3240398cce6128b64ba83fdbdd86129c16a3aa1a3a252efd66eb3d587" +checksum = "458f7a779bf54acc9f347480ac654f68407d3aab21269a6e3c9f922acd9e2da9" dependencies = [ "getrandom 0.3.1", ] @@ -12433,6 +12464,16 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" +[[package]] +name = "windows" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e48a53791691ab099e5e2ad123536d0fff50652600abaf43bbf952894110d0be" +dependencies = [ + "windows-core 0.52.0", + "windows-targets 0.52.6", +] + [[package]] name = "windows" version = "0.57.0" @@ -12483,7 +12524,7 @@ dependencies = [ "windows-implement 0.58.0", "windows-interface 0.58.0", "windows-result 0.2.0", - "windows-strings", + "windows-strings 0.1.0", "windows-targets 0.52.6", ] @@ -12539,13 +12580,13 @@ checksum = "6dccfd733ce2b1753b03b6d3c65edf020262ea35e20ccdf3e288043e6dd620e3" [[package]] name = "windows-registry" -version = "0.2.0" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e400001bb720a623c1c69032f8e3e4cf09984deec740f007dd2b03ec864804b0" +checksum = "4286ad90ddb45071efd1a66dfa43eb02dd0dfbae1545ad6cc3c51cf34d7e8ba3" dependencies = [ - "windows-result 0.2.0", - "windows-strings", - "windows-targets 0.52.6", + "windows-result 0.3.1", + "windows-strings 0.3.1", + "windows-targets 0.53.0", ] [[package]] @@ -12566,6 +12607,15 @@ dependencies = [ "windows-targets 0.52.6", ] +[[package]] +name = "windows-result" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06374efe858fab7e4f881500e6e86ec8bc28f9462c47e5a9941a0142ad86b189" +dependencies = [ + "windows-link", +] + [[package]] name = "windows-strings" version = "0.1.0" @@ -12576,6 +12626,15 @@ dependencies = [ "windows-targets 0.52.6", ] +[[package]] +name = "windows-strings" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87fa48cc5d406560701792be122a10132491cff9d0aeb23583cc2dcafc847319" +dependencies = [ + "windows-link", +] + [[package]] name = "windows-sys" version = "0.48.0" @@ -12627,13 +12686,29 @@ dependencies = [ "windows_aarch64_gnullvm 0.52.6", "windows_aarch64_msvc 0.52.6", "windows_i686_gnu 0.52.6", - "windows_i686_gnullvm", + "windows_i686_gnullvm 0.52.6", "windows_i686_msvc 0.52.6", "windows_x86_64_gnu 0.52.6", "windows_x86_64_gnullvm 0.52.6", "windows_x86_64_msvc 0.52.6", ] +[[package]] +name = "windows-targets" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1e4c7e8ceaaf9cb7d7507c974735728ab453b67ef8f18febdd7c11fe59dca8b" +dependencies = [ + "windows_aarch64_gnullvm 0.53.0", + "windows_aarch64_msvc 0.53.0", + "windows_i686_gnu 0.53.0", + "windows_i686_gnullvm 0.53.0", + "windows_i686_msvc 0.53.0", + "windows_x86_64_gnu 0.53.0", + "windows_x86_64_gnullvm 0.53.0", + "windows_x86_64_msvc 0.53.0", +] + [[package]] name = "windows_aarch64_gnullvm" version = "0.48.5" @@ -12646,6 +12721,12 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "86b8d5f90ddd19cb4a147a5fa63ca848db3df085e25fee3cc10b39b6eebae764" + [[package]] name = "windows_aarch64_msvc" version = "0.48.5" @@ -12658,6 +12739,12 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" +[[package]] +name = "windows_aarch64_msvc" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7651a1f62a11b8cbd5e0d42526e55f2c99886c77e007179efff86c2b137e66c" + [[package]] name = "windows_i686_gnu" version = "0.48.5" @@ -12670,12 +12757,24 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" +[[package]] +name = "windows_i686_gnu" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1dc67659d35f387f5f6c479dc4e28f1d4bb90ddd1a5d3da2e5d97b42d6272c3" + [[package]] name = "windows_i686_gnullvm" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" +[[package]] +name = "windows_i686_gnullvm" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ce6ccbdedbf6d6354471319e781c0dfef054c81fbc7cf83f338a4296c0cae11" + [[package]] name = "windows_i686_msvc" version = "0.48.5" @@ -12688,6 +12787,12 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" +[[package]] +name = "windows_i686_msvc" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "581fee95406bb13382d2f65cd4a908ca7b1e4c2f1917f143ba16efe98a589b5d" + [[package]] name = "windows_x86_64_gnu" version = "0.48.5" @@ -12700,6 +12805,12 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" +[[package]] +name = "windows_x86_64_gnu" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e55b5ac9ea33f2fc1716d1742db15574fd6fc8dadc51caab1c16a3d3b4190ba" + [[package]] name = "windows_x86_64_gnullvm" version = "0.48.5" @@ -12712,6 +12823,12 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a6e035dd0599267ce1ee132e51c27dd29437f63325753051e71dd9e42406c57" + [[package]] name = "windows_x86_64_msvc" version = "0.48.5" @@ -12724,11 +12841,17 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" +[[package]] +name = "windows_x86_64_msvc" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "271414315aff87387382ec3d271b52d7ae78726f5d44ac98b4f4030c91880486" + [[package]] name = "winnow" -version = "0.7.3" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e7f4ea97f6f78012141bcdb6a216b2609f0979ada50b20ca5b52dde2eac2bb1" +checksum = "0e97b544156e9bebe1a0ffbc03484fc1ffe3100cbce3ffb17eac35f7cdd7ab36" dependencies = [ "memchr", ] diff --git a/Cargo.toml b/Cargo.toml index 9dfbd4e21a8..42aa5bafcc1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -660,7 +660,6 @@ ethereum-json-rpc-client = { git = "https://github.com/bitfinity-network/bitfini evm-canister-client = { git = "https://github.com/bitfinity-network/bitfinity-evm-sdk", package = "evm-canister-client", features = [ "ic-agent-client", ], branch = "EPROD-1132_block_validation" } -ic-agent = "0.39" ic-cbor = "3" ic-certificate-verification = "3" ic-certification = "3" diff --git a/bin/reth/Cargo.toml b/bin/reth/Cargo.toml index c8f9ad149af..bd8086e38d3 100644 --- a/bin/reth/Cargo.toml +++ b/bin/reth/Cargo.toml @@ -102,7 +102,7 @@ bitfinity-block-confirmation.workspace = true candid.workspace = true did.workspace = true evm-canister-client = { workspace = true, features = ["ic-agent-client"] } -ic-agent.workspace = true +hex.workspace = true lightspeed_scheduler = { workspace = true, features = ["tracing"] } # rlp = { workspace = true } diff --git a/bin/reth/src/commands/bitfinity_import.rs b/bin/reth/src/commands/bitfinity_import.rs index 86cebed7b4e..decd1beff19 100644 --- a/bin/reth/src/commands/bitfinity_import.rs +++ b/bin/reth/src/commands/bitfinity_import.rs @@ -4,7 +4,6 @@ use crate::{dirs::DataDirPath, version::SHORT_VERSION}; use bitfinity_block_confirmation::BitfinityBlockConfirmation; use eyre::eyre; use futures::{Stream, StreamExt}; -use ic_agent::Agent; use lightspeed_scheduler::{job::Job, scheduler::Scheduler, JobExecutor}; use reth_beacon_consensus::EthBeaconConsensus; use reth_chainspec::ChainSpec; @@ -20,7 +19,7 @@ use reth_downloaders::{ }; use reth_exex::ExExManagerHandle; use reth_node_api::NodeTypesWithDBAdapter; -use reth_node_core::{args::{BitfinityImportArgs, IC_MAINNET_URL}, dirs::ChainPath}; +use reth_node_core::{args::BitfinityImportArgs, dirs::ChainPath}; use reth_node_ethereum::{EthExecutorProvider, EthereumNode}; use reth_node_events::node::NodeEvent; use reth_primitives::{EthPrimitives, SealedHeader}; @@ -118,11 +117,7 @@ impl BitfinityImportCommand { Job::new("import", "block importer", None, move || { let import = self.clone(); Box::pin(async move { - import.single_execution().await.inspect_err(|err| { - // The scheduler doesn't output the returned errors, so we must log - // them before finishing the job - error!(target: "reth::cli - BitfinityImportCommand", "import failed: {err:?}"); - })?; + import.single_execution().await?; import.update_chain_info()?; Ok(()) }) @@ -157,12 +152,6 @@ impl BitfinityImportCommand { debug!(target: "reth::cli - BitfinityImportCommand", "Starting block: {}", start_block); - let ic_url = self.bitfinity.ic_url.clone().unwrap_or_else(|| IC_MAINNET_URL.into()); - let ic_agent = Agent::builder().with_url(ic_url).build()?; - if self.bitfinity.fetch_ic_root_key { - ic_agent.fetch_root_key().await?; - } - let remote_client = Arc::new( BitfinityEvmClient::from_rpc_url( self.rpc_config(), @@ -172,7 +161,7 @@ impl BitfinityImportCommand { self.bitfinity.max_fetch_blocks, Some(CertificateCheckSettings { evmc_principal: self.bitfinity.evmc_principal.clone(), - ic_root_key: ic_agent.read_root_key(), + ic_root_key: self.bitfinity.ic_root_key.clone(), }), self.bitfinity.check_evm_state_before_importing, ) diff --git a/crates/net/downloaders/src/bitfinity_evm_client.rs b/crates/net/downloaders/src/bitfinity_evm_client.rs index 30396e954ae..90b67a720c3 100644 --- a/crates/net/downloaders/src/bitfinity_evm_client.rs +++ b/crates/net/downloaders/src/bitfinity_evm_client.rs @@ -94,7 +94,7 @@ pub struct CertificateCheckSettings { /// Principal of the EVM canister pub evmc_principal: String, /// Root key of the IC network - pub ic_root_key: Vec, + pub ic_root_key: String, } impl BitfinityEvmClient { @@ -560,11 +560,14 @@ impl BlockCertificateChecker { Principal::from_text(certificate_settings.evmc_principal).map_err(|e| { RemoteClientError::CertificateError(format!("failed to parse principal: {e}")) })?; + let ic_root_key = hex::decode(&certificate_settings.ic_root_key).map_err(|e| { + RemoteClientError::CertificateError(format!("failed to parse IC root key: {e}")) + })?; let certified_data = client .get_last_certified_block() .await .map_err(|e| RemoteClientError::ProviderError(e.to_string()))?; - Ok(Self { certified_data, evmc_principal, ic_root_key: certificate_settings.ic_root_key }) + Ok(Self { certified_data, evmc_principal, ic_root_key }) } fn get_block_number(&self) -> u64 { diff --git a/crates/node/core/src/args/bitfinity_args.rs b/crates/node/core/src/args/bitfinity_args.rs index ffdc527b021..9e85ed1ed44 100644 --- a/crates/node/core/src/args/bitfinity_args.rs +++ b/crates/node/core/src/args/bitfinity_args.rs @@ -1,5 +1,9 @@ use clap::{arg, Args}; +/// Public key of the IC main net. +/// IC advices to use a hardcoded value instead of querying it to avoid main-in-the middle attacks. +pub const IC_MAINNET_KEY: &str = "308182301d060d2b0601040182dc7c0503010201060c2b0601040182dc7c05030201036100814c0e6ec71fab583b08bd81373c255c3c371b2e84863c98a4f1e08b74235d14fb5d9c0cd546d9685f913a0c0b2cc5341583bf4b4392e467db96d65b9bb4cb717112f8472e0d5a4d14505ffd7484b01291091c5f87b98883463f98091a0baaae"; + /// URL of the IC mainnet. pub const IC_MAINNET_URL: &str = "https://ic0.app"; @@ -57,19 +61,9 @@ pub struct BitfinityImportArgs { #[arg(long, value_name = "EVMC_PRINCIPAL", default_value = "4fe7g-7iaaa-aaaak-aegcq-cai")] pub evmc_principal: String, - /// If set to true, the importer will fetch root certificate key from IC to validate EVM blocks - /// signed data. - /// - /// Set this flag to true for local deployment. For IC mainnet well known value must be used for - /// secure certificate validation. - #[arg(long)] - pub fetch_ic_root_key: bool, - - /// Url of the ic the EVM is deployed into. - /// - /// If not set, mainnet IC connection is assumed. - #[arg(long, value_name = "IC_URL")] - pub ic_url: Option, + /// Root key for the IC network + #[arg(long, value_name = "IC_ROOT_KEY", default_value = IC_MAINNET_KEY)] + pub ic_root_key: String, /// A flag to check the EVM state before importing blocks #[arg(long, default_value = "true")] From 32acba279fb8e6321b75f426456c114d3622f421 Mon Sep 17 00:00:00 2001 From: Francesco Date: Fri, 14 Mar 2025 11:12:55 +0100 Subject: [PATCH 36/38] Revert "Fix bitfinity tests" This reverts commit 210465fcf70856a7efbea5bcf7be82a8b0b6a17c. --- bin/reth/tests/commands/utils.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bin/reth/tests/commands/utils.rs b/bin/reth/tests/commands/utils.rs index c7f1abedba0..532a5e3615e 100644 --- a/bin/reth/tests/commands/utils.rs +++ b/bin/reth/tests/commands/utils.rs @@ -1,5 +1,6 @@ //! //! Utils for bitfinity integration tests +//! use std::{ fmt::{Debug, Display, Formatter}, path::PathBuf, @@ -13,7 +14,7 @@ use alloy_primitives::BlockNumber; use lightspeed_scheduler::JobExecutor; use parking_lot::Mutex; use reth::{ - args::BitfinityImportArgs, + args::{BitfinityImportArgs, IC_MAINNET_KEY}, commands::bitfinity_import::BitfinityImportCommand, dirs::{ChainPath, DataDirPath, PlatformPath}, }; @@ -165,14 +166,13 @@ pub async fn bitfinity_import_config_data( batch_size: 1000, max_fetch_blocks: 10000, evmc_principal: LOCAL_EVM_CANISTER_ID.to_string(), + ic_root_key: IC_MAINNET_KEY.to_string(), backup_rpc_url: backup_evm_datasource_url, max_retries: 3, retry_delay_secs: 3, check_evm_state_before_importing: false, max_block_age_secs: 600, confirm_unsafe_blocks: false, - fetch_ic_root_key: false, - ic_url: None, }; Ok(( From 0978d1c95924e9d3deb590c15e88a5ed87e8c70e Mon Sep 17 00:00:00 2001 From: Francesco Date: Fri, 14 Mar 2025 12:08:16 +0100 Subject: [PATCH 37/38] bump sdk version --- Cargo.lock | 12 ++++++------ Cargo.toml | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index c86de68df81..899072b8742 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2832,8 +2832,8 @@ dependencies = [ [[package]] name = "did" -version = "0.45.0" -source = "git+https://github.com/bitfinity-network/bitfinity-evm-sdk?branch=EPROD-1132_block_validation#d2ade5d94f3a6d30124ac1373dae76b953c6acde" +version = "0.46.0" +source = "git+https://github.com/bitfinity-network/bitfinity-evm-sdk?tag=v0.46.0#6fe7e9dd868d8b6b567b7dc50b293d84c27f577c" dependencies = [ "alloy", "bincode", @@ -3187,8 +3187,8 @@ dependencies = [ [[package]] name = "ethereum-json-rpc-client" -version = "0.45.0" -source = "git+https://github.com/bitfinity-network/bitfinity-evm-sdk?branch=EPROD-1132_block_validation#d2ade5d94f3a6d30124ac1373dae76b953c6acde" +version = "0.46.0" +source = "git+https://github.com/bitfinity-network/bitfinity-evm-sdk?tag=v0.46.0#6fe7e9dd868d8b6b567b7dc50b293d84c27f577c" dependencies = [ "alloy", "anyhow", @@ -3273,8 +3273,8 @@ dependencies = [ [[package]] name = "evm-canister-client" -version = "0.45.0" -source = "git+https://github.com/bitfinity-network/bitfinity-evm-sdk?branch=EPROD-1132_block_validation#d2ade5d94f3a6d30124ac1373dae76b953c6acde" +version = "0.46.0" +source = "git+https://github.com/bitfinity-network/bitfinity-evm-sdk?tag=v0.46.0#6fe7e9dd868d8b6b567b7dc50b293d84c27f577c" dependencies = [ "candid", "did", diff --git a/Cargo.toml b/Cargo.toml index 42aa5bafcc1..24b29fc7697 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -652,14 +652,14 @@ tracy-client = "0.17.3" async-channel = "2" bitfinity-block-confirmation = { path = "crates/bitfinity-block-confirmation" } candid = "0.10" -did = { git = "https://github.com/bitfinity-network/bitfinity-evm-sdk", package = "did", branch = "EPROD-1132_block_validation" } +did = { git = "https://github.com/bitfinity-network/bitfinity-evm-sdk", package = "did", tag = "v0.46.0" } dirs = "5.0.1" -ethereum-json-rpc-client = { git = "https://github.com/bitfinity-network/bitfinity-evm-sdk", package = "ethereum-json-rpc-client", branch = "EPROD-1132_block_validation", features = [ +ethereum-json-rpc-client = { git = "https://github.com/bitfinity-network/bitfinity-evm-sdk", package = "ethereum-json-rpc-client", tag = "v0.46.0", features = [ "reqwest", ] } evm-canister-client = { git = "https://github.com/bitfinity-network/bitfinity-evm-sdk", package = "evm-canister-client", features = [ "ic-agent-client", -], branch = "EPROD-1132_block_validation" } +], tag = "v0.46.0" } ic-cbor = "3" ic-certificate-verification = "3" ic-certification = "3" From 02089f030a7f9fc52b4ea577600ec68d86018704 Mon Sep 17 00:00:00 2001 From: Francesco Date: Fri, 14 Mar 2025 12:09:13 +0100 Subject: [PATCH 38/38] bump sdk version --- Cargo.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 899072b8742..e50551f2393 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5577,9 +5577,9 @@ checksum = "d26c52dbd32dccf2d10cac7725f8eae5296885fb5703b261f7d0a0739ec807ab" [[package]] name = "linux-raw-sys" -version = "0.9.2" +version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6db9c683daf087dc577b7506e9695b3d556a9f3849903fa28186283afd6809e9" +checksum = "fe7db12097d22ec582439daf8618b8fdd1a7bef6270e9af3b1ebcd30893cf413" [[package]] name = "litemap" @@ -10501,7 +10501,7 @@ dependencies = [ "bitflags 2.9.0", "errno", "libc", - "linux-raw-sys 0.9.2", + "linux-raw-sys 0.9.3", "windows-sys 0.59.0", ]