chore: bump revm 6.0 (#6638)

This commit is contained in:
Matthias Seitz
2024-02-17 11:39:02 +01:00
committed by GitHub
parent 632fc0599b
commit bcc95b1f4f
11 changed files with 44 additions and 43 deletions

32
Cargo.lock generated
View File

@ -173,7 +173,7 @@ dependencies = [
[[package]]
name = "alloy-eips"
version = "0.1.0"
source = "git+https://github.com/alloy-rs/alloy?rev=b9dd518#b9dd518b12efd27ab706ae6ffa9ad6b05df451c7"
source = "git+https://github.com/alloy-rs/alloy?rev=5062eaf#5062eaf1af2733a7115bc0536c9708a42bfb53ca"
dependencies = [
"alloy-primitives",
"alloy-rlp",
@ -183,7 +183,7 @@ dependencies = [
[[package]]
name = "alloy-genesis"
version = "0.1.0"
source = "git+https://github.com/alloy-rs/alloy?rev=b9dd518#b9dd518b12efd27ab706ae6ffa9ad6b05df451c7"
source = "git+https://github.com/alloy-rs/alloy?rev=5062eaf#5062eaf1af2733a7115bc0536c9708a42bfb53ca"
dependencies = [
"alloy-primitives",
"alloy-rpc-types",
@ -205,7 +205,7 @@ dependencies = [
[[package]]
name = "alloy-node-bindings"
version = "0.1.0"
source = "git+https://github.com/alloy-rs/alloy?rev=b9dd518#b9dd518b12efd27ab706ae6ffa9ad6b05df451c7"
source = "git+https://github.com/alloy-rs/alloy?rev=5062eaf#5062eaf1af2733a7115bc0536c9708a42bfb53ca"
dependencies = [
"alloy-genesis",
"alloy-primitives",
@ -266,7 +266,7 @@ dependencies = [
[[package]]
name = "alloy-rpc-engine-types"
version = "0.1.0"
source = "git+https://github.com/alloy-rs/alloy?rev=b9dd518#b9dd518b12efd27ab706ae6ffa9ad6b05df451c7"
source = "git+https://github.com/alloy-rs/alloy?rev=5062eaf#5062eaf1af2733a7115bc0536c9708a42bfb53ca"
dependencies = [
"alloy-primitives",
"alloy-rlp",
@ -281,7 +281,7 @@ dependencies = [
[[package]]
name = "alloy-rpc-trace-types"
version = "0.1.0"
source = "git+https://github.com/alloy-rs/alloy?rev=b9dd518#b9dd518b12efd27ab706ae6ffa9ad6b05df451c7"
source = "git+https://github.com/alloy-rs/alloy?rev=5062eaf#5062eaf1af2733a7115bc0536c9708a42bfb53ca"
dependencies = [
"alloy-primitives",
"alloy-rpc-types",
@ -292,7 +292,7 @@ dependencies = [
[[package]]
name = "alloy-rpc-types"
version = "0.1.0"
source = "git+https://github.com/alloy-rs/alloy?rev=b9dd518#b9dd518b12efd27ab706ae6ffa9ad6b05df451c7"
source = "git+https://github.com/alloy-rs/alloy?rev=5062eaf#5062eaf1af2733a7115bc0536c9708a42bfb53ca"
dependencies = [
"alloy-primitives",
"alloy-rlp",
@ -7022,9 +7022,9 @@ dependencies = [
[[package]]
name = "revm"
version = "5.0.0"
version = "6.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "266f86bdefa6dac07d92e2f5c37d7d183f2575b2f9e0ee9cba9402dfde912524"
checksum = "8154cec6f8c4f543a379cf00a839cf47c67f405e8a92361a7791c55196c9b7e2"
dependencies = [
"auto_impl",
"cfg-if",
@ -7037,14 +7037,16 @@ dependencies = [
[[package]]
name = "revm-inspectors"
version = "0.1.0"
source = "git+https://github.com/paradigmxyz/evm-inspectors?rev=8f17f34#8f17f34da5fec043378e689bb9e4169453371c38"
source = "git+https://github.com/paradigmxyz/evm-inspectors?rev=ac63f06#ac63f069977d04cd68d96fe7ad9dd4b74ceab44e"
dependencies = [
"alloy-primitives",
"alloy-rpc-trace-types",
"alloy-rpc-types",
"alloy-sol-types",
"anstyle",
"boa_engine",
"boa_gc",
"colorchoice",
"revm",
"serde",
"serde_json",
@ -7053,9 +7055,9 @@ dependencies = [
[[package]]
name = "revm-interpreter"
version = "2.1.0"
version = "3.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9a80b516cc706630e604e2fd47c281501d2fb222712be4328921361388b7d2df"
checksum = "dff72cc825a9c44b28749a6181e21fa85ba45ac8d4b5732a7ded165a770ecbd9"
dependencies = [
"revm-primitives",
"serde",
@ -7063,9 +7065,9 @@ dependencies = [
[[package]]
name = "revm-precompile"
version = "4.0.0"
version = "4.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e6912fafe7f70a264ec5895875ce2f2d0621a39263844280c9ee7f85e35bbb9e"
checksum = "186373108c0a46e47368752372cc721d4b0ab4886d6786d180ef9dbf4dd71865"
dependencies = [
"aurora-engine-modexp",
"blst",
@ -7081,9 +7083,9 @@ dependencies = [
[[package]]
name = "revm-primitives"
version = "2.0.0"
version = "2.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4b3683a40f1e94e7389c8e81e5f26bb5d30875ed0b48ab07985ec32eb6d6c712"
checksum = "093dc5df253eececaf03ffe0c12d3fd7ce5dea3342bc9de109d1aac2647ffa81"
dependencies = [
"alloy-primitives",
"auto_impl",

View File

@ -170,9 +170,9 @@ reth-transaction-pool = { path = "crates/transaction-pool" }
reth-trie = { path = "crates/trie" }
# revm
revm = { version = "5.0", features = ["std", "secp256k1"], default-features = false }
revm = { version = "6.0", features = ["std", "secp256k1"], default-features = false }
revm-primitives = { version = "2.0", features = ["std"], default-features = false }
revm-inspectors = { git = "https://github.com/paradigmxyz/evm-inspectors", rev = "8f17f34" }
revm-inspectors = { git = "https://github.com/paradigmxyz/evm-inspectors", rev = "ac63f06" }
# eth
alloy-chains = { version = "0.1", feature = ["serde", "rlp", "arbitrary"] }
@ -181,12 +181,12 @@ alloy-dyn-abi = "0.6"
alloy-sol-types = "0.6"
alloy-rlp = "0.3"
alloy-trie = "0.2"
alloy-rpc-types = { git = "https://github.com/alloy-rs/alloy", rev = "b9dd518" }
alloy-rpc-trace-types = { git = "https://github.com/alloy-rs/alloy", rev = "b9dd518" }
alloy-rpc-engine-types = { git = "https://github.com/alloy-rs/alloy", rev = "b9dd518" }
alloy-genesis = { git = "https://github.com/alloy-rs/alloy", rev = "b9dd518" }
alloy-node-bindings = { git = "https://github.com/alloy-rs/alloy", rev = "b9dd518" }
alloy-eips = { git = "https://github.com/alloy-rs/alloy", rev = "b9dd518" }
alloy-rpc-types = { git = "https://github.com/alloy-rs/alloy", rev = "5062eaf" }
alloy-rpc-trace-types = { git = "https://github.com/alloy-rs/alloy", rev = "5062eaf" }
alloy-rpc-engine-types = { git = "https://github.com/alloy-rs/alloy", rev = "5062eaf" }
alloy-genesis = { git = "https://github.com/alloy-rs/alloy", rev = "5062eaf" }
alloy-node-bindings = { git = "https://github.com/alloy-rs/alloy", rev = "5062eaf" }
alloy-eips = { git = "https://github.com/alloy-rs/alloy", rev = "5062eaf" }
ethers-core = { version = "2.0", default-features = false }
ethers-providers = { version = "2.0", default-features = false }
ethers-signers = { version = "2.0", default-features = false }

View File

@ -55,7 +55,7 @@ mod tests {
#[test]
#[ignore]
fn test_fill_cfg_and_block_env() {
let mut cfg_env = CfgEnvWithHandlerCfg::new(CfgEnv::default(), SpecId::LATEST);
let mut cfg_env = CfgEnvWithHandlerCfg::new_with_spec_id(CfgEnv::default(), SpecId::LATEST);
let mut block_env = BlockEnv::default();
let header = Header::default();
let chain_spec = ChainSpec::default();

View File

@ -56,7 +56,7 @@ mod tests {
#[test]
#[ignore]
fn test_fill_cfg_and_block_env() {
let mut cfg_env = CfgEnvWithHandlerCfg::new(CfgEnv::default(), SpecId::LATEST);
let mut cfg_env = CfgEnvWithHandlerCfg::new_with_spec_id(CfgEnv::default(), SpecId::LATEST);
let mut block_env = BlockEnv::default();
let header = Header::default();
let chain_spec = ChainSpec::default();

View File

@ -208,14 +208,14 @@ impl PayloadBuilderAttributes for EthPayloadBuilderAttributes {
Ok(Self::new(parent, attributes))
}
fn parent(&self) -> B256 {
self.parent
}
fn payload_id(&self) -> PayloadId {
self.id
}
fn parent(&self) -> B256 {
self.parent
}
fn timestamp(&self) -> u64 {
self.timestamp
}
@ -279,7 +279,7 @@ impl PayloadBuilderAttributes for EthPayloadBuilderAttributes {
blob_excess_gas_and_price,
};
(CfgEnvWithHandlerCfg::new(cfg, spec_id), block_env)
(CfgEnvWithHandlerCfg::new_with_spec_id(cfg, spec_id), block_env)
}
}

View File

@ -178,7 +178,7 @@ where
self.db_mut().set_state_clear_flag(state_clear_flag);
let mut cfg: CfgEnvWithHandlerCfg =
CfgEnvWithHandlerCfg::new(self.evm.cfg().clone(), self.evm.spec_id());
CfgEnvWithHandlerCfg::new_with_spec_id(self.evm.cfg().clone(), self.evm.spec_id());
EvmConfig::fill_cfg_and_block_env(
&mut cfg,
self.evm.block_mut(),

View File

@ -91,6 +91,8 @@ pub fn from_block_full(
}
/// Converts from a [reth_primitives::SealedHeader] to a [reth_rpc_types::BlockNumberOrTag]
///
/// Note: This does not set the `totalDifficulty` field.
pub fn from_primitive_with_hash(primitive_header: reth_primitives::SealedHeader) -> Header {
let (header, hash) = primitive_header.split();
let PrimitiveHeader {
@ -138,6 +140,7 @@ pub fn from_primitive_with_hash(primitive_header: reth_primitives::SealedHeader)
blob_gas_used: blob_gas_used.map(U64::from),
excess_blob_gas: excess_blob_gas.map(U64::from),
parent_beacon_block_root,
total_difficulty: None,
}
}
@ -161,7 +164,9 @@ fn from_block_with_transactions(
transactions: BlockTransactions,
) -> Block {
let uncles = block.ommers.into_iter().map(|h| h.hash_slow()).collect();
let header = from_primitive_with_hash(block.header.seal(block_hash));
let mut header = from_primitive_with_hash(block.header.seal(block_hash));
header.total_difficulty = Some(total_difficulty);
let withdrawals = if header.withdrawals_root.is_some() {
block
.withdrawals
@ -169,11 +174,11 @@ fn from_block_with_transactions(
} else {
None
};
Block {
header,
uncles,
transactions,
total_difficulty: Some(total_difficulty),
size: Some(U256::from(block_length)),
withdrawals,
other: Default::default(),
@ -193,7 +198,6 @@ pub fn uncle_block_from_header(header: PrimitiveHeader) -> Block {
transactions: BlockTransactions::Uncle,
withdrawals: Some(vec![]),
size,
total_difficulty: None,
other: Default::default(),
}
}

View File

@ -301,12 +301,7 @@ where
PendingBlockEnvOrigin::DerivedFromLatest(latest)
};
let mut cfg = CfgEnvWithHandlerCfg::new(CfgEnv::default(), SpecId::LATEST);
#[cfg(feature = "optimism")]
{
cfg.handler_cfg.is_optimism = self.provider().chain_spec().is_optimism();
}
let mut cfg = CfgEnvWithHandlerCfg::new_with_spec_id(CfgEnv::default(), SpecId::LATEST);
let mut block_env = BlockEnv::default();
// Note: for the PENDING block we assume it is past the known merge block and thus this will

View File

@ -513,7 +513,7 @@ where
this.action_task_spawner.spawn_blocking(Box::pin(async move {
// Acquire permit
let _permit = rate_limiter.acquire().await;
let mut cfg = CfgEnvWithHandlerCfg::new(
let mut cfg = CfgEnvWithHandlerCfg::new_with_spec_id(
CfgEnv::default(),
SpecId::LATEST,
);

View File

@ -31,7 +31,7 @@ pub trait EvmEnvProvider: Send + Sync {
where
EvmConfig: ConfigureEvmEnv,
{
let mut cfg = CfgEnvWithHandlerCfg::new(CfgEnv::default(), SpecId::LATEST);
let mut cfg = CfgEnvWithHandlerCfg::new_with_spec_id(CfgEnv::default(), SpecId::LATEST);
let mut block_env = BlockEnv::default();
self.fill_env_with_header::<EvmConfig>(&mut cfg, &mut block_env, header, evm_config)?;
Ok((cfg, block_env))

View File

@ -166,7 +166,7 @@ impl PayloadBuilderAttributes for CustomPayloadBuilderAttributes {
blob_excess_gas_and_price,
};
(CfgEnvWithHandlerCfg::new(cfg, spec_id), block_env)
(CfgEnvWithHandlerCfg::new_with_spec_id(cfg, spec_id), block_env)
}
}