Skip to content

feat(sequencer): seal payloads on freeze notifications from execution layer (backport #6557 to v1.5.5) - #6567

Merged
haardikk21 merged 14 commits into
releases/v1.5.5from
fahim/backport-6557-v1.5.5
Nov 12, 2026
Merged

haardikk21 merged 14 commits into
releases/v1.5.5from
fahim/backport-6557-v1.5.5

Conversation

@fahimahmedx

@fahimahmedx fahimahmedx commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Backport of #6557 to releases/v1.5.5, matching it at b09a2ae. #6557 is still open against main, so this carries code that has not merged there yet.

When a Denim block finishes building, the execution layer notifies the consensus layer. This starts getPayload, conductor commit, and gossip immediately instead of waiting for the 150 ms seal deadline, so a searcher reacting to block B can land a transaction in block B+1 instead of B+2.

  • The 150 ms deadline remains the fallback if no usable notification arrives.
  • The next block still starts on its normal schedule.
  • This applies to unified sequencers; split EL/CL deployments are unchanged.

Metrics

Exported by the unified sequencer. Offsets are measured from the block's scheduled build start, which is its parent's timestamp.

Metric Type Labels What it shows
reth_base_node_sequencer_seals_total counter trigger: ready_hint, deadline Payloads fetched with getPayload, by what prompted the request. Hit rate is ready_hint / total.
reth_base_node_sequencer_get_payload_offset_seconds histogram trigger When getPayload was requested.
reth_base_node_sequencer_build_start_offset_seconds histogram none When the block's build was requested from the engine.
reth_base_node_sequencer_payload_ready_hints_dropped_total counter reason: already_sealing, inactive, no_build, payload_id_mismatch, parent_mismatch, pre_denim, lagged Hints that did not trigger a seal. already_sealing means the deadline fetched the payload first.
reth_base_builder_payload_ready_hints_sent_total counter result: delivered, no_receiver Hints the payload builder published.

Differences from #6557

This was not a clean cherry-pick. releases/v1.5.5 is 579 commits behind main, and four things the original relies on do not exist here:

  • Payload service. NativePayloadServiceBuilder is not on this branch; the sequencer runs MultiplexingServiceBuilder. The notification channel is wired through that instead. Only the basic (native) builder sends notifications, so they flow in cutover and basic-only modes and never for Flashblocks builds.
  • Engine transport. The in-process Engine API is not on this branch, so LaunchedBaseNode gains only payload_ready. The consensus layer still reaches the engine over IPC.
  • Fork check. The Denim check uses RollupConfig::is_denim_active in place of the feature API on main.
  • Slot start. The isolated-sequencer schedule delay is not on this branch, so metric offsets are measured from the parent's timestamp directly.

The sequencer actor change and its unit tests are otherwise the same as #6557. Both integration tests are ported to the multiplexed builder and the IPC engine. The in_memory_engine.rs cases from #6557 are dropped because that test file does not exist on this branch.

Testing

On this branch, at c2b8f78:

  • cargo +nightly fmt --all --check, cargo clippy --all-features --all-targets -- -D warnings on the six packages with code changes since the first push, etc/scripts/ci/check-crate-deps.sh, and the docs-index check.
  • base-consensus-node, base-execution-payload-builder, and base-node-runner with --all-features: 577 passed. This includes the 244 sequencer actor tests, with the early-seal and metrics cases.
  • crates/builder/multiplex/tests/payload_ready.rs: 3 passed. A Denim build signals once and a later transaction waits for the next block; replay and pre-Denim builds do not signal.
  • etc/systems/tests/early_broadcast.rs: 2 passed. With the notification a searcher's reaction lands in B+1; with the seal deadline alone it lands in B+2. Before the metrics commits it also passed 24 of 24 runs with eight copies running at once; that was not repeated.
  • base-builder-multiplex with --all-features: 16 passed, including in_process_smoke.

Two checks failed on releases/v1.5.5 independently of this change, and both also failed on #6522 when it merged. This PR fixes both:

CI System Tests passed at 33587d6 (138 tests), including early_broadcast. Not run: a devnet with conductor and P2P.

type=routine
risk=low
impact=sev5

@depot-code-access

depot-code-access Bot commented Nov 11, 2026 •

Copy link
Copy Markdown

✅ All benchmarks green — 14 within ±2% (deterministic instruction counts). View run

Benchmark details (14)
Benchmark Base (target) Head (this PR) Δ instructions
batch_queue/drain/drain_cached_span_batches 242,027 242,027 +0.0%
batch_transaction/encode_in_place/encode_in_place 4,199,759 4,199,759 +0.0%
batch_transaction/temporary_frame_buffers/temporary_frame_buffers 8,408,350 8,408,350 +0.0%
flashblock_decode/decode/brotli 3,296,484 3,296,484 +0.0%
flashblock_decode/decode/plain_json 2,280,194 2,280,194 +0.0%
flz/compress_len/real_contract_call 43,148 43,148 +0.0%
flz/compress_len/synthetic_0 38,205 38,205 +0.0%
flz/compress_len/synthetic_1 54,682 54,682 +0.0%
flz/compress_len/synthetic_2 147,976 147,976 +0.0%
flz/data_gas 43,059 43,059 +0.0%
flz/tx_estimated_size 43,056 43,056 +0.0%
frame_parse/decode/single_4kib 1,031 1,031 +0.0%
frame_parse/parse_frames/few_large 1,053,062 1,053,062 +0.0%
frame_parse/parse_frames/many_small 154,763 154,763 +0.0%

@depot-code-access

depot-code-access Bot commented Nov 11, 2026 •

Copy link
Copy Markdown

Base Std historical fork tests

Fork Result Passed Failed Skipped base/base base-anvil base-std
Beryl pass 616 0 13 5148a9d9 98e7839c 520d069b
Cobalt pass 725 0 14 5148a9d9 98e7839c bbfb352e
Denim pass 757 0 14 5148a9d9 98e7839c 7321d891

View run

@depot-code-access

depot-code-access Bot commented Nov 11, 2026 •

Copy link
Copy Markdown

Acceptance Tests: ✅ Passed

3/3 checks passed · Checks & reports

Acceptance report
  • smoke / chain-identity — passed: chain identity matched
    • Expected: 84538453
    • Observed: 84538453
  • smoke / production — passed: head advanced
    • Expected: {"minimum_blocks":3}
    • Observed: {"delta":3,"from":13,"last":16,"required_delta":3}
  • smoke / validator-converges — passed: heads converged on a common canonical block
    • Expected: {"common_height_hash":true,"max_lag_blocks":5}
    • Observed: {"common_height":16,"hash":"0xf7d47ccb801968f6ebd46a1a031084b3f517b8218b134ad0f40981c6841de20d","high":16,"lag":0,"low":16,"low_timestamp":1794473781,"maximum_lag":5,"minimum_timestamp":0}

Count seals by trigger, record when getPayload and gossip happen relative to the slot start, and count frozen-payload hints sent by the builder and dropped by the sequencer.
…ed payload id

Track the frozen hint on the payload handle so it cannot outlive its build, and treat a hint as having lost to the deadline only when it matches no active build.
It stopped at the handoff to the network actor rather than the publish, so it added little over the getPayload offset.
A Denim build reads the transaction pool once, after the build is requested, so this offset is the deadline for landing in that block.
…elease branch

The isolated-sequencer schedule delay that block_deadline applies on main is not on releases/v1.5.5.
Cover build starts recorded outside the ticker, assert the getPayload offset is taken before the request, and describe the build start offset as part of the searcher reaction window.
@fahimahmedx
fahimahmedx marked this pull request as ready for review November 12, 2026 06:46
…ck (#6455)

Denim activated on mainnet, so the smoke test's wall-clock-based payload
attributes became post-Denim attributes, which the engine rejects unless
they carry the BaseTime update deposit at tx[1]. Anchor the build
timestamp to the last legacy block slot before Denim activation instead:
past every scheduled fork and still pre-Denim, so a single legacy block
stays valid regardless of when the test runs.

Amp-Thread-ID: https://ampcode.com/threads/T-09d6a81e-204d-45bb-a227-69764d686e37

Co-authored-by: Amp <[email protected]>
(cherry picked from commit 407af44)
@github-actions

Copy link
Copy Markdown
Contributor

No actionable findings. The changes are well-structured and safe for block production.

Review covered: payload builder notification path (try_build), sequencer actor select! loop hint arm, broadcast channel wiring (runner -> multiplex/node -> consensus CLI -> RollupNode -> SequencerActor), ready_hint_drop_reason validation logic, sealed_payload_id tracking, metrics, and all new/modified test coverage.

Key observations:

  • notify_payload_ready uses non-blocking broadcast::Sender::send() in the payload builder hot path; a missing receiver is counted and dropped, never blocking payload production.
  • The ready arm in select! is cancellation-safe (broadcast::Receiver::recv is documented as such); Closed disables the arm and Lagged falls back to the seal deadline.
  • The !no_tx_pool gate in try_build correctly prevents notifications for derived-attribute replay builds.
  • The seal deadline remains the unconditional fallback: a lost, lagged, or absent hint only means the sequencer seals at the normal time, never later.
  • resubscribe() on the receiver in RollupNode is correct: the new actor starts from the next sent message.
  • Test coverage is thorough, including unit tests for every drop reason, full-actor integration tests with paused time for both early and deadline seal paths, real-node payload_ready integration tests, and the system-level early_broadcast scenario.

@haardikk21
haardikk21 merged commit 21e98df into releases/v1.5.5 Nov 12, 2026
35 checks passed
@haardikk21
haardikk21 deleted the fahim/backport-6557-v1.5.5 branch November 12, 2026 14:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants