Page MenuHomePhabricator

[avalanche] start implementing reception of avaproof
Needs RevisionPublic

Authored by PiRK on Wed, Mar 31, 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.Wed, Mar 31, 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.Thu, Apr 1, 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.Thu, Apr 1, 12:22