@@ -28,7 +28,7 @@ use std::sync::Arc;
28
28
use std:: time:: Duration ;
29
29
use task_executor:: TaskExecutor ;
30
30
use tokio:: sync:: mpsc:: { self , error:: TrySendError } ;
31
- use tracing:: { debug, error, trace, warn} ;
31
+ use tracing:: { debug, error, instrument , trace, warn} ;
32
32
use types:: * ;
33
33
34
34
pub use sync_methods:: ChainSegmentProcessId ;
@@ -825,30 +825,12 @@ impl<T: BeaconChainTypes> NetworkBeaconProcessor<T> {
825
825
}
826
826
}
827
827
828
- /// Attempt to reconstruct all data columns if the following conditions satisfies:
829
- /// - Our custody requirement is all columns
830
- /// - We have >= 50% of columns, but not all columns
831
- ///
832
- /// Returns `Some(AvailabilityProcessingStatus)` if reconstruction is successfully performed,
833
- /// otherwise returns `None`.
834
- ///
835
- /// The `publish_columns` parameter controls whether reconstructed columns should be published
836
- /// to the gossip network.
837
- async fn attempt_data_column_reconstruction (
838
- self : & Arc < Self > ,
839
- block_root : Hash256 ,
840
- ) -> Option < AvailabilityProcessingStatus > {
841
- // Only supernodes attempt reconstruction
842
- if !self
843
- . chain
844
- . data_availability_checker
845
- . custody_context ( )
846
- . current_is_supernode
847
- {
848
- return None ;
849
- }
850
-
828
+ /// Attempts to reconstruct all data columns if the conditions checked in
829
+ /// [`DataAvailabilityCheckerInner::check_and_set_reconstruction_started`] are satisfied.
830
+ #[ instrument( level = "debug" , skip_all, fields( ?block_root) ) ]
831
+ async fn attempt_data_column_reconstruction ( self : & Arc < Self > , block_root : Hash256 ) {
851
832
let result = self . chain . reconstruct_data_columns ( block_root) . await ;
833
+
852
834
match result {
853
835
Ok ( Some ( ( availability_processing_status, data_columns_to_publish) ) ) => {
854
836
self . publish_data_columns_gradually ( data_columns_to_publish, block_root) ;
@@ -864,29 +846,25 @@ impl<T: BeaconChainTypes> NetworkBeaconProcessor<T> {
864
846
AvailabilityProcessingStatus :: MissingComponents ( _, _) => {
865
847
debug ! (
866
848
result = "imported all custody columns" ,
867
- block_hash = %block_root,
849
+ %block_root,
868
850
"Block components still missing block after reconstruction"
869
851
) ;
870
852
}
871
853
}
872
-
873
- Some ( availability_processing_status)
874
854
}
875
855
Ok ( None ) => {
876
856
// reason is tracked via the `KZG_DATA_COLUMN_RECONSTRUCTION_INCOMPLETE_TOTAL` metric
877
857
trace ! (
878
- block_hash = %block_root,
858
+ %block_root,
879
859
"Reconstruction not required for block"
880
860
) ;
881
- None
882
861
}
883
862
Err ( e) => {
884
863
error ! (
885
864
%block_root,
886
865
error = ?e,
887
866
"Error during data column reconstruction"
888
867
) ;
889
- None
890
868
}
891
869
}
892
870
}
@@ -975,6 +953,7 @@ impl<T: BeaconChainTypes> NetworkBeaconProcessor<T> {
975
953
/// by some nodes on the network as soon as possible. Our hope is that some columns arrive from
976
954
/// other nodes in the meantime, obviating the need for us to publish them. If no other
977
955
/// publisher exists for a column, it will eventually get published here.
956
+ #[ instrument( level="debug" , skip_all, fields( ?block_root, data_column_count=data_columns_to_publish. len( ) ) ) ]
978
957
fn publish_data_columns_gradually (
979
958
self : & Arc < Self > ,
980
959
mut data_columns_to_publish : DataColumnSidecarList < T :: EthSpec > ,
0 commit comments