State journal¶
The frame-revertible state journal is a closed operation algebra. Every mutation records exactly the semantic field needed to restore its predecessor; checkpoint and commit markers encode the nesting structure in the same ordered stream. Backends may refine addresses and storage keys to dense identifiers, but may not introduce rollback behavior outside these variants.
Non-normative
This page documents the model's host interface — internal contracts of the executable specification, not protocol rules.
type JournalTransientChange¶
A prior transient-storage value restored by frame rollback.
A 20-byte account address (YP §4.1), in canonical protocol byte order.
type address = vector(20, inc, byte)The EVM 256-bit machine word (YP §9.1). A transparent range keeps the mathematical subtype relation visible: narrower non-negative ranges can be passed as words without a model-level conversion.
type word = range(0, 2 ^ 256 - 1)type JournalWarmAccountChange¶
The prior warm epoch of an account.
struct JournalWarmAccountChange = {
address : address,
prior_epoch : block_access_index,
}A 20-byte account address (YP §4.1), in canonical protocol byte order.
type address = vector(20, inc, byte)EIP-7928 change position: pre-execution system calls use zero,
transactions use their one-based position, and post-execution system calls
use transaction_count + 1.
type block_access_index = range(0, transaction_count_bound + 1)type JournalWarmStorageChange¶
The prior warm epoch of a storage location.
struct JournalWarmStorageChange = {
key : StorageKey,
prior_epoch : block_access_index,
}A fully qualified storage key: account address and 256-bit slot.
struct StorageKey = { addr : address, slot : word }EIP-7928 change position: pre-execution system calls use zero,
transactions use their one-based position, and post-execution system calls
use transaction_count + 1.
type block_access_index = range(0, transaction_count_bound + 1)type JournalAccountBalanceChange¶
The prior transaction-visible account balance.
A 20-byte account address (YP §4.1), in canonical protocol byte order.
type address = vector(20, inc, byte)The EVM 256-bit machine word (YP §9.1). A transparent range keeps the mathematical subtype relation visible: narrower non-negative ranges can be passed as words without a model-level conversion.
type word = range(0, 2 ^ 256 - 1)type JournalAccountNonceChange¶
The prior transaction-visible account nonce.
struct JournalAccountNonceChange = {
address : address,
prior : account_nonce,
}An account transaction-count nonce (EIP-2681).
type account_nonce = range(0, account_nonce_bound)A 20-byte account address (YP §4.1), in canonical protocol byte order.
type address = vector(20, inc, byte)type JournalAccountCodeHashChange¶
The prior transaction-visible account code hash.
A 20-byte account address (YP §4.1), in canonical protocol byte order.
type address = vector(20, inc, byte)The common digest type used by trie, code, and block hashes.
type hash = b256type JournalAccountExistsChange¶
The prior transaction-visible account-existence flag.
A 20-byte account address (YP §4.1), in canonical protocol byte order.
type address = vector(20, inc, byte)type JournalAccountCreatedChange¶
The prior same-transaction account-creation flag.
A 20-byte account address (YP §4.1), in canonical protocol byte order.
type address = vector(20, inc, byte)type JournalAccountSelfdestructedChange¶
The prior transaction-visible selfdestruction flag.
A 20-byte account address (YP §4.1), in canonical protocol byte order.
type address = vector(20, inc, byte)type JournalStorageValueChange¶
The prior transaction-visible storage value.
struct JournalStorageValueChange = {
key : StorageKey,
prior : word,
}A fully qualified storage key: account address and 256-bit slot.
struct StorageKey = { addr : address, slot : word }The EVM 256-bit machine word (YP §9.1). A transparent range keeps the mathematical subtype relation visible: narrower non-negative ranges can be passed as words without a model-level conversion.
type word = range(0, 2 ^ 256 - 1)type JournalStorageRowGenerationChange¶
The prior incarnation attached to one transaction-visible storage row.
struct JournalStorageRowGenerationChange = {
key : StorageKey,
prior : storage_generation,
}A fully qualified storage key: account address and 256-bit slot.
struct StorageKey = { addr : address, slot : word }The monotonically increasing storage incarnation owned by an account. Generation zero is reserved for the absence of a generation.
type storage_generation = range(0, default_host_region_bound)type JournalAccountStorageGenerationChange¶
The prior account-wide storage incarnation.
struct JournalAccountStorageGenerationChange = {
address : address,
prior : storage_generation,
}A 20-byte account address (YP §4.1), in canonical protocol byte order.
type address = vector(20, inc, byte)The monotonically increasing storage incarnation owned by an account. Generation zero is reserved for the absence of a generation.
type storage_generation = range(0, default_host_region_bound)type StateJournalEntry¶
One append-only state-journal record.
union StateJournalEntry = {
/*! Restores the prior transient-storage value on rollback. */
JournalTransientChanged : JournalTransientChange,
/*! Restores an account's prior warm epoch on rollback. */
JournalWarmAccountChanged : JournalWarmAccountChange,
/*! Restores a storage location's prior warm epoch on rollback. */
JournalWarmStorageChanged : JournalWarmStorageChange,
/*! Restores the prior account balance on rollback. */
JournalAccountBalanceChanged : JournalAccountBalanceChange,
/*! Restores the prior account nonce on rollback. */
JournalAccountNonceChanged : JournalAccountNonceChange,
/*! Restores the prior account code hash on rollback. */
JournalAccountCodeHashChanged : JournalAccountCodeHashChange,
/*! Restores the prior account-existence flag on rollback. */
JournalAccountExistsChanged : JournalAccountExistsChange,
/*! Restores the prior same-transaction account-creation flag on
rollback. */
JournalAccountCreatedChanged : JournalAccountCreatedChange,
/*! Restores the prior selfdestruction flag on rollback. */
JournalAccountSelfdestructedChanged : JournalAccountSelfdestructedChange,
/*! Removes the most recently appended transaction account on rollback. */
JournalTransactionAccountListed : unit,
/*! Removes the most recently appended transaction storage identity for
the given account on rollback. */
JournalTransactionStorageListed : address,
/*! Removes the most recently appended log and its topic/data ranges. */
JournalLogAppended : unit,
JournalStorageValueChanged : JournalStorageValueChange,
JournalStorageRowGenerationChanged : JournalStorageRowGenerationChange,
JournalAccountStorageGenerationChanged : JournalAccountStorageGenerationChange,
JournalFrameCheckpointed : unit,
JournalFrameCommitted : unit,
}The prior transaction-visible account balance.
struct JournalAccountBalanceChange = {
address : address,
prior : word,
}The prior transaction-visible account code hash.
struct JournalAccountCodeHashChange = {
address : address,
prior : hash,
}The prior same-transaction account-creation flag.
struct JournalAccountCreatedChange = {
address : address,
prior : bool,
}The prior transaction-visible account-existence flag.
struct JournalAccountExistsChange = {
address : address,
prior : bool,
}The prior transaction-visible account nonce.
struct JournalAccountNonceChange = {
address : address,
prior : account_nonce,
}The prior transaction-visible selfdestruction flag.
struct JournalAccountSelfdestructedChange = {
address : address,
prior : bool,
}The prior account-wide storage incarnation.
struct JournalAccountStorageGenerationChange = {
address : address,
prior : storage_generation,
}The prior incarnation attached to one transaction-visible storage row.
struct JournalStorageRowGenerationChange = {
key : StorageKey,
prior : storage_generation,
}The prior transaction-visible storage value.
struct JournalStorageValueChange = {
key : StorageKey,
prior : word,
}A prior transient-storage value restored by frame rollback.
struct JournalTransientChange = {
address : address,
slot : word,
prior : word,
}The prior warm epoch of an account.
struct JournalWarmAccountChange = {
address : address,
prior_epoch : block_access_index,
}The prior warm epoch of a storage location.
struct JournalWarmStorageChange = {
key : StorageKey,
prior_epoch : block_access_index,
}A 20-byte account address (YP §4.1), in canonical protocol byte order.
type address = vector(20, inc, byte)val state_journal_reset¶
Empties the transaction-local state journal.
val state_journal_reset = impure { c: "state_journal_reset" } : unit -> unitval state_journal_checkpoint¶
Appends a JournalFrameCheckpointed entry.
val state_journal_checkpoint = impure { c: "state_journal_checkpoint" } : unit -> unitval state_journal_revert¶
Replays entries backwards to the innermost open checkpoint, then removes its marker.
val state_journal_revert = impure { c: "state_journal_revert" } : unit -> unitval state_journal_commit¶
Appends a JournalFrameCommitted entry for the innermost open checkpoint.
Its mutations remain in the journal and are therefore revertible by a
parent.
val state_journal_commit = impure { c: "state_journal_commit" } : unit -> unit