Skip to content

Add use_l2_client_for_state_root and allow_traffic_to_unhealthy_builder #381

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

cody-wang-cb
Copy link

@cody-wang-cb cody-wang-cb commented Jul 24, 2025

Add use_l2_client_for_state_root, such that if it's false, it will use op-geth for state root calculation

Add allow_traffic_to_unhealthy_builder flag such that if it's false, it won't send builder FCUs when it's unheathy, so EL sync won't be triggered

Copy link

vercel bot commented Jul 24, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
rollup-boost ⬜️ Ignored (Inspect) Visit Preview Jul 28, 2025 10:04pm

@cody-wang-cb cody-wang-cb marked this pull request as draft July 28, 2025 21:44
@cody-wang-cb cody-wang-cb marked this pull request as ready for review July 30, 2025 14:41
@cody-wang-cb cody-wang-cb force-pushed the cody/add_base_fork_commits branch from b928c57 to b46ee59 Compare July 30, 2025 19:13

/// Allow all engine API calls to builder even when marked as unhealthy
/// This is default true assuming no builder CL set up
#[arg(long, env, default_value = "true")]
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
#[arg(long, env, default_value = "true")]
#[arg(long, env, default_value = "false")]

default should meant to be false?

Copy link
Author

Choose a reason for hiding this comment

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

the default is true currently, it's always going to send traffic to the builder regardless of the builder health

Copy link
Collaborator

Choose a reason for hiding this comment

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

maybe something like
ignore_unhealthy_builders?

// async call to builder to sync the builder node
if !self.execution_mode().is_disabled() {
if !self.execution_mode().is_disabled()
&& (self.allow_traffic_to_unhealthy_builder || builder_healthy)
Copy link
Collaborator

@avalonche avalonche Jul 31, 2025

Choose a reason for hiding this comment

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

this call should be forwarded to the builder regardless of whether the builder is healthy? its related to execution mode, not builder health

Copy link
Author

Choose a reason for hiding this comment

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

it's blocking the case when the builder is unhealthy and it doesn't want to forward
builder_healthy=false and self.allow_traffic_to_unhealthy_builder=false

so the code is the inverse of that, but maybe it's not as clear

Copy link
Collaborator

Choose a reason for hiding this comment

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

suggest to rework this part a little bit, double negative, and overall quite confusing
Should also have good comment

@@ -93,6 +93,15 @@ pub struct RollupBoostArgs {
#[arg(long, env)]
pub block_selection_policy: Option<BlockSelectionPolicy>,

/// Should we use the l2 client for computing state root
#[arg(long, env, default_value = "false")]
pub use_l2_client_for_state_root: bool,
Copy link
Collaborator

Choose a reason for hiding this comment

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

external_state_root

pub fn transactions(&self) -> Vec<Bytes> {
match self {
OpExecutionPayloadEnvelope::V3(payload) => payload
.execution_payload
Copy link
Collaborator

Choose a reason for hiding this comment

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

looks scary

// Get payload and validate with the local l2 client
tracing::Span::current().record("builder_has_payload", true);
info!(message = "builder has payload, calling get_payload on builder");

let payload = self.builder_client.get_payload(payload_id, version).await?;
let _ = self

if self.use_l2_client_for_state_root == false {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
if self.use_l2_client_for_state_root == false {
if !self.use_l2_client_for_state_root {

Copy link
Collaborator

Choose a reason for hiding this comment

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

Why are we sending new payload only in one case?
I think we could just always send it, even if l2 was used for state root, or will it break anything?


// If execution mode is disabled, return the l2 client response immediately
if self.execution_mode().is_disabled() {
return Ok(l2_fut.await?);
}

// If traffic to the unhealthy builder is not allowed and the builder is unhealthy,
if !self.allow_traffic_to_unhealthy_builder && !builder_healthy {
Copy link
Collaborator

Choose a reason for hiding this comment

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

would be happy to see a refactoring, right now there is a lot of conditions, maybe we need to bundle them somehow

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