Skip to main content

Module gas_state

Module gas_state 

Source
Expand description

Backend-agnostic TIP-1060 SSTORE storage credits accounting.

sstore_storage_credits implements the storage credits policy that runs after a storage slot is written. It is driven through the StorageCreditsBackend trait so the exact same logic can be reused from two places:

  • the opcode-level SSTORE hook in tempo-revm (TempoGasState), and
  • EvmPrecompileStorageProvider so precompile-driven storage writes honor the same accounting.

Traitsยง

StorageCreditsBackend
Minimal journal/gas operations required by storage credit accounting.
StorageCreditsError
Error mapping required by storage credit accounting.

Functionsยง

emit_mode_updated ๐Ÿ”’
sstore_storage_credits
Applies TIP-1060 storage credits after a single SSTORE has been journaled.
store_credit_state ๐Ÿ”’