UNPKG

@lodestar/beacon-node

Version:

A Typescript implementation of the beacon chain

46 lines 2.03 kB
/** * For more info on some of these constants: * https://github.com/ethereum/consensus-specs/blob/v1.1.10/specs/phase0/p2p-interface.md#configuration */ // Gossip constants /** * The maximum number of slots during which an attestation can be propagated. */ export const ATTESTATION_PROPAGATION_SLOT_RANGE = 32; /** The maximum allowed size of uncompressed gossip messages. */ export const GOSSIP_MAX_SIZE = 2 ** 20; export const GOSSIP_MAX_SIZE_BELLATRIX = 10 * GOSSIP_MAX_SIZE; /** The maximum allowed size of uncompressed req/resp chunked responses. */ export const MAX_CHUNK_SIZE = 2 ** 20; export const MAX_CHUNK_SIZE_BELLATRIX = 10 * MAX_CHUNK_SIZE; export var GoodByeReasonCode; (function (GoodByeReasonCode) { GoodByeReasonCode[GoodByeReasonCode["INBOUND_DISCONNECT"] = -1] = "INBOUND_DISCONNECT"; GoodByeReasonCode[GoodByeReasonCode["CLIENT_SHUTDOWN"] = 1] = "CLIENT_SHUTDOWN"; GoodByeReasonCode[GoodByeReasonCode["IRRELEVANT_NETWORK"] = 2] = "IRRELEVANT_NETWORK"; GoodByeReasonCode[GoodByeReasonCode["ERROR"] = 3] = "ERROR"; GoodByeReasonCode[GoodByeReasonCode["TOO_MANY_PEERS"] = 129] = "TOO_MANY_PEERS"; GoodByeReasonCode[GoodByeReasonCode["SCORE_TOO_LOW"] = 250] = "SCORE_TOO_LOW"; GoodByeReasonCode[GoodByeReasonCode["BANNED"] = 251] = "BANNED"; })(GoodByeReasonCode || (GoodByeReasonCode = {})); export const GOODBYE_KNOWN_CODES = { "-1": "InboundDisconnect", 0: "Unknown", // spec-defined codes 1: "Client shutdown", 2: "Irrelevant network", 3: "Internal fault/error", // Teku-defined codes 128: "Unable to verify network", // Lighthouse-defined codes 129: "Client has too many peers", 250: "Peer score too low", 251: "Peer banned this node", }; /** Until js-libp2p exports an enum for its events */ export var Libp2pEvent; (function (Libp2pEvent) { Libp2pEvent["connectionOpen"] = "connection:open"; Libp2pEvent["connectionClose"] = "connection:close"; })(Libp2pEvent || (Libp2pEvent = {})); //# sourceMappingURL=network.js.map