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

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,
);