Skip to content

fix(consensus): tolerate transient next L1 origin lookup failures#3018

Open
niran wants to merge 1 commit into
mainfrom
niranbabalola/chain-4513-l1-origin-fallback
Open

fix(consensus): tolerate transient next L1 origin lookup failures#3018
niran wants to merge 1 commit into
mainfrom
niranbabalola/chain-4513-l1-origin-fallback

Conversation

@niran
Copy link
Copy Markdown
Contributor

@niran niran commented May 28, 2026

Summary

  • Closes CHAIN-4513.
  • Treat next L1 origin lookup failures as best-effort in the sequencer origin selector.
  • Reuse the current L1 origin while it remains within max sequencer drift, including recovery mode.
  • Keep returning NotEnoughData once the drift window is exhausted.

Testing

  • cargo test -p base-consensus-node actors::sequencer::origin_selector --lib
  • cargo clippy -p base-consensus-node --lib -- -D warnings
  • cargo +nightly fmt --package base-consensus-node

Change Management

type=routine
risk=low
impact=sev5

@linear
Copy link
Copy Markdown

linear Bot commented May 28, 2026

CHAIN-4513

@cb-heimdall
Copy link
Copy Markdown
Collaborator

cb-heimdall commented May 28, 2026

🟡 Heimdall Review Status

Requirement Status More Info
Reviews 🟡 0/1
Denominator calculation
Show calculation
1 if user is bot 0
1 if user is external 0
2 if repo is sensitive 0
From .codeflow.yml 1
Additional review requirements
Show calculation
Max 0
0
From CODEOWNERS 0
Global minimum 0
Max 1
1
1 if commit is unverified 0
Sum 1

@niran niran changed the title Tolerate transient next L1 origin lookup failures CHAIN-4513: Tolerate transient next L1 origin lookup failures May 28, 2026
@niran niran changed the title CHAIN-4513: Tolerate transient next L1 origin lookup failures fix(consensus): tolerate transient next L1 origin lookup failures May 28, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Review Summary

The change converts try_fetch_next_origin from a fallible method to an infallible one that swallows L1 provider errors with a warning log. This makes the next-origin lookup best-effort in all code paths (both normal and recovery mode), allowing the sequencer to reuse the current L1 origin while within drift and only returning NotEnoughData once drift is exceeded.

No blocking issues found. The logic is correct, boundary conditions are handled properly, and the tests cover the key scenarios (fetch failure within drift, fetch failure past drift, recovery mode with fetch failure).

Notes (non-blocking)

  • Recovery mode gains a parent_hash continuity check it did not have before. The old recovery path set self.next directly from get_block_by_number without verifying parent_hash == current.hash. The new path goes through try_fetch_next_origin which performs this check (line 185). This is a correctness improvement (it prevents accepting a next origin that does not chain to the current one) but it is a subtle behavioral change worth being aware of.

  • Error type flattening at drift boundary. When past sequencer drift and the next fetch fails, the caller receives NotEnoughData rather than the underlying Provider error. This is fine for the current retry-oriented callers but means operator logs need to look at the warn from try_fetch_next_origin (not the returned error) to diagnose L1 connectivity issues.

@niran niran requested a review from refcell May 28, 2026 18:35
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.

2 participants