Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions crates/op-rbuilder/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ reth-ipc = { workspace = true }
reth-node-builder = { workspace = true, features = ["test-utils"] }
ctor = "0.4.2"
rlimit = { version = "0.10" }
tokio = { workspace = true, features = ["test-util"] }
hyper = { version = "1.7.0", features = ["http1"] }
hyper-util = { version = "0.1.11" }
http-body-util = { version = "0.1.3" }
Expand Down
12 changes: 12 additions & 0 deletions crates/op-rbuilder/src/builders/flashblocks/payload.rs
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,13 @@ where
schedule = ?flashblock_scheduler,
"Computed flashblock timing schedule"
);
// Get target number of flashblocks to build. If no flashblocks are scheduled, return early.
let target_flashblocks = flashblock_scheduler.target_flashblocks();
if target_flashblocks == 0 {
self.resolve_best_payload(&ctx, best_payload, fallback_payload, &resolve_payload);
self.record_flashblocks_metrics(&ctx, &info, 0, &span);
return Ok(());
}

let expected_flashblocks = self.config.flashblocks_per_block();
if target_flashblocks < expected_flashblocks {
Expand Down Expand Up @@ -599,6 +605,12 @@ where
};
let _entered = fb_span.enter();

if ctx.flashblock_index() > ctx.target_flashblock_count() {
self.resolve_best_payload(&ctx, best_payload, fallback_payload, &resolve_payload);
self.record_flashblocks_metrics(&ctx, &info, target_flashblocks, &span);
return Ok(());
}

// Build flashblock after receiving signal
let next_flashblocks_ctx = match self.build_next_flashblock(
&ctx,
Expand Down
Loading