Page MenuHomePhabricator

[avalanche] Improve proof checking at startup
Needs RevisionPublic

Authored by Fabien on Tue, May 4, 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.Tue, May 4, 06:28
deadalnix requested changes to this revision.Tue, May 4, 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.Tue, May 4, 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.Tue, May 4, 07:38

Please address previous feedback.

This revision now requires changes to proceed.Tue, May 4, 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.Tue, May 4, 13:40
deadalnix added inline comments.
src/avalanche/processor.cpp
223

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

230

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.Tue, May 4, 13:40