Skip to content

Commit

Permalink
chore: rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
merklefruit committed Jul 23, 2024
1 parent 6c1d185 commit 4ff1219
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions bolt-sidecar/src/driver/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ impl<C: StateFetcher + Unpin, S: SignerBLS + Unpin> SidecarDriver<C, S> {

// TODO: match when we have more request types
let CommitmentRequest::Inclusion(request) = api_event.request;
let target_slot = request.slot;

tracing::info!(
elapsed = ?start.elapsed(),
Expand All @@ -146,7 +147,7 @@ impl<C: StateFetcher + Unpin, S: SignerBLS + Unpin> SidecarDriver<C, S> {
// TODO: review all this `clone` usage

// parse the request into constraints and sign them with the sidecar signer
let message = ConstraintsMessage::build(validator_index, request.clone(), sender);
let message = ConstraintsMessage::build(validator_index, request, sender);
let signature = match self.signer.sign(&message.digest()) {
Ok(sig) => sig.to_string(),
Err(e) => {
Expand All @@ -158,10 +159,10 @@ impl<C: StateFetcher + Unpin, S: SignerBLS + Unpin> SidecarDriver<C, S> {
let signed_constraints = SignedConstraints { message, signature };

self.execution_state
.add_constraint(request.slot, signed_constraints.clone());
.add_constraint(target_slot, signed_constraints.clone());

let res = serde_json::to_value(signed_constraints).map_err(Into::into);
let _ = api_event.response_tx.send(res).ok();
let _ = api_event.response_tx.send(res);
}

fn handle_new_head_event(&mut self, head_event: HeadEvent) {
Expand Down

0 comments on commit 4ff1219

Please sign in to comment.