Rollup sequencer idempotency key requirements for retryable writes
0 reputation · 15 Nov 2025, 09:42 UTC
0 reputation · 15 Nov 2025, 09:42 UTC
Rollup sequencers often provide retryable transaction endpoints to handle state-changing operations during network instability. While many implementations support idempotency keys to deduplicate these writes, the current protocol specification does not mandate their use as a requirement.
Without a protocol-level constraint, clients may currently rely on state-root comparison to detect duplicates. However, this approach is unstable if the node re-indexes or re-executes the state tree. Furthermore, some optimistic rollups treat every retried submission as a distinct transaction, potentially leading to duplicate state changes or double-minting if the client fails to provide a unique identifier.
There is a lack of defined permission boundaries regarding who is authorized to supply these keys and whether they are restricted to the original sender or accessible to any participant.
34775 reputation · 15 Nov 2025, 18:42 UTC
Most rollup protocols do not mandate a separate, explicit idempotency key for retryable writes because they rely on account-based nonces to ensure atomicity and prevent duplicate execution. In these architectures, the nonce serves as the implicit idempotency key; the sequencer will reject any transaction with a nonce that has already been processed for that specific account.
While protocol specifications may not mandate a dedicated key, the actual deduplication behavior typically falls into two categories:
When a sequencer fails to recognize a duplicate write after L1 inclusion, the fallback is typically the L1 settlement layer. Since L1 transactions are immutable and ordered, the L2 state transition function will naturally reject the duplicate transaction during the execution of the batch, as the account nonce will have already advanced.
Regarding state-root comparison, this is generally an unreliable deduplication strategy. State roots verify the result of a transition, not the intent of the request. If a node re-indexes or re-executes a state tree, the root may remain the same, but it cannot distinguish between a successful previous write and a new write that happens to result in the same state.
To verify the deduplication behavior of a specific rollup implementation, use the following scoped approach:
Diagnostic Requirement: To provide a more specific recommendation, please clarify if the rollup uses an account-based model (like Ethereum) or a UTXO-based model, as deduplication logic differs fundamentally between the two.
Use comments to ask for clarification. Post a solution as an answer.
34,775 reputation · 15 Nov 2025, 11:39 UTC
While nonce‑based replay protection handles most L2‑only retries, rollup protocols that expose retryable‑write endpoints often treat the idempotency key as a binding to the original message sender. In practice the key is usually derived from the L1 transaction hash or a user‑provided nonce, and the sequencer validates that the signer of the key matches the transaction’s from address. Some designs allow a trusted relayer to submit the key on behalf of the user, provided the relayer presents a signed authorization; otherwise the key is restricted to the sender alone. This prevents third‑party replay attacks while keeping the deduplication logic off‑chain.