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

fix: re-add local payload building logic to driver #191

Merged
merged 1 commit into from
Aug 9, 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
6 changes: 0 additions & 6 deletions bolt-sidecar/src/api/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,14 +89,8 @@ where
State(server): State<Arc<BuilderProxyServer<T, P>>>,
Json(registrations): Json<Vec<SignedValidatorRegistration>>,
) -> Result<StatusCode, BuilderApiError> {
let start = std::time::Instant::now();
debug!("Received register validators request");

let response = server.proxy_target.register_validators(registrations).await;

let elapsed = start.elapsed();
debug!(?elapsed, "Returning response: {:?}", response);

response.map(|_| StatusCode::OK)
}

Expand Down
2 changes: 1 addition & 1 deletion bolt-sidecar/src/builder/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ impl LocalBuilder {
//
// NOTE: we don't strictly need this. The validator & beacon nodes have options
// to ALWAYS prefer PBS blocks. This is a safety measure that doesn't hurt to keep.
let value = U256::from(1_000_000_000_000_000_000u128);
let value = U256::from(100_000_000_000_000_000_000u128);

let eth_payload = compat::to_consensus_execution_payload(&sealed_block);
let payload_and_blobs = PayloadAndBlobs { execution_payload: eth_payload, blobs_bundle };
Expand Down
8 changes: 6 additions & 2 deletions bolt-sidecar/src/driver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ impl<C: StateFetcher, BLS: SignerBLS, ECDSA: SignerECDSA> SidecarDriver<C, BLS,
self.handle_new_head_event(head_event).await;
}
Some(slot) = self.consensus.commitment_deadline.wait() => {
self.handle_commitment_deadline(slot);
self.handle_commitment_deadline(slot).await;
}
Some(payload_request) = self.payload_requests_rx.recv() => {
self.handle_fetch_payload_request(payload_request);
Expand Down Expand Up @@ -242,7 +242,7 @@ impl<C: StateFetcher, BLS: SignerBLS, ECDSA: SignerECDSA> SidecarDriver<C, BLS,
}

/// Handle a commitment deadline event, submitting constraints to the MEV-Boost service.
fn handle_commitment_deadline(&mut self, slot: u64) {
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 {
Expand All @@ -266,6 +266,10 @@ impl<C: StateFetcher, BLS: SignerBLS, ECDSA: SignerECDSA> SidecarDriver<C, BLS,
}
}
});

if let Err(e) = self.local_builder.build_new_local_payload(template).await {
tracing::error!(err = ?e, "CRITICAL: Error while building local payload at slot deadline for {slot}");
};
}

/// Handle a fetch payload request, responding with the local payload if available.
Expand Down
Loading