Repository navigation
Conversation
🟡 Heimdall Review Status
|
| /// and unexpected statuses leave readiness pending. A timeout may follow an EL side effect; | ||
| /// callers must reconfirm state rather than assume the request did not execute. No automatic | ||
| /// retries or engine resets occur here. | ||
| pub async fn probe<C: EngineClient>( |
There was a problem hiding this comment.
This sets up a second FCU-confirmation path next to Engine::probe_el_sync (task_queue/core.rs), which the sequencer coordinator and engine processor already call. That method also sends a forced, attribute-free FCU on every call and treats VALID/SYNCING the same way. The new path drifts from it in three ways:
- It doesn't classify
INVALID_FORK_CHOICE_STATE. - It doesn't publish anything on
state_sender. - It leaves
EngineState.sync_statealone.
That last point matters most. A VALID FCU is not read-only: it makes target the EL's canonical head, and the CL's unsafe_head doesn't move to match. Once this is wired in, the CL and EL can disagree about the head, and derivation or the next SynchronizeTask will act on a stale view.
Since nothing calls this type yet, I'd suggest leaving it out until there's a caller. When there is one, extend probe_el_sync, for example with an optional timeout and a target-scoped result, instead of keeping a separate implementation.
| } | ||
| _ = interval.tick() => { | ||
| let remaining = deadline.saturating_duration_since(TokioInstant::now()).min(SEQUENCER_EL_SYNC_PROBE_INTERVAL); | ||
| let status = self.probe_historical_startup(remaining).await?; |
There was a problem hiding this comment.
Startup failures shut down the node, not just the startup phase. The PR description says non-SYNCING probe failures "end the phase without releasing activation". In practice, any probe_historical_startup error propagates through ?, out of run_historical_startup, and out of the coordinator task in start. The same happens when the handoff times out and when the hard-coded 600s deadline expires. EngineActor's handle_task_result then cancels the shared cancellation token, which stops the whole node.
Errors that trigger this:
- one
fork_choice_updated_v3call taking longer than 5s, which is plausible while reth is busy with historical sync; - one transport error;
- one conductor
leader()error or timeout, checked on every tick; - the 600s deadline running out, which a real historical backfill will almost always exceed.
Today nothing calls this API, so it can't halt anything yet. Once it is wired up, though, an inactive sequencer becomes a node that exits on any transient EL or conductor problem during catch-up.
Suggested fix:
- Classify transient failures (timeouts, transport errors, conductor errors) and retry them on the next tick, or keep the gate closed without returning from
start. - Replace the 600s literal with a named constant, or a config value tied to the expected backfill time.
- Add a test asserting that a probe timeout or RPC error leaves the coordinator task running.
| match base_protocol::L2BlockInfo::from_payload_and_genesis( | ||
| envelope.execution_payload, envelope.parent_beacon_block_root, &self.processor.rollup().genesis, | ||
| ) { | ||
| Ok(target) if target != phase.target() => phase.set_target(target), |
There was a problem hiding this comment.
Startup may never converge at the chain tip. Every gossip payload at or above the target moves the target to that block's hash, but the payload itself is never sent to the EL with newPayload; it is simply dropped. Near the tip, a new block arrives every 2s and the probe runs every 5s, so each probe FCU names a block the EL hasn't seen. Reth answers an unknown head with SYNCING and starts downloading it. By the next tick the target has moved again.
So the probe can keep returning SYNCING indefinitely, and the 600s deadline then turns that into node shutdown (see the comment on line 245).
Suggested fix: either insert the authenticated gossip payloads during startup, or stop moving the target once the EL is close to the tip. The mocked FCU tests can't catch this, so it needs coverage that simulates a moving tip.
| /// Admission failure revokes earlier readiness. The old engine completion latch is not used. | ||
| pub async fn probe_historical_startup(&mut self, remaining: Duration) -> Result<base_consensus_engine::StartupSyncStatus, EngineError> { | ||
| let started = TokioInstant::now(); | ||
| let phase = self.historical_startup.as_mut().expect("historical startup selected"); |
There was a problem hiding this comment.
probe_historical_startup is a pub API, but it calls expect on historical_startup without checking it. A caller that probes before begin_historical_startup (or after a completed handoff, which resets it to None) panics instead of getting an error back. Return a named EngineError instead.
| } | ||
| let update = EngineSyncStateUpdate { unsafe_head: Some(target), local_safe_head: Some(start.safe), safe_head: Some(start.safe), finalized_head: Some(start.finalized) }; | ||
| let proposed = self.engine.state().sync_state.updated(update); | ||
| let response = self.client.fork_choice_updated_v3(proposed.create_forkchoice_state(), None).await |
There was a problem hiding this comment.
The handoff sends its own label FCU and then commits the labels through accept_confirmed_startup. Engine::probe_el_sync / SynchronizeTask::new_forced already does both, and also handles INVALID_FORK_CHOICE_STATE and engine metrics, so this re-implements it.
Separately, every failure in the handoff gets flattened into BootstrapHeadQuery(String):
- transport errors;
- a non-canonical target;
- a non-VALID FCU status.
That discards the typed error, so a caller can't tell a retryable failure from a terminal one. Reuse probe_el_sync, and add distinct EngineError variants for these cases.
| } | ||
| // Normal routing starts only after canonical reset and completion delivery. | ||
| self.historical_startup = None; | ||
| self.complete_startup(target); |
There was a problem hiding this comment.
After handoff, complete_startup(target) sets the state to Regular, which skips the CatchingUp gate that a stopped follower normally gets in ordinary bootstrap.
That causes two problems once startup finishes:
prepare_sequencer_startonly checksel_sync_finishedand that the hash matches. Admin activation is accepted attargeteven when newer canonical payloads have already been observed.- Any queued or later gossip more than
catchup_capacityblocks ahead is dropped by theRegulargap filter instead of being buffered.
Either can let a stopped node activate on a stale head and reorg canonical blocks. Consider entering CatchingUp here, seeded with gossip observed during the phase, rather than going straight to the completed state.
| pub async fn handoff_historical_startup(&mut self, target: L2BlockInfo) -> Result<HistoricalStartupHandoff, EngineError> { | ||
| let latest = self.client.l2_block_info_by_label(BlockNumberOrTag::Latest).await | ||
| .map_err(|error| HistoricalStartupFailure::HeadQuery(Box::new(error)))?; | ||
| if latest != Some(target) { |
There was a problem hiding this comment.
The probe confirms the target by block_info.hash alone, but this check and the start.un_safe != target check compare the whole L2BlockInfo, including l1_origin and seq_num.
So an operator JSON target with the right hash but a wrong origin or sequence number goes like this:
- The probe returns VALID and makes the target canonical on the EL.
- The handoff then fails terminally with a misleading "no longer canonical" error.
- Because the EL head is now at the target, a restart with the same flag fails with
ReusedTarget.
Validate the target against the EL's own L2BlockInfo before the first FCU, or compare by hash here and report a field mismatch as its own error.
| ) -> JoinHandle<Result<(), EngineError>> { | ||
| tokio::spawn(async move { | ||
| // Bootstrap: pre-populate the unsafe_head_tx watch channel so that external callers | ||
| // An explicitly selected historical phase owns the connection before bootstrap. |
There was a problem hiding this comment.
This line was inserted in the middle of the existing bootstrap sentence ("…so that external callers / (admin_startSequencer, sync-status RPC) never observe a zero hash"). That breaks the sentence, and the comment now reads as though the historical phase pre-populates unsafe_head_tx, which it doesn't. Move it above the historical_startup_selected check instead.
|
Review summary. Earlier review comments still apply to this revision. The most serious ones:
No additional halt or stall triggers were found beyond those. Nothing calls the new API yet, so none of this affects running nodes until #6714 wires it up. They should be resolved before then. New in this pass: one minor inline comment about a misplaced comment line that splits the existing bootstrap explanation. |
Motivation
Inactive sequencers need a serialized historical EL-sync phase before they can safely resume production. A prior VALID response or the engine's one-shot completion flag cannot authorize a new target.
Changes
Historical startup phase startingand structured target block/hash plus local head.Not proven
Tests
historical_startup_gossip_retarget_revokes_readinesswent RED when the actual retarget branch was disabled, then GREEN when restored. Checks immediate invalidation, exact next target/no attributes and no payload insertion.historical_startup_entry_admission_precedes_probe_admissionwent RED with the entry block removed, despite the old leader test remaining green. Ordered follower-at-entry then leader-at-probe requires zero FCUs.historical_startup_label_syncing_defers_handoffwas RED before implementation. Pending leaves state and notifications unchanged; invalid and transport errors remain typed and terminal.-D warnings; four test threads. Existing fixed-port8080 RPC launch test excluded because an unrelated process owns its port; the unfiltered suite was not rerun for this round.-D warningspassed; CLI1 ignored and node1 fixed-port exclusion remain.Evidence:
/tmp/sequencer-el-sync/fix-round1/review-response1.md, with durable RED/GREEN logs and exact final head/results. Everything remains draft. No new real-node experiment or full pipeline acknowledgement is claimed for these fixes.