Skip to content

update go and improve node state checks#1

Open
x100111010 wants to merge 21 commits intospectre-project:mainfrom
x100111010:main
Open

update go and improve node state checks#1
x100111010 wants to merge 21 commits intospectre-project:mainfrom
x100111010:main

Conversation

@x100111010
Copy link
Member

@x100111010 x100111010 commented Mar 13, 2025

  • update go
  • handle non default ports:
    • checks if the address is routable using addressmanager.IsRoutable
    • does not explicitly filter out non-default ports in AddAddresses
    • -> nodes with the same IP but different ports are treated as different entries in the map

  • "Good": if it is not on a non-default port and if the last successful connection was within defaultStaleGoodTimeout
  • "Stale": If the last connection attempt was more than defaultStaleGoodTimeout ago or more than defaultStaleBadTimeout
  • "Expired": If it hasn’t been seen or had a successful connection in last pruneExpireTimeout

^Credits: @supertypo
really nice changes!


  • ignore addresses with port = 0

  • log address for invalid name

  • log the user agent and p2p version

  • only accept peers as good if protocol version >= 6

    • V5 is being used in go-spectred
    • V6 and above is rusty-spectre and it will be V7 post sigma, so this is easier compared to checking the node version (using regex) from the user agent
  • support for MinProtoVer: minprotocolversion

  • support for MinUaVer: min node version

  • avoid collecting peers for nodes below minimum protocol version

  • properly identify dns seeder with name and version

  • update dep and tidy

x100111010 and others added 20 commits March 9, 2025 23:40
- tn10 (18211) is already defined in spectred so it doesn't need explicit handling, it only makes sense for tn11
- ignore addresses with port = 0
- log address for invalid name
- V5 is being used in go-spectred
- V6 and above is rusty-spectre and it will be V7 post sigma, so this is easier compared to checking the node version (using regex) from the user agent
because go-spectred testnet uses suffix 1
…in p2p version

- support for MinProtoVer: minprotocolversion
- support for MinUaVer: min node version
- avoid collecting peers for nodes below minimum protocol version

- properly identify dns seeder with name and version
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.

1 participant