neo icon indicating copy to clipboard operation
neo copied to clipboard

[Fix] Improve peer bootstrap connections

Open Jim8y opened this issue 4 months ago • 3 comments

Description

Restore healthy bootstrap behaviour after the stash fix by letting Peer.OnTimer() pull a fuller batch of seed peers before honoring low MinDesiredConnections. That way private-net consensus still converges without depending on the accidental disconnects the race condition used to cause.

Fixes # N/A

Type of change

  • [x] Bug fix (non-breaking change which fixes an issue)
  • [ ] Optimization (the change is only an optimization)
  • [ ] Style (the change is only a code style for better maintenance or standard purpose)
  • [ ] New feature (non-breaking change which adds functionality)
  • [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • [ ] This change requires a documentation update

Test Configuration: dotnet test tests/Neo.UnitTests/Neo.UnitTests.csproj -c Release (fails before running: MSBuild cannot bind its named pipe in this sandbox— SocketException (permission denied)).

Checklist:

  • [x] My code follows the style guidelines of this project
  • [x] I have performed a self-review of my code
  • [ ] I have commented my code, particularly in hard-to-understand areas
  • [ ] I have made corresponding changes to the documentation
  • [x] My changes generate no new warnings
  • [ ] I have added tests that prove my fix is effective or that my feature works
  • [ ] New and existing unit tests pass locally with my changes
  • [x] Any dependent changes have been merged and published in downstream modules

Jim8y avatar Nov 01 '25 15:11 Jim8y

The fix looks good @Jim8y, there are some checks and parameters that could improve and some are a little strange to me.

i checked your comments, many of them are reasonable range checks, will udpate.

Jim8y avatar Nov 04 '25 14:11 Jim8y

Could you rebase to master @Jim8y ?

shargon avatar Nov 11 '25 16:11 shargon

To master

Wi1l-B0t avatar Nov 14 '25 13:11 Wi1l-B0t