Skip to content

Commit

Permalink
chore: remove IndexedGossipQueueAvgTime (#7125)
Browse files Browse the repository at this point in the history
  • Loading branch information
twoeths authored Oct 4, 2024
1 parent a19655d commit 0d1fd9c
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 150 deletions.
12 changes: 1 addition & 11 deletions packages/beacon-node/src/network/processor/gossipQueues/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,8 @@ import {GossipType} from "../../gossip/interface.js";
import {PendingGossipsubMessage} from "../types.js";
import {getGossipAttestationIndex} from "../../../util/sszBytes.js";
import {LinearGossipQueue} from "./linear.js";
import {
DropType,
GossipQueue,
GossipQueueOpts,
QueueType,
isIndexedGossipQueueAvgTimeOpts,
isIndexedGossipQueueMinSizeOpts,
} from "./types.js";
import {DropType, GossipQueue, GossipQueueOpts, QueueType, isIndexedGossipQueueMinSizeOpts} from "./types.js";
import {IndexedGossipQueueMinSize} from "./indexed.js";
import {IndexedGossipQueueAvgTime} from "./indexedAvgTime.js";

/**
* In normal condition, the higher this value the more efficient the signature verification.
Expand Down Expand Up @@ -120,8 +112,6 @@ export function createGossipQueues(beaconAttestationBatchValidation = false): {
return mapValues(gossipQueueOpts, (opts) => {
if (isIndexedGossipQueueMinSizeOpts(opts)) {
return new IndexedGossipQueueMinSize(opts);
} else if (isIndexedGossipQueueAvgTimeOpts(opts)) {
return new IndexedGossipQueueAvgTime(opts);
} else {
return new LinearGossipQueue<PendingGossipsubMessage>(opts);
}
Expand Down

This file was deleted.

11 changes: 1 addition & 10 deletions packages/beacon-node/src/network/processor/gossipQueues/types.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export type GossipQueueOpts<T> = LinearGossipQueueOpts | IndexedGossipQueueOpts<T> | IndexedGossipQueueMinSizeOpts<T>;
export type GossipQueueOpts<T> = LinearGossipQueueOpts | IndexedGossipQueueMinSizeOpts<T>;

export type LinearGossipQueueOpts = {
type: QueueType;
Expand All @@ -25,15 +25,6 @@ export function isIndexedGossipQueueMinSizeOpts<T>(opts: GossipQueueOpts<T>): op
);
}

export function isIndexedGossipQueueAvgTimeOpts<T>(opts: GossipQueueOpts<T>): opts is IndexedGossipQueueOpts<T> {
const avgTimeOpts = opts as IndexedGossipQueueMinSizeOpts<T>;
return (
avgTimeOpts.indexFn !== undefined &&
avgTimeOpts.minChunkSize === undefined &&
avgTimeOpts.maxChunkSize === undefined
);
}

export interface GossipQueue<T> {
length: number;
keySize: number;
Expand Down

0 comments on commit 0d1fd9c

Please sign in to comment.