Transaction Lifecycle Overview
1
Transaction Construction
User or application builds a transaction with commands and arguments
2
Signing
Transaction is signed by the sender’s private key
3
Submission
Signed transaction is submitted to a validator or fullnode
4
Validation
Transaction is validated for correctness and gas sufficiency
5
Execution Path Selection
System determines if fast path (owned objects) or consensus path (shared objects) is needed
6
Execution
Transaction executes and produces effects
7
Finalization
Effects are finalized and transaction becomes immutable
8
Indexing
Transaction and effects are indexed for querying
Fast Path vs Consensus Path
- Fast Path (Owned Objects)
Transactions using only owned objects skip consensus:Benefits:
- Sub-second finality (~400ms)
- No consensus overhead
- Parallel execution
- Lower latency
- All objects must be owned by sender
- No shared objects involved
Transaction Validation
Before execution, transactions undergo multiple validation checks:Gas Validation
Checks Performed
Gas Price
Must be >= reference gas price and < max gas price
Gas Budget
Sender must have enough SUI in gas coins
Object Ownership
All owned objects must belong to sender
Object Versions
Object versions must match current state
Type Arguments
Type arguments must not exceed depth/count limits
Signature
Transaction signature must be valid
Execution Process
Pre-Execution
- Lock Objects: Acquire locks on all input objects
- Load State: Read object data from storage
- Initialize Gas: Set up gas tracking
Execution
- Charge gas for computation
- Execute command (Move call, transfer, etc.)
- Update state (modify objects, emit events)
- Track changes for gas accounting
Post-Execution
- Calculate Storage Costs: Based on object size changes
- Apply Storage Rebates: For deleted/modified objects
- Update Gas Coin: Deduct total gas cost
- Generate Effects: Record all state changes
- Release Locks: Free object locks
Transaction Effects
After execution, the transaction produces effects:Status
Status
Success or failure with error details
Gas Summary
Gas Summary
Object Changes
Object Changes
- Created objects
- Modified objects (with new versions)
- Deleted objects
- Wrapped/unwrapped objects
Events
Events
Custom events emitted during execution
Dependencies
Dependencies
Other transactions this one depends on
Gas Computation
Gas is charged for multiple components:Gas Calculation Formula
Transaction Finality
Transactions achieve finality when:- Owned Objects (Fast Path)
- 2f+1 validators sign the transaction effects
- Certificate formed with collected signatures
- Immediately final - cannot be reverted
- Timeline: ~400ms from submission
Error Handling
Transactions can fail at different stages:Pre-Execution Errors
- Invalid signature
- Insufficient gas
- Invalid object references
- Type argument violations
Execution Errors
- Out of gas
- Assertion failures
- Arithmetic overflows
- Access control violations
Checkpoints
Transactions are grouped into checkpoints for additional finality guarantees:Monitoring Transactions
Query Transaction Status
Wait for Transaction
Best Practices
Handle failures gracefully
Handle failures gracefully
Always check transaction status before assuming success:
Set appropriate timeouts
Set appropriate timeouts
- Fast path: 1-2 second timeout
- Consensus path: 5-10 second timeout
- Network congestion: Add extra buffer
Monitor gas costs
Monitor gas costs
Track actual vs expected gas costs to optimize:
Use dry run for complex transactions
Use dry run for complex transactions
Test transactions before submission:
Related Topics
Transactions
Learn about transaction structure
Gas Pricing
Understand gas costs
Objects
Learn about object model