Skip to content

Commit

Permalink
Modify gossipsub params following consensus spec v1.1.10 (#4011)
Browse files Browse the repository at this point in the history
* Modify gossipsub params following consensus spec v1.1.10

* Specify GOSSIPSUB_HEARTBEAT_INTERVAL as a constant
  • Loading branch information
twoeths authored May 19, 2022
1 parent 2535f40 commit b6e0dc2
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions packages/lodestar/src/network/gossip/gossipsub.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ import {PeersData} from "../peers/peersData";
import {ClientKind} from "../peers/client";

/* eslint-disable @typescript-eslint/naming-convention */
/** As specified in https://github.com/ethereum/consensus-specs/blob/v1.1.10/specs/phase0/p2p-interface.md */
const GOSSIPSUB_HEARTBEAT_INTERVAL = 0.7 * 1000;

// TODO: Export this type
type GossipsubEvents = {
Expand Down Expand Up @@ -104,6 +106,11 @@ export class Eth2Gossipsub extends Gossipsub {
Dlo: GOSSIP_D_LOW,
Dhi: GOSSIP_D_HIGH,
Dlazy: 6,
heartbeatInterval: GOSSIPSUB_HEARTBEAT_INTERVAL,
fanoutTTL: 60 * 1000,
mcacheLength: 6,
mcacheGossip: 3,
seenTTL: 550 * GOSSIPSUB_HEARTBEAT_INTERVAL,
scoreParams,
scoreThresholds: gossipScoreThresholds,
// the default in gossipsub is 3s is not enough since lodestar suffers from I/O lag
Expand Down

0 comments on commit b6e0dc2

Please sign in to comment.