ava-labs / awm-relayer

Service for relaying Avalanche Warp Messages between Subnets
Other
24 stars 19 forks source link

Fetch peers p2p #559

Open cam-schultz opened 4 days ago

cam-schultz commented 4 days ago

Why this should be merged

Connects to peers over p2p, rather than via the info API. Post Etna, info API nodes are not expected to track peers for all subnets, so we instead need to fetch peers directly from primary network validators, which do track all peers across all L1s. We do this by bootstrapping the network with connections to primary network validators (which are still fetched from the info API), and discovering peers via peer gossip. Peer gossip only tracks peers that correspond to known validators, so we also need to maintain an up-to-date view of the validators of the L1s we wish to connect to (including the primary network). This change leverages https://github.com/ava-labs/teleporter/pull/641 to confirm that we can connect to L1s with disjoint validator sets from the primary network.

Note: This PR uses a modified version of Avalanchego v1.12.0-fuji that relaxes the outbound peer request handling. Once this change is formalized and included in an Avalanchego release, we will circle back and update the dependency. This workaround is safe because it only impacts outbound messages from the signature aggregator peer.

How this works

How this was tested

CI

How is this documented

N/A