-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
[Feature] Support historical logging for delegated
, bonded, and
unbonding` mappings.
#2493
[Feature] Support historical logging for delegated
, bonded, and
unbonding` mappings.
#2493
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
As for CI (thx for pushing this already!):
Can you also push a clippy fix? I assume maybe a new Rust version came out.
Can you also run the synthesizer tests locally to double check they pass?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. We use a tool that uses a similar mechanism that captures the raw binary values of all mappings and they are quite compact (under 4-16KB per block)
Do you have opinions on whether the data should be stored as raw JSON strings or as bytes? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See comment above. LGTM based on internal CI passing and prior reviews both inside and outside of Provable
I just saw this and I'd highly recommend anyone who use this to store the jsons in a fs that supports compression, since with a busy network those data could get huge really fast. Had to manually implement a similar function to debug my explorer before. Also one of the reasons I don't keep a whole history of bonded and deletaged mappings - they are really huge on a live network. |
This PR supports historical logging for the
delegated
,bonded
, andunbonding
mappings incredits.aleo
.If the
history
feature is enabled, the VM will store the above mappings as JSON to a set local directory (the same directory as the.ledger
).This data is stored and updated as follows:
.history*
directory is created at the storage path.i
is added to the ledger, a subdirectoryblock-<i>
is created containing:block-<i>-delegated.json
,block-<i>-bonded.json
, andblock-<i>-unbonding.json
.Pruning and management of the
.history
directory is left to the node runner.Note. The entirety of this PR is gated under the
history
feature.CI passed mostly here. The failing tests are succeeding locally and unrelated to this PR.