Skip to content

feat(engine): include backpressure in reported persistence_wait, make wait-time mimic CL slot time#23308

Merged
mediocregopher merged 8 commits into
mainfrom
mediocregopher/persistence-wait-backpressure
Apr 1, 2026
Merged

feat(engine): include backpressure in reported persistence_wait, make wait-time mimic CL slot time#23308
mediocregopher merged 8 commits into
mainfrom
mediocregopher/persistence-wait-backpressure

Conversation

@mediocregopher
Copy link
Copy Markdown
Member

@mediocregopher mediocregopher commented Mar 31, 2026

  • persistence_wait_us now always reports the total time spent waiting on persistence: channel queuing time from backpressure plus any explicit wait-for-persistence wait.

  • persistence_wait_us is no longer optional — it is always populated even when wait-for-persistence is not requested.

  • reth_newPayload and wait-for-persistence toggles are removed from the bench GitHub workflow, always using reth_newPayload and relying on backpressure for persistence timing.

  • wait-time in reth-bench now controls the interval between nP submissions excluding validation time, mimicking a CL slot time. If nP does not complete within the wait-time then the next nP is submitted immediately.

…_wait

persistence_wait_us now always reports the total time spent waiting on
persistence: channel queuing time from backpressure plus any explicit
wait-for-persistence wait. An enqueued_at timestamp is recorded when the
RethNewPayload message is sent and used to measure backpressure delay
when the message is dequeued.

The field is no longer optional — it is always populated even when
wait-for-persistence is not requested.

Also removes the reth_newPayload and wait-for-persistence toggles from
the bench GitHub workflow, always using reth_newPayload and relying on
backpressure for persistence timing.

Amp-Thread-ID: https://ampcode.com/threads/T-019d4438-f509-7388-b646-59af336c6ca1
Co-authored-by: Amp <amp@ampcode.com>
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 31, 2026

✅ Changelog found on PR.

Edit changelog

@decofe
Copy link
Copy Markdown
Member

decofe commented Mar 31, 2026

cc @mediocregopher

⚠️ Benchmark cancelled. View logs

@decofe
Copy link
Copy Markdown
Member

decofe commented Mar 31, 2026

cc @mediocregopher

✅ Benchmark complete! View job

Benchmark Results

Metric mediocregopher/persistence-wait-backpressure mediocregopher/persistence-wait-backpressure Change
Mean 1177.91ms 1175.81ms -0.18% ⚪ (±0.36%)
StdDev 367.25ms 364.52ms
P50 1093.95ms 1088.40ms -0.51% ⚪ (±1.35%)
P90 1788.75ms 1766.60ms -1.24% ⚪ (±2.50%)
P99 2131.95ms 2113.75ms -0.85% ⚪ (±2.14%)
Mgas/s 948.46 949.00 +0.06% ⚪ (±0.32%)
Wall Clock 118.93s 118.75s -0.15% ⚪ (±0.36%)

100 big blocks

Wait Time Breakdown

Persistence Wait

Metric mediocregopher/persistence-wait-backpressure mediocregopher/persistence-wait-backpressure
Mean 0.06ms 0.10ms
P50 0.05ms 0.05ms
P95 0.08ms 0.08ms

Trie Cache Update Wait

Metric mediocregopher/persistence-wait-backpressure mediocregopher/persistence-wait-backpressure
Mean 0.00ms 0.00ms
P50 0.00ms 0.00ms
P95 0.00ms 0.00ms

Execution Cache Update Wait

Metric mediocregopher/persistence-wait-backpressure mediocregopher/persistence-wait-backpressure
Mean 0.00ms 0.00ms
P50 0.00ms 0.00ms
P95 0.00ms 0.00ms

Grafana Dashboard

Charts

Latency, Throughput & Diff

Latency, Throughput & Diff

Wait Time Breakdown

Wait Time Breakdown

Gas vs Latency

Gas vs Latency

Grafana Dashboard

View real-time metrics

mediocregopher and others added 2 commits April 1, 2026 09:41
Sleep only the remaining time after block processing to fill the slot,
so blocks are submitted at a fixed interval regardless of validation
time. If validation exceeds the interval, the next block is submitted
immediately.

Amp-Thread-ID: https://ampcode.com/threads/T-019d4438-f509-7388-b646-59af336c6ca1
Co-authored-by: Amp <amp@ampcode.com>
@decofe
Copy link
Copy Markdown
Member

decofe commented Apr 1, 2026

cc @mediocregopher

✅ Benchmark complete! View job

Benchmark Results

Metric mediocregopher/persistence-wait-backpressure mediocregopher/persistence-wait-backpressure Change
Mean 27.81ms 27.79ms -0.08% ⚪ (±0.74%)
StdDev 10.56ms 10.21ms
P50 25.35ms 26.09ms +2.90% ⚪ (±3.24%)
P90 41.59ms 39.83ms -4.25% ⚪ (±4.51%)
P99 76.97ms 76.74ms -0.30% ⚪ (±2.48%)
Mgas/s 1097.52 1091.89 -0.51% ⚪ (±0.91%)
Wall Clock 2.85s 2.85s -0.02% ⚪ (±0.78%)

100 blocks

Wait Time Breakdown

Persistence Wait

Metric mediocregopher/persistence-wait-backpressure mediocregopher/persistence-wait-backpressure
Mean 0.10ms 0.10ms
P50 0.11ms 0.11ms
P95 0.17ms 0.14ms

Trie Cache Update Wait

Metric mediocregopher/persistence-wait-backpressure mediocregopher/persistence-wait-backpressure
Mean 0.00ms 0.00ms
P50 0.00ms 0.00ms
P95 0.00ms 0.00ms

Execution Cache Update Wait

Metric mediocregopher/persistence-wait-backpressure mediocregopher/persistence-wait-backpressure
Mean 0.00ms 0.00ms
P50 0.00ms 0.00ms
P95 0.00ms 0.00ms

Grafana Dashboard

Charts

Latency, Throughput & Diff

Latency, Throughput & Diff

Wait Time Breakdown

Wait Time Breakdown

Gas vs Latency

Gas vs Latency

Grafana Dashboard

View real-time metrics

@decofe
Copy link
Copy Markdown
Member

decofe commented Apr 1, 2026

cc @mediocregopher

✅ Benchmark complete! View job

Benchmark Results

Metric mediocregopher/persistence-wait-backpressure mediocregopher/persistence-wait-backpressure Change
Mean 1235.30ms 1224.12ms -0.90% ⚪ (±1.58%)
StdDev 444.36ms 447.63ms
P50 1109.35ms 1111.46ms +0.19% ⚪ (±3.29%)
P90 1924.30ms 1898.39ms -1.35% ⚪ (±6.81%)
P99 2528.87ms 2574.56ms +1.81% ⚪ (±9.40%)
Mgas/s 925.01 933.78 +0.95% ⚪ (±1.08%)
Wall Clock 124.70s 123.58s -0.90% ⚪ (±1.58%)

100 big blocks

Wait Time Breakdown

Persistence Wait

Metric mediocregopher/persistence-wait-backpressure mediocregopher/persistence-wait-backpressure
Mean 0.08ms 0.11ms
P50 0.07ms 0.07ms
P95 0.10ms 0.12ms

Trie Cache Update Wait

Metric mediocregopher/persistence-wait-backpressure mediocregopher/persistence-wait-backpressure
Mean 0.00ms 0.00ms
P50 0.00ms 0.00ms
P95 0.00ms 0.00ms

Execution Cache Update Wait

Metric mediocregopher/persistence-wait-backpressure mediocregopher/persistence-wait-backpressure
Mean 0.00ms 0.00ms
P50 0.00ms 0.00ms
P95 0.00ms 0.00ms

Grafana Dashboard

Charts

Latency, Throughput & Diff

Latency, Throughput & Diff

Wait Time Breakdown

Wait Time Breakdown

Gas vs Latency

Gas vs Latency

Grafana Dashboard

View real-time metrics

Add wait_time to the summary JSON dict so it's available to all
renderers. Displayed in the PR comment (via generate_markdown),
the GitHub Actions job summary (via blocksLabel), and the Slack
notification.

Amp-Thread-ID: https://ampcode.com/threads/T-019d4438-f509-7388-b646-59af336c6ca1
Co-authored-by: Amp <amp@ampcode.com>
@decofe
Copy link
Copy Markdown
Member

decofe commented Apr 1, 2026

cc @mediocregopher

✅ Benchmark complete! View job

Benchmark Results

Wait time: 100ms

Metric mediocregopher/persistence-wait-backpressure mediocregopher/persistence-wait-backpressure Change
Mean 23.97ms 23.88ms -0.36% ⚪ (±1.11%)
StdDev 12.96ms 13.05ms
P50 21.38ms 21.46ms +0.42% ⚪ (±2.36%)
P90 39.78ms 39.08ms -1.77% ⚪ (±6.00%)
P99 74.49ms 76.20ms +2.30% ⚪ (±8.31%)
Mgas/s 1334.50 1337.11 +0.20% ⚪ (±0.95%)
Wall Clock 12.42s 12.36s -0.47% ⚪ (±1.14%)

500 blocks

Wait Time Breakdown

Persistence Wait

Metric mediocregopher/persistence-wait-backpressure mediocregopher/persistence-wait-backpressure
Mean 0.09ms 0.09ms
P50 0.07ms 0.07ms
P95 0.12ms 0.12ms

Trie Cache Update Wait

Metric mediocregopher/persistence-wait-backpressure mediocregopher/persistence-wait-backpressure
Mean 0.00ms 0.00ms
P50 0.00ms 0.00ms
P95 0.00ms 0.00ms

Execution Cache Update Wait

Metric mediocregopher/persistence-wait-backpressure mediocregopher/persistence-wait-backpressure
Mean 0.00ms 0.00ms
P50 0.00ms 0.00ms
P95 0.00ms 0.00ms

Grafana Dashboard

Charts

Latency, Throughput & Diff

Latency, Throughput & Diff

Wait Time Breakdown

Wait Time Breakdown

Gas vs Latency

Gas vs Latency

Grafana Dashboard

View real-time metrics

The metadata line below the comparison table now shows warmup blocks
and wait-time alongside the block count, matching the job summary
format. Both values are also stored in summary.json for use by the
job summary and Slack notification renderers.

Amp-Thread-ID: https://ampcode.com/threads/T-019d4438-f509-7388-b646-59af336c6ca1
Co-authored-by: Amp <amp@ampcode.com>
@decofe
Copy link
Copy Markdown
Member

decofe commented Apr 1, 2026

cc @mediocregopher

✅ Benchmark complete! View job

Benchmark Results

Metric mediocregopher/persistence-wait-backpressure mediocregopher/persistence-wait-backpressure Change
Mean 1222.77ms 1224.11ms +0.11% ⚪ (±2.25%)
StdDev 275.53ms 253.57ms
P50 1203.52ms 1222.77ms +1.60% ⚪ (±6.86%)
P90 1699.82ms 1664.08ms -2.10% ✅ (±1.54%)
P99 1699.82ms 1664.08ms -2.10% ✅ (±1.54%)
Mgas/s 872.81 866.17 -0.76% ⚪ (±2.30%)
Wall Clock 12.30s 12.32s +0.11% ⚪ (±2.24%)

10 big blocks, 10 warmup, wait time: 10ms

Wait Time Breakdown

Persistence Wait

Metric mediocregopher/persistence-wait-backpressure mediocregopher/persistence-wait-backpressure
Mean 0.05ms 0.06ms
P50 0.05ms 0.06ms
P95 0.08ms 0.10ms

Trie Cache Update Wait

Metric mediocregopher/persistence-wait-backpressure mediocregopher/persistence-wait-backpressure
Mean 0.00ms 0.00ms
P50 0.00ms 0.00ms
P95 0.00ms 0.00ms

Execution Cache Update Wait

Metric mediocregopher/persistence-wait-backpressure mediocregopher/persistence-wait-backpressure
Mean 0.00ms 0.00ms
P50 0.00ms 0.00ms
P95 0.00ms 0.00ms

Grafana Dashboard

Charts

Latency, Throughput & Diff

Latency, Throughput & Diff

Wait Time Breakdown

Wait Time Breakdown

Gas vs Latency

Gas vs Latency

Grafana Dashboard

View real-time metrics

@mediocregopher mediocregopher changed the title feat(engine): report backpressure time in reth_newPayload persistence_wait feat(engine): include backpressure in reported persistence_wait, make wait-time mimic CL slot time Apr 1, 2026
@mediocregopher mediocregopher self-assigned this Apr 1, 2026
@mediocregopher mediocregopher requested a review from pepyakin April 1, 2026 11:32
@mediocregopher mediocregopher marked this pull request as ready for review April 1, 2026 11:33
mediocregopher and others added 2 commits April 1, 2026 11:35
…tence-wait-backpressure

Amp-Thread-ID: https://ampcode.com/threads/T-019d4438-f509-7388-b646-59af336c6ca1
Co-authored-by: Amp <amp@ampcode.com>

# Conflicts:
#	.github/scripts/bench-reth-run.sh
@decofe
Copy link
Copy Markdown
Member

decofe commented Apr 1, 2026

cc @mediocregopher

✅ Benchmark complete! View job

Benchmark Results

Metric mediocregopher/persistence-wait-backpressure mediocregopher/persistence-wait-backpressure Change
Mean 1353.51ms 1350.58ms -0.22% ⚪ (±0.77%)
StdDev 372.58ms 375.40ms
P50 1293.66ms 1279.42ms -1.10% ⚪ (±3.10%)
P90 2052.38ms 2047.31ms -0.25% ⚪ (±1.80%)
P99 2148.74ms 2179.12ms +1.41% ⚪ (±1.55%)
Mgas/s 807.67 809.98 +0.29% ⚪ (±0.75%)
Wall Clock 27.25s 27.19s -0.21% ⚪ (±0.75%)

20 big blocks, 10 warmup, wait time: 100ms

Wait Time Breakdown

Persistence Wait

