Skip to content

fix: Few bugs in Gossip protocol see description#21

Merged
ryandielhenn merged 3 commits intomainfrom
fix/node-mutex-for-gossip
Mar 26, 2026
Merged

fix: Few bugs in Gossip protocol see description#21
ryandielhenn merged 3 commits intomainfrom
fix/node-mutex-for-gossip

Conversation

@ryandielhenn
Copy link
Copy Markdown
Owner

@ryandielhenn ryandielhenn commented Mar 22, 2026

Changes

  1. Currently the gossip protocol reads/writes to node without acquiring a lock. The server runs the gossip pinger and listener in separate goroutines, so locks are needed to handle race conditions.

  2. When a PingReq was being being sent by the gossip pinger it was declaring the node that the PingReq was being sent to as suspect instead of the actual suspect peer.

  3. handlePingAck was sending a Ping to the origin node instead of a PingAck if it is not the original pinger.

Fixes #16

@ryandielhenn ryandielhenn requested a review from hrotovb001 March 22, 2026 06:18
@ryandielhenn ryandielhenn reopened this Mar 26, 2026
@ryandielhenn ryandielhenn merged commit 67f679c into main Mar 26, 2026
3 checks passed
@ryandielhenn ryandielhenn deleted the fix/node-mutex-for-gossip branch March 26, 2026 02:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Should use a lock when writing to Node

1 participant