Skip to content
This repository was archived by the owner on Jan 16, 2026. It is now read-only.

feat(node/service): L1OriginSelector advancement#2404

Merged
clabby merged 1 commit intomainfrom
cl/l1-origin-selector
Jul 15, 2025
Merged

feat(node/service): L1OriginSelector advancement#2404
clabby merged 1 commit intomainfrom
cl/l1-origin-selector

Conversation

@clabby
Copy link
Contributor

@clabby clabby commented Jul 14, 2025

Overview

Adds in the logic for the L1OriginSelector to optimistically advance the origin based on the latest L1 block number, while allowing for transient failures to be retried.

Also adds testing for the selector logic.

closes #2245

@clabby clabby self-assigned this Jul 14, 2025
Copilot AI review requested due to automatic review settings July 14, 2025 20:25
@clabby clabby added the K-feature Kind: feature label Jul 14, 2025
@clabby clabby added A-node Area: cl node (eq. Go op-node) handles single-chain consensus W-node Workstream: kona-node A-services Area: rollup services/actors labels Jul 14, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot reviewed 6 out of 7 changed files in this pull request and generated no comments.

Comment on lines +164 to +174
let l1_origin = match self.origin_selector.next_l1_origin(unsafe_head).await {
Ok(l1_origin) => l1_origin,
Err(err) => {
warn!(
target: "sequencer",
?err,
"Temporary error occurred while selecting next L1 origin. Re-attempting on next tick."
);
return Ok(())
}
};
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Note that we don't really make a difference between what errors returned by the L1 origin selector are temporary vs. which aren't. The sequencer should always assume that transient RPC errors will recover.

@codecov
Copy link

codecov bot commented Jul 14, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 82.2%. Comparing base (a1bd96d) to head (2ab4204).
Report is 3 commits behind head on main.

✅ All tests successful. No failed tests found.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@clabby clabby force-pushed the cl/l1-origin-selector branch from 55d4dc4 to c7ac4ba Compare July 14, 2025 20:47
if next_l1_origin_available { current_epoch + 1 } else { current_epoch };
assert_eq!(next.hash, B256::with_last_byte(expected_epoch as u8));
assert_eq!(next.number, expected_epoch);
}
Copy link
Member

Choose a reason for hiding this comment

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

These tests are really great and I think we could get pretty high returns on having a few data structures like the MockOriginSelectorProvider in a common test crate to reuse to test the remaining actors

Copy link
Member

@theochap theochap left a comment

Choose a reason for hiding this comment

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

Looks great!

## Overview

Adds in the logic for the `L1OriginSelector` to optimistically advance the origin based on the latest L1 block number, while allowing for transient failures to be retried.

Also adds testing for the selector logic.
@clabby clabby force-pushed the cl/l1-origin-selector branch from c7ac4ba to 2ab4204 Compare July 15, 2025 00:06
@clabby clabby enabled auto-merge July 15, 2025 00:06
@clabby clabby added this pull request to the merge queue Jul 15, 2025
Merged via the queue into main with commit f166235 Jul 15, 2025
25 checks passed
@clabby clabby deleted the cl/l1-origin-selector branch July 15, 2025 00:34
theochap pushed a commit to ethereum-optimism/optimism that referenced this pull request Dec 10, 2025
## Overview

Adds in the logic for the `L1OriginSelector` to optimistically advance
the origin based on the latest L1 block number, while allowing for
transient failures to be retried.

Also adds testing for the selector logic.

closes op-rs/kona#2245
theochap pushed a commit to ethereum-optimism/optimism that referenced this pull request Jan 14, 2026
## Overview

Adds in the logic for the `L1OriginSelector` to optimistically advance
the origin based on the latest L1 block number, while allowing for
transient failures to be retried.

Also adds testing for the selector logic.

closes #2245
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

A-node Area: cl node (eq. Go op-node) handles single-chain consensus A-services Area: rollup services/actors K-feature Kind: feature W-node Workstream: kona-node

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(node/service): L1 origin selector

3 participants