filecoin-project / lotus

Reference implementation of the Filecoin protocol, written in Go
https://lotus.filecoin.io/
Other
2.83k stars 1.25k forks source link

Events database GC #12274

Open rvagg opened 1 month ago

rvagg commented 1 month ago

Tie event lifetime to blockstore lifetime. Make this configurable but if you have a splitstore enabled then events shouldn't persist if you don't have the blocks available for them.

Needs some consideration though: eth_getLogs and GetActorEventsRaw I think should still work on old epochs even if you don't have the blocks, maybe that's desirable? We could make this configurable to either have a config option with "number of epochs to store" or "follow splitstore".

BigLep commented 1 month ago

@rvagg : newbie question here: does this only apply for the events db, or do we need to cover the messages and transactions dbs as well?

rvagg commented 1 month ago

txhash.db has a GC already

I think msgindex.db does a basic GC on lotus startup

It's events that's the main problem, because it doesn't have any, and it accumulates a lot quicker and gets a lot larger. But we could apply the same pattern to the others when we implement it.