Skip to content

pre-regolith failed deposit in op-revm stopping with OutOfFunds doesn't bump nonce #3458

@kevin-valerio

Description

@kevin-valerio

op-revm version 15 bumps the sender nonce for deposit txs only when it’s a call, so a deposit contract-creation (to == null) that errors with OutOfFunds never increments nonce, leading to the state root mismatch.

As mentioned in the OP Stack specs, when EVM processing fails and roll back the change, the from account nonce must be incremented by 1. In op-revm however, the nonce is not incremented.

This issue is valid only for pre-regolith updates. However the issue remain critical because if this nonce isn't updated, the state root differs from other clients running on pre-regolith, which can lead to chain splits.

The bug can be reproduce using https://gist.github.com/kevin-valerio/0a15d2350d111a3e0bf88181b177327a

Expected output:
  - result = Halt { reason: Base(OutOfFunds), ... }
  - post_nonce = 0

This issue serves mainly for tracking purposes, since it has been already shared and discussed with the core maintainer of revm.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions