-
Notifications
You must be signed in to change notification settings - Fork 721
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
Trace hard fork transition events #1520
Conversation
1c2ddee
to
f8500e9
Compare
This is what the structured output looks like on
|
f8500e9
to
8e46b94
Compare
instance ToObject ProtocolUpdate where | ||
toObject verb (ProtocolUpdate updateVersion updateState) = | ||
mkObject $ | ||
[ "protocolUpdateVersion" .= updateVersion | ||
, "protocolUpdateState" .= toObject verb updateState | ||
] |
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.
Are we purposefully not providing a kind
field here?
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.
Probably not. I suggest add it.
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.
Oh, not purposefully, will fix it. BTW, if a kind
field is mandatory, maybe mkObject
should take it as an argument?
<> showT (unSlotNo slotNo) | ||
<> ", but we cannot lead because: " | ||
<> showT reason | ||
TraceNoLedgerState slotNo _blk -> const $ | ||
"No ledger state at slot " <> showT (unSlotNo slotNo) | ||
"No ledger state for slot " <> showT (unSlotNo slotNo) |
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 don't think it really matters much, but should we stay consistent with your changes and say "in slot"?
"No ledger state for slot " <> showT (unSlotNo slotNo) | |
"No ledger state in slot " <> showT (unSlotNo slotNo) |
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.
This made me realise that it's still not right, I now changed it to:
TraceNoLedgerState slotNo pt -> const $
"Could not obtain ledger state for point "
<> pack (showPoint MaximalVerbosity immutableTipPoint)
<> ", current slot: "
<> showT (unSlotNo slotNo)
Because we're asking a ledger state for a point, not the current slot.
I also intentionally use "for slot" for TraceNoLedgerView
, because we're asking for a forecast of the LedgerView
for a particular slot using forecastFor
.
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, modulo the couple copy'n'paste fixes below.
8e46b94
to
290de71
Compare
bors merge |
1520: Trace hard fork transition events r=mrBliss a=mrBliss This will trace events like: * `HardForkUpdateTransitionConfirmed` * `HardForkUpdateTransitionDone` * `HardForkUpdateTransitionRolledBack` * ... Co-authored-by: Thomas Winant <[email protected]>
TraceNoLedgerState slotNo pt -> const $ | ||
"Could not obtain ledger state for point " | ||
<> pack (showPoint MaximalVerbosity immutableTipPoint) |
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.
immutableTipPoint
is apparently not in scope.
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 after fixing a few copy'n'pastos, I make another one 🤦. I would blame ghcide for being unreliable in showing type errors (all green), but I should have run cabal build all
to check.
Build failed |
For example `TraceBlockFromFuture`, was incorrect.
290de71
to
35309ff
Compare
bors merge |
1520: Trace hard fork transition events r=mrBliss a=mrBliss This will trace events like: * `HardForkUpdateTransitionConfirmed` * `HardForkUpdateTransitionDone` * `HardForkUpdateTransitionRolledBack` * ... Co-authored-by: Thomas Winant <[email protected]>
Bors crashed, this PR is cursed. |
bors merge |
Build succeeded |
This will trace events like:
HardForkUpdateTransitionConfirmed
HardForkUpdateTransitionDone
HardForkUpdateTransitionRolledBack