Page MenuHomePhabricator

[avalanche] Check the delegation generated at startup is valid
Needs RevisionPublic

Authored by Fabien on Mon, Apr 26, 10:14.

Details

Reviewers
deadalnix
Group Reviewers
Restricted Project
Summary

This makes sure we don't generate an invalid delegation. The proof and
delegation verification are moved to their own function to unbloat the
processor factory.

Depends on D9365.

Test Plan
ninja check-functional

Diff Detail

Event Timeline

Fabien requested review of this revision.Mon, Apr 26, 10:14
deadalnix requested changes to this revision.Mon, Apr 26, 21:24
deadalnix added a subscriber: deadalnix.

Why does this depends on D9365 . It seems to me that verifying that the delegation is correct isn't really something that depends on being able to supply it. If anything, it should be done no matter what.

src/avalanche/processor.cpp
304

Once again, is this checking for the delegation's validity? Why? If not, then this code is even more puzzling.

321

Is this used anywhere?

test/functional/abc_rpc_avalancheproof.py
267

The fact that this comment bars no resemblance to the error message reported is a sure sign something's not quite right. You can't express what is going on in a consistent manner because there is nothing consistent about this behavior to express.

I think I kinda understand where the edge case come from, but ultimately, that means the code needs to be reworked, and reading that test should have been a clear sign this is the case.

This revision now requires changes to proceed.Mon, Apr 26, 21:24