fix(gossipsub): prune empty topic entries from topics map#3405
Open
lodekeeper wants to merge 3 commits intolibp2p:mainfrom
Open
fix(gossipsub): prune empty topic entries from topics map#3405lodekeeper wants to merge 3 commits intolibp2p:mainfrom
lodekeeper wants to merge 3 commits intolibp2p:mainfrom
Conversation
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Monorepo port of
ChainSafe/js-libp2p-gossipsub#543.This carries over the empty-topic pruning fix for the internal
topics: Map<TopicStr, Set<PeerIdStr>>bookkeeping:topicsentries on remote unsubscribetopicsentries on peer disconnecttopicsentries from unsubscribe-only updatesOriginal standalone PR / discussion:
ChainSafe/js-libp2p-gossipsub#543Original issue context:
ChainSafe/js-libp2p-gossipsub#542Why reopen here?
wemeetagain asked for this to be reopened against the
js-libp2pmonorepo becausejs-libp2p-gossipsubwill soon be archived.Notes
This is intentionally scoped to
topicsonly. I did not fold in anymeshcleanup changes here becausemeshtracks local joined-topic state and deleting emptymeshtopics on disconnect would interfere with heartbeat maintenance/regrafting.Testing
npm exec --workspace packages/gossipsub -- aegir lintgossip.spec.tsrun currently trips pre-existing monorepo package type/build issues in unrelatedtest/utils/*files; this patch itself is limited topackages/gossipsub/src/gossipsub.tsandpackages/gossipsub/test/gossip.spec.tsAI disclosure
Initial heap analysis and patch drafting were assisted by AI tooling, then validated with local source inspection and review.