Module stf

Source
Expand description

This module is the core of the Sovereign SDK. It defines the traits and types that allow the SDK to run the “business logic” of any application generically.

The most important trait in this module is the StateTransitionFunction, which defines the main event loop of the rollup.

Structs§

BatchReceipt
A receipt for a batch of transactions. These receipts are stored in the rollup’s database and may be queried via RPC. Batch receipts are generic over a type BatchReceiptContents which the rollup can use to store arbitrary typed data, like the gas used by the batch. They are also generic over a type TxReceiptContents, since they contain a vectors of TransactionReceipts. A receipt giving the outcome of a batch of transactions
Event
A key-value pair representing a change to the rollup state
EventKey
The key of an event. This is a wrapper around a Vec<u8>.
EventValue
The value of an event. This is a wrapper around a Vec<u8>.
ProverConfig
The configuration of a full node of the rollup which creates zk proofs.
SlotResult
Result of applying a slot to current state Where:
StandardConfig
The configuration of a standard full node of the rollup which does not create zk proofs
TransactionReceipt
A receipt for a single transaction. These receipts are stored in the rollup’s database and may be queried via RPC. Receipts are generic over a type R which the rollup can use to store additional data, such as the status code of the transaction or the amout of gas used.s A receipt showing the result of a transaction
ZkConfig
The configuration used to initialize the “Verifier” of the state transition function which runs inside of the zkVM.

Traits§

StateTransitionConfig
A special marker trait which allows us to define different rollup configurations. There are only 3 possible instantiations of this trait: ProverConfig, ZkConfig, and StandardConfig.
StateTransitionFunction
State transition function defines business logic that responsible for changing state. Terminology: