Skip to content

Commit 22bbd3c

Browse files
authored
Remove proof generation type node (#3)
* - update tests to have special zkvm nodes - check for zkvm capability in the enr - execution_proof_lookup_request filters zkvm nodes * remove proof generation service * cargo fmt * fix * update proof-gen-types * endpoints exposed * add basic tests * cargo fmt * remove executionWitness
1 parent 0fc7530 commit 22bbd3c

File tree

25 files changed

+342
-717
lines changed

25 files changed

+342
-717
lines changed

Cargo.lock

Lines changed: 0 additions & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ members = [
1414
"beacon_node/lighthouse_tracing",
1515
"beacon_node/network",
1616
"beacon_node/operation_pool",
17-
"beacon_node/proof_generation_service",
1817
"beacon_node/store",
1918
"beacon_node/timer",
2019
"boot_node",

beacon_node/beacon_chain/src/beacon_chain.rs

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -133,15 +133,13 @@ use store::{
133133
KeyValueStore, KeyValueStoreOp, StoreItem, StoreOp,
134134
};
135135
use task_executor::{RayonPoolType, ShutdownReason, TaskExecutor};
136-
use tokio::sync::mpsc::UnboundedSender;
137136
use tokio_stream::Stream;
138137
use tracing::{Span, debug, debug_span, error, info, info_span, instrument, trace, warn};
139138
use tree_hash::TreeHash;
140139
use types::blob_sidecar::FixedBlobSidecarList;
141140
use types::data_column_sidecar::ColumnIndex;
142141
use types::payload::BlockProductionVersion;
143142
use types::*;
144-
use zkvm_execution_layer::GeneratorRegistry;
145143

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

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

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

355-
pub type ProofGenerationEvent<E> = (Hash256, Slot, Arc<SignedBeaconBlock<E>>);
356-
357353
pub type BeaconForkChoice<T> = ForkChoice<
358354
BeaconForkChoiceStore<
359355
<T as BeaconChainTypes>::EthSpec,
@@ -495,10 +491,6 @@ pub struct BeaconChain<T: BeaconChainTypes> {
495491
pub kzg: Arc<Kzg>,
496492
/// RNG instance used by the chain. Currently used for shuffling column sidecars in block publishing.
497493
pub rng: Arc<Mutex<Box<dyn RngCore + Send>>>,
498-
/// Registry of zkVM proof generators for altruistic proof generation
499-
pub zkvm_generator_registry: Option<Arc<GeneratorRegistry>>,
500-
/// Sender to notify proof generation service of blocks needing proofs
501-
pub proof_generation_tx: Option<UnboundedSender<ProofGenerationEvent<T::EthSpec>>>,
502494
}
503495

504496
pub enum BeaconBlockResponseWrapper<E: EthSpec> {
@@ -4191,20 +4183,6 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
41914183
current_slot,
41924184
);
41934185

4194-
// Notify proof generation service for altruistic proof generation
4195-
if let Some(ref proof_gen_tx) = self.proof_generation_tx {
4196-
let slot = signed_block.slot();
4197-
let event = (block_root, slot, signed_block.clone());
4198-
4199-
if let Err(e) = proof_gen_tx.send(event) {
4200-
debug!(
4201-
error = ?e,
4202-
?block_root,
4203-
"Failed to send proof generation event"
4204-
);
4205-
}
4206-
}
4207-
42084186
Ok(block_root)
42094187
}
42104188

beacon_node/beacon_chain/src/builder.rs

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ use crate::ChainConfig;
22
use crate::CustodyContext;
33
use crate::beacon_chain::{
44
BEACON_CHAIN_DB_KEY, CanonicalHead, LightClientProducerEvent, OP_POOL_DB_KEY,
5-
ProofGenerationEvent,
65
};
76
use crate::beacon_proposer_cache::BeaconProposerCache;
87
use crate::custody_context::NodeCustodyType;
@@ -43,7 +42,6 @@ use std::sync::Arc;
4342
use std::time::Duration;
4443
use store::{Error as StoreError, HotColdDB, ItemStore, KeyValueStoreOp};
4544
use task_executor::{ShutdownReason, TaskExecutor};
46-
use tokio::sync::mpsc::UnboundedSender;
4745
use tracing::{debug, error, info};
4846
use types::data_column_custody_group::CustodyIndex;
4947
use types::{
@@ -116,10 +114,6 @@ pub struct BeaconChainBuilder<T: BeaconChainTypes> {
116114
/// be replaced with ZkVmEngineApi from zkvm_execution_layer. This would allow the
117115
/// --execution-endpoint CLI flag to be optional when running in ZK-VM mode.
118116
zkvm_execution_layer_config: Option<zkvm_execution_layer::ZKVMExecutionLayerConfig>,
119-
/// Registry of zkVM proof generators for currently altruistic proof generation
120-
zkvm_generator_registry: Option<Arc<zkvm_execution_layer::GeneratorRegistry>>,
121-
/// Sender to notify proof generation service of blocks needing proofs
122-
proof_generation_tx: Option<UnboundedSender<ProofGenerationEvent<T::EthSpec>>>,
123117
}
124118

125119
impl<TSlotClock, E, THotStore, TColdStore>
@@ -161,8 +155,6 @@ where
161155
ordered_custody_column_indices: None,
162156
rng: None,
163157
zkvm_execution_layer_config: None,
164-
zkvm_generator_registry: None,
165-
proof_generation_tx: None,
166158
}
167159
}
168160

@@ -723,21 +715,6 @@ where
723715
self
724716
}
725717

726-
/// Sets the zkVM generator registry for altruistic proof generation.
727-
pub fn zkvm_generator_registry(
728-
mut self,
729-
registry: Arc<zkvm_execution_layer::GeneratorRegistry>,
730-
) -> Self {
731-
self.zkvm_generator_registry = Some(registry);
732-
self
733-
}
734-
735-
/// Sets a `Sender` to notify the proof generation service of new blocks.
736-
pub fn proof_generation_tx(mut self, sender: UnboundedSender<ProofGenerationEvent<E>>) -> Self {
737-
self.proof_generation_tx = Some(sender);
738-
self
739-
}
740-
741718
/// Creates a new, empty operation pool.
742719
fn empty_op_pool(mut self) -> Self {
743720
self.op_pool = Some(OperationPool::new());
@@ -1016,9 +993,6 @@ where
1016993
};
1017994
debug!(?custody_context, "Loaded persisted custody context");
1018995

1019-
let has_execution_layer_and_proof_gen =
1020-
self.execution_layer.is_some() && self.zkvm_generator_registry.is_some();
1021-
1022996
let beacon_chain = BeaconChain {
1023997
spec: self.spec.clone(),
1024998
config: self.chain_config,
@@ -1102,17 +1076,11 @@ where
11021076
self.zkvm_execution_layer_config
11031077
.as_ref()
11041078
.map(|_| Arc::new(zkvm_execution_layer::registry_proof_verification::VerifierRegistry::new_with_dummy_verifiers())),
1105-
// Pass whether this node has an execution layer AND generates proofs
1106-
// Nodes with EL+proof-gen validate via traditional execution
1107-
// Nodes with EL but no proof-gen wait for proofs (lightweight verifier)
1108-
has_execution_layer_and_proof_gen,
11091079
)
11101080
.map_err(|e| format!("Error initializing DataAvailabilityChecker: {:?}", e))?,
11111081
),
11121082
kzg: self.kzg.clone(),
11131083
rng: Arc::new(Mutex::new(rng)),
1114-
zkvm_generator_registry: self.zkvm_generator_registry,
1115-
proof_generation_tx: self.proof_generation_tx,
11161084
};
11171085

11181086
let head = beacon_chain.head_snapshot();

