Skip to content

perf: Drain and aggregate PrefetchProofs / StateUpdate messages #19168

@yongkangc

Description

@yongkangc

Describe the feature

we should do similar thing here as we do in sparse trie updates

[https://github.com/paradigmxyz/reth/blob/e9598ba5ac4e32600e48b93d197a25603b1c644b/crates/engine/tree/src/tree/payload_processor/sparse_trie.rs#L[…]6](

num_iterations += 1;
let mut num_updates = 1;
while let Ok(next) = self.updates.try_recv() {
update.extend(next);
num_updates += 1;
}
)

basically drain the channel, aggregate everything, and then batch

Additional context

In MultiProofTask::run, mirror the sparse trie pattern
reth/crates/engine/tree/src/tree/payload_processor/sparse_trie.rs

by draining additional PrefetchProofs / StateUpdate messages with try_recv and merging their targets before handing them to the manager. Current handling without draining:

reth/crates/engine/tree/src/tree/payload_processor/multiproof.rs

Metadata

Metadata

Assignees

Labels

A-engineRelated to the engine implementationC-enhancementNew feature or requestC-perfA change motivated by improving speed, memory usage or disk footprint

Type

No type

Projects

Status

Backlog

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions