-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat!: deprecate named pubsub topics and use static/auto sharding (#2097
) * feat: deprecate named sharding & protocols adhere simplify network config type, all protocols use pubsub topic internally * chore: update tests * tests: rm application info * chore: use static sharding and auto sharding terminologies * chore: update docs for network config * chore: update interfaces * tests: update tests error message * chore: remove `ShardingParams` type and fix test
- Loading branch information
1 parent
86f730f
commit 5ce36c8
Showing
54 changed files
with
376 additions
and
787 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
import type { PeerId } from "@libp2p/interface"; | ||
|
||
import { type ShardInfo } from "./enr.js"; | ||
import { ThisOrThat } from "./misc.js"; | ||
import type { IBaseProtocolCore, ShardingParams } from "./protocols.js"; | ||
import { PubsubTopic, ThisOrThat } from "./misc.js"; | ||
import type { IBaseProtocolCore } from "./protocols.js"; | ||
import type { ShardInfo } from "./sharding.js"; | ||
|
||
export type MetadataQueryResult = ThisOrThat<"shardInfo", ShardInfo>; | ||
|
||
// IMetadata always has shardInfo defined while it is optionally undefined in IBaseProtocol | ||
export interface IMetadata extends Omit<IBaseProtocolCore, "shardInfo"> { | ||
shardInfo: ShardingParams; | ||
pubsubTopics: PubsubTopic[]; | ||
confirmOrAttemptHandshake(peerId: PeerId): Promise<MetadataQueryResult>; | ||
query(peerId: PeerId): Promise<MetadataQueryResult>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
export type ShardInfo = { | ||
clusterId: number; | ||
shards: number[]; | ||
}; | ||
|
||
export type ContentTopicInfo = { | ||
clusterId?: number; | ||
contentTopics: string[]; | ||
}; | ||
|
||
export type StaticSharding = ShardInfo; | ||
export type AutoSharding = ContentTopicInfo; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.