beacon_node/beacon_chain/src/data_availability_checker.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,14 +130,12 @@ impl<T: BeaconChainTypes> DataAvailabilityChecker<T> {
130130
custody_context: Arc<CustodyContext<T::EthSpec>>,
131131
spec: Arc<ChainSpec>,
132132
verifier_registry: Option<Arc<VerifierRegistry>>,
133-
has_execution_layer_and_proof_gen: bool,
134133
) -> Result<Self, AvailabilityCheckError> {
135134
let inner = DataAvailabilityCheckerInner::new(
136135
OVERFLOW_LRU_CAPACITY_NON_ZERO,
137136
store,
138137
custody_context.clone(),
139138
spec.clone(),
140-
has_execution_layer_and_proof_gen,
141139
)?;
142140
Ok(Self {
143141
complete_blob_backfill,
@@ -1473,7 +1471,6 @@ mod test {
14731471
custody_context,
14741472
spec,
14751473
None,
1476-
false,
14771474
)
14781475
.expect("should initialise data availability checker")
14791476
}

beacon_node/beacon_chain/src/data_availability_checker/overflow_lru_cache.rs

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,6 @@ impl<E: EthSpec> PendingComponents<E> {
272272
&self,
273273
spec: &Arc<ChainSpec>,
274274
num_expected_columns_opt: Option<usize>,
275-
has_execution_layer_and_proof_gen: bool,
276275
recover: R,
277276
) -> Result<Option<AvailableExecutedBlock<E>>, AvailabilityCheckError>
278277
where
@@ -351,12 +350,7 @@ impl<E: EthSpec> PendingComponents<E> {
351350
};
352351

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

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

497487
// This enum is only used internally within the crate in the reconstruction function to improve
@@ -509,14 +499,12 @@ impl<T: BeaconChainTypes> DataAvailabilityCheckerInner<T> {
509499
beacon_store: BeaconStore<T>,
510500
custody_context: Arc<CustodyContext<T::EthSpec>>,
511501
spec: Arc<ChainSpec>,
512-
has_execution_layer_and_proof_gen: bool,
513502
) -> Result<Self, AvailabilityCheckError> {
514503
Ok(Self {
515504
critical: RwLock::new(LruCache::new(capacity)),
516505
state_cache: StateLRUCache::new(beacon_store, spec.clone()),
517506
custody_context,
518507
spec,
519-
has_execution_layer_and_proof_gen,
520508
})
521509
}
522510

@@ -720,7 +708,6 @@ impl<T: BeaconChainTypes> DataAvailabilityCheckerInner<T> {
720708
if let Some(available_block) = pending_components.make_available(
721709
&self.spec,
722710
num_expected_columns_opt,
723-
self.has_execution_layer_and_proof_gen,
724711
|block, span| self.state_cache.recover_pending_executed_block(block, span),
725712
)? {
726713
// Explicitly drop read lock before acquiring write lock
@@ -1172,7 +1159,6 @@ mod test {
11721159
test_store,
11731160
custody_context,
11741161
spec.clone(),
1175-
false,
11761162
)
11771163
.expect("should create cache"),
11781164
);

beacon_node/beacon_chain/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ pub use self::beacon_chain::{
6666
BeaconBlockResponseWrapper, BeaconChain, BeaconChainTypes, BeaconStore, BlockProcessStatus,
6767
ChainSegmentResult, ForkChoiceError, INVALID_FINALIZED_MERGE_TRANSITION_BLOCK_SHUTDOWN_REASON,
6868
INVALID_JUSTIFIED_PAYLOAD_SHUTDOWN_REASON, LightClientProducerEvent, OverrideForkchoiceUpdate,
69-
ProduceBlockVerification, ProofGenerationEvent, StateSkipConfig, WhenSlotSkipped,
69+
ProduceBlockVerification, StateSkipConfig, WhenSlotSkipped,
7070
};
7171
pub use self::beacon_snapshot::BeaconSnapshot;
7272
pub use self::chain_config::ChainConfig;

beacon_node/client/Cargo.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@ logging = { workspace = true }
2424
metrics = { workspace = true }
2525
monitoring_api = { workspace = true }
2626
network = { workspace = true }
27-
# TODO(zkproofs): add as a workspace dependency
28-
proof_generation_service = { path = "../proof_generation_service" }
2927
rand = { workspace = true }
3028
sensitive_url = { workspace = true }
3129
serde = { workspace = true }

beacon_node/client/src/builder.rs

Lines changed: 0 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ use crate::compute_light_client_updates::{
44
};
55
use crate::config::{ClientGenesis, Config as ClientConfig};
66
use crate::notifier::spawn_notifier;
7-
use beacon_chain::ProofGenerationEvent;
87
use beacon_chain::attestation_simulator::start_attestation_simulator_service;
98
use beacon_chain::data_availability_checker::start_availability_cache_maintenance_service;
109
use beacon_chain::graffiti_calculator::start_engine_version_cache_refresh_service;
@@ -33,7 +32,6 @@ use lighthouse_network::identity::Keypair;
3332
use lighthouse_network::{NetworkGlobals, prometheus_client::registry::Registry};
3433
use monitoring_api::{MonitoringHttpClient, ProcessType};
3534
use network::{NetworkConfig, NetworkSenders, NetworkService};
36-
use proof_generation_service;
3735
use rand::SeedableRng;
3836
use rand::rngs::{OsRng, StdRng};
3937
use slasher::Slasher;
@@ -50,7 +48,6 @@ use types::{
5048
BeaconState, BlobSidecarList, ChainSpec, EthSpec, ExecutionBlockHash, Hash256,
5149
SignedBeaconBlock, test_utils::generate_deterministic_keypairs,
5250
};
53-
use zkvm_execution_layer;
5451

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

@@ -128,7 +123,6 @@ where
128123
beacon_processor_config: None,
129124
beacon_processor_channels: None,
130125
light_client_server_rv: None,
131-
proof_generation_rx: None,
132126
}
133127
}
134128

@@ -253,44 +247,6 @@ where
253247
builder
254248
};
255249

