@lodestar/beacon-node
Version:
A Typescript implementation of the beacon chain
27 lines • 1.07 kB
TypeScript
import { ForkDigest, Root, Slot, phase0 } from "@lodestar/types";
export declare enum IrrelevantPeerCode {
INCOMPATIBLE_FORKS = "IRRELEVANT_PEER_INCOMPATIBLE_FORKS",
DIFFERENT_CLOCKS = "IRRELEVANT_PEER_DIFFERENT_CLOCKS",
DIFFERENT_FINALIZED = "IRRELEVANT_PEER_DIFFERENT_FINALIZED"
}
type IrrelevantPeerType = {
code: IrrelevantPeerCode.INCOMPATIBLE_FORKS;
ours: ForkDigest;
theirs: ForkDigest;
} | {
code: IrrelevantPeerCode.DIFFERENT_CLOCKS;
slotDiff: number;
} | {
code: IrrelevantPeerCode.DIFFERENT_FINALIZED;
expectedRoot: Root;
remoteRoot: Root;
};
/**
* Process a `Status` message to determine if a peer is relevant to us. If the peer is
* irrelevant the reason is returned.
*/
export declare function assertPeerRelevance(remote: phase0.Status, local: phase0.Status, currentSlot: Slot): IrrelevantPeerType | null;
export declare function isZeroRoot(root: Root): boolean;
export declare function renderIrrelevantPeerType(type: IrrelevantPeerType): string;
export {};
//# sourceMappingURL=assertPeerRelevance.d.ts.map