Skip to main content

BalIndexedDatabase

Trait BalIndexedDatabase 

pub trait BalIndexedDatabase: Database {
    // Required methods
    fn set_bal_index(&mut self, index: u64);
    fn bump_bal_index(&mut self);
}
Available on crate feature evm only.
Expand description

Database that tracks the current block-level access list (BAL) index from EIP-7928.

BAL values are indexed by their position in block execution. Index 0 is reserved for pre-transaction block execution changes, such as system contract calls. Regular transactions start at index 1, so transaction 0 in the block uses BAL index 1, transaction 1 uses BAL index 2, and so on. Post-transaction block execution changes use the index after the last transaction.

Required Methods§

fn set_bal_index(&mut self, index: u64)

Sets the current EIP-7928 BAL index for subsequent database reads and writes.

Use index 0 for pre-transaction block execution, tx_index + 1 for regular transactions in the block, and the next index after the last transaction for post-transaction block execution. In other words, regular block transactions start at BAL index 1.

fn bump_bal_index(&mut self)

Advances the current BAL index.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

§

impl<DB> BalIndexedDatabase for BalDatabase<DB>
where BalDatabase<DB>: Database,

§

impl<DB> BalIndexedDatabase for State<DB>
where State<DB>: Database,