Skip to content

Commit fb648fa

Browse files
authored
fix: don't miss blocks on batcher updates (#529)
## 📝 Summary When batcher's max channel duration is big enough (e.g. 10m), the batcher would be pushing its updates at specified intervals. This causes the sequencer to send an avalanche of FCUs (and getBlockByNumber) that push safe head step-by-step. As a consequence it can happen that the time b/w FCU and ensuing getPayload would be on the scale of ~2.5s. This means that we should "remember" the payloads long enough to accommodate that corner-case. --- ## ✅ I have completed the following steps: * [ ] Run `make lint` * [ ] Run `make test` * [ ] Added tests (if applicable)
1 parent f04cd2c commit fb648fa

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

Diff for: crates/op-rbuilder/src/generator.rs

+10-1
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,16 @@ where
155155
// Adding 0.5 seconds as wiggle room since block times are shorter here.
156156
// TODO: A better long-term solution would be to implement cancellation logic
157157
// that cancels existing jobs when receiving new block building requests.
158-
let deadline = job_deadline(attributes.timestamp()) + Duration::from_millis(500);
158+
//
159+
// When batcher's max channel duration is big enough (e.g. 10m), the
160+
// sequencer would send an avalanche of FCUs/getBlockByNumber on
161+
// each batcher update (with 10m channel it's ~800 FCUs at once).
162+
// At such moment it can happen that the time b/w FCU and ensuing
163+
// getPayload would be on the scale of ~2.5s. Therefore we should
164+
// "remember" the payloads long enough to accommodate this corner-case
165+
// (without it we are losing blocks). Postponing the deadline for 5s
166+
// (not just 0.5s) because of that.
167+
let deadline = job_deadline(attributes.timestamp()) + Duration::from_millis(5000);
159168

160169
let deadline = Box::pin(tokio::time::sleep(deadline));
161170
let config = PayloadConfig::new(Arc::new(parent_header.clone()), attributes);

0 commit comments

Comments
 (0)