The primary difference between these schemas is that the new (v3) schema uses natural primary keys, based on unique deterministic fields (or combinations of fields) of the ethereum objects (e.g. header hash, tx hash, header hash + state path).
In addition, some new columns unrelated to primary keys have been added (coinbase in header_cids, value in transaction_cids) and some columns have been removed (base_fee in header_cids).
This snapshot tool only operates on header_cids, state_cids, and storage_cids tables so only the v2 => v3 changes to these tables need to be reflected here.
Currently, this tool writes to the Postgres DB schema defined in https://github.com/vulcanize/ipld-eth-db/releases/tag/v2.0.0
We need to upgrade it to write the models defined in https://github.com/vulcanize/ipld-eth-db/releases/tag/v3.0.6
The primary difference between these schemas is that the new (v3) schema uses natural primary keys, based on unique deterministic fields (or combinations of fields) of the ethereum objects (e.g. header hash, tx hash, header hash + state path).
In addition, some new columns unrelated to primary keys have been added (
coinbase
in header_cids,value
in transaction_cids) and some columns have been removed (base_fee
in header_cids).This snapshot tool only operates on header_cids, state_cids, and storage_cids tables so only the v2 => v3 changes to these tables need to be reflected here.
Steps:
NOTE: This work should be done on-top of the changes that enable writing the models out to a CSV for loading into Postgres by COPY FROM, aka https://github.com/vulcanize/ipld-eth-state-snapshot/issues/18.