Skip to content
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
15 changes: 0 additions & 15 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ members = [
"beacon_node/lighthouse_tracing",
"beacon_node/network",
"beacon_node/operation_pool",
"beacon_node/proof_generation_service",
"beacon_node/store",
"beacon_node/timer",
"boot_node",
Expand Down
22 changes: 0 additions & 22 deletions beacon_node/beacon_chain/src/beacon_chain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,15 +133,13 @@ use store::{
KeyValueStore, KeyValueStoreOp, StoreItem, StoreOp,
};
use task_executor::{RayonPoolType, ShutdownReason, TaskExecutor};
use tokio::sync::mpsc::UnboundedSender;
use tokio_stream::Stream;
use tracing::{Span, debug, debug_span, error, info, info_span, instrument, trace, warn};
use tree_hash::TreeHash;
use types::blob_sidecar::FixedBlobSidecarList;
use types::data_column_sidecar::ColumnIndex;
use types::payload::BlockProductionVersion;
use types::*;
use zkvm_execution_layer::GeneratorRegistry;

pub type ForkChoiceError = fork_choice::Error<crate::ForkChoiceStoreError>;

Expand Down Expand Up @@ -352,8 +350,6 @@ pub enum BlockProcessStatus<E: EthSpec> {

pub type LightClientProducerEvent<T> = (Hash256, Slot, SyncAggregate<T>);

pub type ProofGenerationEvent<E> = (Hash256, Slot, Arc<SignedBeaconBlock<E>>);

pub type BeaconForkChoice<T> = ForkChoice<
BeaconForkChoiceStore<
<T as BeaconChainTypes>::EthSpec,
Expand Down Expand Up @@ -495,10 +491,6 @@ pub struct BeaconChain<T: BeaconChainTypes> {
pub kzg: Arc<Kzg>,
/// RNG instance used by the chain. Currently used for shuffling column sidecars in block publishing.
pub rng: Arc<Mutex<Box<dyn RngCore + Send>>>,
/// Registry of zkVM proof generators for altruistic proof generation
pub zkvm_generator_registry: Option<Arc<GeneratorRegistry>>,
/// Sender to notify proof generation service of blocks needing proofs
pub proof_generation_tx: Option<UnboundedSender<ProofGenerationEvent<T::EthSpec>>>,
}

pub enum BeaconBlockResponseWrapper<E: EthSpec> {
Expand Down Expand Up @@ -4191,20 +4183,6 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
current_slot,
);

// Notify proof generation service for altruistic proof generation
if let Some(ref proof_gen_tx) = self.proof_generation_tx {
let slot = signed_block.slot();
let event = (block_root, slot, signed_block.clone());

if let Err(e) = proof_gen_tx.send(event) {
debug!(
error = ?e,
?block_root,
"Failed to send proof generation event"
);
}
}

Ok(block_root)
}

Expand Down
32 changes: 0 additions & 32 deletions beacon_node/beacon_chain/src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ use crate::ChainConfig;
use crate::CustodyContext;
use crate::beacon_chain::{
BEACON_CHAIN_DB_KEY, CanonicalHead, LightClientProducerEvent, OP_POOL_DB_KEY,
ProofGenerationEvent,
};
use crate::beacon_proposer_cache::BeaconProposerCache;
use crate::custody_context::NodeCustodyType;
Expand Down Expand Up @@ -43,7 +42,6 @@ use std::sync::Arc;
use std::time::Duration;
use store::{Error as StoreError, HotColdDB, ItemStore, KeyValueStoreOp};
use task_executor::{ShutdownReason, TaskExecutor};
use tokio::sync::mpsc::UnboundedSender;
use tracing::{debug, error, info};
use types::data_column_custody_group::CustodyIndex;
use types::{
Expand Down Expand Up @@ -116,10 +114,6 @@ pub struct BeaconChainBuilder<T: BeaconChainTypes> {
/// be replaced with ZkVmEngineApi from zkvm_execution_layer. This would allow the
/// --execution-endpoint CLI flag to be optional when running in ZK-VM mode.
zkvm_execution_layer_config: Option<zkvm_execution_layer::ZKVMExecutionLayerConfig>,
/// Registry of zkVM proof generators for currently altruistic proof generation
zkvm_generator_registry: Option<Arc<zkvm_execution_layer::GeneratorRegistry>>,
/// Sender to notify proof generation service of blocks needing proofs
proof_generation_tx: Option<UnboundedSender<ProofGenerationEvent<T::EthSpec>>>,
}

impl<TSlotClock, E, THotStore, TColdStore>
Expand Down Expand Up @@ -161,8 +155,6 @@ where
ordered_custody_column_indices: None,
rng: None,
zkvm_execution_layer_config: None,
zkvm_generator_registry: None,
proof_generation_tx: None,
}
}

