Page MenuHomePhabricator

[avalanche] start implementing reception of avaproof
AbandonedPublic

Authored by PiRK on Mar 31 2021, 13:11.

Details

Reviewers
deadalnix
Group Reviewers
Restricted Project
Summary

Until now the delegation was checked when receiving an avahello message.
When this happens we don't have the proof, so this check fails and the
node gets banned. The signature contained in the avahello message was
not checked.

This diff add a sig field to the AvalancheState to store the signature
until it can be checked, and delays the verification of the delegation
until after we receive the proof from the peer.
The avahello signature verification is implemented, and the node is
banned if his signature is wrong because signature verification is
expensive.

A test is added to ensure that this banning happens. A mininode sends a
valid delegation and an invalid signature in an avahello message, then
it sends a valid proof corresponding to the delegation. The signature
verification then fails.

This is mostly code salvaged from D9327
Depends on D9360

Test Plan

ninja all check-all

Event Timeline

PiRK requested review of this revision.Mar 31 2021, 13:12
src/net_processing.cpp
3996

This todo can be addressed only after we do the proof storage.

deadalnix requested changes to this revision.Apr 1 2021, 12:22
deadalnix added a subscriber: deadalnix.

You want to fix the proof size handling before moving on there, or you'll just multiply the point where this needs fixing.

This revision now requires changes to proceed.Apr 1 2021, 12:22

This can be abandoned. There is similar code in D9478 and Fabien is working on proper proof relaying.