You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 under RocksDBStore temporarily for operational reasons, but should no longer be part of the IStore 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 remove RocksDBStore.MigrateChainDBFromColumnFamilies() as well.
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.
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, reimplementing RocksDBStore.IterateIndexes() becomes trivial.
A reimplementation of RocksDBStore.IterateIndexes() may require some optimization as pruning will result in significant performance degradation due to an Iterator normally having to iterate from the very beginning even if one is only looking for the last n blocks. Iterator.SeekForPrev() may be used for this purpose.
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.
The text was updated successfully, but these errors were encountered:
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 under
RocksDBStore
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:
RocksDBStore.PruneOutdatedChains()
as in FixedPruneOutdatedChains()
#3999.RocksDBStore
during the instantiation phase.ListChainIds()
and see if there is more than 1.RocksDBStore
is already pruned.RocksDBStore.IterateIndexes()
.RocksDBStore.IterateIndexes()
is bugged, which I believe is the reason why the current 9c-network chains are corrupted.RocksDBStore
is always pruned, reimplementingRocksDBStore.IterateIndexes()
becomes trivial.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.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.The text was updated successfully, but these errors were encountered: