Page MenuHomePhabricator

[avalanche] Don't rely on the service bit for sending the avalanche message

Authored by Fabien on Jul 4 2022, 14:32.



This leverage the avahello message to determine if a peer has avalanche enabled rather than relying on the service bit or the ability to ignore the unsupported messages. This will let poll only nodes (that don't set the service bit) participate in the address and compact proof messaging.

Sending the getavaaddr and getavaproofs are now sent upon reception of the avahello message instead of the version message.

The tests are updated in a way that makes them closer to the actual real use case: the nodes are non longer connected via RPC but use the regular peer discovery mechanism instead.

Depends on D11723.

Test Plan
ninja all check-all

Diff Detail

rABC Bitcoin ABC
Lint Not Applicable
Tests Not Applicable

Event Timeline

Fabien requested review of this revision.Jul 4 2022, 14:32
deadalnix requested changes to this revision.Jul 5 2022, 12:58
deadalnix added a subscriber: deadalnix.
deadalnix added inline comments.
4911–4941 ↗(On Diff #34231)

The fact the message name made no sense was already a hint, but the fact all of this needs to be moved here is another. When you need to do a handshake before you do the handshake, you know you have one too many handshake.

This revision now requires changes to proceed.Jul 5 2022, 12:58

Use the avahello message instead of another handshake

sdulfari requested changes to this revision.Jul 12 2022, 16:31
sdulfari added a subscriber: sdulfari.
sdulfari added inline comments.
313 ↗(On Diff #34296)

Is this necessary?

287 ↗(On Diff #34296)

It seems like this should be the default interface to use in tests, so naming it AvaP2PInterface is more appropriate. There are not very many direct usages of the base interface, so maybe name the base something like NoHandshakeAvaP2PInterface to make it clear.

This revision now requires changes to proceed.Jul 12 2022, 16:31
313 ↗(On Diff #34296)

Yes, because you're now connecting more peers (all the below avapeers)

Rebase, make the handshake interface the default

This revision is now accepted and ready to land.Jul 14 2022, 22:57