Skip to content

Commit

Permalink
Merge pull request #377 from chainbound/lore/fix/block-template-log
Browse files Browse the repository at this point in the history
Review logs on commitment deadline
  • Loading branch information
thedevbirb authored Nov 12, 2024
2 parents b27741f + d00f2cc commit c2b6301
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
8 changes: 5 additions & 3 deletions bolt-sidecar/src/driver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -374,13 +374,15 @@ impl<C: StateFetcher, ECDSA: SignerECDSA> SidecarDriver<C, ECDSA> {
/// 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}");
};
Expand Down
1 change: 0 additions & 1 deletion bolt-sidecar/src/state/execution.rs
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,6 @@ impl<C: StateFetcher> ExecutionState<C> {

/// 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);
Expand Down

0 comments on commit c2b6301

Please sign in to comment.