Skip to main content
Once accounts are delegated to an Ephemeral Rollup, you can execute transactions with minimal latency (typically 50-100ms). Transactions in ERs work identically to Solana transactions, but connect to the ER endpoint instead of the base layer.

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:

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:
Use skipPreflight: true for faster transaction submission. Preflight checks add unnecessary latency in ERs.

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
Execute the commit from the client:

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
From the client:

Performance comparison

Typical transaction latencies:
Delegation and undelegation must be executed on the base layer connection, not the ER connection.

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

Next steps

Account delegation

Learn how to delegate accounts to ERs

Ephemeral Rollups

Understand the complete ER architecture