Page MenuHomePhabricator

[avalanche] Improve proof checking at startup
AbandonedPublic

Authored by Fabien on May 4 2021, 06:28.

Details

Reviewers
deadalnix
Group Reviewers
Restricted Project
Summary

This adds a couple more checks for the proof supplied via -avaproof:

  • Make sure the serialized proof is not total garbage
  • Make sure the master private key matches the proof master public key
Test Plan
ninja check-functional

Event Timeline

Fabien requested review of this revision.May 4 2021, 06:28
deadalnix requested changes to this revision.May 4 2021, 06:45
deadalnix added a subscriber: deadalnix.
deadalnix added inline comments.
src/avalanche/processor.cpp
218 ↗(On Diff #28340)

Remove

225 ↗(On Diff #28340)

Are we going to continue to introduce errors which are formatted differently from the other init errors?

Also, why is the error sent on the log rather than reported as an error?

This revision now requires changes to proceed.May 4 2021, 06:45
src/avalanche/processor.cpp
225 ↗(On Diff #28340)

Only the exception is sent to the log, the error is returned like all the others and reported at init.

Remove the brackets and "supplied" wording

deadalnix requested changes to this revision.May 4 2021, 07:38

Please address previous feedback.

This revision now requires changes to proceed.May 4 2021, 07:38

Improve the error message to be more meaningful and consistent with other parts of the codebase.
Don't print the exception to the log but add it to the init error message.

deadalnix requested changes to this revision.May 4 2021, 13:40
deadalnix added inline comments.
src/avalanche/processor.cpp
223 ↗(On Diff #28342)

Put this in the try block so that the string is kept around needlessly.

230 ↗(On Diff #28342)

Do these error messages look like other error messages in init.cpp ? I don't think they do.

This revision now requires changes to proceed.May 4 2021, 13:40
Fabien planned changes to this revision.Jun 4 2021, 20:00