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

fix(primitives): nothing to prune situations for PruneModes #4021

Merged
merged 2 commits into from
Aug 1, 2023

Conversation

shekhirin
Copy link
Collaborator

@shekhirin shekhirin commented Aug 1, 2023

If tip is less than the value in PruneMode::Distance or PruneMode::Before, there's nothing to prune yet and we should just return None from prune_target_block_* methods. Previously, we were crashing with configuration error.

@shekhirin shekhirin requested a review from joshieDo August 1, 2023 12:59
@shekhirin shekhirin marked this pull request as ready for review August 1, 2023 12:59
@shekhirin shekhirin requested a review from gakonst as a code owner August 1, 2023 12:59
@shekhirin shekhirin removed the request for review from gakonst August 1, 2023 12:59
@codecov
Copy link

codecov bot commented Aug 1, 2023

Codecov Report

Merging #4021 (3df29f0) into main (1249601) will decrease coverage by 0.02%.
The diff coverage is 22.22%.

Impacted file tree graph

Files Changed Coverage Δ
crates/primitives/src/prune/target.rs 60.52% <22.22%> (+8.14%) ⬆️

... and 9 files with indirect coverage changes

Flag Coverage Δ
integration-tests 16.52% <0.00%> (-0.02%) ⬇️
unit-tests 64.09% <22.22%> (-0.01%) ⬇️

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

Components Coverage Δ
reth binary 25.63% <ø> (ø)
blockchain tree 83.04% <ø> (ø)
pipeline 90.10% <ø> (ø)
storage (db) 74.30% <ø> (ø)
trie 94.70% <ø> (ø)
txpool 47.36% <ø> (ø)
networking 77.43% <ø> (-0.07%) ⬇️
rpc 58.23% <ø> (-0.04%) ⬇️
consensus 63.51% <ø> (ø)
revm 32.71% <ø> (ø)
payload builder 6.58% <ø> (ø)
primitives 88.00% <22.22%> (+0.05%) ⬆️

@@ -11,7 +11,7 @@ use serde::{Deserialize, Serialize};
pub struct PruneModes {
/// Sender Recovery pruning configuration.
// TODO(alexey): removing min blocks restriction is possible if we start calculating the senders
// dynamically on blockchain tree unwind.
// dynamically on blockchain tree unwind.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
// dynamically on blockchain tree unwind.
// dynamically on blockchain tree unwind.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

istg this change makes sense for my ide (excuse my light theme)

image image

@shekhirin shekhirin added this pull request to the merge queue Aug 1, 2023
Merged via the queue into main with commit 9430800 Aug 1, 2023
24 checks passed
@shekhirin shekhirin deleted the alexey/prune-mode-target-block branch August 1, 2023 14:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants