Skip to content

Commit

Permalink
chore: remove AttnetsService (#6579)
Browse files Browse the repository at this point in the history
* chore: remove AttnetsService

* chore: fix lint

* fix: check type in cli

* chore: refactor DLLAttnetsService to AttnetsService

* Revert "chore: refactor DLLAttnetsService to AttnetsService"

This reverts commit 9e0cb99.
  • Loading branch information
twoeths authored Mar 28, 2024
1 parent ea7c6c6 commit d8f6199
Show file tree
Hide file tree
Showing 10 changed files with 3 additions and 620 deletions.
1 change: 0 additions & 1 deletion docs/pages/beacon-management/networking.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ Some of the important Lodestar flags related to networking are:
- [`--port6`](./beacon-cli#--port6)
- [`--discoveryPort6`](./beacon-cli#--discoveryport6)
- [`--bootnodes`](./beacon-cli#--bootnodes)
- [`--deterministicLongLivedAttnets`](./beacon-cli#--deterministiclonglivedattnets)
- [`--subscribeAllSubnets`](./beacon-cli#--subscribeallsubnets)
- [`--disablePeerScoring`](./beacon-cli#--disablepeerscoring)
- [`--enr.ip`](./beacon-cli#--enrip)
Expand Down
5 changes: 2 additions & 3 deletions packages/beacon-node/src/network/core/metrics.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import {RegistryMetricCreator} from "../../metrics/utils/registryMetricCreator.js";
import {SubnetType} from "../metadata.js";
import {DiscoveredPeerStatus} from "../peers/discover.js";
import {SubnetSource} from "../subnets/attnetsService.js";
import {DLLSubnetSource} from "../subnets/dllAttnetsService.js";

export type NetworkCoreMetrics = ReturnType<typeof createNetworkCoreMetrics>;
Expand Down Expand Up @@ -214,12 +213,12 @@ export function createNetworkCoreMetrics(register: RegistryMetricCreator) {
name: "lodestar_attnets_service_long_lived_subscriptions_total",
help: "Count of long lived subscriptions",
}),
subscribeSubnets: register.gauge<{subnet: number; src: SubnetSource | DLLSubnetSource}>({
subscribeSubnets: register.gauge<{subnet: number; src: DLLSubnetSource}>({
name: "lodestar_attnets_service_subscribe_subnets_total",
help: "Count of subscribe_subnets calls",
labelNames: ["subnet", "src"],
}),
unsubscribeSubnets: register.gauge<{subnet: number; src: SubnetSource | DLLSubnetSource}>({
unsubscribeSubnets: register.gauge<{subnet: number; src: DLLSubnetSource}>({
name: "lodestar_attnets_service_unsubscribe_subnets_total",
help: "Count of unsubscribe_subnets calls",
labelNames: ["subnet", "src"],
Expand Down
5 changes: 1 addition & 4 deletions packages/beacon-node/src/network/core/networkCore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import {PeerManager} from "../peers/peerManager.js";
import {ReqRespBeaconNode} from "../reqresp/ReqRespBeaconNode.js";
import {OutgoingRequestArgs, GetReqRespHandlerFn} from "../reqresp/types.js";
import {Eth2Gossipsub, getCoreTopicsAtFork} from "../gossip/index.js";
import {AttnetsService} from "../subnets/attnetsService.js";
import {SyncnetsService} from "../subnets/syncnetsService.js";
import {FORK_EPOCH_LOOKAHEAD, getActiveForks} from "../forks.js";
import {NetworkOptions} from "../options.js";
Expand Down Expand Up @@ -197,9 +196,7 @@ export class NetworkCore implements INetworkCore {

const enr = opts.discv5?.enr;
const nodeId = enr ? fromHexString(ENR.decodeTxt(enr).nodeId) : null;
const attnetsService = opts.deterministicLongLivedAttnets
? new DLLAttnetsService(config, clock, gossip, metadata, logger, metrics, nodeId, opts)
: new AttnetsService(config, clock, gossip, metadata, logger, metrics, opts);
const attnetsService = new DLLAttnetsService(config, clock, gossip, metadata, logger, metrics, nodeId, opts);
const syncnetsService = new SyncnetsService(config, clock, gossip, metadata, logger, metrics, opts);

const peerManager = await PeerManager.init(
Expand Down
2 changes: 0 additions & 2 deletions packages/beacon-node/src/network/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@ export const defaultNetworkOptions: NetworkOptions = {
useWorker: true,
// default set via research in https://github.com/ChainSafe/lodestar/issues/2115
maxYoungGenerationSizeMb: 152,
// subscribe to 2 subnets per node since v1.10
deterministicLongLivedAttnets: true,
// subscribe 2 slots before aggregator dutied slot to get stable mesh peers as monitored on goerli
slotsToSubscribeBeforeAggregatorDuty: 2,
// this should only be set to true if useWorker is true
Expand Down
Loading

0 comments on commit d8f6199

Please sign in to comment.