ouroboros-network icon indicating copy to clipboard operation
ouroboros-network copied to clipboard

Feed peer selection governor with big ledger peers obtained from a snapshot

Open crocodile-dentist opened this issue 1 year ago • 0 comments

Description

Consensus Genesis syncing mode relies on having at least one honest peer to ensure a syncing node will finish on a good chain. Largest stake pools are a good proxy for honesty, and therefore these peers are the big ledger peers, which a syncing node may not be aware of when its ledger state may still be too stale. A snapshot file of these peers can be provided in a node's topology configuration, and this set will be provided to peer selection governor so it has an opportunity to make these connections.

This change modifies ledgerPeersThread to leverage this data, and appropriately randomly pick from this set and respond to peer selection governor when it makes a request for big ledger peers.

Checklist

  • Branch
    • [x] Updated changelog files.
    • [x] Commit sequence broadly makes sense
    • [x] Commits have useful messages
    • [ ] The documentation has been properly updated
    • [x] New tests are added if needed and existing tests are updated
    • [ ] If serialization changes, user-facing consequences (e.g. replay from genesis) are confirmed to be intentional.
  • Pull Request
    • [ ] Self-reviewed the diff
    • [ ] Useful pull request description at least containing the following information:
      • What does this PR change?
      • Why these changes were needed?
      • How does this affect downstream repositories and/or end-users?
      • Which ticket does this PR close (if any)? If it does, is it linked?
    • [ ] Reviewer requested

crocodile-dentist avatar Apr 11 '24 14:04 crocodile-dentist