Skip to content

Commit

Permalink
feat(sidecar): verify operator and validator keys on startup
Browse files Browse the repository at this point in the history
  • Loading branch information
thedevbirb committed Oct 29, 2024
1 parent 5c0c7ee commit e455d3c
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions bolt-sidecar/src/driver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -161,6 +161,16 @@ impl<C: StateFetcher, ECDSA: SignerECDSA> SidecarDriver<C, ECDSA> {
commitment_signer: ECDSA,
fetcher: C,
) -> eyre::Result<Self> {
// 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?;

Expand Down

0 comments on commit e455d3c

Please sign in to comment.