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

Remove subnet filter from Peer.TrackedSubnets() #2975

Open
wants to merge 19 commits into
base: master
Choose a base branch
from

Conversation

StephenButtolph
Copy link
Contributor

@StephenButtolph StephenButtolph commented Apr 29, 2024

Why this should be merged

For Sov networking, we must track which subnets the peer is attempting to connect to. Rather than including this information in every GetPeerList message, we can use the information provided during the Handshake. However, currently we limit the memory usage of a peer by filtering the provided subnets to be the subset of subnets that the local node also tracks.

This PR removes the filtering of tracked subnets and replaces it with a maximum number of tracked subnets.

How this works

  • Removes if p.MySubnets.Contains(subnetID) { from the handling of subnetIDs in the Handshake message.
  • Updates the usage of trackedSubnets to filter with the local trackedSubnets (if needed).

How this was tested

  • Added unit test
  • CI
  • Running on Fuji seems to report non-tracked subnets from info.Peers now.
{
    "ip": "54.163.96.167:9651",
    "publicIP": "54.163.96.167:9651",
    "nodeID": "NodeID-GPc1Si7SQ6oAEfP8MzQ3cFN3fsAtkwC6i",
    "version": "avalanchego/1.11.3",
    "lastSent": "2024-04-29T15:06:39-04:00",
    "lastReceived": "2024-04-29T15:06:39-04:00",
    "observedUptime": "0",
    "observedSubnetUptimes": {},
    "trackedSubnets": [
        "25BsTBm8GQZirHUUKoRSjed8NxjTxtnXP1FvGNanV3QRuizkdt",
        "2J8TLHUDfWuGnEuKKG6n47rkU9YcocEtpxCAaFg447doVBYLEH",
        "Ck7LqxbQX5wzqy6w6UHRoy6EDB1jeEb8AMa6V6vXyn4csc8Mu",
        "SEerb4ZQYMPFiSaekS1LqnJqPgYR5uPYBR9ggPjfxc1SaeBSj",
        "dLyxcugrVZarrCSREN4B7idVwoRzEbP3kzyJN2BTsoRqYggN5"
    ],
    "supportedACPs": [
        23,
        24,
        25,
        30,
        31,
        41,
        62
    ],
    "objectedACPs": [],
    "benched": []
}

@StephenButtolph StephenButtolph added the networking This involves networking label Apr 29, 2024
@StephenButtolph StephenButtolph added this to the v1.11.6 milestone Apr 29, 2024
@StephenButtolph StephenButtolph self-assigned this Apr 29, 2024
@StephenButtolph StephenButtolph marked this pull request as ready for review April 29, 2024 21:03
network/peer/peer.go Outdated Show resolved Hide resolved
network/peer/peer_test.go Outdated Show resolved Hide resolved
network/peer/peer_test.go Show resolved Hide resolved
@StephenButtolph StephenButtolph changed the base branch from master to standardize-peer-logs May 13, 2024 21:38
Base automatically changed from standardize-peer-logs to master May 14, 2024 15:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
networking This involves networking
Projects
Status: In Review 👀
Development

Successfully merging this pull request may close these issues.

None yet

3 participants