Purpose and Scope
This document describes the complete lifecycle of a transaction in StableNet, from the moment it is submitted to the system until it is finally included (finalized) on the blockchain.It covers the entire process, including submission via RPC or P2P, transaction pool validation and acceptance, mining candidate selection, state transition (EVM execution), block sealing, and consensus-based finalization. For details on transaction types and encoding, see Transaction Types and Encoding.
For transaction pool management policies, see Transaction Pool.
For internal EVM execution behavior, see EVM Execution.
For gas fees and tip policies, see Gas Fee Policy.
Transaction Lifecycle Overview
Transactions in StableNet go through the following 7-stage lifecycle in sequence. Transaction Lifecycle Stages- Transaction submission
- Pool-level validation and acceptance
- Mining candidate selection
- Transaction execution (state transition)
- Block sealing and propagation
- Block verification and chain insertion
- Consensus-based finality
Stage 1: Transaction Submission
Transactions enter a StableNet node through two main paths.Entry Points
| Path | Entry Point | Description |
|---|---|---|
| RPC API | internal/ethapi/api.go (TransactionAPI) | Transactions are submitted via JSON-RPC calls such as eth_sendTransaction or eth_sendRawTransaction. Internally, they pass through SubmitTransaction → backend SendTx and are forwarded to the txpool |
| P2P Network | eth/handler.go (txFetcher) | Transactions broadcast by peers are received and added to the pool via txpool.Add(tx, remote) |
TransactionArgs.setDefaults fills in fields such as nonce, gas limit, and fee parameters.After wallet- or keystore-based signing (
SignTx), a fully signed transaction is delivered to the txpool.
Stage 2: Pool-Level Validation and Acceptance
The txpool does not execute submitted transactions immediately. Instead, it applies a pool-level validation pipeline to filter them. Key validation checks include:- Transaction type validity (including fork activation checks)
- Gas limit and minimum gas price requirements
- Consistency of EIP-1559 fee fields (
maxFeePerGas,maxPriorityFeePerGas) - Nonce ordering and detection of per-account nonce gaps
- Replacement rules (price bump requirements for resubmission with the same nonce)
- Per-account queue / pending slot limits
- Whether fee-delegated transaction types are allowed
pending or queued sub-pools.Transactions that fail validation are either rejected immediately or retained in the queue until conditions are met.
Stage 3: Mining Candidate Selection
The mining worker (miner/worker.go) selects transactions as block candidates at the following times:
- Upon receiving a
NewTxsEvent - When starting a new block-building work loop
- A
txpool.PendingFilteris constructed based on the current block’sbaseFee, the governance-defined gas tip retrieved fromGovValidator, and blob fees (EIP-4844). TxPool().Pending(filter)is called to retrieve transactions that satisfy the conditions.- Local transactions are prioritized, followed by remote transactions.
- Transactions are ordered via
newTransactionsByPriceAndNonceusing the following criteria:- Effective gas tip and fee level
- Per-account nonce continuity
- Authorized account status in the Anzeon environment
commitTransactionsgreedily selects transactions until the block gas limit is reached.
Stage 4: Transaction Execution (State Transition)
Each selected transaction is executed sequentially viacore.StateTransition.
The execution flow is as follows:
- Create
NewStateTransition(evm, msg, gasPool) - Call
TransitionDb()to start the state transition - Perform pre-execution checks in
preCheck():- Nonce correctness (TooLow / TooHigh / Max)
- Whether the sender is an EOA (contract accounts are rejected, except for EIP-7702 delegated code)
- Relationship between
gasFeeCap,gasTipCap, and the blockbaseFee - Validation of blob fees (EIP-4844) and authorization formats (EIP-7702)
- Perform upfront gas deduction in
buyGas():- Deduct from the sender’s balance if no fee delegation is used
- Deduct from the FeePayer’s balance if fee delegation is applied
- Execute contract calls or creations via the EVM
- Compute gas usage, gas refunds, execution results, and logs
Consensus-level errors (such as preCheck failures) cause the transaction to be excluded from the block.
Stage 5: Block Sealing and Propagation
After all selected transactions have been executed, the worker performs the following steps:- Finalizes the block header by computing the state root, receipt root, and log bloom
- Seals the block according to WBFT consensus rules (including BLS signature aggregation)
- Writes the sealed block to the local chain and broadcasts it to the network via
eth/handlerand P2P subprotocols
Stage 6: Block Verification and Chain Insertion
Other nodes that receive the block perform the following validations:- Header validation (parent hash, timestamp, gas limit, extra data)
- Verification of the transaction Merkle root and receipt root
- Re-execution of transactions to verify the state root
- Validation of WBFT consensus signatures
Stage 7: Finality and Confirmation
When the conditions required by WBFT consensus (signatures from at least 2/3 of validators) are met, the block is marked as finalized.- Finalized blocks cannot be reverted.
- Clients and applications treat transactions in finalized blocks as confirmed.
- Safe and Final header concepts can be used in UIs and APIs to distinguish trust levels.

