Skip to content

Commit 11d8e5e

Browse files
authored
Merge branch 'main' into feat/bump-reth
2 parents 94fc530 + fefab34 commit 11d8e5e

File tree

3 files changed

+16
-10
lines changed

3 files changed

+16
-10
lines changed

crates/engine/src/driver.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use super::{future::EngineFuture, ForkchoiceState};
22
use crate::{
33
future::{BuildNewPayloadFuture, EngineDriverFutureResult},
44
metrics::EngineDriverMetrics,
5-
EngineDriverEvent,
5+
EngineDriverError, EngineDriverEvent,
66
};
77

88
use alloy_provider::Provider;
@@ -237,7 +237,10 @@ where
237237
return Some(EngineDriverEvent::NewPayload(block))
238238
}
239239
Err(err) => {
240-
tracing::error!(target: "scroll::engine", ?err, "failed to build new payload")
240+
tracing::error!(target: "scroll::engine", ?err, "failed to build new payload");
241+
if let EngineDriverError::MissingPayloadId(attributes) = err {
242+
self.l1_payload_attributes.push_front(attributes);
243+
}
241244
}
242245
}
243246
}

crates/engine/src/error.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
use alloy_rpc_types_engine::PayloadError;
2+
use rollup_node_primitives::ScrollPayloadAttributesWithBatchInfo;
23
use scroll_alloy_provider::ScrollEngineApiError;
34

45
/// The error type for the engine API.
@@ -13,10 +14,10 @@ pub enum EngineDriverError {
1314
/// The execution payload provider is unavailable.
1415
#[error("Execution payload provider is unavailable")]
1516
ExecutionPayloadProviderUnavailable,
16-
/// The execution payload id is missing.
17-
#[error("missing payload id")]
18-
MissingExecutionPayloadId,
1917
/// The forkchoice update failed.
2018
#[error("Forkchoice update failed: {0}")]
2119
ForkchoiceUpdateFailed(ScrollEngineApiError),
20+
/// The payload id field is missing in the forkchoice update response.
21+
#[error("Forkchoice update response missing payload id")]
22+
MissingPayloadId(ScrollPayloadAttributesWithBatchInfo),
2223
}

crates/engine/src/future/mod.rs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -232,23 +232,23 @@ where
232232
#[instrument(skip_all, level = "trace",
233233
fields(
234234
fcs = ?fcs,
235-
payload_attributes = ?payload_attributes
235+
payload_attributes = ?payload_attributes_with_batch_info
236236
)
237237
)]
238238
async fn handle_payload_attributes<EC, P>(
239239
client: Arc<EC>,
240240
provider: P,
241241
fcs: ForkchoiceState,
242-
payload_attributes: ScrollPayloadAttributesWithBatchInfo,
242+
payload_attributes_with_batch_info: ScrollPayloadAttributesWithBatchInfo,
243243
) -> Result<ConsolidationOutcome, EngineDriverError>
244244
where
245245
EC: ScrollEngineApi + Unpin + Send + Sync + 'static,
246246
P: Provider<Scroll> + Unpin + Send + Sync + 'static,
247247
{
248-
tracing::trace!(target: "scroll::engine::future", ?fcs, ?payload_attributes, "handling payload attributes");
248+
tracing::trace!(target: "scroll::engine::future", ?fcs, ?payload_attributes_with_batch_info, "handling payload attributes");
249249

250250
let ScrollPayloadAttributesWithBatchInfo { mut payload_attributes, batch_info } =
251-
payload_attributes;
251+
payload_attributes_with_batch_info.clone();
252252

253253
let maybe_execution_payload = provider
254254
.get_block((fcs.safe_block_info().number + 1).into())
@@ -288,7 +288,9 @@ where
288288
// retrieve the execution payload
289289
let execution_payload = get_payload(
290290
client.clone(),
291-
fc_updated.payload_id.expect("payload attributes has been set"),
291+
fc_updated
292+
.payload_id
293+
.ok_or(EngineDriverError::MissingPayloadId(payload_attributes_with_batch_info))?,
292294
)
293295
.await?;
294296
// issue the execution payload to the EL

0 commit comments

Comments
 (0)