@@ -25,8 +25,8 @@ use beacon_chain::{
25
25
use beacon_processor:: WorkEvent ;
26
26
use lighthouse_network:: rpc:: { RPCError , RequestType , RpcErrorResponse } ;
27
27
use lighthouse_network:: service:: api_types:: {
28
- AppRequestId , DataColumnsByRootRequester , Id , SamplingRequester , SingleLookupReqId ,
29
- SyncRequestId ,
28
+ AppRequestId , DataColumnsByRootRequestId , DataColumnsByRootRequester , Id , SamplingRequester ,
29
+ SingleLookupReqId , SyncRequestId ,
30
30
} ;
31
31
use lighthouse_network:: types:: SyncState ;
32
32
use lighthouse_network:: NetworkConfig ;
@@ -745,10 +745,10 @@ impl TestRig {
745
745
let first_dc = data_columns. first ( ) . unwrap ( ) ;
746
746
let block_root = first_dc. block_root ( ) ;
747
747
let sampling_request_id = match id. 0 {
748
- SyncRequestId :: DataColumnsByRoot (
749
- _ ,
750
- _requester @ DataColumnsByRootRequester :: Sampling ( sampling_id ) ,
751
- ) => sampling_id. sampling_request_id ,
748
+ SyncRequestId :: DataColumnsByRoot ( DataColumnsByRootRequestId {
749
+ requester : DataColumnsByRootRequester :: Sampling ( sampling_id ) ,
750
+ ..
751
+ } ) => sampling_id. sampling_request_id ,
752
752
_ => unreachable ! ( ) ,
753
753
} ;
754
754
self . complete_data_columns_by_root_request ( id, data_columns) ;
@@ -773,14 +773,15 @@ impl TestRig {
773
773
data_columns : Vec < Arc < DataColumnSidecar < E > > > ,
774
774
missing_components : bool ,
775
775
) {
776
- let lookup_id =
777
- if let SyncRequestId :: DataColumnsByRoot ( _, DataColumnsByRootRequester :: Custody ( id) ) =
778
- ids. first ( ) . unwrap ( ) . 0
779
- {
780
- id. requester . 0 . lookup_id
781
- } else {
782
- panic ! ( "not a custody requester" )
783
- } ;
776
+ let lookup_id = if let SyncRequestId :: DataColumnsByRoot ( DataColumnsByRootRequestId {
777
+ requester : DataColumnsByRootRequester :: Custody ( id) ,
778
+ ..
779
+ } ) = ids. first ( ) . unwrap ( ) . 0
780
+ {
781
+ id. requester . 0 . lookup_id
782
+ } else {
783
+ panic ! ( "not a custody requester" )
784
+ } ;
784
785
785
786
let first_column = data_columns. first ( ) . cloned ( ) . unwrap ( ) ;
786
787
@@ -1189,6 +1190,7 @@ impl TestRig {
1189
1190
penalty_msg, expect_penalty_msg,
1190
1191
"Unexpected penalty msg for {peer_id}"
1191
1192
) ;
1193
+ self . log ( & format ! ( "Found expected penalty {penalty_msg}" ) ) ;
1192
1194
}
1193
1195
1194
1196
pub fn expect_single_penalty ( & mut self , peer_id : PeerId , expect_penalty_msg : & ' static str ) {
@@ -1416,7 +1418,7 @@ fn test_single_block_lookup_empty_response() {
1416
1418
1417
1419
// The peer does not have the block. It should be penalized.
1418
1420
r. single_lookup_block_response ( id, peer_id, None ) ;
1419
- r. expect_penalty ( peer_id, "NoResponseReturned " ) ;
1421
+ r. expect_penalty ( peer_id, "NotEnoughResponsesReturned " ) ;
1420
1422
// it should be retried
1421
1423
let id = r. expect_block_lookup_request ( block_root) ;
1422
1424
// Send the right block this time.
@@ -2160,7 +2162,7 @@ fn sampling_batch_requests_not_enough_responses_returned() {
2160
2162
r. assert_sampling_request_ongoing ( block_root, & column_indexes) ;
2161
2163
2162
2164
// Split the indexes to simulate the case where the supernode doesn't have the requested column.
2163
- let ( _column_indexes_supernode_does_not_have , column_indexes_to_complete) =
2165
+ let ( column_indexes_supernode_does_not_have , column_indexes_to_complete) =
2164
2166
column_indexes. split_at ( 1 ) ;
2165
2167
2166
2168
// Complete the requests but only partially, so a NotEnoughResponsesReturned error occurs.
@@ -2176,7 +2178,7 @@ fn sampling_batch_requests_not_enough_responses_returned() {
2176
2178
2177
2179
// The request status should be set to NoPeers since the supernode, the only peer, returned not enough responses.
2178
2180
r. log_sampling_requests ( block_root, & column_indexes) ;
2179
- r. assert_sampling_request_nopeers ( block_root, & column_indexes ) ;
2181
+ r. assert_sampling_request_nopeers ( block_root, column_indexes_supernode_does_not_have ) ;
2180
2182
2181
2183
// The sampling request stalls.
2182
2184
r. expect_empty_network ( ) ;
@@ -2721,11 +2723,6 @@ mod deneb_only {
2721
2723
self . blobs . pop ( ) . expect ( "blobs" ) ;
2722
2724
self
2723
2725
}
2724
- fn invalidate_blobs_too_many ( mut self ) -> Self {
2725
- let first_blob = self . blobs . first ( ) . expect ( "blob" ) . clone ( ) ;
2726
- self . blobs . push ( first_blob) ;
2727
- self
2728
- }
2729
2726
fn expect_block_process ( mut self ) -> Self {
2730
2727
self . rig . expect_block_process ( ResponseType :: Block ) ;
2731
2728
self
@@ -2814,21 +2811,6 @@ mod deneb_only {
2814
2811
. expect_no_block_request ( ) ;
2815
2812
}
2816
2813
2817
- #[ test]
2818
- fn single_block_response_then_too_many_blobs_response_attestation ( ) {
2819
- let Some ( tester) = DenebTester :: new ( RequestTrigger :: AttestationUnknownBlock ) else {
2820
- return ;
2821
- } ;
2822
- tester
2823
- . block_response_triggering_process ( )
2824
- . invalidate_blobs_too_many ( )
2825
- . blobs_response ( )
2826
- . expect_penalty ( "TooManyResponses" )
2827
- // Network context returns "download success" because the request has enough blobs + it
2828
- // downscores the peer for returning too many.
2829
- . expect_no_block_request ( ) ;
2830
- }
2831
-
2832
2814
// Test peer returning block that has unknown parent, and a new lookup is created
2833
2815
#[ test]
2834
2816
fn parent_block_unknown_parent ( ) {
@@ -2869,7 +2851,7 @@ mod deneb_only {
2869
2851
} ;
2870
2852
tester
2871
2853
. empty_block_response ( )
2872
- . expect_penalty ( "NoResponseReturned " )
2854
+ . expect_penalty ( "NotEnoughResponsesReturned " )
2873
2855
. expect_block_request ( )
2874
2856
. expect_no_blobs_request ( )
2875
2857
. block_response_and_expect_blob_request ( )
0 commit comments