Expand Down Expand Up @@ -723,21 +715,6 @@ where
self
}

/// Sets the zkVM generator registry for altruistic proof generation.
pub fn zkvm_generator_registry(
mut self,
registry: Arc<zkvm_execution_layer::GeneratorRegistry>,
) -> Self {
self.zkvm_generator_registry = Some(registry);
self
}

/// Sets a `Sender` to notify the proof generation service of new blocks.
pub fn proof_generation_tx(mut self, sender: UnboundedSender<ProofGenerationEvent<E>>) -> Self {
self.proof_generation_tx = Some(sender);
self
}

/// Creates a new, empty operation pool.
fn empty_op_pool(mut self) -> Self {
self.op_pool = Some(OperationPool::new());
Expand Down Expand Up @@ -1016,9 +993,6 @@ where
};
debug!(?custody_context, "Loaded persisted custody context");

let has_execution_layer_and_proof_gen =
self.execution_layer.is_some() && self.zkvm_generator_registry.is_some();

let beacon_chain = BeaconChain {
spec: self.spec.clone(),
config: self.chain_config,
Expand Down Expand Up @@ -1102,17 +1076,11 @@ where
self.zkvm_execution_layer_config
.as_ref()
.map(|_| Arc::new(zkvm_execution_layer::registry_proof_verification::VerifierRegistry::new_with_dummy_verifiers())),
// Pass whether this node has an execution layer AND generates proofs
// Nodes with EL+proof-gen validate via traditional execution
// Nodes with EL but no proof-gen wait for proofs (lightweight verifier)
has_execution_layer_and_proof_gen,
)
.map_err(|e| format!("Error initializing DataAvailabilityChecker: {:?}", e))?,
),
kzg: self.kzg.clone(),
rng: Arc::new(Mutex::new(rng)),
zkvm_generator_registry: self.zkvm_generator_registry,
proof_generation_tx: self.proof_generation_tx,
};

