Skip to content

Commit

Permalink
feat(sidecar): --unsafe-disable-onchain-checks flag
Browse files Browse the repository at this point in the history
  • Loading branch information
thedevbirb committed Nov 13, 2024
1 parent 55b66b3 commit f3f4a9c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
3 changes: 3 additions & 0 deletions bolt-sidecar/src/config/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,9 @@ pub struct Opts {
/// available without checking if connected validators are scheduled to propose a block.
#[clap(long, env = "BOLT_SIDECAR_UNSAFE_DISABLE_CONSENSUS_CHECKS", default_value_t = false)]
pub unsafe_disable_consensus_checks: bool,
/// Unsafe disables on-chain checks of validators and operator when starting the sidecar
#[clap(long, env = "BOLT_SIDECAR_UNSAFE_DISABLE_ONCHAIN_CHECKS", default_value_t = false)]
pub unsafe_disable_onchain_checks: bool,
/// Operating limits for the sidecar
#[clap(flatten)]
pub limits: LimitsOpts,
Expand Down
9 changes: 6 additions & 3 deletions bolt-sidecar/src/driver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use alloy::{rpc::types::beacon::events::HeadEvent, signers::local::PrivateKeySig
use beacon_api_client::mainnet::Client as BeaconClient;
use ethereum_consensus::{
clock::{self, SlotStream, SystemTimeProvider},
phase0::mainnet::{BlsPublicKey, SLOTS_PER_EPOCH},
phase0::mainnet::SLOTS_PER_EPOCH,
};
use eyre::Context;
use futures::StreamExt;
Expand Down Expand Up @@ -170,9 +170,12 @@ impl<C: StateFetcher, ECDSA: SignerECDSA> SidecarDriver<C, ECDSA> {
Vec::from_iter(constraint_signer.available_pubkeys())
};

// Verify the operator and validator keys with the bolt manager
if let Some(manager) = BoltManager::from_chain(opts.execution_api_url.clone(), *opts.chain)
if opts.unsafe_disable_onchain_checks {
info!("Skipping validators and operator public keys verification, --unsafe-disable-onchain-checks is 'true'");
} else if let Some(manager) =
BoltManager::from_chain(opts.execution_api_url.clone(), *opts.chain)
{
// Verify the operator and validator keys with the bolt manager
let commitment_signer_pubkey = commitment_signer.public_key();
info!(
validator_pubkeys = %validator_pubkeys.len(),
Expand Down

0 comments on commit f3f4a9c

Please sign in to comment.