Skip to content

Conversation

@yongkangc
Copy link
Member

@yongkangc yongkangc commented Oct 21, 2025

closes: #19177

This is a follow up from #19171 where we removed the cli args. here, we remove the inflight limits completely.

The core changes are instead of manually allocating task from a VecDeque, we make use of the unbounded crossbeam channel as queue to allocate tasks and perform backpressure.

@github-project-automation github-project-automation bot moved this to Backlog in Reth Tracker Oct 21, 2025
@mattsse mattsse added the C-perf A change motivated by improving speed, memory usage or disk footprint label Oct 21, 2025
@yongkangc yongkangc self-assigned this Oct 22, 2025
@yongkangc yongkangc changed the base branch from yk/fix-maxcc to main October 22, 2025 03:19
@yongkangc yongkangc added the A-engine Related to the engine implementation label Oct 22, 2025
@yongkangc yongkangc moved this from Backlog to In Progress in Reth Tracker Oct 22, 2025
@yongkangc yongkangc added the S-needs-benchmark This set of changes needs performance benchmarking to double-check that they help label Oct 22, 2025
@yongkangc yongkangc changed the title refactor: rm pending queue refactor: rm pending queue from MultiproofManager Oct 22, 2025
@yongkangc yongkangc marked this pull request as ready for review October 22, 2025 04:46
@yongkangc yongkangc requested a review from shekhirin October 22, 2025 04:46
@yongkangc yongkangc added this to the v1.9.0 milestone Oct 22, 2025
@yongkangc yongkangc changed the title refactor: rm pending queue from MultiproofManager perf: rm pending queue from MultiproofManager Oct 22, 2025
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.

lgtm, we need this anyway for #19183

chunks += 1;
};

if should_chunk && let Some(chunk_size) = self.chunk_size {
Copy link
Collaborator

Choose a reason for hiding this comment

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

leaving a comment to not forget to need to fix this, because now we always chunk even if all workers are busy

@yongkangc
Copy link
Member Author

yongkangc commented Oct 22, 2025

  • Use the number of idle workers to calculate a dynamic chunk size instead of hardcoding one.
    another possible one that we should do (possibly with removal of pending queue
  • possibly a simple benchmark for a start is find avaliable workers and use that to determine chunking logic using atomic

we should look into this for this PR

leaving a note (cc @shekhirin @mediocregopher @mattsse )

ref:
#19178 (comment)

@yongkangc
Copy link
Member Author

@mattsse @shekhirin @mediocregopher just added in a way for us to track avaliable worker and chunk if we have avaliable worker.

In the future we should prob go for dynamic logic but this is a simple one for now

- Introduced a counter for available workers to manage task processing.
- Updated multiproof spawning logic to utilize worker availability for chunking.
- Enhanced worker decrement/increment logic during task execution.
…ultiproof manager

- Eliminated the worker count variable and associated logic from the multiproof manager.
- Updated multiproof spawning to check for available account workers instead of a general worker count.
- Cleaned up related comments and code for clarity and maintainability.
- We no longer seed the counters with the worker count. In ProofWorkerHandle::new we switched to zero-initializing both atomics
- Added histograms for pending storage and account tasks in the MultiproofManager.
- Implemented methods in ProofWorkerHandle to retrieve the count of pending storage and account tasks.
- Updated multiproof processing logic to record these new metrics.
- Added recording of pending storage and account tasks in the MultiproofManager upon calculation completion.
- Enhanced metrics tracking to provide better insights into task management.
@yongkangc
Copy link
Member Author

yongkangc commented Oct 23, 2025

Benchmarks

Mainnet
latency_comparison

Performance Changes:
NewPayload Latency: -4.31%
FCU Latency: -3.36%
Total Latency: -4.29%
Gas/Second: +0.85%
Blocks/Second: +0.85%
Statistics:
Mean percent difference: -2.76%
Median percent difference: -3.77%
Standard deviation: 16.00%

Base:
image

Statistics:
Mean percent difference: -3.05%
Median percent difference: -4.26%
Standard deviation: 14.94%
Gas/s percent change: +3.58%
Performance Changes:
NewPayload Latency: -4.07%
FCU Latency: -3.20%
Total Latency: -4.06%
Gas/Second: +1.57%
Blocks/Second: +1.51%

@yongkangc yongkangc requested a review from shekhirin October 23, 2025 04:54
@yongkangc yongkangc added this pull request to the merge queue Oct 23, 2025
@yongkangc yongkangc moved this from In Progress to Done in Reth Tracker Oct 23, 2025
Merged via the queue into main with commit 4548209 Oct 23, 2025
40 of 41 checks passed
@yongkangc yongkangc deleted the yk/remove_pending branch October 23, 2025 07:34
@jenpaff jenpaff moved this from Done to Completed in Reth Tracker Oct 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-engine Related to the engine implementation C-perf A change motivated by improving speed, memory usage or disk footprint S-needs-benchmark This set of changes needs performance benchmarking to double-check that they help

Projects

Status: Completed

Development

Successfully merging this pull request may close these issues.

perf: remove pending queue for MultiproofManager

5 participants