From e455d3cdf4d1b1fa6f1866c8901feb6f5d781fb2 Mon Sep 17 00:00:00 2001 From: thedevbirb Date: Tue, 29 Oct 2024 13:29:35 +0100 Subject: [PATCH] feat(sidecar): verify operator and validator keys on startup --- bolt-sidecar/src/driver.rs | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/bolt-sidecar/src/driver.rs b/bolt-sidecar/src/driver.rs index dd36caa3b..50460c40f 100644 --- a/bolt-sidecar/src/driver.rs +++ b/bolt-sidecar/src/driver.rs @@ -30,8 +30,8 @@ use crate::{ start_builder_proxy_server, state::{fetcher::StateFetcher, ConsensusState, ExecutionState, HeadTracker, StateClient}, telemetry::ApiMetrics, - BuilderProxyConfig, CommitBoostSigner, ConstraintsApi, ConstraintsClient, LocalBuilder, Opts, - SignerBLS, + BoltManager, BuilderProxyConfig, CommitBoostSigner, ConstraintsApi, ConstraintsClient, + LocalBuilder, Opts, SignerBLS, }; /// The driver for the sidecar, responsible for managing the main event loop. @@ -161,6 +161,16 @@ impl SidecarDriver { commitment_signer: ECDSA, fetcher: C, ) -> eyre::Result { + // Verify the operator and validator keys with the bolt manager + let bolt_manager = + BoltManager::from_chain(opts.execution_api_url.clone(), opts.chain.chain); + if let Some(bolt_manager) = bolt_manager { + bolt_manager.verify_operator(commitment_signer.public_key()).await?; + bolt_manager + .verify_validator_pubkeys(&Vec::from_iter(constraint_signer.available_pubkeys())) + .await?; + } + let beacon_client = BeaconClient::new(opts.beacon_api_url.clone()); let execution = ExecutionState::new(fetcher, opts.limits).await?;