go-ethereum/statediff/docs/KnownGaps.md
Abdul Rabbani b609d4d6c2 Statediff Geth
* Handle conflicts (#244)

* Handle conflicts

* Update go mod file versions

* Make lint changes

* Disassociate block number from the indexer object

* Update ipld-eth-db ref

* Refactor builder code to make it reusable

* Use prefix comparison for account selective statediffing

* Update builder unit tests

* Add mode to write to CSV files in statediff file writer (#249)

* Change file writing mode to csv files

* Implement writer interface for file indexer

* Implement option for csv or sql in file mode

* Close files in CSV writer

* Add tests for CSV file mode

* Implement CSV file for watched addresses

* Separate test configs for CSV and SQL

* Refactor common code for file indexer tests

* Update indexer to include block hash in receipts and logs (#256)

* Update indexer to include block hash in receipts and logs

* Upgrade ipld-eth-db image in docker-compose to run tests
2022-07-14 08:14:23 -05:00

1.3 KiB

Overview

This document will provide some insight into the known_gaps table, their use cases, and implementation. Please refer to the following PR and the following epic to grasp their inception.

known gaps

Use Cases

The known gaps table is updated when the following events occur:

  1. At start up we check the latest block from the eth.headers_cid table. We compare the first block that we are processing with the latest block from the DB. If they are not one unit of expectedDifference away from each other, add the gap between the two blocks.
  2. If there is any error in processing a block (db connection, deadlock, etc), add that block to the knownErrorBlocks slice, when the next block is successfully written, write this slice into the DB.

Glossary

  1. expectedDifference (number) - This number indicates what the difference between two blocks should be. If we are capturing all events on a geth node then this number would be 1. But once we scale nodes, the expectedDifference might be 2 or greater.
  2. processingKey (number) - This number can be used to keep track of different geth nodes and their specific expectedDifference.