-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Suggestion to utilize RocksDB checkpoint in archival node to quickly obtain snapshot at any historical block height #3645
Comments
How long will a checkpoint be maintained? |
for debugging purpose, will be there permanently, but its optional. |
I do not have a determinate idea now. Personally I am thinking of leaving only -log(1-current_height/total_height) checkpoints for very ancient history. This may require complex controls in deleting and merging checkpoints. Besides, ancient checkpoints with very long computation time to a certain later block may be meaningless for users waiting online. |
That'd be DB-specific, but maybe somewhat more efficient in terms of speed. We do historic things via MPT (https://github.com/nspcc-dev/neo-go/blob/master/docs/rpc.md#historic-calls). |
MPT is way larger, but verifiable... |
We don't know what's gonna happen to RocksDB if one is try |
It’s a great idea for debug |
virtual void CompactRange(const Slice* begin, const Slice* end)
|
If nothing was removed, this wont work |
Summary or problem description
#3639 took the first step for archival nodes. Maybe we can make some enhancements in RocksDBStore plugin and
ISnapshot GetSnapshot();
interfaces to retrieve a historical snapshot quickly, at very little additional costs.Do you have any solution you want to propose?
RocksDB checkpoint offers a historical state of the database immediately, at a small cost of storage. The RocksDBStore plugin should decide (based on config) whether it is needed to generate a new checkpoint, when
Blockchain.Committed
is invoked.The
ISnapshot GetSnapshot();
in interfaceIStore
can have an additional parameter with default value, to request for a historical block. I think auint height=uint.MaxValue
can be good enough to get the latest snapshot as default. If historical snapshot is not supported by a storage provider, and the height is notuint.MaxValue
, the storage can simply throw exceptions.These capabilities should enable us to quickly retrieve and debug historical blocks, and historical transactions.
Where in the software does this update applies to?
The text was updated successfully, but these errors were encountered: