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

feat(primitives): increase minimum pruning distance #4750

Merged
merged 8 commits into from
Sep 28, 2023

Conversation

shekhirin
Copy link
Collaborator

@shekhirin shekhirin commented Sep 23, 2023

/// Minimum distance from the tip necessary for the node to work correctly:
/// 1. Minimum 2 epochs (32 blocks per epoch) required to handle any reorg according to the
/// consensus protocol.
/// 2. Another 10k blocks to have a room for maneuver in case when things go wrong and a manual
/// unwind is required.
pub const MINIMUM_PRUNING_DISTANCE: u64 = 32 * 2 + 10_000;

@shekhirin shekhirin force-pushed the alexey/min-pruning-distance branch 2 times, most recently from 0845700 to 8fb1d25 Compare September 23, 2023 17:13
@codecov
Copy link

codecov bot commented Sep 23, 2023

Codecov Report

Merging #4750 (daa6002) into main (486b289) will increase coverage by 0.03%.
Report is 3 commits behind head on main.
The diff coverage is 100.00%.

Impacted file tree graph

Files Coverage Δ
bin/reth/src/args/pruning_args.rs 21.42% <ø> (ø)
crates/primitives/src/prune/mode.rs 96.39% <100.00%> (-0.04%) ⬇️
crates/primitives/src/prune/target.rs 59.09% <ø> (ø)
crates/prune/src/pruner.rs 78.37% <100.00%> (+0.39%) ⬆️
crates/stages/src/stages/index_account_history.rs 96.43% <100.00%> (ø)
crates/stages/src/stages/index_storage_history.rs 96.33% <100.00%> (ø)

... and 8 files with indirect coverage changes

Flag Coverage Δ
integration-tests 15.60% <0.00%> (-0.01%) ⬇️
unit-tests 62.75% <100.00%> (+0.03%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
reth binary 32.06% <ø> (ø)
blockchain tree 83.76% <ø> (ø)
pipeline 88.45% <100.00%> (ø)
storage (db) 73.29% <ø> (ø)
trie 94.48% <ø> (-0.04%) ⬇️
txpool 50.00% <ø> (+0.45%) ⬆️
networking 76.49% <ø> (+0.03%) ⬆️
rpc 57.79% <ø> (-0.03%) ⬇️
consensus 62.64% <ø> (ø)
revm 28.54% <ø> (ø)
payload builder 8.16% <ø> (ø)
primitives 85.29% <100.00%> (+<0.01%) ⬆️

@ghost
Copy link

ghost commented Sep 24, 2023

@shekhirin Is this a breaking change and thus we need to update our nodes?

@shekhirin
Copy link
Collaborator Author

@kaliubuntu0206 I think it's not, but we still need to test it.

The node should run just fine with new minimum pruning distance, and start persisting more blocks in database for the full node. As for the custom configured pruned node, this change may break the existing configuration, but shouldn't require a resync anyway.

@shekhirin shekhirin added C-enhancement New feature or request A-pruning Related to pruning or full node labels Sep 25, 2023
@shekhirin shekhirin marked this pull request as ready for review September 25, 2023 17:09
Copy link
Member

@onbjerg onbjerg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good to me! pending another review

@joshieDo
Copy link
Collaborator

joshieDo commented Sep 26, 2023

Can't select them in the PR, but there are a few comments in the docs saying that pruning distance is 128. should be changed or replaced with the actually const var, so we can change it in the future without changing the docs.

regex:
.*run.*128

@shekhirin
Copy link
Collaborator Author

testing on existing full node

@shekhirin shekhirin added this pull request to the merge queue Sep 28, 2023
Merged via the queue into main with commit 0adc856 Sep 28, 2023
23 checks passed
@shekhirin shekhirin deleted the alexey/min-pruning-distance branch September 28, 2023 18:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-pruning Related to pruning or full node C-enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants