paradigmxyz / cryo

cryo is the easiest way to extract blockchain data to parquet, csv, json, or python dataframes
Apache License 2.0
1.12k stars 97 forks source link

[Request] Support OP Stack Chains' Transaction Receipt Fields #155

Open MSilb7 opened 8 months ago

MSilb7 commented 8 months ago

Is your feature request related to a problem? Please describe. OP Stack Chains contain extra fields in the transaction receipt that are required to calculate the L1 data fee portion of transaction fees:

This may be due to an upstream ethers-rs dependency, but raising here first.

Describe the solution you'd like

Short-Term:

Longer-Term

Describe alternatives you've considered N/A

Additional context

Example receipt response via Alchemy's eth_getTransactionReceipt - Optimism (I cut out logs manually):

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "transactionHash": "0x38bddf161a79fd4e8a6cb5b84cd533ec8193014c89ba9b0b6a4b3ffd75ba1030",
    "blockHash": "0x5be845b408b60f80b4654836d4d819b787259dcd0235668cc1a08b608359100f",
    "blockNumber": "0x6c53b9b",
    ...
    ...
    ...
    "status": "0x1",
    "to": "0x0684076ee3595221861c50cdb9cb66402ec11cb9",
    "transactionIndex": "0x3",
    "type": "0x2",
    "l1Fee": "0xf422cbc70c6b",
    "l1FeeScalar": "0.684",
    "l1GasPrice": "0x796cdde4f",
    "l1GasUsed": "0x2f08"
  }
}
ameya-deshmukh commented 8 months ago

@sslivkoff is this something I can take up?

MSilb7 commented 6 months ago

Note for the Ecotone upgrade (Mar 14 - support for blobs) there will be two additional fields: l1BlobBaseFee and l1BlobBaseFeeScalar

See discussion here: https://github.com/ethereum-optimism/op-analytics/discussions/382

MSilb7 commented 4 months ago

Bumping this, there should be similar requirements across other stacks (i.e. Arb has gas used for l1).

Maybe there's an option to just pull all fields in the schema, versus having to pre-select?