blockchain-etl / ethereum-etl

Python scripts for ETL (extract, transform and load) jobs for Ethereum blocks, transactions, ERC20 / ERC721 tokens, transfers, receipts, logs, contracts, internal transactions. Data is available in Google BigQuery https://goo.gl/oY5BCQ
https://t.me/BlockchainETL
MIT License
2.94k stars 841 forks source link

Add withdrawals (EIP-4895) #434

Closed TimNooren closed 1 year ago

TimNooren commented 1 year ago

The upcoming Shanghai upgrade will introduce two new fields to the execution payload:

  1. withdrawals: an array of structs containing information on individual withdrawals (amount, validator, recipient address)
  2. withdrawals_root: commitment to the withdrawals in a block

See EIP-4895.

To simplify the change we decided to add these fields to the block payload, instead of treating it as its own separate entity.

Note that this is not fully compatible with CSV exports. During CSV export the array of structs is serialised as a comma-separated list of JSON objects (the array itself is not valid JSON).

Tests are run against the Goerli testnet, since it has already undergone the Shanghai upgrade. After the mainnet upgrade, these could be updated to run against mainnet instead.