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(pipeline): prune receipts based on log emitters #4044

Merged
merged 16 commits into from
Aug 16, 2023

Conversation

joshieDo
Copy link
Collaborator

@joshieDo joshieDo commented Aug 3, 2023

This allows us to only include the deposit contract receipts, alongside whatever the user chooses to keep (ref #2753) . (for pipeline only)

@joshieDo joshieDo added A-staged-sync Related to staged sync (pipelines and stages) A-pruning Related to pruning or full node labels Aug 3, 2023
@codecov
Copy link

codecov bot commented Aug 3, 2023

Codecov Report

Merging #4044 (8ea668b) into main (058c55c) will increase coverage by 0.01%.
The diff coverage is 78.43%.

Impacted file tree graph

Files Changed Coverage Δ
bin/reth/src/args/pruning_args.rs 20.00% <0.00%> (-2.23%) ⬇️
bin/reth/src/debug_cmd/execution.rs 1.15% <0.00%> (ø)
bin/reth/src/node/mod.rs 11.87% <0.00%> (-0.02%) ⬇️
crates/config/src/config.rs 64.65% <0.00%> (ø)
crates/primitives/src/lib.rs 100.00% <ø> (ø)
crates/primitives/src/prune/mod.rs 50.00% <50.00%> (ø)
crates/storage/provider/src/post_state/mod.rs 95.00% <56.66%> (-0.75%) ⬇️
crates/primitives/src/prune/target.rs 59.09% <60.00%> (-1.44%) ⬇️
crates/primitives/src/prune/mode.rs 97.24% <97.64%> (+1.41%) ⬆️
crates/primitives/src/prune/part.rs 100.00% <100.00%> (+25.00%) ⬆️
... and 2 more

... and 9 files with indirect coverage changes

Flag Coverage Δ
integration-tests 16.89% <0.00%> (-0.03%) ⬇️
unit-tests 63.95% <78.43%> (+0.01%) ⬆️

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

Components Coverage Δ
reth binary 25.37% <0.00%> (-0.01%) ⬇️
blockchain tree 83.04% <ø> (ø)
pipeline 90.07% <100.00%> (ø)
storage (db) 74.57% <56.66%> (-0.06%) ⬇️
trie 94.71% <ø> (ø)
txpool 48.16% <ø> (-0.03%) ⬇️
networking 77.40% <ø> (ø)
rpc 58.66% <ø> (-0.04%) ⬇️
consensus 63.76% <ø> (ø)
revm 32.26% <ø> (ø)
payload builder 6.57% <ø> (ø)
primitives 87.81% <88.07%> (+0.04%) ⬆️

@joshieDo joshieDo marked this pull request as ready for review August 3, 2023 15:58
@joshieDo joshieDo marked this pull request as draft August 3, 2023 16:01
@joshieDo joshieDo marked this pull request as ready for review August 3, 2023 16:05
@joshieDo joshieDo requested a review from mattsse August 3, 2023 17:21
@joshieDo joshieDo added the M-changelog This change should be included in the changelog label Aug 3, 2023
crates/primitives/src/prune/mod.rs Show resolved Hide resolved
crates/primitives/src/prune/part.rs Outdated Show resolved Hide resolved
crates/storage/provider/src/post_state/mod.rs Outdated Show resolved Hide resolved
crates/primitives/src/prune/mod.rs Outdated Show resolved Hide resolved
Copy link
Collaborator

@mattsse mattsse left a comment

Choose a reason for hiding this comment

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

nit and question re format

crates/primitives/src/prune/mod.rs Outdated Show resolved Hide resolved
crates/primitives/src/prune/mod.rs Outdated Show resolved Hide resolved
Comment on lines +20 to +25
pub fn prune_target_block(
&self,
tip: BlockNumber,
min_blocks: u64,
prune_part: PrunePart,
) -> Result<Option<(BlockNumber, PruneMode)>, PrunePartError> {
Copy link
Collaborator

Choose a reason for hiding this comment

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

can we add a sanity test for this, code looks correct afaict, just to be sure

crates/primitives/src/prune/mode.rs Outdated Show resolved Hide resolved
Copy link
Collaborator

@shekhirin shekhirin left a comment

Choose a reason for hiding this comment

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

LGTM modulo Matt's comments

crates/primitives/src/prune/mod.rs Outdated Show resolved Hide resolved
crates/primitives/src/prune/mod.rs Show resolved Hide resolved
@joshieDo
Copy link
Collaborator Author

joshieDo commented Aug 4, 2023

testing on sepolia by including only receipts from the deposit contract and another random contract

@joshieDo
Copy link
Collaborator Author

joshieDo commented Aug 9, 2023

worked fine. receipt table ended the pipeline with ~15MB keeping all receipts from the last 128 blocks, and further only the ones (2 contracts) that were present in the configuration

Copy link
Collaborator

@mattsse mattsse left a comment

Choose a reason for hiding this comment

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

tests look good,

lgtm

@joshieDo joshieDo added this pull request to the merge queue Aug 16, 2023
Merged via the queue into main with commit 8a2c3ab Aug 16, 2023
24 checks passed
@joshieDo joshieDo deleted the joshie/pipeline-receipt-log-prune branch August 16, 2023 16:52
alessandromazza98 pushed a commit to alessandromazza98/reth that referenced this pull request Aug 19, 2023
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 A-staged-sync Related to staged sync (pipelines and stages) M-changelog This change should be included in the changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants