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
|
||||
);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user