From ee021ffaef3d26d4c61fb14579755aa5acd7c42a Mon Sep 17 00:00:00 2001 From: thedevbirb Date: Tue, 12 Nov 2024 15:47:45 +0100 Subject: [PATCH 1/2] chore(sidecar): remove not revelant TODO it refers to a function 'try_commit' that doesn't exist --- bolt-sidecar/src/state/execution.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/bolt-sidecar/src/state/execution.rs b/bolt-sidecar/src/state/execution.rs index a4bfa81a..81a3d112 100644 --- a/bolt-sidecar/src/state/execution.rs +++ b/bolt-sidecar/src/state/execution.rs @@ -432,7 +432,6 @@ impl ExecutionState { /// Commits the transaction to the target block. Initializes a new block template /// if one does not exist for said block number. - /// TODO: remove `pub` modifier once `try_commit` is fully implemented. pub fn add_constraint(&mut self, target_slot: u64, signed_constraints: SignedConstraints) { if let Some(template) = self.block_templates.get_mut(&target_slot) { template.add_constraints(signed_constraints); From d00f2cc2d17c1f9e27f205fc893fed9a6da0cf10 Mon Sep 17 00:00:00 2001 From: thedevbirb Date: Tue, 12 Nov 2024 16:03:42 +0100 Subject: [PATCH 2/2] fix(sidecar): review logs on commitment deadline --- bolt-sidecar/src/driver.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/bolt-sidecar/src/driver.rs b/bolt-sidecar/src/driver.rs index 99b39b7d..802ba23a 100644 --- a/bolt-sidecar/src/driver.rs +++ b/bolt-sidecar/src/driver.rs @@ -374,13 +374,15 @@ impl SidecarDriver { /// Handle a commitment deadline event, submitting constraints to the Constraints client service /// and starting to build a local payload for the given target slot. async fn handle_commitment_deadline(&mut self, slot: u64) { - debug!(slot, "Commitment deadline reached, building local block"); - let Some(template) = self.execution.get_block_template(slot) else { - warn!("No block template found for slot {slot} when requested"); + // Nothing to do then. Block templates are created only when constraints are added, + // which means we haven't issued any commitment for this slot because we are + // (probably) not the proposer for this block. return; }; + info!(slot, "Commitment deadline reached, building local block"); + if let Err(e) = self.local_builder.build_new_local_payload(slot, template).await { error!(err = ?e, "Error while building local payload at deadline for slot {slot}"); };