From f3f4a9ca1c04c68ff756bec63ad3bfb0667333bb Mon Sep 17 00:00:00 2001 From: thedevbirb Date: Wed, 13 Nov 2024 17:37:23 +0100 Subject: [PATCH] feat(sidecar): --unsafe-disable-onchain-checks flag --- bolt-sidecar/src/config/mod.rs | 3 +++ bolt-sidecar/src/driver.rs | 9 ++++++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/bolt-sidecar/src/config/mod.rs b/bolt-sidecar/src/config/mod.rs index ba435161..24d159eb 100644 --- a/bolt-sidecar/src/config/mod.rs +++ b/bolt-sidecar/src/config/mod.rs @@ -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, diff --git a/bolt-sidecar/src/driver.rs b/bolt-sidecar/src/driver.rs index 9c71d786..1a72df0b 100644 --- a/bolt-sidecar/src/driver.rs +++ b/bolt-sidecar/src/driver.rs @@ -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; @@ -170,9 +170,12 @@ impl SidecarDriver { 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(),