feat: block executor provider and ethereum + op impl (#7594)

Co-authored-by: Oliver Nordbjerg <onbjerg@users.noreply.github.com>
Co-authored-by: Georgios Konstantopoulos <me@gakonst.com>
This commit is contained in:
Matthias Seitz
2024-04-19 11:41:51 +02:00
committed by GitHub
parent 93871b3eaf
commit 1c46e5ae7d
15 changed files with 1779 additions and 10 deletions

View File

@ -18,6 +18,7 @@ reth-interfaces.workspace = true
reth-provider.workspace = true
reth-consensus-common.workspace = true
reth-evm.workspace = true
reth-trie = { workspace = true, optional = true }
# revm
revm.workspace = true
@ -30,6 +31,7 @@ tracing.workspace = true
reth-trie.workspace = true
[features]
test-utils = ["dep:reth-trie"]
optimism = [
"revm/optimism",
"reth-primitives/optimism",

View File

@ -38,7 +38,7 @@ pub mod stack;
pub mod optimism;
/// Common test helpers
#[cfg(test)]
#[cfg(any(test, feature = "test-utils"))]
pub mod test_utils;
// Convenience re-exports.

View File

@ -460,20 +460,16 @@ pub fn compare_receipts_root_and_logs_bloom(
#[cfg(test)]
mod tests {
use std::collections::HashMap;
use revm::{Database, TransitionState};
use super::*;
use crate::test_utils::{StateProviderTest, TestEvmConfig};
use reth_primitives::{
bytes,
constants::{BEACON_ROOTS_ADDRESS, EIP1559_INITIAL_BASE_FEE, SYSTEM_ADDRESS},
keccak256, Account, Bytes, ChainSpecBuilder, ForkCondition, Signature, Transaction,
TransactionKind, TxEip1559, MAINNET,
};
use crate::test_utils::{StateProviderTest, TestEvmConfig};
use super::*;
use revm::{Database, TransitionState};
use std::collections::HashMap;
static BEACON_ROOT_CONTRACT_CODE: Bytes = bytes!("3373fffffffffffffffffffffffffffffffffffffffe14604d57602036146024575f5ffd5b5f35801560495762001fff810690815414603c575f5ffd5b62001fff01545f5260205ff35b5f5ffd5b62001fff42064281555f359062001fff015500");

View File

@ -25,6 +25,7 @@ use {
},
};
/// Mock state for testing
#[derive(Debug, Default, Clone, Eq, PartialEq)]
pub struct StateProviderTest {
accounts: HashMap<Address, (HashMap<StorageKey, U256>, Account)>,