Skip to content

Commit

Permalink
Address lion's comments
Browse files Browse the repository at this point in the history
  • Loading branch information
pawanjay176 committed Jan 31, 2025
1 parent cbf7dca commit 8cab019
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
2 changes: 2 additions & 0 deletions beacon_node/network/src/subnet_service/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -636,6 +636,8 @@ impl<T: BeaconChainTypes> Stream for SubnetService<T> {
match self.scheduled_subscriptions.poll_next_unpin(cx) {
Poll::Ready(Some(Ok(exact_subnet))) => {
let ExactSubnet { subnet, slot } = exact_subnet;
// Set the `end_slot` for the subscription to be `duty.slot + 1` so that we unsubscribe
// only at the end of the duty slot.
if let Err(e) = self.subscribe_to_subnet_immediately(subnet, slot + 1) {
debug!(self.log, "Failed to subscribe to short lived subnet"; "subnet" => ?subnet, "err" => e);
}
Expand Down
8 changes: 2 additions & 6 deletions beacon_node/network/src/subnet_service/tests/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,6 @@ use types::{
SyncCommitteeSubscription, SyncSubnetId, ValidatorSubscription,
};

// Set to enable/disable logging
// const TEST_LOG_LEVEL: Option<slog::Level> = Some(slog::Level::Debug);
const TEST_LOG_LEVEL: Option<slog::Level> = None;

const SLOT_DURATION_MILLIS: u64 = 400;

type TestBeaconChainType = Witness<
Expand All @@ -45,7 +41,7 @@ impl TestBeaconChain {

let keypairs = generate_deterministic_keypairs(1);

let log = get_logger(TEST_LOG_LEVEL);
let log = logging::test_logger();
let store =
HotColdDB::open_ephemeral(StoreConfig::default(), spec.clone(), log.clone()).unwrap();

Expand Down Expand Up @@ -118,7 +114,7 @@ fn get_logger(log_level: Option<slog::Level>) -> Logger {
static CHAIN: LazyLock<TestBeaconChain> = LazyLock::new(TestBeaconChain::new_with_system_clock);

fn get_subnet_service() -> SubnetService<TestBeaconChainType> {
let log = get_logger(TEST_LOG_LEVEL);
let log = logging::test_logger();
let config = NetworkConfig::default();

let beacon_chain = CHAIN.chain.clone();
Expand Down

0 comments on commit 8cab019

Please sign in to comment.