-
Notifications
You must be signed in to change notification settings - Fork 809
Client: purge history helper #3934
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
base: master
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
Is this true? I thought that opening a DB (we use LevelDB right?) can only be done by one process? |
Is this testable? Maybe on a synced client. |
Will test and get back on this. If that's true, than we should also revisit the If this turns out impossible (deleting from DB while client is running) than I may prefer to code this function (and the export history function) into the client itself, maybe as RPC methods. |
Right. Not sure that "unit test" is possible here. Testing on a live client will also expose other places in our code that need work for 4444 |
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.
I'm going to do some tests on this today now that client sync is working again.
Task related to #3931
Add utility function
purgeHistory
exported fromclient/src/util/purge.ts
This function will delete block bodies, receipts, and optionally headers from client DB.
Parameters:
mainnet
MERGE_BLOCK
)false
)purgeHistory
deletes directly from theDB
, and operates as an independent process from the client itself. Therefore, it can be run while the client is running or stopped.Block and Transaction indexing are left untouched. So
NumberToHash
, etc. will still be possible for deleted blocks.