-
Notifications
You must be signed in to change notification settings - Fork 491
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: ancient blockchain pruner #751
Conversation
Is it cherry-picking from BSC repository? If it is we need to check licences. |
@JekaMas Yes, most of the code are cherry-picked from bsc, mainly those PR: |
I'll test this feature in our infra for a while, and after that will make this pr as ready. |
It's ready for review, it's there anyone who can help to review this PR, thanks. |
Hi @jsvisa , thanks for raising the PR! We haven't had the bandwidth to review but we shall soon. |
Any news? is this a working feature in the PR repository? |
If you also need this feature, you can try this branch https://github.com/jsvisa/bor/tree/block-pruner |
Hey man yes I need it, I tried to use it, but unfortunatelly after I do prune the ancient blocks, my snapshot kinda gets screwed up and then the ancient directory is eliminated completely. Afterwards if I try to start the node, bor gives an error: says please specify the correct ancient directory since it has been moved. Can you provide exact command you used with your snapshot? I used the following:
Also I noticed, if I use |
No, you can't rename the binary name, else the directory will be misused. (just naming as one more thing, after you prune the old ancient, you also need to run the node with the patched bor binary. good luck. |
Okay thank you, Ill try again. |
@jsvisa Hey man it works! |
yeah, this is a design from go-ethereum |
Signed-off-by: Delweng <delweng@gmail.com>
Signed-off-by: Delweng <delweng@gmail.com>
Signed-off-by: Delweng <delweng@gmail.com>
Signed-off-by: Delweng <delweng@gmail.com>
Signed-off-by: Delweng <delweng@gmail.com>
Signed-off-by: Delweng <delweng@gmail.com>
Signed-off-by: Delweng <delweng@gmail.com>
Signed-off-by: Delweng <delweng@gmail.com>
Signed-off-by: Delweng <delweng@gmail.com>
Signed-off-by: Delweng <delweng@gmail.com>
Signed-off-by: Delweng <delweng@gmail.com>
…-chain/bsc#1005 Signed-off-by: Delweng <delweng@gmail.com>
Signed-off-by: Delweng <delweng@gmail.com>
Given that this obviously useful feature has been dragging out for a year now, I'd like to add a datapoint to the argument of data availability. Right now, there is no data availability at all. I'm currently trying to sync a couple of tens of servers from your latest outdated snapshot, which is two month old, and the ETA just for 1.5 million blocks is between 80 and 270 hours, going up and down randomly. So this is in my opinion a very weak argument, it has been factually impossible to sync Polygon from scratch for a long time. As an aside, you might want to seriously get working on reducing further bloat, as an easy starting point, I'd suggest to finally remove the completely useless and long time deprecated LogFeeTransfer() event that is bloating the state for every single transaction. |
I might add, presuming to speak for all node operators, we have had it with your sloppy way of running this chain. BSC used to be the dog pile of blockchains, but they got their act together, while Polygon is bloating like crazy, taking ages to include useful features for node operators, doing sloppy merges and making life more difficult for everyone by mindlessly reformatting upstream code, deep reorging constantly, etc. Get your act together, or this will blow up soon. |
@kaber2 @0x090909, apologies for the long delay. We understand the concern of increased disk usage and are internally convinced for inclusion of this feature. We're waiting for the final governance call (as mentioned here) before merging this fully. Meanwhile, we'll make sure that the PR is updated with latest changes. Thanks! |
@kaber2 you can use their snapshots, work good and they update it daily. |
@manav2401 updates? |
Hi. Here is data for a sentry node that I pruned 45 days ago.
45 days later:
Conclusion: the disk usage can be reduced by 50% by pruning the whole database (including ancient) every 2 months. PS: Moving ancient to a cheaper storage may seem like a good idea but it is often impossible or complex. Not every server provider has it as a standard option to add a 4 TB HDD to the server. Configuring this over a network is probably possible but increases complexity in setting up a node. |
@vicmik I did try to store ancient in an external HDD, but unfortunatelly there are also storage issues and sometimes the db gets corrupted out of nowhere, while having the whole db on a NVME works always flawlessly |
I am using the branch jsvisa:block-pruner but the prune does not delete the data right ? It just move them to ancient folder (and compress). Am I missing something ? |
I'm rebasing the code to the last develop branch right now, maybe 1 or 2 days to finish it. |
Deleted comment with abusive / unprofessional language. @jsvisa thanks for your help with the rebase. We appreciate everyone's patience and attention to this issue. We will review priority asap. |
Hello everyone, the rebasing process was done, but my local env doesn't have a large SSD to store the matic mainnet data, does anyone interested to verify the |
I can do that later |
this is the version I have: go version go1.22.1 linux/amd64 |
I started the node and its syncing again, it worksss!!!! @jsvisa GREAT JOB!!!!!!!!1 |
Good job, Could you please paste the instructions below for others to follow up |
INSTRUCTIONS TO PRUNE ANCIENT DATA
|
@manav2401 @ssandeep when are you planning to merge? |
@0x090909 I will be merging this by end of this week. I will be testing this on internal nodes. Also, I am not sure how but a develop merge caused all the conflicts to reappear here. Will be fixing that. |
Hey folks, looks like the git history of this PR is corrupted and I can't seem to push a merge commit resolving conflicts to this branch. Hence, I have created a new PR with the same set of commits as in this PR instead. Please follow that going forward for updates and further discussion if any. Really appreciate everyone's help. Closing this for now. Thanks! |
Description
Implement historical blockchain data pruning #718
Changes
Breaking changes
Please complete this section if any breaking changes have been made, otherwise delete it
Nodes audience
In case this PR includes changes that must be applied only to a subset of nodes, please specify how you handled it (e.g. by adding a flag with a default value...)
Checklist
Cross repository changes
Testing
Manual tests
Please complete this section with the steps you performed if you ran manual tests for this functionality, otherwise delete it
Additional comments
Ancient Data Prune
A new tool is introduced to prune ancient undesired block data, it will discard block, receipt, header in the ancient db to save space.
Example:
./build/bin/bor snapshot prune-block -datadir ./node -check-snapshot-with-mpt -block-amount-reserved 4096