Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Review logs on commitment deadline #377

Merged
merged 2 commits into from
Nov 12, 2024
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
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.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This function try_commit does not exist, so I think this comment is stale.

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