Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
105e9c3
chore: upgrade reth v0.0.9 → v2.0.0 (develop-v2) (#332)
chee-chyuan Apr 29, 2026
76ba4ad
chore: upgrade bnb-chain/reth to develop-v2.1 and reth-core to v0.3.0-v2
chee-chyuan May 5, 2026
5187fa2
fix: migrate to revm 38 / revm-precompile 34 API
chee-chyuan May 5, 2026
5e8b517
fix: add missing BlockHeader methods and fix iavl test assertions
chee-chyuan May 5, 2026
04b2c13
fix: resolve clippy deprecation warnings and ef-tests version conflicts
chee-chyuan May 5, 2026
0cbf4e2
chore: upgrade bnb-chain/reth to develop-v2.2 and reth-core to v0.3.1-v2
chee-chyuan May 7, 2026
9fc8667
chore: point reth deps to develop-v2.2-new branch and align triedb to…
chee-chyuan May 15, 2026
2fe8a04
fix(block_import): log engine errors in new_payload instead of silent…
chee-chyuan May 18, 2026
7c57047
chore: update reth dependency to ac8062d2
chee-chyuan May 25, 2026
c135db4
fix(rpc): include empty withdrawals in block RLP size computation (#340)
MqllR Apr 29, 2026
d29b14d
fix: resolve some p2p peer related issues (#344)
will-2012 May 12, 2026
39a150e
perf: miner prefetcher warmup (#336)
constwz May 12, 2026
4bdc191
chore: modify triedb dep (#352)
constwz May 12, 2026
f4226f6
fix: registry tx (#355)
constwz May 19, 2026
92ec81e
fix: make the received block metrics correct (#357)
will-2012 May 21, 2026
38dc30a
Merge pull request #359 from bnb-chain/fix/v2.2-prefetcher-warmup
chee-chyuan May 26, 2026
be8d4b7
chore: update Cargo.lock
chee-chyuan May 26, 2026
352b1ac
chore: merge develop-v2.2-new into develop, pin reth to de11c921
chee-chyuan May 26, 2026
8ddbac5
fix: replace revm_context_interface crate refs with revm::context_int…
chee-chyuan May 26, 2026
c3082c2
fix: remove unused ContextTr import in node/evm/mod.rs
chee-chyuan May 26, 2026
e9f15a7
chore: pin reth deps to rev 485e37b (bnb-chain/reth#192)
chee-chyuan May 28, 2026
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
2,207 changes: 1,139 additions & 1,068 deletions Cargo.lock

Large diffs are not rendered by default.

138 changes: 71 additions & 67 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,95 +16,100 @@ name = "reth-bsc"
path = "src/main.rs"

[dependencies]
reth = { git = "https://github.com/bnb-chain/reth.git", branch = "develop" }
reth-cli = { git = "https://github.com/bnb-chain/reth.git", branch = "develop" }
reth-cli-commands = { git = "https://github.com/bnb-chain/reth.git", branch = "develop" }
reth-basic-payload-builder = { git = "https://github.com/bnb-chain/reth.git", branch = "develop" }
reth-db = { git = "https://github.com/bnb-chain/reth.git", branch = "develop" }
reth-engine-local = { git = "https://github.com/bnb-chain/reth.git", branch = "develop" }
reth-engine-tree = { git = "https://github.com/bnb-chain/reth.git", branch = "develop" }
reth-node-builder = { git = "https://github.com/bnb-chain/reth.git", branch = "develop" }
reth-chainspec = { git = "https://github.com/bnb-chain/reth.git", branch = "develop" }
reth-cli-util = { git = "https://github.com/bnb-chain/reth.git", branch = "develop" }
reth-discv4 = { git = "https://github.com/bnb-chain/reth.git", branch = "develop", features = [
reth = { git = "https://github.com/bnb-chain/reth.git", rev = "485e37b738754f96603391f42ee529f9364b47a4" }
reth-cli = { git = "https://github.com/bnb-chain/reth.git", rev = "485e37b738754f96603391f42ee529f9364b47a4" }
reth-cli-commands = { git = "https://github.com/bnb-chain/reth.git", rev = "485e37b738754f96603391f42ee529f9364b47a4" }
reth-basic-payload-builder = { git = "https://github.com/bnb-chain/reth.git", rev = "485e37b738754f96603391f42ee529f9364b47a4" }
reth-db = { git = "https://github.com/bnb-chain/reth.git", rev = "485e37b738754f96603391f42ee529f9364b47a4" }
reth-engine-local = { git = "https://github.com/bnb-chain/reth.git", rev = "485e37b738754f96603391f42ee529f9364b47a4" }
reth-engine-tree = { git = "https://github.com/bnb-chain/reth.git", rev = "485e37b738754f96603391f42ee529f9364b47a4" }
reth-node-builder = { git = "https://github.com/bnb-chain/reth.git", rev = "485e37b738754f96603391f42ee529f9364b47a4" }
reth-chainspec = { git = "https://github.com/bnb-chain/reth.git", rev = "485e37b738754f96603391f42ee529f9364b47a4" }
reth-cli-util = { git = "https://github.com/bnb-chain/reth.git", rev = "485e37b738754f96603391f42ee529f9364b47a4" }
reth-discv4 = { git = "https://github.com/bnb-chain/reth.git", rev = "485e37b738754f96603391f42ee529f9364b47a4", features = [
"test-utils",
] }
reth-engine-primitives = { git = "https://github.com/bnb-chain/reth.git", branch = "develop" }
reth-ethereum-forks = { git = "https://github.com/bnb-chain/reth.git", branch = "develop", features = [
reth-engine-primitives = { git = "https://github.com/bnb-chain/reth.git", rev = "485e37b738754f96603391f42ee529f9364b47a4" }
reth-ethereum-forks = { git = "https://github.com/bnb-chain/reth.git", rev = "485e37b738754f96603391f42ee529f9364b47a4", features = [
"serde",
] }
reth-ethereum-payload-builder = { git = "https://github.com/bnb-chain/reth.git", branch = "develop" }
reth-payload-builder-primitives = { git = "https://github.com/bnb-chain/reth.git", branch = "develop" }
reth-chain-state = { git = "https://github.com/bnb-chain/reth.git", branch = "develop" }
reth-ethereum-primitives = { git = "https://github.com/bnb-chain/reth.git", branch = "develop" }
reth-eth-wire = { git = "https://github.com/bnb-chain/reth.git", branch = "develop" }
reth-eth-wire-types = { git = "https://github.com/bnb-chain/reth.git", branch = "develop" }
reth-evm = { git = "https://github.com/bnb-chain/reth.git", branch = "develop" }
reth-evm-ethereum = { git = "https://github.com/bnb-chain/reth.git", branch = "develop" }
reth-execution-types = { git = "https://github.com/bnb-chain/reth.git", branch = "develop" }
reth-ipc = { git = "https://github.com/bnb-chain/reth.git", branch = "develop" }
reth-metrics = { git = "https://github.com/bnb-chain/reth.git", branch = "develop" }
reth-node-core = { git = "https://github.com/bnb-chain/reth.git", branch = "develop" }
reth-revm = { git = "https://github.com/bnb-chain/reth.git", branch = "develop" }
reth-network = { git = "https://github.com/bnb-chain/reth.git", branch = "develop", features = [
reth-ethereum-payload-builder = { git = "https://github.com/bnb-chain/reth.git", rev = "485e37b738754f96603391f42ee529f9364b47a4" }
reth-payload-builder-primitives = { git = "https://github.com/bnb-chain/reth.git", rev = "485e37b738754f96603391f42ee529f9364b47a4" }
reth-chain-state = { git = "https://github.com/bnb-chain/reth.git", rev = "485e37b738754f96603391f42ee529f9364b47a4" }
reth-ethereum-primitives = { git = "https://github.com/bnb-chain/reth.git", rev = "485e37b738754f96603391f42ee529f9364b47a4" }
reth-eth-wire = { git = "https://github.com/bnb-chain/reth.git", rev = "485e37b738754f96603391f42ee529f9364b47a4" }
reth-eth-wire-types = { git = "https://github.com/bnb-chain/reth.git", rev = "485e37b738754f96603391f42ee529f9364b47a4" }
reth-evm = { git = "https://github.com/bnb-chain/reth.git", rev = "485e37b738754f96603391f42ee529f9364b47a4" }
reth-evm-ethereum = { git = "https://github.com/bnb-chain/reth.git", rev = "485e37b738754f96603391f42ee529f9364b47a4" }
reth-execution-types = { git = "https://github.com/bnb-chain/reth.git", rev = "485e37b738754f96603391f42ee529f9364b47a4" }
reth-ipc = { git = "https://github.com/bnb-chain/reth.git", rev = "485e37b738754f96603391f42ee529f9364b47a4" }
reth-metrics = { git = "https://github.com/bnb-chain/reth.git", rev = "485e37b738754f96603391f42ee529f9364b47a4" }
reth-node-core = { git = "https://github.com/bnb-chain/reth.git", rev = "485e37b738754f96603391f42ee529f9364b47a4" }
reth-revm = { git = "https://github.com/bnb-chain/reth.git", rev = "485e37b738754f96603391f42ee529f9364b47a4" }
reth-network = { git = "https://github.com/bnb-chain/reth.git", rev = "485e37b738754f96603391f42ee529f9364b47a4", features = [
"test-utils",
] }
reth-network-p2p = { git = "https://github.com/bnb-chain/reth.git", branch = "develop" }
reth-network-api = { git = "https://github.com/bnb-chain/reth.git", branch = "develop" }
reth-node-ethereum = { git = "https://github.com/bnb-chain/reth.git", branch = "develop", features = [
reth-network-p2p = { git = "https://github.com/bnb-chain/reth.git", rev = "485e37b738754f96603391f42ee529f9364b47a4" }
reth-network-api = { git = "https://github.com/bnb-chain/reth.git", rev = "485e37b738754f96603391f42ee529f9364b47a4" }
reth-node-ethereum = { git = "https://github.com/bnb-chain/reth.git", rev = "485e37b738754f96603391f42ee529f9364b47a4", features = [
"test-utils",
] }
reth-network-peers = { git = "https://github.com/bnb-chain/reth.git", branch = "develop" }
reth-payload-primitives = { git = "https://github.com/bnb-chain/reth.git", branch = "develop" }
reth-ethereum-engine-primitives = { git = "https://github.com/bnb-chain/reth.git", branch = "develop" }
reth-primitives = { git = "https://github.com/bnb-chain/reth.git", branch = "develop" }
reth-primitives-traits = { git = "https://github.com/bnb-chain/reth.git", branch = "develop" }
reth-provider = { git = "https://github.com/bnb-chain/reth.git", branch = "develop", features = [
reth-network-peers = { git = "https://github.com/bnb-chain/reth.git", rev = "485e37b738754f96603391f42ee529f9364b47a4" }
reth-payload-primitives = { git = "https://github.com/bnb-chain/reth.git", rev = "485e37b738754f96603391f42ee529f9364b47a4" }
reth-ethereum-engine-primitives = { git = "https://github.com/bnb-chain/reth.git", rev = "485e37b738754f96603391f42ee529f9364b47a4" }
reth-primitives-traits = { git = "https://github.com/bnb-chain/reth-core.git", branch = "v0.3.1-v2", default-features = false }
reth-codecs = { git = "https://github.com/bnb-chain/reth-core.git", branch = "v0.3.1-v2" }
reth-provider = { git = "https://github.com/bnb-chain/reth.git", rev = "485e37b738754f96603391f42ee529f9364b47a4", features = [
"test-utils",
] }
reth-rpc-eth-api = { git = "https://github.com/bnb-chain/reth.git", branch = "develop" }
reth-rpc-convert = { git = "https://github.com/bnb-chain/reth.git", branch = "develop" }
reth-rpc-engine-api = { git = "https://github.com/bnb-chain/reth.git", branch = "develop" }
reth-rpc-server-types = { git = "https://github.com/bnb-chain/reth.git", branch = "develop" }
reth-trie-common = { git = "https://github.com/bnb-chain/reth.git", branch = "develop" }
reth-trie-db = { git = "https://github.com/bnb-chain/reth.git", branch = "develop" }
reth-tasks = { git = "https://github.com/bnb-chain/reth.git", branch = "develop" }
reth-transaction-pool = { git = "https://github.com/bnb-chain/reth.git", branch = "develop" }
reth-rpc-eth-api = { git = "https://github.com/bnb-chain/reth.git", rev = "485e37b738754f96603391f42ee529f9364b47a4" }
reth-rpc-convert = { git = "https://github.com/bnb-chain/reth.git", rev = "485e37b738754f96603391f42ee529f9364b47a4" }
reth-rpc-engine-api = { git = "https://github.com/bnb-chain/reth.git", rev = "485e37b738754f96603391f42ee529f9364b47a4" }
reth-rpc-server-types = { git = "https://github.com/bnb-chain/reth.git", rev = "485e37b738754f96603391f42ee529f9364b47a4" }
reth-trie-common = { git = "https://github.com/bnb-chain/reth.git", rev = "485e37b738754f96603391f42ee529f9364b47a4" }
reth-trie-db = { git = "https://github.com/bnb-chain/reth.git", rev = "485e37b738754f96603391f42ee529f9364b47a4" }
reth-tasks = { git = "https://github.com/bnb-chain/reth.git", rev = "485e37b738754f96603391f42ee529f9364b47a4" }
reth-transaction-pool = { git = "https://github.com/bnb-chain/reth.git", rev = "485e37b738754f96603391f42ee529f9364b47a4" }

# triedb dependencies
rust-eth-triedb = { git = "https://github.com/bnb-chain/reth-bsc-triedb.git", branch = "develop" }
rust-eth-triedb-common = { git = "https://github.com/bnb-chain/reth-bsc-triedb.git", branch = "develop", package = "rust-eth-triedb-common" }
rust-eth-triedb-pathdb = { git = "https://github.com/bnb-chain/reth-bsc-triedb.git", branch = "develop", package = "rust-eth-triedb-pathdb" }
rust-eth-triedb-state-trie = { git = "https://github.com/bnb-chain/reth-bsc-triedb.git", branch = "develop", package = "rust-eth-triedb-state-trie" }

revm = "34.0.0"
revm-context-interface = "14.0.0"
revm-database = "10.0.0"
revm = "38.0.0"
revm-database = "13.0.0"
revm-bytecode = "10.0.0"
revm-state = "11.0.0"
revm-primitives = { version = "23.0.0", default-features = false }
revm-interpreter = "35.0.0"
revm-database-interface = "11.0.0"

# alloy dependencies
alloy-evm = "0.26.3"

alloy-genesis = "1.1.3"
alloy-consensus = "1.1.3"
alloy-eips = "1.1.3"
alloy-network = "1.1.3"
alloy-rpc-types = { version = "1.1.3", features = ["engine"] }
alloy-rpc-types-eth = "1.1.3"
alloy-rpc-types-engine = "1.1.3"
alloy-rpc-types-mev = "1.1.3"
alloy-signer = "1.1.3"

alloy-chains = "0.2.23"
alloy-rlp = { version = "0.3.12", default-features = false, features = [
alloy-evm = { version = "0.34.0", features = ["rpc"] }

alloy-genesis = "2.0.4"
alloy-consensus = "2.0.4"
alloy-eips = "2.0.4"
alloy-network = "2.0.4"
alloy-rpc-types = { version = "2.0.4", features = ["eth"] }
alloy-rpc-types-eth = "2.0.4"
alloy-rpc-types-engine = "2.0.4"
alloy-rpc-types-mev = "2.0.4"
alloy-signer = "2.0.4"

alloy-chains = "0.2.33"
alloy-rlp = { version = "0.3.13", default-features = false, features = [
"core-net",
] }

alloy-dyn-abi = "1.4.1"
alloy-json-abi = { version = "1.4.1", default-features = false }
alloy-primitives = { version = "1.4.1", default-features = false, features = [
alloy-dyn-abi = "1.5.6"
alloy-json-abi = { version = "1.5.6", default-features = false }
alloy-primitives = { version = "1.5.6", default-features = false, features = [
"map-foldhash",
] }
alloy-sol-macro = "1.4.1"
alloy-sol-types = { version = "1.4.1", default-features = false }
alloy-sol-macro = "1.5.6"
alloy-sol-types = { version = "1.5.6", default-features = false }

jsonrpsee = { version = "0.26.0", features = ["server", "client", "macros"] }
jsonrpsee-core = { version = "0.26.0", features = ["server"] }
Expand Down Expand Up @@ -182,7 +187,6 @@ dev = ["reth-cli-commands/arbitrary", "reth/dev", "revm/dev"]
asm-keccak = [
"reth/asm-keccak",
"reth-node-core/asm-keccak",
"reth-primitives/asm-keccak",
"reth-node-ethereum/asm-keccak",
]

Expand Down
2 changes: 1 addition & 1 deletion src/chainspec/bsc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use alloy_primitives::BlockHash;
use reth_chainspec::{
make_genesis_header, BaseFeeParams, BaseFeeParamsKind, Chain, ChainSpec, Head, NamedChain,
};
use reth_primitives::SealedHeader;
use reth_primitives_traits::SealedHeader;
use std::str::FromStr;

pub fn bsc_mainnet() -> ChainSpec {
Expand Down
2 changes: 1 addition & 1 deletion src/chainspec/bsc_chapel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use alloy_primitives::{BlockHash, B256, U256};
use reth_chainspec::{
make_genesis_header, BaseFeeParams, BaseFeeParamsKind, Chain, ChainSpec, Head, NamedChain,
};
use reth_primitives::SealedHeader;
use reth_primitives_traits::SealedHeader;
use std::str::FromStr;

pub fn bsc_testnet() -> ChainSpec {
Expand Down
2 changes: 1 addition & 1 deletion src/chainspec/bsc_rialto.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use alloy_primitives::{BlockHash, U256, B256};
use reth_chainspec::{
make_genesis_header, BaseFeeParams, BaseFeeParamsKind, Chain, ChainSpec, Head,
};
use reth_primitives::SealedHeader;
use reth_primitives_traits::SealedHeader;
use std::str::FromStr;

pub const RIALTO_CHAIN_ID: u64 = 714;
Expand Down
2 changes: 1 addition & 1 deletion src/chainspec/local.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use crate::hardforks::bsc::BscHardfork;
use reth_chainspec::{
make_genesis_header, BaseFeeParams, BaseFeeParamsKind, Chain, ChainSpec, Head, NamedChain,
};
use reth_primitives::SealedHeader;
use reth_primitives_traits::SealedHeader;

pub fn bsc_local() -> ChainSpec {
let genesis = serde_json::from_str(include_str!("genesis_local.json"))
Expand Down
13 changes: 9 additions & 4 deletions src/consensus/parlia/snapshot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ use super::vote::{VoteAddress, VoteAttestation, VoteData};
use crate::metrics::BscVoteMetrics;
use alloy_primitives::{Address, BlockHash, BlockNumber};
use once_cell::sync::Lazy;
use reth_db::table::{Compress, Decompress};
use reth_db::DatabaseError;
use reth_codecs::{Compress, Decompress, DecompressError};
use serde::{Deserialize, Serialize};

/// Number of blocks after which we persist snapshots to DB.
Expand Down Expand Up @@ -498,8 +497,8 @@ impl Compress for Snapshot {
}

impl Decompress for Snapshot {
fn decompress(value: &[u8]) -> Result<Self, DatabaseError> {
serde_cbor::from_slice(value).map_err(|_| DatabaseError::Decode)
fn decompress(value: &[u8]) -> Result<Self, DecompressError> {
serde_cbor::from_slice(value).map_err(DecompressError::new)
}
}

Expand Down Expand Up @@ -652,6 +651,12 @@ mod tests {
fn requests_hash(&self) -> Option<alloy_primitives::B256> {
None
}
fn block_access_list_hash(&self) -> Option<alloy_primitives::B256> {
None
}
fn slot_number(&self) -> Option<u64> {
None
}
}

impl alloy_primitives::Sealable for MockHeader {
Expand Down
26 changes: 13 additions & 13 deletions src/consensus/parlia/validation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ use crate::consensus::eip4844::is_blob_eligible_block;
use super::{Parlia, EMPTY_WITHDRAWALS_HASH};
use alloy_consensus::{Header, Transaction, EMPTY_OMMER_ROOT_HASH};
use alloy_primitives::B256;
use reth_primitives::GotExpected;
use reth_primitives_traits::GotExpected;
use alloy_eips::eip4844::{DATA_GAS_PER_BLOB, MAX_DATA_GAS_PER_BLOCK_DENCUN};
use crate::BscBlock;
use reth_primitives_traits::Block;
use std::time::SystemTime;
use std::{sync::Arc, time::SystemTime};

const MAX_RLP_BLOCK_SIZE_OSAKA: usize = 8 * 1024 * 1024;

Expand Down Expand Up @@ -51,11 +51,11 @@ pub fn validate_4844_header_of_bsc<ChainSpec: BscHardforks>(

// BEP-657: After Mendel, non-eligible blocks must have blob_gas_used == 0
if !is_blob_eligible_block(chain_spec, header.number, header.timestamp) && blob_gas_used != 0 {
return Err(ConsensusError::Other(format!(
return Err(ConsensusError::Other(Arc::new(std::io::Error::other(format!(
"blob transactions not allowed in block {} (N % {} != 0)",
header.number,
crate::consensus::eip4844::BLOB_ELIGIBLE_BLOCK_INTERVAL
)));
)))));
}

if blob_gas_used > MAX_DATA_GAS_PER_BLOCK_DENCUN {
Expand Down Expand Up @@ -114,16 +114,16 @@ fn validate_mix_digest_for_parlia(
) -> Result<(), ConsensusError> {
if !lorentz_active {
if header.mix_hash != B256::ZERO {
return Err(ConsensusError::Other("non-zero mix digest".to_string()));
return Err(ConsensusError::Other(Arc::new(std::io::Error::other("non-zero mix digest"))));
}
return Ok(());
}

// In Lorentz+, mix digest carries the millisecond remainder. It must not overflow seconds.
if calculate_millisecond_timestamp(header) / 1000 != header.timestamp {
return Err(ConsensusError::Other(
"invalid mix digest milliseconds component".to_string(),
));
return Err(ConsensusError::Other(Arc::new(std::io::Error::other(
"invalid mix digest milliseconds component",
))));
}
Ok(())
}
Expand Down Expand Up @@ -172,7 +172,7 @@ impl<ChainSpec: EthChainSpec + BscHardforks + std::fmt::Debug + Send + Sync + 's
validate_header_not_from_future(header, present_unix_seconds())?;

// Check extra data
self.check_header_extra(header).map_err(|e| ConsensusError::Other(format!("Invalid header extra: {e}")))?;
self.check_header_extra(header).map_err(|e| ConsensusError::Other(Arc::new(std::io::Error::other(format!("Invalid header extra: {e}")))))?;

// Ensure that the block with no uncles
if header.ommers_hash != EMPTY_OMMER_ROOT_HASH {
Expand Down Expand Up @@ -268,9 +268,9 @@ impl<ChainSpec: EthChainSpec + BscHardforks + std::fmt::Debug + Send + Sync + 's
if !is_blob_eligible_block(&*self.spec, block.number, block.timestamp)
&& block.body().transactions().any(|tx| tx.is_eip4844())
{
return Err(ConsensusError::Other(
"blob transactions not allowed in this block".to_string(),
));
return Err(ConsensusError::Other(Arc::new(std::io::Error::other(
"blob transactions not allowed in this block",
))));
}
// Check that the blob gas used in the header matches the sum of the blob gas used by
// each blob tx
Expand All @@ -297,7 +297,7 @@ impl<ChainSpec: EthChainSpec + BscHardforks + std::fmt::Debug + Send + Sync + 's
mod tests {
use super::*;
use alloy_primitives::B256;
use reth_primitives::SealedHeader as RethSealedHeader;
use reth_primitives_traits::SealedHeader as RethSealedHeader;

fn sealed(header: Header) -> SealedHeader {
RethSealedHeader::new(header, B256::ZERO)
Expand Down
6 changes: 3 additions & 3 deletions src/evm/api/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ use revm::{
primitives::hardfork::SpecId,
Context, Inspector, Journal,
};
use revm_context_interface::journaled_state::account::JournaledAccountTr;
use revm::context_interface::journaled_state::account::JournaledAccountTr;

mod exec;

Expand Down Expand Up @@ -379,7 +379,7 @@ mod tests {
false,
false,
);
mismatched.inner.instruction = EthInstructions::new_mainnet();
mismatched.inner.instruction = EthInstructions::new_mainnet_with_spec(SpecId::default());

let mismatched_result = mismatched
.transact_one(tx)
Expand Down Expand Up @@ -565,7 +565,7 @@ mod tests {
beneficiary: Address,
) -> U256 {
use revm::context::{ContextTr, JournalTr};
use revm_context_interface::journaled_state::account::JournaledAccountTr;
use revm::context_interface::journaled_state::account::JournaledAccountTr;
*evm.journal_mut()
.load_account_mut(beneficiary)
.expect("beneficiary account should load")
Expand Down
Loading
Loading