-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sanity checking for node configuration on startup #874
Conversation
89e8181
to
ca818ca
Compare
My immediate thought is that the kinds of errors we're concerned with here deserve exceptions. |
ouroboros-consensus/src/ouroboros-consensus/Ouroboros/Consensus/HardFork/Combinator/Protocol.hs
Outdated
Show resolved
Hide resolved
ouroboros-consensus/src/ouroboros-consensus/Ouroboros/Consensus/HardFork/Combinator/Protocol.hs
Outdated
Show resolved
Hide resolved
ouroboros-consensus/src/ouroboros-consensus/Ouroboros/Consensus/HardFork/Combinator/Protocol.hs
Outdated
Show resolved
Hide resolved
ouroboros-consensus/src/ouroboros-consensus/Ouroboros/Consensus/Protocol/Abstract.hs
Outdated
Show resolved
Hide resolved
d50d74b
to
ff8db93
Compare
1eb753d
to
57bdbd3
Compare
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 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 |
ouroboros-consensus/src/ouroboros-consensus/Ouroboros/Consensus/Block/SupportsSanityCheck.hs
Outdated
Show resolved
Hide resolved
1b7a6de
to
09adfd2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm "Requesting changes" only because of the dangling dead code comment.
Otherwise, looks very good. Great comments. Idiomatic design. 👍
Regarding tracers, versus exceptions: tracers does seem reasonable, given that these checks are not necessarily fatal.
ouroboros-consensus-cardano/test/cardano-test/Test/Consensus/Cardano/SupportsSanityCheck.hs
Outdated
Show resolved
Hide resolved
ouroboros-consensus/src/ouroboros-consensus/Ouroboros/Consensus/Block/SupportsSanityCheck.hs
Outdated
Show resolved
Hide resolved
ouroboros-consensus/src/ouroboros-consensus/Ouroboros/Consensus/Block/SupportsSanityCheck.hs
Outdated
Show resolved
Hide resolved
ouroboros-consensus/src/ouroboros-consensus/Ouroboros/Consensus/Block/SupportsSanityCheck.hs
Outdated
Show resolved
Hide resolved
ouroboros-consensus/src/ouroboros-consensus/Ouroboros/Consensus/Block/SupportsSanityCheck.hs
Show resolved
Hide resolved
...s/src/ouroboros-consensus/Ouroboros/Consensus/HardFork/Combinator/Abstract/SingleEraBlock.hs
Outdated
Show resolved
Hide resolved
...onsensus/src/ouroboros-consensus/Ouroboros/Consensus/HardFork/Combinator/Node/SanityCheck.hs
Outdated
Show resolved
Hide resolved
ouroboros-consensus/src/unstable-consensus-testlib/Test/Util/SanityCheck.hs
Outdated
Show resolved
Hide resolved
81fc683
to
b90cb3c
Compare
ouroboros-consensus-diffusion/src/ouroboros-consensus-diffusion/Ouroboros/Consensus/Node.hs
Show resolved
Hide resolved
ouroboros-consensus/src/ouroboros-consensus/Ouroboros/Consensus/Block/SupportsSanityCheck.hs
Outdated
Show resolved
Hide resolved
ouroboros-consensus/src/unstable-mock-block/Ouroboros/Consensus/Mock/Node.hs
Outdated
Show resolved
Hide resolved
b90cb3c
to
08dc61b
Compare
19fedfa
to
e730e81
Compare
ouroboros-consensus-cardano/changelog.d/20240214_182440_fraser.murray_startup_sanity_checks.md
Outdated
Show resolved
Hide resolved
ouroboros-consensus/changelog.d/20240207_130158_fraser.murray_startup_sanity_checks.md
Outdated
Show resolved
Hide resolved
ouroboros-consensus/src/ouroboros-consensus/Ouroboros/Consensus/Block/SupportsSanityCheck.hs
Outdated
Show resolved
Hide resolved
...onsensus/src/ouroboros-consensus/Ouroboros/Consensus/HardFork/Combinator/Node/SanityCheck.hs
Outdated
Show resolved
Hide resolved
5977d3b
to
c46fc2a
Compare
appropriate changes to |
63846a8
to
82454c0
Compare
Wasn't the idea (also see #874 (comment)) to throw an exception for |
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
Makes sense, can you record that somewhere, maybe in #125?
Apart from that, LGTM after formatting, squasing and updating the PR description 👍
d9fdb4c
to
1173bb5
Compare
1173bb5
to
7bd62bf
Compare
Currently the only supported sanity check is that k (the security parameter) is consistent between eras, and traces a SanityCheckIssue exception if it isn't
7bd62bf
to
8448a91
Compare
cardano-node
to support this will only log the exception in the standard way, though in future it should cause the node to terminate. We plan to add a way for thecardano-node
tracer implementation to distinguish between sanity check issues which are fatal and those which are only warnings.SanityCheckIssue
exception will be traced in the newsanityCheckIssueTracer
.There is an associated branch in the cardano-node repository with changes required to support this additional
Tracer
.