Don't publish data columns reconstructed from RPC columns to the gossip network (#7409)

Don't publish data columns reconstructed from RPC columns to the gossip network, as this may result in peer downscoring if we're sending columns from past slots.
This commit is contained in:
Jimmy Chen
2025-05-08 09:24:48 +10:00
committed by GitHub
parent 058dae0641
commit 0f13029c7d
3 changed files with 15 additions and 4 deletions

View File

@@ -1160,7 +1160,8 @@ impl<T: BeaconChainTypes> NetworkBeaconProcessor<T> {
"Processed data column, waiting for other components"
);
self.attempt_data_column_reconstruction(block_root).await;
self.attempt_data_column_reconstruction(block_root, true)
.await;
}
},
Err(BlockError::DuplicateFullyImported(_)) => {

View File

@@ -918,9 +918,13 @@ impl<T: BeaconChainTypes> NetworkBeaconProcessor<T> {
///
/// Returns `Some(AvailabilityProcessingStatus)` if reconstruction is successfully performed,
/// otherwise returns `None`.
///
/// The `publish_columns` parameter controls whether reconstructed columns should be published
/// to the gossip network.
async fn attempt_data_column_reconstruction(
self: &Arc<Self>,
block_root: Hash256,
publish_columns: bool,
) -> Option<AvailabilityProcessingStatus> {
// Only supernodes attempt reconstruction
if !self.network_globals.is_supernode() {
@@ -930,7 +934,9 @@ impl<T: BeaconChainTypes> NetworkBeaconProcessor<T> {
let result = self.chain.reconstruct_data_columns(block_root).await;
match result {
Ok(Some((availability_processing_status, data_columns_to_publish))) => {
self.publish_data_columns_gradually(data_columns_to_publish, block_root);
if publish_columns {
self.publish_data_columns_gradually(data_columns_to_publish, block_root);
}
match &availability_processing_status {
AvailabilityProcessingStatus::Imported(hash) => {
debug!(

View File

@@ -383,8 +383,12 @@ impl<T: BeaconChainTypes> NetworkBeaconProcessor<T> {
);
// Attempt reconstruction here before notifying sync, to avoid sending out more requests
// that we may no longer need.
if let Some(availability) =
self.attempt_data_column_reconstruction(block_root).await
// We don't publish columns reconstructed from rpc columns to the gossip network,
// as these are likely historic columns.
let publish_columns = false;
if let Some(availability) = self
.attempt_data_column_reconstruction(block_root, publish_columns)
.await
{
result = Ok(availability)
}