Repository navigation
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.
Description
Radios grow memory without bound under relay traffic. Two things in the SDK retain every message ever seen:
GossipSubParams.history_lengthis set to 100000, so go-libp2p-pubsub keeps that many heartbeat windows of full messages in its MessageCache, andseen_msg_idsis a HashSet that is only ever inserted into.This drops the history_length override back to the gossipsub default and replaces the set with
SeenMsgIds, a HashSet plus VecDeque capped at 10000 ids with oldest-first eviction. Gossipsub already discards repeats inside its 1800s seen TTL, so the set only has to outlast that window. The field type onGraphcastAgentchanges; nothing in graphops reads it outside the SDK.Verified with two ping-pong radios on 0.7.4. The stock build climbed to ~330MB RSS over a 15h soak and was still going, with the Go heap almost entirely MessageCache. The patched build stayed flat around 100MB for 6h.
test_seen_msg_ids_boundedcovers the eviction.Issue link
graphops/subgraph-radio#150
Checklist