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

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,158 changes: 540 additions & 618 deletions Cargo.lock

Large diffs are not rendered by default.

88 changes: 44 additions & 44 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,59 +12,59 @@ name = "reth"
path = "src/main.rs"

[dependencies]
reth = { git = "https://github.com/paradigmxyz/reth", tag = "v1.4.3" }
reth-evm = { git = "https://github.com/paradigmxyz/reth", tag = "v1.4.3" }
reth-revm = { git = "https://github.com/paradigmxyz/reth", tag = "v1.4.3" }
reth-engine-primitives = { git = "https://github.com/paradigmxyz/reth", tag = "v1.4.3" }
reth-node-builder = { git = "https://github.com/paradigmxyz/reth", tag = "v1.4.3" }
reth-node-ethereum = { git = "https://github.com/paradigmxyz/reth", tag = "v1.4.3" }
reth-evm-ethereum = { git = "https://github.com/paradigmxyz/reth", tag = "v1.4.3" }
reth-ethereum-consensus = { git = "https://github.com/paradigmxyz/reth", tag = "v1.4.3" }
reth-chainspec = { git = "https://github.com/paradigmxyz/reth", tag = "v1.4.3" }
reth-chain-state = { git = "https://github.com/paradigmxyz/reth", tag = "v1.4.3" }
reth-consensus = { git = "https://github.com/paradigmxyz/reth", tag = "v1.4.3" }
reth-cli = { git = "https://github.com/paradigmxyz/reth", tag = "v1.4.3" }
reth-cli-commands = { git = "https://github.com/paradigmxyz/reth", tag = "v1.4.3" }
reth-cli-util = { git = "https://github.com/paradigmxyz/reth", tag = "v1.4.3" }
reth-prune-types = { git = "https://github.com/paradigmxyz/reth", tag = "v1.4.3" }
reth-basic-payload-builder = { git = "https://github.com/paradigmxyz/reth", tag = "v1.4.3" }
reth-payload-builder = { git = "https://github.com/paradigmxyz/reth", tag = "v1.4.3" }
reth-ethereum-forks = { git = "https://github.com/paradigmxyz/reth", tag = "v1.4.3" }
reth-ethereum-payload-builder = { git = "https://github.com/paradigmxyz/reth", tag = "v1.4.3" }
reth-ethereum-engine-primitives = { git = "https://github.com/paradigmxyz/reth", tag = "v1.4.3" }
reth-ethereum-primitives = { git = "https://github.com/paradigmxyz/reth", tag = "v1.4.3" }
reth-fs-util = { git = "https://github.com/paradigmxyz/reth", tag = "v1.4.3" }
reth-provider = { git = "https://github.com/paradigmxyz/reth", tag = "v1.4.3", features = [
reth = { git = "https://github.com/paradigmxyz/reth", tag = "v1.4.8" }
reth-evm = { git = "https://github.com/paradigmxyz/reth", tag = "v1.4.8" }
reth-revm = { git = "https://github.com/paradigmxyz/reth", tag = "v1.4.8" }
reth-engine-primitives = { git = "https://github.com/paradigmxyz/reth", tag = "v1.4.8" }
reth-node-builder = { git = "https://github.com/paradigmxyz/reth", tag = "v1.4.8" }
reth-node-ethereum = { git = "https://github.com/paradigmxyz/reth", tag = "v1.4.8" }
reth-evm-ethereum = { git = "https://github.com/paradigmxyz/reth", tag = "v1.4.8" }
reth-ethereum-consensus = { git = "https://github.com/paradigmxyz/reth", tag = "v1.4.8" }
reth-chainspec = { git = "https://github.com/paradigmxyz/reth", tag = "v1.4.8" }
reth-chain-state = { git = "https://github.com/paradigmxyz/reth", tag = "v1.4.8" }
reth-consensus = { git = "https://github.com/paradigmxyz/reth", tag = "v1.4.8" }
reth-cli = { git = "https://github.com/paradigmxyz/reth", tag = "v1.4.8" }
reth-cli-commands = { git = "https://github.com/paradigmxyz/reth", tag = "v1.4.8" }
reth-cli-util = { git = "https://github.com/paradigmxyz/reth", tag = "v1.4.8" }
reth-prune-types = { git = "https://github.com/paradigmxyz/reth", tag = "v1.4.8" }
reth-basic-payload-builder = { git = "https://github.com/paradigmxyz/reth", tag = "v1.4.8" }
reth-payload-builder = { git = "https://github.com/paradigmxyz/reth", tag = "v1.4.8" }
reth-ethereum-forks = { git = "https://github.com/paradigmxyz/reth", tag = "v1.4.8" }
reth-ethereum-payload-builder = { git = "https://github.com/paradigmxyz/reth", tag = "v1.4.8" }
reth-ethereum-engine-primitives = { git = "https://github.com/paradigmxyz/reth", tag = "v1.4.8" }
reth-ethereum-primitives = { git = "https://github.com/paradigmxyz/reth", tag = "v1.4.8" }
reth-fs-util = { git = "https://github.com/paradigmxyz/reth", tag = "v1.4.8" }
reth-provider = { git = "https://github.com/paradigmxyz/reth", tag = "v1.4.8", features = [
"test-utils",
] }
reth-primitives-traits = { git = "https://github.com/paradigmxyz/reth", tag = "v1.4.3" }
reth-errors = { git = "https://github.com/paradigmxyz/reth", tag = "v1.4.3" }
reth-db = { git = "https://github.com/paradigmxyz/reth", tag = "v1.4.3" }
reth-db-api = { git = "https://github.com/paradigmxyz/reth", tag = "v1.4.3" }
reth-db-common = { git = "https://github.com/paradigmxyz/reth", tag = "v1.4.3" }
reth-network-peers = { git = "https://github.com/paradigmxyz/reth", tag = "v1.4.3" }
reth-eth-wire-types = { git = "https://github.com/paradigmxyz/reth", tag = "v1.4.3" }
reth-rpc = { git = "https://github.com/paradigmxyz/reth", tag = "v1.4.3" }
reth-stages = { git = "https://github.com/paradigmxyz/reth", tag = "v1.4.3" }
reth-stages-api = { git = "https://github.com/paradigmxyz/reth", tag = "v1.4.3" }
reth-stages-types = { git = "https://github.com/paradigmxyz/reth", tag = "v1.4.3" }
reth-primitives = { git = "https://github.com/paradigmxyz/reth", tag = "v1.4.3" }
reth-tracing = { git = "https://github.com/paradigmxyz/reth", tag = "v1.4.3" }
reth-trie = { git = "https://github.com/paradigmxyz/reth", tag = "v1.4.3" }
reth-trie-db = { git = "https://github.com/paradigmxyz/reth", tag = "v1.4.3" }
reth-transaction-pool = { git = "https://github.com/paradigmxyz/reth", tag = "v1.4.3" }
reth-primitives-traits = { git = "https://github.com/paradigmxyz/reth", tag = "v1.4.8" }
reth-errors = { git = "https://github.com/paradigmxyz/reth", tag = "v1.4.8" }
reth-db = { git = "https://github.com/paradigmxyz/reth", tag = "v1.4.8" }
reth-db-api = { git = "https://github.com/paradigmxyz/reth", tag = "v1.4.8" }
reth-db-common = { git = "https://github.com/paradigmxyz/reth", tag = "v1.4.8" }
reth-network-peers = { git = "https://github.com/paradigmxyz/reth", tag = "v1.4.8" }
reth-eth-wire-types = { git = "https://github.com/paradigmxyz/reth", tag = "v1.4.8" }
reth-rpc = { git = "https://github.com/paradigmxyz/reth", tag = "v1.4.8" }
reth-stages = { git = "https://github.com/paradigmxyz/reth", tag = "v1.4.8" }
reth-stages-api = { git = "https://github.com/paradigmxyz/reth", tag = "v1.4.8" }
reth-stages-types = { git = "https://github.com/paradigmxyz/reth", tag = "v1.4.8" }
reth-primitives = { git = "https://github.com/paradigmxyz/reth", tag = "v1.4.8" }
reth-tracing = { git = "https://github.com/paradigmxyz/reth", tag = "v1.4.8" }
reth-trie = { git = "https://github.com/paradigmxyz/reth", tag = "v1.4.8" }
reth-trie-db = { git = "https://github.com/paradigmxyz/reth", tag = "v1.4.8" }
reth-transaction-pool = { git = "https://github.com/paradigmxyz/reth", tag = "v1.4.8" }
eyre = "0.6"
clap = { version = "4.5.6", features = ["derive"] }
derive_more = { version = "2", default-features = false, features = ["full"] }

# revm
revm = { version = "23.0.0", features = ["std"], default-features = false }
revm = { version = "24.0.1", features = ["std"], default-features = false }
revm-database = { version = "4.0.0", default-features = false }
revm-state = { version = "4.0.0", default-features = false }
revm-primitives = { version = "19.0.0", features = [
"std",
], default-features = false }
revm-inspectors = "0.22"
revm-inspectors = "0.23"

serde = { version = "1.0", features = ["derive"], default-features = false }
serde_json = "1.0.94"
Expand All @@ -76,12 +76,12 @@ thiserror-no-std = { version = "2.0.2", default-features = false }

# eth
alloy-chains = { version = "0.2.0", default-features = false }
alloy-evm = { version = "0.8.0", default-features = false }
alloy-dyn-abi = "1.0"
alloy-evm = { version = "0.10", default-features = false }
alloy-dyn-abi = "1.1.0"
alloy-primitives = { version = "1.1.0", default-features = false }
alloy-rlp = { version = "0.3.10", default-features = false }
alloy-sol-types = "1.1.0"
alloy-trie = { version = "0.7.9", default-features = false }
alloy-trie = { version = "0.8.1", default-features = false }

alloy-consensus = { version = "1.0", default-features = false }
alloy-eips = { version = "1.0", default-features = false }
Expand Down
6 changes: 0 additions & 6 deletions src/blobs.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
use alloy_eips::eip7840::BlobParams;
use alloy_eips::BlobScheduleBlobParams;
use revm::context_interface::block::BlobExcessGasAndPrice;
use revm_primitives::hardfork::SpecId;

pub static CANCUN_BLOB_PARAMS: BlobParams = BlobParams {
target_blob_count: 1,
Expand All @@ -26,11 +25,6 @@ pub fn gnosis_blob_schedule() -> BlobScheduleBlobParams {
}
}

// helper function to create the evm's CfgEnv in get_cfg_env
pub fn evm_env_blob_schedule() -> Vec<(SpecId, u64, u64)> {
vec![(SpecId::CANCUN, 1, 2), (SpecId::PRAGUE, 1, 2)]
}

pub fn get_blob_params(is_prague: bool) -> BlobParams {
if is_prague {
PRAGUE_BLOB_PARAMS
Expand Down
25 changes: 14 additions & 11 deletions src/block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,14 +118,17 @@ where
Ok(())
}

fn execute_transaction_with_result_closure(
fn execute_transaction_with_commit_condition(
&mut self,
tx: impl ExecutableTx<Self>,
f: impl FnOnce(&ExecutionResult<<Self::Evm as Evm>::HaltReason>),
) -> Result<u64, BlockExecutionError> {
f: impl FnOnce(
&ExecutionResult<<Self::Evm as Evm>::HaltReason>,
) -> reth_evm::block::CommitChanges,
) -> Result<Option<u64>, BlockExecutionError> {
// The sum of the transaction's gas limit, Tg, and the gas utilized in this block prior,
// must be no greater than the block's gasLimit.
let block_available_gas = self.evm.block().gas_limit - self.gas_used;

if tx.tx().gas_limit() > block_available_gas {
return Err(
BlockValidationError::TransactionGasLimitMoreThanAvailableBlockGas {
Expand All @@ -137,17 +140,17 @@ where
}

// Execute transaction.
let result_and_state = self
let ResultAndState { result, state } = self
.evm
.transact(tx)
.map_err(|err| BlockExecutionError::evm(err, tx.tx().trie_hash()))?;
self.system_caller.on_state(
StateChangeSource::Transaction(self.receipts.len()),
&result_and_state.state,
);
let ResultAndState { result, state } = result_and_state;

f(&result);
if !f(&result).should_commit() {
return Ok(None);
}

self.system_caller
.on_state(StateChangeSource::Transaction(self.receipts.len()), &state);

let gas_used = result.gas_used();

Expand All @@ -167,7 +170,7 @@ where
// Commit the state changes.
self.evm.db_mut().commit(state);

Ok(gas_used)
Ok(Some(gas_used))
}

fn finish(
Expand Down
8 changes: 4 additions & 4 deletions src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use reth::{
CliRunner,
};
use reth_cli::chainspec::ChainSpecParser;
use reth_cli_commands::node::NoArgs;
use reth_cli_commands::{launcher::FnLauncher, node::NoArgs};
use reth_db::DatabaseEnv;
use reth_eth_wire_types::EthNetworkPrimitives;
use reth_ethereum_consensus::EthBeaconConsensus;
Expand Down Expand Up @@ -126,9 +126,9 @@ where
};

match self.command {
Commands::Node(command) => {
runner.run_command_until_exit(|ctx| command.execute(ctx, launcher))
}
Commands::Node(command) => runner.run_command_until_exit(|ctx| {
command.execute(ctx, FnLauncher::new::<C, Ext>(launcher))
}),
Commands::Init(command) => {
runner.run_blocking_until_ctrl_c(command.execute::<GnosisNode>())
}
Expand Down
8 changes: 8 additions & 0 deletions src/evm/factory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,14 @@ where
fn inspector_mut(&mut self) -> &mut Self::Inspector {
&mut self.inner.0.inspector
}

fn precompiles(&self) -> &Self::Precompiles {
&self.inner.0.precompiles
}

fn inspector(&self) -> &Self::Inspector {
&self.inner.0.inspector
}
}

/// Custom EVM configuration.
Expand Down
4 changes: 2 additions & 2 deletions src/evm_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ use revm_primitives::Bytes;
use std::borrow::Cow;
use std::{convert::Infallible, sync::Arc};

use crate::blobs::{evm_env_blob_schedule, get_blob_params, next_blob_gas_and_price};
use crate::blobs::{get_blob_params, next_blob_gas_and_price};
use crate::block::GnosisBlockExecutorFactory;
use crate::build::GnosisBlockAssembler;
use crate::evm::factory::GnosisEvmFactory;
Expand All @@ -26,7 +26,7 @@ pub fn get_cfg_env(chain_spec: &GnosisChainSpec, spec: SpecId, timestamp: u64) -
let mut cfg = CfgEnv::new()
.with_chain_id(chain_spec.chain().id())
.with_spec(spec);
cfg.set_blob_max_and_target_count(evm_env_blob_schedule());
cfg.set_blob_max_count(get_blob_params(spec >= SpecId::PRAGUE).max_blob_count);

if !chain_spec.is_shanghai_active_at_timestamp(timestamp) {
// EIP-170 is enabled at the Shanghai Fork on Gnosis Chain
Expand Down
14 changes: 9 additions & 5 deletions src/network.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ use reth::{
builder::{components::NetworkBuilder, BuilderContext},
network::{NetworkHandle, NetworkManager, PeersInfo},
};
use reth_eth_wire_types::Status;
use reth_primitives::{EthPrimitives, PooledTransaction};
use reth_eth_wire_types::UnifiedStatus;
use reth_ethereum_primitives::PooledTransactionVariant;
use reth_primitives::EthPrimitives;
use reth_transaction_pool::{PoolTransaction, TransactionPool};
use revm_primitives::b256;
use tracing::info;
Expand All @@ -21,7 +22,10 @@ impl<Node, Pool> NetworkBuilder<Node, Pool> for GnosisNetworkBuilder
where
Node: FullNodeTypes<Types: NodeTypes<ChainSpec = GnosisChainSpec, Primitives = EthPrimitives>>,
Pool: TransactionPool<
Transaction: PoolTransaction<Consensus = TxTy<Node::Types>, Pooled = PooledTransaction>,
Transaction: PoolTransaction<
Consensus = TxTy<Node::Types>,
Pooled = PooledTransactionVariant,
>,
> + Unpin
+ 'static,
{
Expand All @@ -48,11 +52,11 @@ where
_ => spec.genesis_hash(),
};

let status = Status::builder()
let status = UnifiedStatus::builder()
.chain(spec.chain())
.genesis(genesis_hash)
.blockhash(head.hash)
.total_difficulty(head.total_difficulty)
.total_difficulty(Some(head.total_difficulty))
.forkid(network_config.fork_filter.current())
.build();
network_config.status = status;
Expand Down
Loading