pub fn attach_bal_before_tx<DB>(
db: &mut State<DB>,
bal: &DecodedBal<Arc<Bal>>,
tx_index: usize,
)where
DB: Database,Available on crate feature
rpc only.Expand description
Attaches bal to the database, positioned at the state right before the transaction at
tx_index.
Reads served by the attached BAL reflect all writes prior to the transaction, including the block’s pre-execution system calls. Reads not covered by the BAL fall back to the underlying database, which holds the correct values for all state the block does not touch.
Note: changes must not be committed to the database afterwards, because the attached BAL takes precedence over committed state when serving reads.