nimbus-eth1/nimbus/sync/snap/worker
Jordan Hrycaj d53eacb854
Prep for full sync after snap (#1253)
* Split fetch accounts into sub-modules

details:
  There will be separated modules for accounts snapshot, storage snapshot,
  and healing for either.

* Allow to rebase pivot before negotiated header

why:
  Peers seem to have not too many snapshots available. By setting back the
  pivot block header slightly, the chances might be higher to find more
  peers to serve this pivot. Experiment on mainnet showed that setting back
  too much (tested with 1024), the chances to find matching snapshot peers
  seem to decrease.

* Add accounts healing

* Update variable/field naming in `worker_desc` for readability

* Handle leaf nodes in accounts healing

why:
  There is no need to fetch accounts when they had been added by the
  healing process. On the flip side, these accounts must be checked for
  storage data and the batch queue updated, accordingly.

* Reorganising accounts hash ranges batch queue

why:
  The aim is to formally cover as many accounts as possible for different
  pivot state root environments. Formerly, this was tried by starting the
  accounts batch queue at a random value for each pivot (and wrapping
  around.)

  Now, each pivot environment starts with an interval set mutually
  disjunct from any interval set retrieved with other pivot state roots.

also:
  Stop fishing for more pivots in `worker` if 100% download is reached

* Reorganise/update accounts healing

why:
  Error handling was wrong and the (math. complexity of) whole process
  could be better managed.

details:
  Much of the algorithm is now documented at the top of the file
  `heal_accounts.nim`
2022-10-08 18:20:50 +01:00
..
com Prep for full sync after snap (#1253) 2022-10-08 18:20:50 +01:00
db Prep for full sync after snap (#1253) 2022-10-08 18:20:50 +01:00
heal_accounts.nim Prep for full sync after snap (#1253) 2022-10-08 18:20:50 +01:00
store_accounts.nim Prep for full sync after snap (#1253) 2022-10-08 18:20:50 +01:00
store_storages.nim Prep for full sync after snap (#1253) 2022-10-08 18:20:50 +01:00
ticker.nim Prep for full sync after snap (#1253) 2022-10-08 18:20:50 +01:00