ethereum-optimism / op-geth

GNU Lesser General Public License v3.0
280 stars 735 forks source link

Historical receipts are missing l1 data on snap sync nodes #270

Open quickchase opened 6 months ago

quickchase commented 6 months ago

System information

op-geth version 1.101308.2-stable-0402d543

Expected behaviour

The response to eth_getBlockReceipts and eth_getTransactionReceipt should be identical regardless of sync method.

Actual behaviour

Snap sync nodes return null for l1 data and are missing the field l1FeeScalar entirely for historical blocks

Steps to reproduce the behaviour

Query:

{"jsonrpc":"2.0","id":1,"method":"eth_getBlockReceipts","params":["0x1234"]}

Result:

❯ diff <(jq --sort-keys . ~/tmp/snap.json) <(jq --sort-keys . ~/tmp/full.json)
13,15c13,16
<       "l1Fee": null,
<       "l1GasPrice": null,
<       "l1GasUsed": null,
---
>       "l1Fee": "0x4d0d1b312dc7a",
>       "l1FeeScalar": "1.5",
>       "l1GasPrice": "0x2b61b593ee",
>       "l1GasUsed": "0x12f2",

So the full sync full nodes have l1Fee and l1Gas data, but the snap sync node does not.

relevant op-geth flags:

--op-network=op-mainnet
--state.scheme=path
--history.transactions=0
--syncmode=snap
--gcmode=full