ouroboros-consensus icon indicating copy to clipboard operation
ouroboros-consensus copied to clipboard

Sanity checking for node configuration on startup

Open fraser-iohk opened this issue 1 year ago • 2 comments

this PR is intended as work towards #125, and adds a check to runNode ensuring that K is the same between eras

some questions / things I don't like:

  • is a Tracer the correct way to report these errors / warnings?
    • if the Tracers that are used here are created in cardano-node (for real purposes), should I also make a change there to add a tracer that throws / logs the failed sanity checks?

fraser-iohk avatar Jan 11 '24 11:01 fraser-iohk

is a Tracer the correct way to report these errors / warnings?

My immediate thought is that the kinds of errors we're concerned with here deserve exceptions.

nfrisby avatar Jan 11 '24 15:01 nfrisby

My immediate thought is that the kinds of errors we're concerned with here deserve exceptions.

when I discussed this initially with damien and javier, we thought that tracers would be better, since the "errors" we want to raise here shouldn't necessarily be fatal, but probably should at least be communicated to the user as a warning. we thought that implementing them with a Tracer meant that we'd have the flexibility to change it easily and have different issues with varying severity. I don't think exceptions are a bad idea, but it feels a little more awkward to have someone (probably a developer) add catches than to add a filter to a Tracer

edit: putting "errors" in quotes makes it look like I'm being snarky when I'm not trying to, I think that me calling them "errors" in the first place was a mistake

fraser-iohk avatar Feb 15 '24 14:02 fraser-iohk

appropriate changes to cardano-node are available on the fraser-iohk/consensus-startup-sanity-checks branch: https://github.com/IntersectMBO/cardano-node/tree/fraser-iohk/consensus-startup-sanity-checks

fraser-iohk avatar Jul 08 '24 14:07 fraser-iohk

appropriate changes to cardano-node are available on the fraser-iohk/consensus-startup-sanity-checks branch: https://github.com/IntersectMBO/cardano-node/tree/fraser-iohk/consensus-startup-sanity-checks

Wasn't the idea (also see https://github.com/IntersectMBO/ouroboros-consensus/pull/874#discussion_r1560717398) to throw an exception for InconsistentSecurityParam (as part of the tracer, based on a "fatality" classification function in Consensus)?

amesgen avatar Jul 08 '24 16:07 amesgen

Wasn't the idea (also see #874 (comment)) to throw an exception for InconsistentSecurityParam (as part of the tracer, based on a "fatality" classification function in Consensus)?

yep, that's the goal for the future, but for the first iteration (when stuff might go wrong) I've just made it trace the exception since I don't want to potentially break node use cases without warning the user for at least one version first

fraser-iohk avatar Jul 09 '24 11:07 fraser-iohk