Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion packages/gossipsub/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@
"./types": {
"types": "./dist/src/types.d.ts",
"import": "./dist/src/types.js"
},
"./partial": {
"types": "./dist/src/partial/index.d.ts",
"import": "./dist/src/partial/index.js"
}
},
"typesVersions": {
Expand All @@ -51,7 +55,7 @@
"pretest:e2e": "npm run build",
"benchmark": "yarn benchmark:files 'test/benchmark/**/*.test.ts'",
"benchmark:files": "NODE_OPTIONS='--max-old-space-size=4096 --loader=ts-node/esm' benchmark --config .benchrc.yaml --defaultBranch master",
"test": "aegir test -f './dist/test/*.spec.js'",
"test": "aegir test -f './dist/test/*.spec.js' -f './dist/test/partial-messages/*.spec.js'",
"test:unit": "aegir test -f './dist/test/unit/*.test.js' --target node",
"test:e2e": "aegir test -f './dist/test/e2e/*.spec.js'",
"test:browser": "npm run test -- --target browser"
Expand Down
26 changes: 26 additions & 0 deletions packages/gossipsub/src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -259,3 +259,29 @@ export const BACKOFF_SLACK = 1

export const GossipsubIdontwantMinDataSize = 512
export const GossipsubIdontwantMaxMessages = 512

// Partial Messages Extension constants

/**
* Maximum number of groups to track per topic in PartialMessageState.
* When exceeded, oldest groups are evicted (LRU).
*
* @default 128
*/
export const PartialMessagesMaxGroups = 128

/**
* Time-to-live for partial message groups in milliseconds.
* Groups older than this are pruned during heartbeat.
*
* @default 120000 (2 minutes)
*/
export const PartialMessagesGroupTTLMs = 2 * minute

/**
* Maximum size in bytes for parts metadata.
* Metadata larger than this will be rejected.
*
* @default 1024
*/
export const PartialMessagesMaxMetadataSize = 1024
Loading
Loading