File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change 2424rl_v2 = [Capability .BASE , Capability .BLOCK_HEADERS , Capability .RATE_LIMITS_V2 ]
2525rl_v1 = [Capability .BASE ]
2626node_with_params_b = node_with_params
27- test_different_versions_results : list [int ] = []
2827
2928
3029@dataclass
@@ -418,11 +417,14 @@ async def test_different_versions(
418417 # The following code checks whether all of the runs resulted in the same number of items in "rate_limits_tx",
419418 # which would mean the same rate limits are always used. This should not happen, since two nodes with V2
420419 # will use V2.
421- total_tx_msg_count = len (get_rate_limits_to_use (a_con .local_capabilities , a_con .peer_capabilities ))
420+ rate_limits = get_rate_limits_to_use (a_con .local_capabilities , a_con .peer_capabilities )[0 ]
421+ limit = rate_limits [ProtocolMessageTypes .request_header_blocks ]
422+ assert isinstance (limit , RLSettings )
422423
423- test_different_versions_results .append (total_tx_msg_count )
424- if len (test_different_versions_results ) >= 4 :
425- assert len (set (test_different_versions_results )) >= 2
424+ if Capability .RATE_LIMITS_V2 in a_con .local_capabilities and Capability .RATE_LIMITS_V2 in a_con .peer_capabilities :
425+ assert limit .frequency == 5000
426+ else :
427+ assert limit .frequency == 500
426428
427429
428430@pytest .mark .anyio
You can’t perform that action at this time.
0 commit comments