let head = beacon_chain.head_snapshot();
Expand Down
3 changes: 0 additions & 3 deletions beacon_node/beacon_chain/src/data_availability_checker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -130,14 +130,12 @@ impl<T: BeaconChainTypes> DataAvailabilityChecker<T> {
custody_context: Arc<CustodyContext<T::EthSpec>>,
spec: Arc<ChainSpec>,
verifier_registry: Option<Arc<VerifierRegistry>>,
has_execution_layer_and_proof_gen: bool,
) -> Result<Self, AvailabilityCheckError> {
let inner = DataAvailabilityCheckerInner::new(
OVERFLOW_LRU_CAPACITY_NON_ZERO,
store,
custody_context.clone(),
spec.clone(),
has_execution_layer_and_proof_gen,
)?;
Ok(Self {
complete_blob_backfill,
Expand Down Expand Up @@ -1473,7 +1471,6 @@ mod test {
custody_context,
spec,
None,
false,
)
.expect("should initialise data availability checker")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,6 @@ impl<E: EthSpec> PendingComponents<E> {
&self,
spec: &Arc<ChainSpec>,
num_expected_columns_opt: Option<usize>,
has_execution_layer_and_proof_gen: bool,
recover: R,
) -> Result<Option<AvailableExecutedBlock<E>>, AvailabilityCheckError>
where
Expand Down Expand Up @@ -351,12 +350,7 @@ impl<E: EthSpec> PendingComponents<E> {
};

// Check if this node needs execution proofs to validate blocks.
// Nodes that have EL and generate proofs validate via EL execution.
// Nodes that have EL but DON'T generate proofs are lightweight verifiers and wait for proofs.
// TODO(zkproofs): This is a technicality mainly because we cannot remove the EL on kurtosis
// ie each CL is coupled with an EL
let needs_execution_proofs =
spec.zkvm_min_proofs_required().is_some() && !has_execution_layer_and_proof_gen;
let needs_execution_proofs = spec.zkvm_min_proofs_required().is_some();

if needs_execution_proofs {
let min_proofs = spec.zkvm_min_proofs_required().unwrap();
Expand Down Expand Up @@ -488,10 +482,6 @@ pub struct DataAvailabilityCheckerInner<T: BeaconChainTypes> {
state_cache: StateLRUCache<T>,
custody_context: Arc<CustodyContext<T::EthSpec>>,
spec: Arc<ChainSpec>,
/// Whether this node has an execution layer AND generates proofs.
/// - true: Node has EL and generates proofs → validates via EL execution
/// - false: Node either has no EL, or has EL but doesn't generate → waits for proofs (lightweight verifier)
has_execution_layer_and_proof_gen: bool,
}

// This enum is only used internally within the crate in the reconstruction function to improve
Expand All @@ -509,14 +499,12 @@ impl<T: BeaconChainTypes> DataAvailabilityCheckerInner<T> {
beacon_store: BeaconStore<T>,
custody_context: Arc<CustodyContext<T::EthSpec>>,
spec: Arc<ChainSpec>,
has_execution_layer_and_proof_gen: bool,
) -> Result<Self, AvailabilityCheckError> {
Ok(Self {
critical: RwLock::new(LruCache::new(capacity)),
state_cache: StateLRUCache::new(beacon_store, spec.clone()),
custody_context,
spec,
has_execution_layer_and_proof_gen,
})
}

Expand Down Expand Up @@ -720,7 +708,6 @@ impl<T: BeaconChainTypes> DataAvailabilityCheckerInner<T> {
if let Some(available_block) = pending_components.make_available(
&self.spec,
num_expected_columns_opt,
self.has_execution_layer_and_proof_gen,
|block, span| self.state_cache.recover_pending_executed_block(block, span),
)? {
// Explicitly drop read lock before acquiring write lock
Expand Down Expand Up @@ -1172,7 +1159,6 @@ mod test {
test_store,
custody_context,
spec.clone(),
false,
)
.expect("should create cache"),
);
Expand Down
2 changes: 1 addition & 1 deletion beacon_node/beacon_chain/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ pub use self::beacon_chain::{
BeaconBlockResponseWrapper, BeaconChain, BeaconChainTypes, BeaconStore, BlockProcessStatus,
ChainSegmentResult, ForkChoiceError, INVALID_FINALIZED_MERGE_TRANSITION_BLOCK_SHUTDOWN_REASON,
INVALID_JUSTIFIED_PAYLOAD_SHUTDOWN_REASON, LightClientProducerEvent, OverrideForkchoiceUpdate,
ProduceBlockVerification, ProofGenerationEvent, StateSkipConfig, WhenSlotSkipped,
ProduceBlockVerification, StateSkipConfig, WhenSlotSkipped,
};
pub use self::beacon_snapshot::BeaconSnapshot;
pub use self::chain_config::ChainConfig;
Expand Down
2 changes: 0 additions & 2 deletions beacon_node/client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ logging = { workspace = true }
metrics = { workspace = true }
monitoring_api = { workspace = true }
network = { workspace = true }
# TODO(zkproofs): add as a workspace dependency
proof_generation_service = { path = "../proof_generation_service" }
rand = { workspace = true }
sensitive_url = { workspace = true }
serde = { workspace = true }
Expand Down
64 changes: 0 additions & 64 deletions beacon_node/client/src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ use crate::compute_light_client_updates::{
};
use crate::config::{ClientGenesis, Config as ClientConfig};
use crate::notifier::spawn_notifier;
use beacon_chain::ProofGenerationEvent;
use beacon_chain::attestation_simulator::start_attestation_simulator_service;
use beacon_chain::data_availability_checker::start_availability_cache_maintenance_service;
use beacon_chain::graffiti_calculator::start_engine_version_cache_refresh_service;
Expand Down Expand Up @@ -33,7 +32,6 @@ use lighthouse_network::identity::Keypair;
use lighthouse_network::{NetworkGlobals, prometheus_client::registry::Registry};
use monitoring_api::{MonitoringHttpClient, ProcessType};
use network::{NetworkConfig, NetworkSenders, NetworkService};
use proof_generation_service;
use rand::SeedableRng;
use rand::rngs::{OsRng, StdRng};
use slasher::Slasher;
Expand All @@ -50,7 +48,6 @@ use types::{
BeaconState, BlobSidecarList, ChainSpec, EthSpec, ExecutionBlockHash, Hash256,
SignedBeaconBlock, test_utils::generate_deterministic_keypairs,
};
use zkvm_execution_layer;

/// Interval between polling the eth1 node for genesis information.
pub const ETH1_GENESIS_UPDATE_INTERVAL_MILLIS: u64 = 7_000;
Expand Down Expand Up @@ -92,8 +89,6 @@ pub struct ClientBuilder<T: BeaconChainTypes> {
beacon_processor_config: Option<BeaconProcessorConfig>,
beacon_processor_channels: Option<BeaconProcessorChannels<T::EthSpec>>,
light_client_server_rv: Option<Receiver<LightClientProducerEvent<T::EthSpec>>>,
proof_generation_rx:
Option<tokio::sync::mpsc::UnboundedReceiver<ProofGenerationEvent<T::EthSpec>>>,
eth_spec_instance: T::EthSpec,
}

Expand Down Expand Up @@ -128,7 +123,6 @@ where
beacon_processor_config: None,
beacon_processor_channels: None,
light_client_server_rv: None,
proof_generation_rx: None,
}
}

Expand Down Expand Up @@ -253,44 +247,6 @@ where
builder
};

// Set up proof generation service if zkVM is configured with generation proof types
let builder = if let Some(ref zkvm_config) = config.zkvm_execution_layer {
if !zkvm_config.generation_proof_types.is_empty() {
// Validate that proof generation requires an execution layer
// Proof-generating nodes will validate blocks via EL execution, not proofs
if config.execution_layer.is_none() {
return Err(
"Proof generation requires an EL. \
Nodes generating proofs must validate blocks via an execution layer. \
To run a lightweight verifier node (without EL), omit --zkvm-generation-proof-types."
.into(),
);
}

// Create channel for proof generation events
let (proof_gen_tx, proof_gen_rx) =
tokio::sync::mpsc::unbounded_channel::<ProofGenerationEvent<E>>();

// Create generator registry with enabled proof types
let registry = Arc::new(
zkvm_execution_layer::GeneratorRegistry::new_with_dummy_generators(
zkvm_config.generation_proof_types.clone(),
),
);

// Store receiver for later when we spawn the service
self.proof_generation_rx = Some(proof_gen_rx);

builder
.zkvm_generator_registry(registry)
.proof_generation_tx(proof_gen_tx)
} else {
builder
}
} else {
builder
};

let chain_exists = builder.store_contains_beacon_chain().unwrap_or(false);

// If the client is expect to resume but there's no beacon chain in the database,
Expand Down Expand Up @@ -852,26 +808,6 @@ where
beacon_chain.task_executor.clone(),
beacon_chain.clone(),
);

// Start proof generation service if configured
if let Some(proof_gen_rx) = self.proof_generation_rx {
let network_tx = self
.network_senders
.as_ref()
.ok_or("proof_generation_service requires network_senders")?
.network_send();

let service = proof_generation_service::ProofGenerationService::new(
beacon_chain.clone(),
proof_gen_rx,
network_tx,
);

runtime_context.executor.spawn(
async move { service.run().await },
"proof_generation_service",
);
}
}

Ok(Client {
Expand Down
Loading
Loading