Skip to content
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

fix: peer sharing agency is theirs error #33

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

lancevincentsalera
Copy link
Contributor

Issue

  • Some peers with peer sharing enabled has this broken behavior of not updating the client states when receiving Message::SharePeers(Vec<PeerAddress>)
  • Calling this function from peer sharing client should update the state from State::Busy to State::Idle
  • However, upon investigation, it seems like our peer sharing client cannot properly decode the intended message that it should receive.
  • Thus, the state won't update and will always be on State::Busy
  • Since the current behavior of the fanout stage is to schedule peer discovery up until a number of desired peers
  • There will be multiple instances where that peer will try to send_share_request(amount) and recv_peer_addresses() again and again.
  • And since the peer sharing client's state of the broken peer is still on State::Busy
  • An agency is theirs error will occur because in order for us to do send_share_request(amount) again, we need to be on State::Idle

Fix

  • This fix is very reliant on a change in pallas where we expose has_agency() function of Pallas' peersharing mini-protocol client
  • We check if we have agency first before we can send_share_request(amount) and recv_peer_addresses() again and again.
  • Otherwise, we set the peer's is_peer_sharing_enabled field to false so that it won't try to discover peers again

Other adjustments

  • Added a timeout duration for discovered peers when doing handshake query since a long hang will happen if we don't handle it especially with P2P relays
  • Another PR will be made for the fix of lock contention issue in the fanout stage

paulobressan and others added 6 commits February 19, 2025 15:43
* feat: updated priority to queue

* feat: implemented priority config

* feat: added priority module

* chore: adjusted lint

* feat: implemented priority quote

* feat: implemented storage query to be used in priority module

* test: implemented priority test

* chore: removed dbg

* chore: added validation when the state is empty

* docs: added priority docs

* chore: updated config structure

* docs: updated docs
@lancevincentsalera lancevincentsalera changed the title fix: peer sharing agency is theirs bug fix: peer sharing agency is theirs error Feb 28, 2025
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.

2 participants