nethermind icon indicating copy to clipboard operation
nethermind copied to clipboard

Prune bodies and receipts from before a newly configured barrier.

Open tkstanczak opened this issue 5 years ago • 3 comments

  1. Create a MetaDB for storing some extra node info
  2. In the MetaDB store
  • ReceiptBarrier
  • BodyBarrier
  • CurrentReceiptBarrier
  • CurrentBodyBarrier
  1. When launching Nethermind
  • if BodyBarrier is null and CurrentBodyBarrier is not null then copy CurrentBodyBarrier to BodyBarrier
  • if ReceiptBarrier is null and CurrentReceiptBarrier is not null then copy ReceiptBodyBarrier to ReceiptBarrier
  1. update CurrentBodyBarrier and CurrentReceiptBarrier to the configured version
  2. if BodyBarrier != CurrentBodyBarrier then start deleting bodies between as a DB migration
  3. if ReceiptBarrier != CurrentReceiptBarrier then start deleting receipts between as a DB migration
  4. after deleting bodies/receipt set Body/ReceiptBarrier values to null

tkstanczak avatar Jan 06 '21 12:01 tkstanczak

That is very interesting idea.

@smartprogrammer93 You were adding some extra fields to metadata db about barrier vs pivot, am i right? Is there a space for such check and any way to remove those?

Would be even nicer if I'd be able to set something like "latest" as a param for those barriers (or something else like -1 to keep the param type) and it would remove all bodies and receipts till head. Then after restart I can start syncing bodies and receipts again - will allow me to quickly check if performance of sync of bodies and receipts is the same/better/worse.

kamilchodola avatar Jun 03 '24 21:06 kamilchodola

Would also be needed for 4444?

benaadams avatar Jun 03 '24 21:06 benaadams

Oh nice. We can do something like this. Yes we started storing the previously set barrier values in the meta db. Agree with ben that we will probably need this for 4444 for existing node operators to delete their history

smartprogrammer93 avatar Jun 03 '24 21:06 smartprogrammer93

@asdacap While implementing era support wasn't that supported? Or in plans?

kamilchodola avatar Jan 09 '25 10:01 kamilchodola