Metric mediocregopher/persistence-wait-backpressure mediocregopher/persistence-wait-backpressure
Mean 0.07ms 0.08ms
P50 0.07ms 0.08ms
P95 0.11ms 0.11ms

Trie Cache Update Wait

Metric mediocregopher/persistence-wait-backpressure mediocregopher/persistence-wait-backpressure
Mean 0.00ms 0.00ms
P50 0.00ms 0.00ms
P95 0.00ms 0.00ms

Execution Cache Update Wait

Metric mediocregopher/persistence-wait-backpressure mediocregopher/persistence-wait-backpressure
Mean 0.00ms 0.00ms
P50 0.00ms 0.00ms
P95 0.00ms 0.00ms

Grafana Dashboard

Charts

Latency, Throughput & Diff

Latency, Throughput & Diff

Wait Time Breakdown

Wait Time Breakdown

Gas vs Latency

Gas vs Latency

Grafana Dashboard

View real-time metrics

Copy link
Copy Markdown
Member

@pepyakin pepyakin left a comment

Choose a reason for hiding this comment

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

Looks sensible.

/// Time spent waiting on persistence in microseconds, including both time spent
/// queued due to persistence backpressure and, when requested, the explicit wait
/// for in-flight persistence to complete.
pub persistence_wait_us: u64,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nit: why not break it down/split into persistence / backpressure?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

seemed like a YAGNI situation, i think with backpressure we won't really need wait-for-persistence going forward, and this is less changes to the plumbing

@github-project-automation github-project-automation Bot moved this from Backlog to In Progress in Reth Tracker Apr 1, 2026
@mediocregopher mediocregopher added this pull request to the merge queue Apr 1, 2026
Merged via the queue into main with commit 0031445 Apr 1, 2026
38 checks passed
@mediocregopher mediocregopher deleted the mediocregopher/persistence-wait-backpressure branch April 1, 2026 13:44
@github-project-automation github-project-automation Bot moved this from In Progress to Done in Reth Tracker Apr 1, 2026
github-merge-queue Bot pushed a commit to tempoxyz/tempo that referenced this pull request Apr 3, 2026
Automated nightly update of reth dependencies from `paradigmxyz/reth`
main branch.

## Upstream reth changes


[`f8efc76...c82d435`](paradigmxyz/reth@f8efc76...c82d435)

🔗 Amp thread:
https://ampcode.com/threads/T-019d517e-981b-75fd-b3cf-8ad2455f38f6
**RPC**
- Remove `0x` prefix from `admin_peers` id and return keccak256 node ID
in `admin_nodeInfo.id` to match go-ethereum format
([#23318](paradigmxyz/reth#23318),
[#23319](paradigmxyz/reth#23319))
- Apply count filter only after `after` is consumed in pagination
([#23338](paradigmxyz/reth#23338))
- Pre-allocate vectors in `eth_feeHistory`
([#23334](paradigmxyz/reth#23334))
- Add `bal` RPC methods
([#23330](paradigmxyz/reth#23330))

**Engine**
- Include backpressure in reported `persistence_wait`, make wait-time
mimic CL slot time
([#23308](paradigmxyz/reth#23308))

**Perf**
- Reduce cacheline ping-pong in workers availability
([#23321](paradigmxyz/reth#23321))

**Net**
- Avoid itertools `Format` panic in tracing log
([#23331](paradigmxyz/reth#23331))

**DB**
- Cap `storage_v2` unwind history by MDBX tip
([#23335](paradigmxyz/reth#23335))

**Bench**
- Add warmup step for big blocks mode
([#23323](paradigmxyz/reth#23323))
- Make payload handling ethereum-only
([#23324](paradigmxyz/reth#23324))
- Use repository instead of GitHub Actions cache to track hourly runs
([#23306](paradigmxyz/reth#23306))
- Upload nightly regression results to ClickHouse
([#23344](paradigmxyz/reth#23344))

**Chore**
- Migrate `allow(clippy::` to `expect(clippy::`
([#23340](paradigmxyz/reth#23340))
- Remove unused return value from `dispatch_with_chunking`
([#23341](paradigmxyz/reth#23341))
- Update nixpkgs to 25.11 and refresh flake inputs
([#23342](paradigmxyz/reth#23342))

## Migrations

🔗 Amp thread:
https://ampcode.com/threads/T-019d517e-baf0-727b-a57e-0488240af973
- **Reth dependency bump**: All `reth-*` git dependencies updated from
rev `f8efc76` to `c82d435`
- **New `GetBlockAccessList` trait impl**: `TempoEthApi` now implements
`GetBlockAccessList` (imported from `reth_rpc_eth_api::helpers::bal`),
likely a new required trait added upstream in the reth update

[GitHub
Workflow](https://github.com/tempoxyz/tempo/actions/runs/23933027282)

---------

Co-authored-by: Arsenii Kulikov <klkvrr@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants