Mainnet Replay
Mainnet Replay is how a Stagenet follows a target chain’s changing state.
When you create a Stagenet, it starts from the target chain’s current block. From there, it replays new blocks from the target chain one after another.
As replay advances, untouched state continues to update from the target chain. State changed by transactions on your Stagenet is persisted and is no longer overwritten by replay.
This gives you a private environment that keeps following production state while letting your own transactions persist.
Block Replay
For each replayed block, the Stagenet:
- Executes any pending transactions submitted to the Stagenet.
- Updates untouched state to match the target chain at the end of the replayed block.
This makes your Stagenet follow the target chain’s state progression, giving your contracts access to on-chain data that changes over time:
- DeFi protocol state
- Oracle prices
- Token balances
If a Chainlink price feed updates on Ethereum, that updated value is applied to an Ethereum Stagenet when it replays the corresponding block, unless the feed state has already been modified on the Stagenet.
Modified state
Mainnet Replay only updates state that has not been modified on the Stagenet.
If a Stagenet transaction changes a piece of state — for example, a wallet balance or a contract storage slot — that change is preserved on the Stagenet. Replay updates from the target chain will no longer overwrite that specific piece of state.
All other untouched state continues to follow the target chain as replay advances.
| What happens | Result |
|---|---|
| An account balance is never touched on the Stagenet | It continues updating from replayed blocks |
| A contract storage slot is never touched on the Stagenet | It continues updating from replayed blocks |
| A Stagenet transaction changes a wallet or token balance | That balance is persisted and no longer overwritten by replay |
| A Stagenet transaction writes to a storage slot | That slot is persisted and no longer overwritten by replay |
| Other unrelated state is untouched | It continues following the target chain |
This means your activity modifies select parts of the environment while the rest of the chain continues to follow the target chain.
If you swap against a Uniswap pool on your Stagenet, the pool state changed by that swap is persisted on the Stagenet.
Other untouched chain state continues following the target chain as replay advances.
Block context
As replay advances, the Stagenet follows the target chain’s block progression.
Block number
block.number matches the target chain block currently being replayed.
Block timestamp
block.timestamp is the time the Stagenet produced the block, not the historical timestamp of the target chain’s replayed block.
This helps off-chain integrations that depend on freshness, such as signed orders, quote validation, and oracle freshness checks.
Chain ID
Each Stagenet has its own chainId, separate from the target chain it replays.
This is what the CHAINID opcode returns and what wallets use when signing Stagenet transactions.
A separate chainId prevents Stagenet transactions from being replayed on the target chain.
Gas
Stagenets use standard EVM gas metering. gasPrice and baseFee follow the target chain block being replayed.
Transactions still require the target chain’s native gas token, which you can fund using the faucet or generated wallets.