Skip to content

test(gossipsub): parameters #1442

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 12 commits into from
Jun 6, 2025
Merged

test(gossipsub): parameters #1442

merged 12 commits into from
Jun 6, 2025

Conversation

rlve
Copy link
Contributor

@rlve rlve commented Jun 4, 2025

Add missing tests according to the 7. Parameter Configuration Tests

New tests:

  • "Max IDONTWANT messages per heartbeat per peer"
  • "rebalanceMesh Degree Hi - dScore controls number of peers to retain by score when pruning"
  • "Unsubscribe backoff" and remove skipped "GossipSub unsub - resub faster than backoff"
  • "Prune backoff"

New test suits:

  • "GossipSubParams validation"
  • "TopicParams validation"

@@ -129,7 +129,6 @@ proc setupGossipSubWithPeers*(

proc teardownGossipSub*(gossipSub: TestGossipSub, conns: seq[Connection]) {.async.} =
await allFuturesThrowing(conns.mapIt(it.close()))
await gossipSub.switch.stop()
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like it wasn't needed. With it we can observe logs:

WRN 2025-06-05 12:34:58.136+01:00 service is already stopped                 topics="libp2p switch" tid=15516792
WRN 2025-06-05 12:34:58.136+01:00 TCP transport already stopped              topics="libp2p tcptransport" tid=15516792


# Then it saves max 1001 messages in the history and the rest is dropped
check:
peer.iDontWants[0].len == 1001
Copy link
Contributor Author

@rlve rlve Jun 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Compared to the magic number, as the condition in code is done in the following way:

if peer.iDontWants[0].len > 1000:
break

Spec for context

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#1446

i'll make this pr tomorrow

@rlve rlve marked this pull request as ready for review June 5, 2025 14:29
@rlve rlve requested a review from a team as a code owner June 5, 2025 14:29
@vladopajic vladopajic mentioned this pull request Jun 5, 2025
@rlve rlve changed the title test(gossipsub): paremeters test(gossipsub): parameters Jun 6, 2025
@github-project-automation github-project-automation bot moved this from new to In Progress in nim-libp2p Jun 6, 2025
@rlve rlve enabled auto-merge (squash) June 6, 2025 13:50
@rlve rlve merged commit fb42a9b into master Jun 6, 2025
23 of 24 checks passed
@rlve rlve deleted the test-gossipsub-peremeters branch June 6, 2025 14:09
@github-project-automation github-project-automation bot moved this from In Progress to done in nim-libp2p Jun 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: done
Development

Successfully merging this pull request may close these issues.

3 participants