celestia-core
celestia-core copied to clipboard
Separate out ancient blocks from recent blocks
Blocked by #1811 and probably #1812
Ref: https://geth.ethereum.org/docs/fundamentals/databases
Allow separating ancient from recent blocks. My suggestion is that ancient blocks are those outside the sampling window, and recent blocks are those within the sampling window. Have to take care of the edge case of the sampling window changing.
This suggestion naturally lends itself to, especially with #1813, ancient blocks being just the block data (could be in ODS form, or another form) and recent blocks being block data, and Q1+Q4 (or the whole EDS) if the node is configured to serve samples.
One thing to watch for is that post-FBSS there's also a third type of thing to be stored: blocks before a square is formed for those blocks. Putting it all together:
- Very recent blocks, i.e. blocks before a square is formed. Blocks can be moved from here as soon as a square is formed for those blocks. This might become relevant even before FBSS with pipelined square construction.
- Recent blocks, and recent squares (optionally, if serving samples). Can be dumped into the ancient block store once outside the sampling window.
- Ancient blocks.
The exact storage format isn't prescribed here.