-
Notifications
You must be signed in to change notification settings - Fork 154
Open
Description
Since moving to PBFT, there has been no real need to allow forking of chains. The following methods should be removed:
IStore.ForkTxNonces()
IStore.ForkBlockIndexes()
IStore.DeleteChainId()
IStore.PruneOutdatedChains()
IStore.ListChainIds()
These methods may be provided underRocksDBStore
temporarily for operational reasons, but should no longer be part of theIStore
interface. It may be desirable to remove all in one go. Due to the 9c-network chain database being corrupted internally already, it would be nearly impossible to implement additional migration methods while accommodating existing chains. Additionally, we might want to removeRocksDBStore.MigrateChainDBFromColumnFamilies()
as well.
I propose the following migration path:
- Remove all interface methods suggested above.
- Implement
RocksDBStore.PruneOutdatedChains()
as in FixedPruneOutdatedChains()
#3999. - Automatically prune
RocksDBStore
during the instantiation phase.- This can be checked by calling
ListChainIds()
and see if there is more than 1. - Pruning can be skipped if the
RocksDBStore
is already pruned.
- This can be checked by calling
- Fix
RocksDBStore.IterateIndexes()
.- As it stands,
RocksDBStore.IterateIndexes()
is bugged, which I believe is the reason why the current 9c-network chains are corrupted. - Once we can assume that a loaded
RocksDBStore
is always pruned, reimplementingRocksDBStore.IterateIndexes()
becomes trivial. - A reimplementation of
RocksDBStore.IterateIndexes()
may require some optimization as pruning will result in significant performance degradation due to anIterator
normally having to iterate from the very beginning even if one is only looking for the lastn
blocks.Iterator.SeekForPrev()
may be used for this purpose.
- As it stands,
Once this is done, I presume significant portions of RocksDBStore
can be refactored easily after a full release cycle (to make sure that all local chains are pruned) making additional migrations feasible for further optimizations.
Metadata
Metadata
Assignees
Labels
No labels