256-
// Set up proof generation service if zkVM is configured with generation proof types
257-
let builder = if let Some(ref zkvm_config) = config.zkvm_execution_layer {
258-
if !zkvm_config.generation_proof_types.is_empty() {
259-
// Validate that proof generation requires an execution layer
260-
// Proof-generating nodes will validate blocks via EL execution, not proofs
261-
if config.execution_layer.is_none() {
262-
return Err(
263-
"Proof generation requires an EL. \
264-
Nodes generating proofs must validate blocks via an execution layer. \
265-
To run a lightweight verifier node (without EL), omit --zkvm-generation-proof-types."
266-
.into(),
267-
);
268-
}
269-
270-
// Create channel for proof generation events
271-
let (proof_gen_tx, proof_gen_rx) =
272-
tokio::sync::mpsc::unbounded_channel::<ProofGenerationEvent<E>>();
273-
274-
// Create generator registry with enabled proof types
275-
let registry = Arc::new(
276-
zkvm_execution_layer::GeneratorRegistry::new_with_dummy_generators(
277-
zkvm_config.generation_proof_types.clone(),
278-
),
279-
);
280-
281-
// Store receiver for later when we spawn the service
282-
self.proof_generation_rx = Some(proof_gen_rx);
283-
284-
builder
285-
.zkvm_generator_registry(registry)
286-
.proof_generation_tx(proof_gen_tx)
287-
} else {
288-
builder
289-
}
290-
} else {
291-
builder
292-
};
293-
294250
let chain_exists = builder.store_contains_beacon_chain().unwrap_or(false);
295251

296252
// If the client is expect to resume but there's no beacon chain in the database,
@@ -852,26 +808,6 @@ where
852808
beacon_chain.task_executor.clone(),
853809
beacon_chain.clone(),
854810
);
855-
856-
// Start proof generation service if configured
857-
if let Some(proof_gen_rx) = self.proof_generation_rx {
858-
let network_tx = self
859-
.network_senders
860-
.as_ref()
861-
.ok_or("proof_generation_service requires network_senders")?
862-
.network_send();
863-
864-
let service = proof_generation_service::ProofGenerationService::new(
865-
beacon_chain.clone(),
866-
proof_gen_rx,
867-
network_tx,
868-
);
869-
870-
runtime_context.executor.spawn(
871-
async move { service.run().await },
872-
"proof_generation_service",
873-
);
874-
}
875811
}
876812

877813
Ok(Client {

0 commit comments

Comments
 (0)