lotus/node/impl
Hector Sanjuan fa93c23813 Chain ranged export: rework and address current shortcomings
This commit moderately refactors the ranged export code. It addresses several
problems:
  * Code does not finish cleanly and things hang on ctrl-c
  * Same block is read multiple times in a row (artificially increasing cached
    blockstore metrics to 50%)
  * It is unclear whether there are additional races (a single worker quits
    when reaching height 0)
  * CARs produced have duplicated blocks (~400k for an 80M-blocks CAR or
    so). Some blocks appear up to 5 times.
  * Using pointers for tasks where it is not necessary.

The changes:

  * Use a FIFO instead of stack: simpler implementation as its own type. This
has not proven to be much more memory-friendly, but it has not made things
worse either.
  * We avoid a probably not small amount of allocations by not using
    unnecessary pointers.
  * Fix duplicated blocks by atomically checking+adding to CID set.
  * Context-termination now works correctly. Worker lifetime is correctly tracked and all channels
  are closed, avoiding any memory leaks and deadlocks.
  * We ensure all work is finished before finishing, something that might have
  been broken in some edge cases previously. In practice, we would not have
  seen this except perhaps in very early snapshots close to genesis.

Initial testing shows the code is currently about 5% faster. Resulting
snapshots do not have duplicates so they are a bit smaller. We have manually
verified that no CID is lost versus previous results, with both old and recent
snapshots.
2023-02-14 21:08:10 +01:00
..
client netbs: Address review 2022-11-08 09:37:43 +00:00
common feat: Add node uptime rpc / output in info command 2022-10-11 10:11:09 +02:00
full Chain ranged export: rework and address current shortcomings 2023-02-14 21:08:10 +01:00
market chore: fix imports 2022-06-14 17:00:51 +02:00
net Update other deprecated libp2p imports 2022-08-25 14:23:25 -04:00
paych chore: fix imports 2022-06-14 17:00:51 +02:00
backup.go Plumb contexts through 2021-12-11 17:04:00 -05:00
full.go NV18: Filecoin EVM runtime + Actor Events + EthAccount + EAM + f4 addressing (#9998) 2023-01-13 19:11:13 +00:00
remoteworker.go storage: Move extern/sector-storage to storage/sealer 2022-06-14 20:03:38 +02:00
storminer.go Fix lotus-miner proving check 2022-11-14 15:29:50 -05:00