-
Notifications
You must be signed in to change notification settings - Fork 86
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
Generalize StrictT(M)Var invariant #1040
Conversation
Rather than just returning a `Bool`, we return `Maybe` an error message. This paves the way for more detailed information we get back from the NF check.
5d58ef7
to
6dc6745
Compare
Ok, this works. Ready for review and to be merged. |
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.
LGTM
@@ -18,6 +18,11 @@ source-repository head | |||
location: https://github.com/input-output-hk/ouroboros-network | |||
subdir: io-sim-classes | |||
|
|||
flag checktvarinvariant |
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.
When/where do we enable this flag?
Thinking out loud: we want to enable it always (?) for test-consensus
and test-storage
. We don't want to have to pass it manually via the cmd line.
Dealing with invariants | ||
-------------------------------------------------------------------------------} | ||
|
||
checkInvariant :: HasCallStack => Maybe String -> m x -> m x |
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.
Would it be useful to reuse this function to check other invariants than this one? I mean instead of assert
, which does not support a custom error message (or a call stack with a depth > 1).
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.
💯
bors r+ |
1040: Generalize StrictT(M)Var invariant r=edsko a=edsko Rather than just returning a `Bool`, we return `Maybe` an error message. This paves the way for more detailed information we get back from the NF check. Marking this as a draft because still untested. Co-authored-by: Edsko de Vries <[email protected]>
It's a good suggestion regarding enabling the flag on CI, but I don't know how to do it. Opened a separate ticket for it IntersectMBO/ouroboros-consensus#756 . |
1040: Generalize StrictT(M)Var invariant r=edsko a=edsko Rather than just returning a `Bool`, we return `Maybe` an error message. This paves the way for more detailed information we get back from the NF check. Marking this as a draft because still untested. Co-authored-by: Edsko de Vries <[email protected]>
Rather than just returning a
Bool
, we returnMaybe
an error message. This paves the way for more detailed information we get back from the NF check.Marking this as a draft because still untested.