mirror of
https://github.com/sigp/lighthouse.git
synced 2026-05-30 20:57:10 +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:
@@ -20,8 +20,6 @@ pub struct GossipCache {
|
||||
topic_msgs: HashMap<GossipTopic, HashMap<Vec<u8>, Key>>,
|
||||
/// Timeout for blocks.
|
||||
beacon_block: Option<Duration>,
|
||||
/// Timeout for blobs.
|
||||
blob_sidecar: Option<Duration>,
|
||||
/// Timeout for data columns.
|
||||
data_column_sidecar: Option<Duration>,
|
||||
/// Timeout for aggregate attestations.
|
||||
@@ -59,8 +57,6 @@ pub struct GossipCacheBuilder {
|
||||
default_timeout: Option<Duration>,
|
||||
/// Timeout for blocks.
|
||||
beacon_block: Option<Duration>,
|
||||
/// Timeout for blob sidecars.
|
||||
blob_sidecar: Option<Duration>,
|
||||
/// Timeout for data column sidecars.
|
||||
data_column_sidecar: Option<Duration>,
|
||||
/// Timeout for aggregate attestations.
|
||||
@@ -195,7 +191,6 @@ impl GossipCacheBuilder {
|
||||
let GossipCacheBuilder {
|
||||
default_timeout,
|
||||
beacon_block,
|
||||
blob_sidecar,
|
||||
data_column_sidecar,
|
||||
aggregates,
|
||||
attestation,
|
||||
@@ -216,7 +211,6 @@ impl GossipCacheBuilder {
|
||||
expirations: DelayQueue::default(),
|
||||
topic_msgs: HashMap::default(),
|
||||
beacon_block: beacon_block.or(default_timeout),
|
||||
blob_sidecar: blob_sidecar.or(default_timeout),
|
||||
data_column_sidecar: data_column_sidecar.or(default_timeout),
|
||||
aggregates: aggregates.or(default_timeout),
|
||||
attestation: attestation.or(default_timeout),
|
||||
@@ -247,7 +241,6 @@ impl GossipCache {
|
||||
pub fn insert(&mut self, topic: GossipTopic, data: Vec<u8>) {
|
||||
let expire_timeout = match topic.kind() {
|
||||
GossipKind::BeaconBlock => self.beacon_block,
|
||||
GossipKind::BlobSidecar(_) => self.blob_sidecar,
|
||||
GossipKind::DataColumnSidecar(_) => self.data_column_sidecar,
|
||||
GossipKind::BeaconAggregateAndProof => self.aggregates,
|
||||
GossipKind::Attestation(_) => self.attestation,
|
||||
|
||||
@@ -284,10 +284,6 @@ pub(crate) fn create_whitelist_filter(
|
||||
for id in 0..sync_committee_subnet_count {
|
||||
add(SyncCommitteeMessage(SyncSubnetId::new(id)));
|
||||
}
|
||||
let blob_subnet_count = spec.blob_sidecar_subnet_count_max();
|
||||
for id in 0..blob_subnet_count {
|
||||
add(BlobSidecar(id));
|
||||
}
|
||||
for id in 0..spec.data_column_sidecar_subnet_count {
|
||||
add(DataColumnSidecar(DataColumnSubnetId::new(id)));
|
||||
}
|
||||
|
||||
@@ -7,10 +7,10 @@ use ssz::{Decode, Encode};
|
||||
use std::io::{Error, ErrorKind};
|
||||
use std::sync::Arc;
|
||||
use types::{
|
||||
AttesterSlashing, AttesterSlashingBase, AttesterSlashingElectra, BlobSidecar,
|
||||
DataColumnSidecar, DataColumnSubnetId, EthSpec, ForkContext, ForkName, Hash256,
|
||||
LightClientFinalityUpdate, LightClientOptimisticUpdate, PartialDataColumn,
|
||||
PartialDataColumnSidecar, PayloadAttestationMessage, ProposerSlashing, SignedAggregateAndProof,
|
||||
AttesterSlashing, AttesterSlashingBase, AttesterSlashingElectra, DataColumnSidecar,
|
||||
DataColumnSubnetId, EthSpec, ForkContext, ForkName, Hash256, LightClientFinalityUpdate,
|
||||
LightClientOptimisticUpdate, PartialDataColumn, PartialDataColumnSidecar,
|
||||
PayloadAttestationMessage, ProposerSlashing, SignedAggregateAndProof,
|
||||
SignedAggregateAndProofBase, SignedAggregateAndProofElectra, SignedBeaconBlock,
|
||||
SignedBeaconBlockAltair, SignedBeaconBlockBase, SignedBeaconBlockBellatrix,
|
||||
SignedBeaconBlockCapella, SignedBeaconBlockDeneb, SignedBeaconBlockElectra,
|
||||
@@ -24,8 +24,6 @@ use types::{
|
||||
pub enum PubsubMessage<E: EthSpec> {
|
||||
/// Gossipsub message providing notification of a new block.
|
||||
BeaconBlock(Arc<SignedBeaconBlock<E>>),
|
||||
/// Gossipsub message providing notification of a [`BlobSidecar`] along with the subnet id where it was received.
|
||||
BlobSidecar(Box<(u64, Arc<BlobSidecar<E>>)>),
|
||||
/// Gossipsub message providing notification of a [`DataColumnSidecar`] along with the subnet id where it was received.
|
||||
DataColumnSidecar(Box<(DataColumnSubnetId, Arc<DataColumnSidecar<E>>)>),
|
||||
/// Gossipsub message providing notification of a Aggregate attestation and associated proof.
|
||||
@@ -139,9 +137,6 @@ impl<E: EthSpec> PubsubMessage<E> {
|
||||
pub fn kind(&self) -> GossipKind {
|
||||
match self {
|
||||
PubsubMessage::BeaconBlock(_) => GossipKind::BeaconBlock,
|
||||
PubsubMessage::BlobSidecar(blob_sidecar_data) => {
|
||||
GossipKind::BlobSidecar(blob_sidecar_data.0)
|
||||
}
|
||||
PubsubMessage::DataColumnSidecar(column_sidecar_data) => {
|
||||
GossipKind::DataColumnSidecar(column_sidecar_data.0)
|
||||
}
|
||||
@@ -266,26 +261,6 @@ impl<E: EthSpec> PubsubMessage<E> {
|
||||
};
|
||||
Ok(PubsubMessage::BeaconBlock(Arc::new(beacon_block)))
|
||||
}
|
||||
GossipKind::BlobSidecar(blob_index) => {
|
||||
if let Some(fork_name) =
|
||||
fork_context.get_fork_from_context_bytes(gossip_topic.fork_digest)
|
||||
&& fork_name.deneb_enabled()
|
||||
{
|
||||
let blob_sidecar = Arc::new(
|
||||
BlobSidecar::from_ssz_bytes(data)
|
||||
.map_err(|e| format!("{:?}", e))?,
|
||||
);
|
||||
return Ok(PubsubMessage::BlobSidecar(Box::new((
|
||||
*blob_index,
|
||||
blob_sidecar,
|
||||
))));
|
||||
}
|
||||
|
||||
Err(format!(
|
||||
"beacon_blobs_and_sidecar topic invalid for given fork digest {:?}",
|
||||
gossip_topic.fork_digest
|
||||
))
|
||||
}
|
||||
GossipKind::DataColumnSidecar(subnet_id) => {
|
||||
match fork_context.get_fork_from_context_bytes(gossip_topic.fork_digest) {
|
||||
Some(fork) if fork.fulu_enabled() => {
|
||||
@@ -444,7 +419,6 @@ impl<E: EthSpec> PubsubMessage<E> {
|
||||
// messages for us.
|
||||
match &self {
|
||||
PubsubMessage::BeaconBlock(data) => data.as_ssz_bytes(),
|
||||
PubsubMessage::BlobSidecar(data) => data.1.as_ssz_bytes(),
|
||||
PubsubMessage::DataColumnSidecar(data) => data.1.as_ssz_bytes(),
|
||||
PubsubMessage::AggregateAndProofAttestation(data) => data.as_ssz_bytes(),
|
||||
PubsubMessage::VoluntaryExit(data) => data.as_ssz_bytes(),
|
||||
@@ -502,12 +476,6 @@ impl<E: EthSpec> std::fmt::Display for PubsubMessage<E> {
|
||||
block.slot(),
|
||||
block.message().proposer_index()
|
||||
),
|
||||
PubsubMessage::BlobSidecar(data) => write!(
|
||||
f,
|
||||
"BlobSidecar: slot: {}, blob index: {}",
|
||||
data.1.slot(),
|
||||
data.1.index,
|
||||
),
|
||||
PubsubMessage::DataColumnSidecar(data) => write!(
|
||||
f,
|
||||
"DataColumnSidecar: slot: {}, column index: {}",
|
||||
|
||||
@@ -21,7 +21,6 @@ pub const SSZ_SNAPPY_ENCODING_POSTFIX: &str = "ssz_snappy";
|
||||
pub const BEACON_BLOCK_TOPIC: &str = "beacon_block";
|
||||
pub const BEACON_AGGREGATE_AND_PROOF_TOPIC: &str = "beacon_aggregate_and_proof";
|
||||
pub const BEACON_ATTESTATION_PREFIX: &str = "beacon_attestation_";
|
||||
pub const BLOB_SIDECAR_PREFIX: &str = "blob_sidecar_";
|
||||
pub const DATA_COLUMN_SIDECAR_PREFIX: &str = "data_column_sidecar_";
|
||||
pub const VOLUNTARY_EXIT_TOPIC: &str = "voluntary_exit";
|
||||
pub const PROPOSER_SLASHING_TOPIC: &str = "proposer_slashing";
|
||||
@@ -82,13 +81,6 @@ pub fn core_topics_to_subscribe<E: EthSpec>(
|
||||
topics.push(GossipKind::BlsToExecutionChange);
|
||||
}
|
||||
|
||||
if fork_name.deneb_enabled() && !fork_name.fulu_enabled() {
|
||||
// All of deneb blob topics are core topics
|
||||
for i in 0..spec.blob_sidecar_subnet_count(fork_name) {
|
||||
topics.push(GossipKind::BlobSidecar(i));
|
||||
}
|
||||
}
|
||||
|
||||
if fork_name.fulu_enabled() {
|
||||
for subnet in &opts.sampling_subnets {
|
||||
topics.push(GossipKind::DataColumnSidecar(*subnet));
|
||||
@@ -118,7 +110,6 @@ pub fn is_fork_non_core_topic(topic: &GossipTopic, _fork_name: ForkName) -> bool
|
||||
// All these topics are core-only
|
||||
GossipKind::BeaconBlock
|
||||
| GossipKind::BeaconAggregateAndProof
|
||||
| GossipKind::BlobSidecar(_)
|
||||
| GossipKind::DataColumnSidecar(_)
|
||||
| GossipKind::VoluntaryExit
|
||||
| GossipKind::ProposerSlashing
|
||||
@@ -166,8 +157,6 @@ pub enum GossipKind {
|
||||
BeaconBlock,
|
||||
/// Topic for publishing aggregate attestations and proofs.
|
||||
BeaconAggregateAndProof,
|
||||
/// Topic for publishing BlobSidecars.
|
||||
BlobSidecar(u64),
|
||||
/// Topic for publishing DataColumnSidecars.
|
||||
DataColumnSidecar(DataColumnSubnetId),
|
||||
/// Topic for publishing raw attestations on a particular subnet.
|
||||
@@ -216,9 +205,6 @@ impl std::fmt::Display for GossipKind {
|
||||
GossipKind::SyncCommitteeMessage(subnet_id) => {
|
||||
write!(f, "sync_committee_{}", **subnet_id)
|
||||
}
|
||||
GossipKind::BlobSidecar(blob_index) => {
|
||||
write!(f, "{}{}", BLOB_SIDECAR_PREFIX, blob_index)
|
||||
}
|
||||
GossipKind::DataColumnSidecar(column_subnet_id) => {
|
||||
write!(f, "{}{}", DATA_COLUMN_SIDECAR_PREFIX, **column_subnet_id)
|
||||
}
|
||||
@@ -349,9 +335,6 @@ impl std::fmt::Display for GossipTopic {
|
||||
GossipKind::SyncCommitteeMessage(index) => {
|
||||
format!("{}{}", SYNC_COMMITTEE_PREFIX_TOPIC, *index)
|
||||
}
|
||||
GossipKind::BlobSidecar(blob_index) => {
|
||||
format!("{}{}", BLOB_SIDECAR_PREFIX, blob_index)
|
||||
}
|
||||
GossipKind::DataColumnSidecar(column_subnet_id) => {
|
||||
format!("{}{}", DATA_COLUMN_SIDECAR_PREFIX, *column_subnet_id)
|
||||
}
|
||||
@@ -401,8 +384,6 @@ fn subnet_topic_index(topic: &str) -> Option<GossipKind> {
|
||||
return Some(GossipKind::SyncCommitteeMessage(SyncSubnetId::new(
|
||||
index.parse::<u64>().ok()?,
|
||||
)));
|
||||
} else if let Some(index) = topic.strip_prefix(BLOB_SIDECAR_PREFIX) {
|
||||
return Some(GossipKind::BlobSidecar(index.parse::<u64>().ok()?));
|
||||
} else if let Some(index) = topic.strip_prefix(DATA_COLUMN_SIDECAR_PREFIX) {
|
||||
return Some(GossipKind::DataColumnSidecar(DataColumnSubnetId::new(
|
||||
index.parse::<u64>().ok()?,
|
||||
@@ -576,17 +557,6 @@ mod tests {
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn blobs_are_not_subscribed_in_peerdas() {
|
||||
let spec = get_spec();
|
||||
let s = get_sampling_subnets();
|
||||
let topic_config = get_topic_config(&s);
|
||||
assert!(
|
||||
!core_topics_to_subscribe::<E>(ForkName::Fulu, &topic_config, &spec,)
|
||||
.contains(&GossipKind::BlobSidecar(0))
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn columns_are_subscribed_in_peerdas() {
|
||||
let spec = get_spec();
|
||||
|
||||
Reference in New Issue
Block a user