Overview
The transaction processing module handles execution of Core Lane transactions, including transfers, intent operations, and special contract calls.Core Functions
execute_transaction
Executes a Core Lane transaction within a processing context. Location:src/transaction.rs:151
Transaction envelope to execute (supports Legacy, EIP-1559, EIP-2930, EIP-4844)
Address of the transaction sender (recovered from signature)
Bundle state manager to apply transaction changes
Processing context implementing ProcessingContext trait
Timestamp of the current block
Result<ExecutionResult> containing execution outcome
Example
get_transaction_input_bytes
Extracts calldata from a transaction envelope. Location:src/transaction.rs:74
Transaction envelope
get_transaction_nonce
Extracts the nonce from a transaction. Location:src/transaction.rs:85
Transaction envelope
ProcessingContext Trait
Trait for contexts that can process transactions. Allows both the node and external sequencers to process transactions. Location:src/transaction.rs:96
Methods
Returns a reference to the state manager.
Returns a mutable reference to the state manager.
Returns the Bitcoin RPC read client if available.
Returns the Bitcoin network (mainnet, testnet, regtest, etc.).
Handles CMIO queries from Cartesi machine execution.Parameters:
message: CMIO message from the machinecurrent_intent_id: Optional intent ID being processed
ExecutionResult
Result of transaction execution. Location:src/transaction.rs:139
Fields
Whether the transaction executed successfully
Amount of gas consumed during execution
Amount of gas refunded
Transaction output data (return value for calls)
Execution log messages
Error message if execution failed
CoreLaneAddresses
Special addresses for Core Lane operations. Location:src/transaction.rs:109
Methods
Returns the burn address:
0x0000000000000000000000000000000000000666Used for burning tokens to mint on Core Lane.Returns the exit marketplace address:
0x0000000000000000000000000000000000000045Used for intent operations (create, lock, solve, cancel).Returns the Cartesi HTTP runner address:
0x0000000000000000000000000000000000000042Used for executing RISC-V programs via Cartesi.Example
Transaction Validation
Transaction processing includes automatic validation:Nonce Validation
Nonces are validated to prevent replay attacks and ensure transaction ordering:Balance Validation
Sufficient balance is checked before transfers:Special Transaction Types
Intent Transactions
Transactions toCoreLaneAddresses::exit_marketplace() trigger intent operations. See Intent System API for details.
Cartesi Transactions
Transactions toCoreLaneAddresses::cartesi_http_runner() execute RISC-V programs (requires cartesi-runner feature).
Burn Transactions
Transactions toCoreLaneAddresses::burn() with proper formatting mint tokens on Core Lane. See block processing documentation for details.