revm_context

Type Alias JournalInit

Source
pub type JournalInit = JournaledState<EmptyDB>;
Expand description

A clonable version of JournaledState that uses EmptyDB.

Aliased Type§

struct JournalInit {
    pub database: EmptyDBTyped<Infallible>,
    pub state: HashMap<Address, Account>,
    pub transient_storage: HashMap<(Address, Uint<256, 4>), Uint<256, 4>>,
    pub logs: Vec<Log>,
    pub depth: usize,
    pub journal: Vec<Vec<JournalEntry>>,
    pub spec: SpecId,
    pub warm_preloaded_addresses: HashSet<Address>,
    pub precompiles: HashSet<Address>,
}

Fields§

§database: EmptyDBTyped<Infallible>

Database

§state: HashMap<Address, Account>

The current state

§transient_storage: HashMap<(Address, Uint<256, 4>), Uint<256, 4>>

Transient storage that is discarded after every transaction.

See EIP-1153.

§logs: Vec<Log>

Emitted logs

§depth: usize

The current call stack depth

§journal: Vec<Vec<JournalEntry>>

The journal of state changes, one for each call

§spec: SpecId

The spec ID for the EVM

This spec is used for two things:

  • EIP-161: Prior to this EIP, Ethereum had separate definitions for empty and non-existing accounts.
  • EIP-6780: SELFDESTRUCT only in same transaction
§warm_preloaded_addresses: HashSet<Address>

Warm loaded addresses are used to check if loaded address should be considered cold or warm loaded when the account is first accessed.

Note that this not include newly loaded accounts, account and storage is considered warm if it is found in the State.

§precompiles: HashSet<Address>

Precompile addresses