Skip to main content

Module db

Module db 

Source
Expand description

Backing databases.

A backing database only serves reads that miss evm2’s accepted-state overlay. Fork lifecycle, snapshots and cheatcode policy live in ForkRegistry and ExecutionLifecycle, not here.

Re-exportsΒ§

use crate::fork::prefetch; πŸ”’
use alloy_network::Network; πŸ”’
use alloy_primitives::Address; πŸ”’
use alloy_primitives::B256; πŸ”’
use alloy_primitives::Bytes; πŸ”’
use alloy_primitives::U256; πŸ”’
use alloy_primitives::map::B256Map; πŸ”’
use evm2::DatabaseError; πŸ”’
use evm2::bytecode::Bytecode; πŸ”’
use evm2::evm::AccountInfo; πŸ”’
use evm2::evm::Cache; πŸ”’
use evm2::evm::DbResult; πŸ”’
use evm2::evm::DynDatabase; πŸ”’
use evm2::evm::EmptyDB; πŸ”’
use evm2::evm::InMemoryDB; πŸ”’
use evm2::evm::NonStaticAny; πŸ”’
use evm2::interpreter::Word; πŸ”’
use foundry_fork_db::ForkBlockEnv; πŸ”’
use foundry_fork_db::SharedBackend; πŸ”’
use parking_lot::RwLock; πŸ”’
use std::any::TypeId; πŸ”’
use std::sync::Arc; πŸ”’
use std::sync::atomic::AtomicBool; πŸ”’
use std::sync::atomic::Ordering; πŸ”’

StructsΒ§

AcceptedView πŸ”’
A context’s accepted state layered over its backing database, shared without copying.
ForkCode
Converts accounts of the fork cache, which holds raw code, into evm2 accounts.
ForkDb
A remote fork’s backing database: Foundry’s RPC-backed fork cache, read by evm2.

TraitsΒ§

BackingDb
A shareable backing database: every fork and every nested transaction reads through its own handle to the same source.
FoundryDatabase
Database view the factory needs at construction time.

FunctionsΒ§

existing_account
Returns account, which a database reports as an existing empty account when it does not hold it, as an execution applying EIP-161 or not loads it. Under EIP-161 an empty account does not exist, so it is loaded as absent.
fatal πŸ”’