Skip to Content

State Reset

State Reset periodically returns your Stagenet’s state to the live chain it replays, while keeping your own wallets intact.

A Stagenet is a persistent fork: every transaction you run modifies and keeps state on top of the replayed chain (see State Behaviour). Over a long-lived session that modified state drifts away from the live chain — pool prices move, market-maker inventories drain, oracle data ages. State Reset clears that accumulated drift in one step, so the Stagenet behaves like a fresh fork again — without losing the balances, approvals, and nonces your wallets have built up.

State Reset is the counterpart to Mainnet Follow. Follow keeps specific state pinned to the live chain continuously; State Reset wipes all accumulated drift on a schedule (or on demand). Use Follow for a few known-sensitive slots, and State Reset to keep a long-running Stagenet healthy overall.

When to reset state

State Reset is built for long-lived staging environments — especially integrations that quote against the live chain and execute against your Stagenet, such as swap aggregators.

  • A swap aggregator quotes a route against live chain liquidity, but your Stagenet executes against pool state that earlier test swaps have moved. As the difference grows, swaps that work on the live chain start reverting on your Stagenet.
  • Market-maker (RFQ) routes pay out of a maker’s on-chain inventory. On a fork that inventory only drains — it never refills — so those routes fail more often the longer the Stagenet is used.

Resetting on a cadence keeps the Stagenet close to the live chain, so quotes and swaps keep working over days of testing instead of degrading.

What is preserved, and what is reset

A reset is deliberately surgical — it keeps your state and resets everything else:

Preserved

  • Wallet native balances and nonces
  • ERC-20 token balances held by your wallets
  • Token approvals, including Permit2 allowances
  • The block history and current block (the chain does not rewind)

Reset to the live chain

  • Pool prices and reserves
  • Market-maker / protocol inventories
  • Any other third-party state your transactions have modified

Nonces are preserved on purpose. If a reset rolled wallet nonces back, a connected wallet such as MetaMask would keep submitting from its remembered (higher) nonce and its transactions would get stuck.

Your wallets are identified from on-chain activity — any address that has sent a transaction, plus wallets created on the Stagenet — so their balances and approvals are carried across the reset automatically.

How it works

A reset runs at a block boundary, so it never interrupts a transaction mid-execution:

  1. The current balances, approvals, and nonces of your wallets are recorded.
  2. All locally-modified state is cleared, so reads fall through to the live chain again.
  3. Your wallets’ recorded state is written back on top.

Block height is unchanged — only the state snaps back to the live chain.

How to use State Reset

Open your Stagenet’s Settings page and find the State Reset card. Enable it and choose a cadence (for example, every 12 hours or daily). State Reset is off by default.

Programmatic control

You can also drive State Reset over the RPC endpoint:

# Reset now (one-off) mock_wipeLocalState # Configure the schedule (e.g. every 24h) — null interval disables it mock_setWipeSchedule [{ "intervalMs": 86400000 }] # Read the current schedule mock_getWipeSchedule
Last updated on