Prune bodies and receipts from before a newly configured barrier.
- Create a MetaDB for storing some extra node info
- In the MetaDB store
- ReceiptBarrier
- BodyBarrier
- CurrentReceiptBarrier
- CurrentBodyBarrier
- 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
- update CurrentBodyBarrier and CurrentReceiptBarrier to the configured version
- if BodyBarrier != CurrentBodyBarrier then start deleting bodies between as a DB migration
- if ReceiptBarrier != CurrentReceiptBarrier then start deleting receipts between as a DB migration
- after deleting bodies/receipt set Body/ReceiptBarrier values to null
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.
Would also be needed for 4444?
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
@asdacap While implementing era support wasn't that supported? Or in plans?