Skip to content
Open
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
95 changes: 77 additions & 18 deletions Cargo.lock

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

19 changes: 18 additions & 1 deletion bin/ethlambda/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,18 @@ struct CliOptions {
/// Directory for RocksDB storage
#[arg(long, default_value = "./data")]
data_dir: PathBuf,

/// Produce a real cryptographic Type-2 SNARK on the block-building hot
/// path (proposer Type-1 wrap + `merge_many_type_1`).
///
/// Off by default: each SNARK currently runs on the actor thread and
/// takes seconds, starving interval-1 attestation production. With the
/// flag off, blocks ship a metadata-only Type-2 envelope (empty SNARK
/// bytes); per-attestation crypto verification still runs at gossip
/// ingestion, and block-level verify falls back to its structural check.
/// Flip the flag on once the SNARK work is moved off the actor thread.
#[arg(long, default_value = "false")]
crypto_merge_t1_into_t2: bool,
}

#[tokio::main]
Expand Down Expand Up @@ -208,7 +220,12 @@ async fn main() -> eyre::Result<()> {
// and the API server (which exposes GET/POST admin endpoints).
let aggregator = AggregatorController::new(options.is_aggregator);

let blockchain = BlockChain::spawn(store.clone(), validator_keys, aggregator.clone());
let blockchain = BlockChain::spawn(
store.clone(),
validator_keys,
aggregator.clone(),
options.crypto_merge_t1_into_t2,
);

// Note: SwarmConfig.is_aggregator is intentionally a plain bool, not the
// AggregatorController — subnet subscriptions are decided once here and
Expand Down
12 changes: 2 additions & 10 deletions crates/blockchain/src/aggregation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use ethlambda_crypto::aggregate_mixed;
use ethlambda_storage::Store;
use ethlambda_types::{
attestation::{AggregationBits, HashedAttestationData},
block::{ByteListMiB, BytecodeClaim, TypeOneInfo, TypeOneMultiSignature},
block::{ByteListMiB, TypeOneMultiSignature},
primitives::H256,
signature::{ValidatorPublicKey, ValidatorSignature},
state::Validator,
Expand Down Expand Up @@ -290,15 +290,7 @@ pub fn aggregate_job(job: AggregationJob) -> Option<AggregatedGroupOutput> {
participants.dedup();

let aggregation_bits = aggregation_bits_from_validator_indices(&participants);
let proof = TypeOneMultiSignature {
info: TypeOneInfo {
message: data_root,
slot: job.slot,
participants: aggregation_bits,
bytecode_claim: BytecodeClaim::ZERO,
},
proof: proof_data,
};
let proof = TypeOneMultiSignature::new(aggregation_bits, proof_data);
metrics::observe_aggregated_proof_size(proof.proof.len());

Some(AggregatedGroupOutput {
Expand Down
Loading
Loading