Skip to content

Conversation

@shekhirin
Copy link
Collaborator

@shekhirin shekhirin commented Nov 10, 2025

Fixes #19621

This PR returns the previously removed receipts log filter pruning, but makes it work only with Full and Before prune modes. Most of the changes are reverted from #19184.

We're returning it, because some stakers depend on having receipts from certain staking protocols, and they don't want to store all 300GB+ of receipts on Mainnet.

We don't have Distance prune mode for this segment anymore because it's not useful for the type of pruning stakers do, and for us to support it, we would need to add a prune segment back. Full and Before modes work without a separate pruning segment, writing only specific receipts at the time of persisting.

@shekhirin shekhirin added C-enhancement New feature or request A-db Related to the database A-pruning Related to pruning or full node labels Nov 10, 2025
@github-project-automation github-project-automation bot moved this to Backlog in Reth Tracker Nov 10, 2025
@codspeed-hq
Copy link

codspeed-hq bot commented Nov 10, 2025

CodSpeed Performance Report

Merging #19630 will improve performances by 33.22%

Comparing alexey/receipts-log-filter-is-back (d5fc327) with main (4621456)

Summary

⚡ 1 improvement
✅ 80 untouched

Benchmarks breakdown

Benchmark BASE HEAD Change
remove_leaf[1000] 270.2 µs 202.8 µs +33.22%

@shekhirin shekhirin force-pushed the alexey/receipts-log-filter-is-back branch from a83211e to b64b8ad Compare November 10, 2025 15:42
@shekhirin shekhirin force-pushed the alexey/receipts-log-filter-is-back branch from b64b8ad to 39c1f0e Compare November 10, 2025 15:45
@shekhirin shekhirin force-pushed the alexey/receipts-log-filter-is-back branch from af63c54 to 2d9300f Compare November 10, 2025 16:45
@shekhirin shekhirin force-pushed the alexey/receipts-log-filter-is-back branch from a928c07 to 5256e00 Compare November 10, 2025 17:25
@shekhirin shekhirin marked this pull request as ready for review November 10, 2025 22:39
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.

a few nits

definitely need @joshieDo to review as well and need to take a look at the previous pr

Comment on lines 21 to 26
#[derive(Debug, EnumIs)]
#[allow(missing_docs)]
pub enum EitherWriterDestination {
Database,
StaticFile,
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

this type is out of order

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

done

}

impl EitherWriter<'_, (), ()> {
/// Returns the destination for writing receipts.
Copy link
Collaborator

Choose a reason for hiding this comment

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

this needs docs about what the rules are here

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

done

#[error("the configuration provided for {0} is invalid")]
Configuration(PruneSegment),
/// Unsupported receipts log filter prune mode for address.
#[error("distance prune mode is not supported for receipts log filter, check address {0}")]
Copy link
Collaborator

Choose a reason for hiding this comment

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

what should be checked here with the address?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

fixed

Copy link
Collaborator

Choose a reason for hiding this comment

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

is this what we had previously?

can we reference the previous pr in the pr description?

@github-project-automation github-project-automation bot moved this from Backlog to In Progress in Reth Tracker Nov 10, 2025
@shekhirin shekhirin force-pushed the alexey/receipts-log-filter-is-back branch from e0b9e21 to e679fbd Compare November 10, 2025 23:18
@shekhirin shekhirin requested a review from mattsse November 10, 2025 23:18
Comment on lines 83 to 84
@@ -84,2 +83,2 @@
.segment_opt(receipts.map(UserReceipts::new))
Copy link
Collaborator

Choose a reason for hiding this comment

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

do we no longer need the following?

           // Receipts by logs
            .segment_opt(
                (!receipts_log_filter.is_empty())
                    .then(|| ReceiptsByLogs::new(receipts_log_filter.clone())),
            )

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

nope, because we don't have a prune segment anymore! Pruning for receipts log filter is now handled at the time of writing.

Copy link
Collaborator

@joshieDo joshieDo Nov 10, 2025

Choose a reason for hiding this comment

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

dont we follow the MINIMUM_PRUNING_DISTANCE "rule", so we do need the pruner to remove the other receipts once its out of that range no?

@shekhirin shekhirin marked this pull request as draft November 10, 2025 23:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-db Related to the database A-pruning Related to pruning or full node C-enhancement New feature or request

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

v1.9.1 crashes immediately on Hoodi

4 participants