File tree Expand file tree Collapse file tree 2 files changed +4
-6
lines changed
beacon_node/network/src/subnet_service Expand file tree Collapse file tree 2 files changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -636,6 +636,8 @@ impl<T: BeaconChainTypes> Stream for SubnetService<T> {
636
636
match self . scheduled_subscriptions . poll_next_unpin ( cx) {
637
637
Poll :: Ready ( Some ( Ok ( exact_subnet) ) ) => {
638
638
let ExactSubnet { subnet, slot } = exact_subnet;
639
+ // Set the `end_slot` for the subscription to be `duty.slot + 1` so that we unsubscribe
640
+ // only at the end of the duty slot.
639
641
if let Err ( e) = self . subscribe_to_subnet_immediately ( subnet, slot + 1 ) {
640
642
debug ! ( self . log, "Failed to subscribe to short lived subnet" ; "subnet" => ?subnet, "err" => e) ;
641
643
}
Original file line number Diff line number Diff line change @@ -20,10 +20,6 @@ use types::{
20
20
SyncCommitteeSubscription , SyncSubnetId , ValidatorSubscription ,
21
21
} ;
22
22
23
- // Set to enable/disable logging
24
- // const TEST_LOG_LEVEL: Option<slog::Level> = Some(slog::Level::Debug);
25
- const TEST_LOG_LEVEL : Option < slog:: Level > = None ;
26
-
27
23
const SLOT_DURATION_MILLIS : u64 = 400 ;
28
24
29
25
type TestBeaconChainType = Witness <
@@ -45,7 +41,7 @@ impl TestBeaconChain {
45
41
46
42
let keypairs = generate_deterministic_keypairs ( 1 ) ;
47
43
48
- let log = get_logger ( TEST_LOG_LEVEL ) ;
44
+ let log = logging :: test_logger ( ) ;
49
45
let store =
50
46
HotColdDB :: open_ephemeral ( StoreConfig :: default ( ) , spec. clone ( ) , log. clone ( ) ) . unwrap ( ) ;
51
47
@@ -118,7 +114,7 @@ fn get_logger(log_level: Option<slog::Level>) -> Logger {
118
114
static CHAIN : LazyLock < TestBeaconChain > = LazyLock :: new ( TestBeaconChain :: new_with_system_clock) ;
119
115
120
116
fn get_subnet_service ( ) -> SubnetService < TestBeaconChainType > {
121
- let log = get_logger ( TEST_LOG_LEVEL ) ;
117
+ let log = logging :: test_logger ( ) ;
122
118
let config = NetworkConfig :: default ( ) ;
123
119
124
120
let beacon_chain = CHAIN . chain . clone ( ) ;
You can’t perform that action at this time.
0 commit comments