ouroboros-consensus
ouroboros-consensus copied to clipboard
Sanity checking for node configuration on startup
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
Tracerthe correct way to report these errors / warnings?- if the
Tracersthat are used here are created incardano-node(for real purposes), should I also make a change there to add a tracer that throws / logs the failed sanity checks?
- if the
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.
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
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
appropriate changes to
cardano-nodeare available on thefraser-iohk/consensus-startup-sanity-checksbranch: 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)?
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