Overview
Transactions in Ephemeral Rollups:- Execute on delegated accounts with sub-100ms latency
- Use the same instruction format as Solana
- Support all program types (Anchor, native Rust, Bolt, etc.)
- Automatically commit to the base layer at configured intervals
- Can be manually committed or undelegated at any time
Connection setup
To execute transactions on an ER, create a connection to the ER endpoint instead of the base layer.Anchor connection
From the anchor-counter example:/home/daytona/workspace/source/anchor-counter/tests/anchor-counter.ts
Web3.js connection
From the rust-counter example:/home/daytona/workspace/source/rust-counter/tests/web3js/rust-counter.test.ts
You need both connections: one for base layer operations (delegation/undelegation) and one for ER execution.
Environment configuration
Set these environment variables to configure your ER endpoints:- Devnet
- Local
Executing transactions
Transactions on ERs follow the same pattern as Solana, but use the ER connection.Anchor transactions
From the anchor-counter test:Native Web3.js transactions
From the rust-counter test:Bolt transactions
From the bolt-counter test:Transaction confirmation
ER transactions can be confirmed using standard Solana confirmation strategies:Committing state
State changes in ERs can be committed to the base layer in three ways:Automatic commits
State automatically commits at the interval specified during delegation:Manual commits
You can manually commit state from within your program:/home/daytona/workspace/source/anchor-counter/programs/anchor-counter/src/lib.rs
Tracking commit confirmations
Use the SDK to wait for commit finalization on the base layer:The commit transaction executes on the ER instantly, but takes several seconds to finalize on the base layer.
Commit and undelegate
To commit final state and return the account to the base layer:/home/daytona/workspace/source/anchor-counter/programs/anchor-counter/src/lib.rs
Performance comparison
Typical transaction latencies:Transaction lifecycle example
Complete flow from the anchor-counter test:Best practices
Skip preflight
Use
skipPreflight: true to reduce latency. ER validators handle validation efficiently.Batch operations
Execute multiple operations on the ER before committing to minimize base layer costs.
Connection management
Maintain separate connections for base layer and ER operations.
Error handling
Handle ER connection failures gracefully and retry on the base layer if needed.
Examples
- Anchor Counter - Basic transaction execution with Anchor
- Rust Counter - Native Web3.js transaction handling
- Bolt Counter - ECS system execution on ERs
- Session Keys - Temporary signing authorities
Next steps
Account delegation
Learn how to delegate accounts to ERs
Ephemeral Rollups
Understand the complete ER architecture