From 6bf2e623b63398dd2e06e209cf8a1cfeb14f9fa8 Mon Sep 17 00:00:00 2001 From: dapplion <35266934+dapplion@users.noreply.github.com> Date: Thu, 1 Dec 2022 14:54:45 +0700 Subject: [PATCH] Fix typo in gossipsub coreTopicsAtFork --- packages/beacon-node/src/network/network.ts | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/packages/beacon-node/src/network/network.ts b/packages/beacon-node/src/network/network.ts index b03c38f35122..b77ccff5623c 100644 --- a/packages/beacon-node/src/network/network.ts +++ b/packages/beacon-node/src/network/network.ts @@ -418,9 +418,13 @@ export class Network implements INetwork { // Before fork transition if (epoch === forkEpoch - FORK_EPOCH_LOOKAHEAD) { - this.logger.info("Subscribing gossip topics to next fork", {nextFork}); // Don't subscribe to new fork if the node is not subscribed to any topic - if (this.isSubscribedToGossipCoreTopics()) this.subscribeCoreTopicsAtFork(nextFork); + if (this.isSubscribedToGossipCoreTopics()) { + this.subscribeCoreTopicsAtFork(nextFork); + this.logger.info("Subscribing gossip topics before fork", {nextFork}); + } else { + this.logger.info("Skipping subscribing gossip topics before fork", {nextFork}); + } this.attnetsService.subscribeSubnetsToNextFork(nextFork); this.syncnetsService.subscribeSubnetsToNextFork(nextFork); } @@ -494,11 +498,11 @@ export class Network implements INetwork { if (this.opts.subscribeAllSubnets) { for (let subnet = 0; subnet < ATTESTATION_SUBNET_COUNT; subnet++) { - this.gossip.unsubscribeTopic({type: GossipType.beacon_attestation, fork, subnet}); + topics.push({type: GossipType.beacon_attestation, subnet}); } if (forkSeq >= ForkSeq.altair) { for (let subnet = 0; subnet < SYNC_COMMITTEE_SUBNET_COUNT; subnet++) { - this.gossip.unsubscribeTopic({type: GossipType.sync_committee, fork, subnet}); + topics.push({type: GossipType.sync_committee, subnet}); } } }