Skip to content

t8n: typed tx JSON with yParity (no v) is rejected #1488

@chfast

Description

@chfast

Summary

evmone-t8n rejects typed transaction JSON that uses yParity without v, while go-ethereum evm t8n accepts and executes it.

This affects typed tx compatibility (type: 0x2/0x3/0x4) where yParity is a canonical JSON signature field.

Reproducer (Cancun, EIP-1559 tx)

alloc.json

{
  "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b": {
    "code": "0x",
    "nonce": "0x0",
    "balance": "0xde0b6b3a7640000",
    "storage": {}
  }
}

env.json

{
  "currentCoinbase": "0x8888f1f195afa192cfee860698584c030f4c9db1",
  "currentNumber": "0x01",
  "currentTimestamp": "0x54c99069",
  "currentGasLimit": "0x2fefd8",
  "currentRandom": "0x0000000000000000000000000000000000000000000000000000000000000001",
  "parentBeaconBlockRoot": "0x0000000000000000000000000000000000000000000000000000000000000000",
  "currentBaseFee": "0x1",
  "currentExcessBlobGas": "0x0",
  "withdrawals": []
}

txs.json (note: no v, only yParity)

[
  {
    "accessList": [],
    "chainId": "0x1",
    "gas": "0x5208",
    "hash": "0x3a01c573d8ea83d8872a79d7afe20bd009a61039da1347b64f0b3972ebc6a911",
    "input": "0x",
    "maxFeePerGas": "0x1",
    "maxPriorityFeePerGas": "0x0",
    "nonce": "0x0",
    "r": "0x1043c2860f2cc884d4ce573c89fd36e7b68ff41480a17693f1e1349a5837e9fe",
    "s": "0x78b469d7feac811d12dffc12bfefafc27e36e893042cb11c5c24a2e3e35b94a4",
    "sender": "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b",
    "to": "0x095E7BAea6a6c7c4c2DfeB977eFac326aF552d87",
    "type": "0x2",
    "value": "0x0",
    "yParity": "0x1"
  }
]

Commands

# evmone
evmone-t8n \
  --state.fork Cancun --state.chainid 1 \
  --input.alloc alloc.json --input.env env.json --input.txs txs.json \
  --output.basedir out-evmone --output.result result.json --output.alloc alloc.json

# geth
evm t8n \
  --state.fork Cancun --state.chainid 1 \
  --input.alloc alloc.json --input.env env.json --input.txs txs.json \
  --output.basedir out-geth --output.result result.json --output.alloc alloc.json

Observed divergence

  • evmone exits with:
    • [json.exception.out_of_range.403] key 'v' not found
  • geth executes successfully:
    • gasUsed = 0x5208
    • sender nonce increments.

Suspected root cause

evmone transaction JSON loader requires "v" unconditionally:

  • test/utils/statetest_loader.cpp
    • o.v = from_json<uint8_t>(j.at("v"));

go-ethereum accepts typed tx signature via yParity (or v) in JSON:

  • core/types/transaction_marshalling.go via dec.yParityValue() in typed tx decode paths.

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