mirror of
https://github.com/sigp/lighthouse.git
synced 2026-05-30 04:37:13 +00:00
Deprecate gossip blobs (#9126)
#9124 Deprecate unneeded pre-Fulu blob features - blob gossip - blob lookup sync - engine getBlobsV1 Also deprecates some tests and cleans up production code paths I think this is blocked until gnosis forks to fulu? Co-Authored-By: Eitan Seri-Levi <eserilev@ucsc.edu> Co-Authored-By: Eitan Seri- Levi <eserilev@gmail.com> Co-Authored-By: dapplion <35266934+dapplion@users.noreply.github.com> Co-Authored-By: Pawan Dhananjay <pawandhananjay@gmail.com> Co-Authored-By: Michael Sproul <michael@sigmaprime.io> Co-Authored-By: Daniel Knopik <daniel@dknopik.de> Co-Authored-By: Michael Sproul <michaelsproul@users.noreply.github.com>
This commit is contained in:
@@ -2,7 +2,6 @@ use super::*;
|
||||
use crate::decode::{ssz_decode_file, ssz_decode_file_with, ssz_decode_state, yaml_decode_file};
|
||||
use ::fork_choice::{AttestationFromBlock, PayloadVerificationStatus, ProposerHeadError};
|
||||
use beacon_chain::beacon_proposer_cache::compute_proposer_duties_from_head;
|
||||
use beacon_chain::blob_verification::GossipBlobError;
|
||||
use beacon_chain::block_verification_types::LookupBlock;
|
||||
use beacon_chain::chain_config::DisallowedReOrgOffsets;
|
||||
use beacon_chain::data_column_verification::GossipVerifiedDataColumn;
|
||||
@@ -12,7 +11,7 @@ use beacon_chain::{
|
||||
attestation_verification::{
|
||||
VerifiedAttestation, obtain_indexed_attestation_and_committees_per_slot,
|
||||
},
|
||||
blob_verification::GossipVerifiedBlob,
|
||||
blob_verification::KzgVerifiedBlob,
|
||||
custody_context::NodeCustodyType,
|
||||
test_utils::{BeaconChainHarness, EphemeralHarnessType},
|
||||
};
|
||||
@@ -696,7 +695,6 @@ impl<E: EthSpec> Tester<E> {
|
||||
|
||||
let mut blob_success = true;
|
||||
|
||||
// Convert blobs and kzg_proofs into sidecars, then plumb them into the availability tracker
|
||||
if let Some(blobs) = blobs.clone() {
|
||||
let proofs = kzg_proofs.unwrap();
|
||||
let commitments = block
|
||||
@@ -709,37 +707,51 @@ impl<E: EthSpec> Tester<E> {
|
||||
// Zipping will stop when any of the zipped lists runs out, which is what we want. Some
|
||||
// of the tests don't provide enough proofs/blobs, and should fail the availability
|
||||
// check.
|
||||
for (i, ((blob, kzg_proof), kzg_commitment)) in
|
||||
blobs.into_iter().zip(proofs).zip(commitments).enumerate()
|
||||
{
|
||||
let blob_sidecar = Arc::new(BlobSidecar {
|
||||
index: i as u64,
|
||||
blob,
|
||||
kzg_commitment,
|
||||
kzg_proof,
|
||||
signed_block_header: block.signed_block_header(),
|
||||
kzg_commitment_inclusion_proof: block
|
||||
.message()
|
||||
.body()
|
||||
.kzg_commitment_merkle_proof(i)
|
||||
.unwrap(),
|
||||
});
|
||||
let verified_blobs: Vec<KzgVerifiedBlob<E>> = blobs
|
||||
.into_iter()
|
||||
.zip(proofs)
|
||||
.zip(commitments)
|
||||
.enumerate()
|
||||
.filter_map(|(i, ((blob, kzg_proof), kzg_commitment))| {
|
||||
let blob_sidecar = Arc::new(BlobSidecar {
|
||||
index: i as u64,
|
||||
blob,
|
||||
kzg_commitment,
|
||||
kzg_proof,
|
||||
signed_block_header: block.signed_block_header(),
|
||||
kzg_commitment_inclusion_proof: block
|
||||
.message()
|
||||
.body()
|
||||
.kzg_commitment_merkle_proof(i)
|
||||
.unwrap(),
|
||||
});
|
||||
|
||||
let chain = self.harness.chain.clone();
|
||||
let blob =
|
||||
match GossipVerifiedBlob::new(blob_sidecar.clone(), blob_sidecar.index, &chain)
|
||||
{
|
||||
Ok(gossip_verified_blob) => gossip_verified_blob,
|
||||
Err(GossipBlobError::KzgError(_)) => {
|
||||
match KzgVerifiedBlob::new(
|
||||
blob_sidecar.clone(),
|
||||
&self.harness.chain.kzg,
|
||||
Duration::default(),
|
||||
) {
|
||||
Ok(verified) => Some(verified),
|
||||
Err(_) => {
|
||||
blob_success = false;
|
||||
GossipVerifiedBlob::__assumed_valid(blob_sidecar)
|
||||
None
|
||||
}
|
||||
Err(_) => GossipVerifiedBlob::__assumed_valid(blob_sidecar),
|
||||
};
|
||||
let result =
|
||||
self.block_on_dangerous(self.harness.chain.process_gossip_blob(blob))?;
|
||||
}
|
||||
})
|
||||
.collect();
|
||||
|
||||
if !verified_blobs.is_empty() {
|
||||
let result = self
|
||||
.harness
|
||||
.chain
|
||||
.data_availability_checker
|
||||
.put_kzg_verified_blobs(block_root, verified_blobs);
|
||||
if valid {
|
||||
assert!(result.is_ok());
|
||||
assert!(
|
||||
result.is_ok(),
|
||||
"put_kzg_verified_blobs failed: {:?}",
|
||||
result
|
||||
);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -6,6 +6,7 @@ edition = { workspace = true }
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[dependencies]
|
||||
beacon_chain = { workspace = true }
|
||||
clap = { workspace = true }
|
||||
environment = { workspace = true }
|
||||
execution_layer = { workspace = true }
|
||||
|
||||
@@ -30,9 +30,10 @@ const ALTAIR_FORK_EPOCH: u64 = 0;
|
||||
const BELLATRIX_FORK_EPOCH: u64 = 0;
|
||||
const CAPELLA_FORK_EPOCH: u64 = 0;
|
||||
const DENEB_FORK_EPOCH: u64 = 0;
|
||||
const ELECTRA_FORK_EPOCH: u64 = 2;
|
||||
// const FULU_FORK_EPOCH: u64 = 3;
|
||||
// const GLOAS_FORK_EPOCH: u64 = 4;
|
||||
const ELECTRA_FORK_EPOCH: u64 = 0;
|
||||
const FULU_FORK_EPOCH: u64 = 0;
|
||||
// TODO(gloas): enable Gloas in simulator, current blocker is lack of data column gossip verification
|
||||
// const GLOAS_FORK_EPOCH: u64 = 2;
|
||||
|
||||
const SUGGESTED_FEE_RECIPIENT: [u8; 20] =
|
||||
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1];
|
||||
@@ -171,8 +172,8 @@ pub fn run_basic_sim(matches: &ArgMatches) -> Result<(), String> {
|
||||
let genesis_delay = GENESIS_DELAY;
|
||||
|
||||
// Convenience variables. Update these values when adding a newer fork.
|
||||
let latest_fork_version = spec.electra_fork_version;
|
||||
let latest_fork_start_epoch = ELECTRA_FORK_EPOCH;
|
||||
let latest_fork_version = spec.fulu_fork_version;
|
||||
let latest_fork_start_epoch = FULU_FORK_EPOCH;
|
||||
|
||||
let mut slot_duration_ms = spec.get_slot_duration().as_millis() as u64;
|
||||
slot_duration_ms /= speed_up_factor;
|
||||
@@ -187,6 +188,7 @@ pub fn run_basic_sim(matches: &ArgMatches) -> Result<(), String> {
|
||||
spec.capella_fork_epoch = Some(Epoch::new(CAPELLA_FORK_EPOCH));
|
||||
spec.deneb_fork_epoch = Some(Epoch::new(DENEB_FORK_EPOCH));
|
||||
spec.electra_fork_epoch = Some(Epoch::new(ELECTRA_FORK_EPOCH));
|
||||
spec.fulu_fork_epoch = Some(Epoch::new(FULU_FORK_EPOCH));
|
||||
let spec = Arc::new(spec);
|
||||
env.eth2_config.spec = spec.clone();
|
||||
|
||||
|
||||
@@ -25,11 +25,12 @@ const END_EPOCH: u64 = 16;
|
||||
const GENESIS_DELAY: u64 = 38;
|
||||
const ALTAIR_FORK_EPOCH: u64 = 0;
|
||||
const BELLATRIX_FORK_EPOCH: u64 = 0;
|
||||
const CAPELLA_FORK_EPOCH: u64 = 1;
|
||||
const DENEB_FORK_EPOCH: u64 = 2;
|
||||
// const ELECTRA_FORK_EPOCH: u64 = 3;
|
||||
// const FULU_FORK_EPOCH: u64 = 4;
|
||||
// const GLOAS_FORK_EPOCH: u64 = 5;
|
||||
const CAPELLA_FORK_EPOCH: u64 = 0;
|
||||
const DENEB_FORK_EPOCH: u64 = 0;
|
||||
const ELECTRA_FORK_EPOCH: u64 = 0;
|
||||
const FULU_FORK_EPOCH: u64 = 0;
|
||||
// TODO(gloas): enable Gloas in simulator, current blocker is lack of data column gossip verification
|
||||
// const GLOAS_FORK_EPOCH: u64 = 2;
|
||||
|
||||
// Since simulator tests are non-deterministic and there is a non-zero chance of missed
|
||||
// attestations, define an acceptable network-wide attestation performance.
|
||||
@@ -191,8 +192,8 @@ pub fn run_fallback_sim(matches: &ArgMatches) -> Result<(), String> {
|
||||
spec.bellatrix_fork_epoch = Some(Epoch::new(BELLATRIX_FORK_EPOCH));
|
||||
spec.capella_fork_epoch = Some(Epoch::new(CAPELLA_FORK_EPOCH));
|
||||
spec.deneb_fork_epoch = Some(Epoch::new(DENEB_FORK_EPOCH));
|
||||
//spec.electra_fork_epoch = Some(Epoch::new(ELECTRA_FORK_EPOCH));
|
||||
//spec.fulu_fork_epoch = Some(Epoch::new(FULU_FORK_EPOCH));
|
||||
spec.electra_fork_epoch = Some(Epoch::new(ELECTRA_FORK_EPOCH));
|
||||
spec.fulu_fork_epoch = Some(Epoch::new(FULU_FORK_EPOCH));
|
||||
let spec = Arc::new(spec);
|
||||
env.eth2_config.spec = spec.clone();
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
use crate::checks::epoch_delay;
|
||||
use beacon_chain::custody_context::NodeCustodyType;
|
||||
use kzg::trusted_setup::get_trusted_setup;
|
||||
use node_test_rig::{
|
||||
ClientConfig, ClientGenesis, LocalBeaconNode, LocalExecutionNode, LocalValidatorClient,
|
||||
@@ -46,6 +47,7 @@ fn default_client_config(network_params: LocalNetworkParams, genesis_time: u64)
|
||||
beacon_config.network.discv5_config.enable_packet_filter = false;
|
||||
beacon_config.chain.enable_light_client_server = true;
|
||||
beacon_config.chain.optimistic_finalized_sync = false;
|
||||
beacon_config.chain.node_custody_type = NodeCustodyType::Supernode;
|
||||
beacon_config.trusted_setup = get_trusted_setup();
|
||||
|
||||
let el_config = execution_layer::Config {
|
||||
@@ -103,6 +105,15 @@ fn default_mock_execution_config<E: EthSpec>(
|
||||
)
|
||||
}
|
||||
|
||||
if let Some(gloas_fork_epoch) = spec.gloas_fork_epoch {
|
||||
mock_execution_config.amsterdam_time = Some(
|
||||
genesis_time
|
||||
+ (spec.get_slot_duration().as_secs())
|
||||
* E::slots_per_epoch()
|
||||
* gloas_fork_epoch.as_u64(),
|
||||
)
|
||||
}
|
||||
|
||||
mock_execution_config
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user