-
Notifications
You must be signed in to change notification settings - Fork 22
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
foldBlocks update #350
foldBlocks update #350
Conversation
4b9a087
to
08fd859
Compare
08fd859
to
a88ad73
Compare
, "k: " <> show (envSecurityParam env) | ||
, "Current IORef State: " <> show currentIORefState | ||
] | ||
clientIdle_DoneNwithMaybeError n ioRefErr |
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 not sure how soon this gets logged/written somewhere, but it may be worth enforcing strictness here to avoid accumulating thunks
clientIdle_DoneNwithMaybeError n ioRefErr | |
deepseq ioRefErr $ clientIdle_DoneNwithMaybeError n ioRefErr |
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.
So this would be ideal but I would need to derive NFData
instances for types in consensus. In a follow up PR I will see if I can easily create some orphan instances.
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.
Right. I guess we can get around using NFData with BangPatterns
:
- Make
DebugError
constructor field strict - use
let !ioRefError = DebugError . force $ ...
- this will evaluate whole expression, without the need forNFData
orphans - wrap
ioRefErr
inJust
when callingclientIdle_DoneNwithMaybeError
, becauseMaybe
is lazy
https://github.com/input-output-hk/cardano-api/pull/350/files#r1381956300
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.
54a634f
to
f3887a4
Compare
@@ -238,13 +240,15 @@ data LedgerStateError | |||
-- ^ Encountered a rollback larger than the security parameter. | |||
SlotNo -- ^ Oldest known slot number that we can roll back to. | |||
ChainPoint -- ^ Rollback was attempted to this point. | |||
| DebugError String |
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.
| DebugError String | |
| DebugError !String |
specified in the accumulator via the FoldStatus type Modify foldBlocks to accumulate the chain tip rather than only immutable blocks (blocks that are k blocks away from the tip) Add debug mode to foldBlocks which forces it to error with information about ledger states, client and server tip, number of requests in flight and the current IORef state
f3887a4
to
e9494bc
Compare
let ioRefErr = Just . DebugError | ||
$ unlines [ "newClientTip: " <> show newClientTip | ||
, "newServerTip: " <> show newServerTip | ||
, "newLedgerState: " <> show (snd newLedgerState) | ||
, "knownLedgerStates: " <> show (extractHistory knownLedgerStates) | ||
, "committedStates: " <> show (extractHistory committedStates) | ||
, "numberOfRequestsInFlight: " <> show n | ||
, "k: " <> show (envSecurityParam env) | ||
, "Current IORef State: " <> show currentIORefState | ||
] | ||
clientIdle_DoneNwithMaybeError n ioRefErr |
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.
let ioRefErr = Just . DebugError | |
$ unlines [ "newClientTip: " <> show newClientTip | |
, "newServerTip: " <> show newServerTip | |
, "newLedgerState: " <> show (snd newLedgerState) | |
, "knownLedgerStates: " <> show (extractHistory knownLedgerStates) | |
, "committedStates: " <> show (extractHistory committedStates) | |
, "numberOfRequestsInFlight: " <> show n | |
, "k: " <> show (envSecurityParam env) | |
, "Current IORef State: " <> show currentIORefState | |
] | |
clientIdle_DoneNwithMaybeError n ioRefErr | |
let !ioRefErr = DebugError . force | |
$ unlines [ "newClientTip: " <> show newClientTip | |
, "newServerTip: " <> show newServerTip | |
, "newLedgerState: " <> show (snd newLedgerState) | |
, "knownLedgerStates: " <> show (extractHistory knownLedgerStates) | |
, "committedStates: " <> show (extractHistory committedStates) | |
, "numberOfRequestsInFlight: " <> show n | |
, "k: " <> show (envSecurityParam env) | |
, "Current IORef State: " <> show currentIORefState | |
] | |
clientIdle_DoneNwithMaybeError n (Just ioRefErr) |
17e9f44
to
cc33aa3
Compare
Do not allow submitting transactions older than current node era
Changelog
Context
Additional context for the PR goes here. If the PR fixes a particular issue please provide a link to the issue.
How to trust this PR
Highlight important bits of the PR that will make the review faster. If there are commands the reviewer can run to observe the new behavior, describe them.
Checklist