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

feat(sidecar): --unsafe-disable-onchain-checks flag #382

Merged
merged 1 commit into from
Nov 13, 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
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,
/// Unsafely 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