Skip to content

PrestateTracer works bad for EIP-7702 #3250

@devil-may-cry-era

Description

@devil-may-cry-era

System information

Geth version: geth version: v1.5.17
OS & Version: Windows/Linux/OSX: Linux
Commit hash : (if develop)

Expected behaviour

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "post": {
      "0x0000000000000000000000000000000000000000": {
        "balance": "0x74a34efc66d1a47f27"
      },
      "0x268fabadf62f59c28103060bd8575c5dae25ef1d": {
        "balance": "0x1546ce23b9a4dff",
        "code": "0xef0100bb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c",
        "nonce": 14
      }
    },
    "pre": {
      "0x0000000000000000000000000000000000000000": {
        "balance": "0x74a34efc66d1a47f26"
      },
      "0x268fabadf62f59c28103060bd8575c5dae25ef1d": {
        "balance": "0x1548e5a6687ce00",
        "nonce": 12
      }
    }
  }
}

Actual behaviour

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "post": {
      "0x0000000000000000000000000000000000000000": {
        "balance": "0x74a34efc66d1a47f27"
      },
      "0x268fabadf62f59c28103060bd8575c5dae25ef1d": {
        "balance": "0x1546ce23b9a4dff",
        "nonce": 14
      }
    },
    "pre": {
      "0x0000000000000000000000000000000000000000": {
        "balance": "0x74a34efc66d1a47f26"
      },
      "0x268fabadf62f59c28103060bd8575c5dae25ef1d": {
        "balance": "0x1548e5a6687ce00",
        "code": "0xef0100bb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c",
        "nonce": 13
      }
    }
  }
}

Steps to reproduce the behaviour

{
    "method": "debug_traceTransaction",
    "params": [
        "0xE1381999BE2800188FE5BA4E6A96FA3B74FF62F6BB0D295DF1C6A38768802ACA",
        {
            "tracer": "prestateTracer",
            "tracerConfig": {
                "diffMode": true
            }
        }
    ],
    "id": 1,
    "jsonrpc": "2.0"
}

Backtrace

eth/tracers/native: 39
func init() {
	tracers.DefaultDirectory.Register("prestateTracer", newPrestateTracer, false)
}
eth/tracers/js/goja.go: 58
tracers.DefaultDirectory.Register(name, lookup(code), true)

As shown above, two tracers (tracers/js/internal/tracers/prestate_tracer.js and tracers/native/prestate.go) with the same name are registered repeatedly. However, only the native implementation (prestate.go) produces the expected result, while the JS version does not. Actually, to avoid duplicate registration, go-ethereum has removed the JS tracer.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions