JournaledState

Type Alias JournaledState 

pub type JournaledState = JournalInner<JournalEntry>;

Aliased Type§

pub struct JournaledState {
    pub state: HashMap<Address, Account, RandomState>,
    pub transient_storage: HashMap<(Address, Uint<256, 4>), Uint<256, 4>, RandomState>,
    pub logs: Vec<Log>,
    pub depth: usize,
    pub journal: Vec<JournalEntry>,
    pub transaction_id: usize,
    pub spec: SpecId,
    pub warm_addresses: WarmAddresses,
}

Fields§

§state: HashMap<Address, Account, RandomState>

The current state

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

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<JournalEntry>

The journal of state changes, one for each transaction

§transaction_id: usize

Global transaction id that represent number of transactions executed (Including reverted ones). It can be different from number of journal_history as some transaction could be reverted or had a error on execution.

This ID is used in Self::state to determine if account/storage is touched/warm/cold.

§spec: SpecId

The spec ID for the EVM. Spec is required for some journal entries and needs to be set for JournalInner to be functional.

If spec is set it assumed that precompile addresses are set as well for this particular spec.

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_addresses: WarmAddresses

Warm addresses containing both coinbase and current precompiles.

Layout§

Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.

Size: 240 bytes