Skip to content
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 request: ability to prune the old ancient blockchain data #718

Closed
jsvisa opened this issue Feb 3, 2023 · 21 comments
Closed

Feature request: ability to prune the old ancient blockchain data #718

jsvisa opened this issue Feb 3, 2023 · 21 comments
Assignees
Labels

Comments

@jsvisa
Copy link
Contributor

jsvisa commented Feb 3, 2023

Rationale

I'm running a new snap-sync node, downloading a fresh snapshot from https://snapshots.matic.today, after the syncing progress, found the local chaindata consuming 1.1/1.6TB are the ancient data, used toooomuch disk:

$  du --max-depth=1 -h bor/chaindata/
1.1T    bor/chaindata/ancient
1.6T    bor/chaindata/

The old ancient data is useless in most cases, so if we support the ancient data pruning, we can use fewer disks.

Implementation

Seems the binance smartchain has supported this feature(merged in #543) maybe we can backport this feature into go-ethereum.

$ ./bin/bsc snapshot prune-block --help
prune-block [command options]

geth offline prune-block for block data in ancientdb.
The amount of blocks expected for remaining after prune can be specified via block-amount-reserved in this command,
will prune and only remain the specified amount of old block data in ancientdb.
the brief workflow is to backup the the number of this specified amount blocks backward in original ancientdb
into new ancient_backup, then delete the original ancientdb dir and rename the ancient_backup to original one for replacement,
finally assemble the statedb and new ancientDb together.
The purpose of doing it is because the block data will be moved into the ancient store when it
becomes old enough(exceed the Threshold 90000), the disk usage will be very large over time, and is occupied mainly by ancientDb,
so it's very necessary to do block data prune, this feature will handle it.


ETHEREUM OPTIONS:
                                      --datadir value                       Data directory for the databases and keystore (default: "/home/amber/.ethereum")
                                      --datadir.ancient value               Data directory for ancient chain segments (default = inside chaindata, '${datadir}/geth/chaindata/ancient/')
                                      --block-amount-reserved value         Sets the expected remained amount of blocks for offline block prune (default: 0)
                                      --triesInMemory value                 The layer of tries trees that keep in memory (default: 128)
                                      --check-snapshot-with-mpt             Enable checking between snapshot and MPT
@github-actions
Copy link

This issue is stale because it has been open 14 days with no activity. Remove stale label or comment or this will be closed in 14 days.

@github-actions github-actions bot added the Stale label Feb 18, 2023
@manav2401
Copy link
Contributor

Hi, pruning is available as a sub command of the new bor cli with bor version v0.3.3. Please refer to the this post for more info (specifically the change log part). Hope this helps.

Also, just fyi, we don't support snap sync yet as it doesn't work out of the box for polygon mainnet. You might want to run it on a full sync node.

@github-actions github-actions bot removed the Stale label Feb 23, 2023
@petejkim
Copy link

petejkim commented Feb 23, 2023

@manav2401 this is different though. geth/bor's pruning is stale state pruning, this is ancient block pruning.

@jsvisa +1, would love to see this (ideally with EIP-4444) implemented in bor

@jsvisa
Copy link
Contributor Author

jsvisa commented Feb 23, 2023

@petejkim Sorry, this not fully EIP-4444, it will prune the old historical data only, and not handle the p2p issues.

@petejkim
Copy link

Yep, which is why I said "ideally"...because I'd like to see it happen.

@0x090909
Copy link

0x090909 commented Mar 6, 2023

yeah Im also looking for that, lets make it happen

@github-actions
Copy link

This issue is stale because it has been open 14 days with no activity. Remove stale label or comment or this will be closed in 14 days.

@github-actions github-actions bot added the Stale label Mar 21, 2023
@temaniarpit27 temaniarpit27 self-assigned this Mar 23, 2023
@github-actions
Copy link

github-actions bot commented Apr 7, 2023

This issue is stale because it has been open 14 days with no activity. Remove stale label or comment or this will be closed in 14 days.

@github-actions github-actions bot added the Stale label Apr 7, 2023
@jsvisa
Copy link
Contributor Author

jsvisa commented Apr 7, 2023

/ping

@temaniarpit27
Copy link
Contributor

Hi @jsvisa
The team is currently working on a few high-priority releases, and we couldn't take this up.
We will definitely try to look into this soon (I don't have a timeline though, maybe the later half of this month). Thanks for keeping your patience.

@kmalloc
Copy link

kmalloc commented Apr 17, 2023

just have the feeling that this is going to take years to get it working.

@temaniarpit27
Copy link
Contributor

@kmalloc I understand your concerns but I want you to know that we will take this up soon depending on availability. The team is working on some prior commitments.

@pratikspatil024 pratikspatil024 linked a pull request Apr 27, 2023 that will close this issue
16 tasks
@github-actions
Copy link

This issue is stale because it has been open 14 days with no activity. Remove stale label or comment or this will be closed in 14 days.

@github-actions
Copy link

This issue is stale because it has been open 14 days with no activity. Remove stale label or comment or this will be closed in 14 days.

@github-actions
Copy link

This issue is stale because it has been open 14 days with no activity. Remove stale label or comment or this will be closed in 14 days.

@github-actions
Copy link

This issue is stale because it has been open 14 days with no activity. Remove stale label or comment or this will be closed in 14 days.

@github-actions
Copy link

This issue is stale because it has been open 14 days with no activity. Remove stale label or comment or this will be closed in 14 days.

@github-actions
Copy link

This issue is stale because it has been open 14 days with no activity. Remove stale label or comment or this will be closed in 14 days.

@github-actions
Copy link

This issue is stale because it has been open 14 days with no activity. Remove stale label or comment or this will be closed in 14 days.

@github-actions
Copy link

This issue is stale because it has been open 14 days with no activity. Remove stale label or comment or this will be closed in 14 days.

@github-actions github-actions bot added the Stale label Aug 31, 2023
@github-actions
Copy link

This issue was closed because it has been stalled for 28 days with no activity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants