Skip to content
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

[BUG] - query kes-period-info returns null for qKesKesKeyExpiry metric #4396

Closed
Tracked by #4144 ...
mkoura opened this issue Aug 26, 2022 · 6 comments · Fixed by #4909
Closed
Tracked by #4144 ...

[BUG] - query kes-period-info returns null for qKesKesKeyExpiry metric #4396

mkoura opened this issue Aug 26, 2022 · 6 comments · Fixed by #4909
Assignees
Labels
area: kes-info bug Something isn't working comp: cardano-cli status: duplicate The PR or issue already exists type: bug Something is not working user type: internal Created by an IOG employee

Comments

@mkoura
Copy link
Contributor

mkoura commented Aug 26, 2022

Internal

Area
Other Any other topic (Delegation, Ranking, ...).

Summary
The query kes-period-info returns null value for qKesKesKeyExpiry metric instead of time and date of kes key expiry.

$ cardano-cli query kes-period-info --testnet-magic 42 --op-cert-file node-pool2/op.cert
✓ Operational certificate's KES period is within the correct KES period interval
✓ The operational certificate counter agrees with the node protocol state counter
{
"qKesCurrentKesPeriod": 14,
"qKesEndKesInterval": 64,
"qKesKesKeyExpiry": null,
"qKesMaxKESEvolutions": 64,
"qKesNodeStateOperationalCertificateNumber": 0,
"qKesOnDiskOperationalCertificateNumber": 0,
"qKesRemainingSlotsInKesPeriod": 6440085,
"qKesSlotsPerKesPeriod": 129600,
"qKesStartKesInterval": 0
}

Expected behavior
The command reports time and date of kes key expiry.

System info (please complete the following information):

@mkoura mkoura added the bug Something isn't working label Aug 26, 2022
@gitmachtl
Copy link
Contributor

duplication of #4383

@CarlosLopezDeLara CarlosLopezDeLara moved this to 🔖 Sprint backlog in Node CLI/API 2022 Aug 29, 2022
@CarlosLopezDeLara CarlosLopezDeLara moved this from 🔖 Sprint backlog to 📋 Backlog in Node CLI/API 2022 Aug 29, 2022
@CarlosLopezDeLara CarlosLopezDeLara moved this from 📋 Backlog to 🔖 Sprint backlog in Node CLI/API 2022 Oct 19, 2022
@Jimbo4350 Jimbo4350 assigned Jimbo4350 and unassigned newhoggy Oct 20, 2022
@dorin100 dorin100 added status: duplicate The PR or issue already exists user type: internal Created by an IOG employee comp: cardano-cli area: kes-info type: bug Something is not working labels Oct 21, 2022
@Jimbo4350
Copy link
Contributor

Closing this. Please reopen if this is still relevant.

@mkoura
Copy link
Contributor Author

mkoura commented Nov 3, 2022

This issue is still present on master (46d8db3)

@mkoura mkoura reopened this Nov 3, 2022
@newhoggy
Copy link
Contributor

newhoggy commented Feb 22, 2023

On a testnet, this is the error that is returned by epochInfoSlotToUTCTime:

PastHorizon {pastHorizonCallStack = [("runQuery",SrcLoc {srcLocPackage = "rbrs-cnsnss-0.1.0.2-832f7c41", srcLocModule = "Ouroboros.Consensus.HardFork.History.Qry", srcLocFile = "src/Ouroboros/Consensus/HardFork/History/Qry.hs", srcLocStartLine = 430, srcLocStartCol = 44, srcLocEndLine = 430, srcLocEndCol = 64}),("interpretQuery",SrcLoc {srcLocPackage = "rbrs-cnsnss-0.1.0.2-832f7c41", srcLocModule = "Ouroboros.Consensus.HardFork.History.EpochInfo", srcLocFile = "src/Ouroboros/Consensus/HardFork/History/EpochInfo.hs", srcLocStartLine = 46, srcLocStartCol = 50, srcLocEndLine = 46, srcLocEndCol = 68}),("interpretQuery'",SrcLoc {srcLocPackage = "rbrs-cnsnss-0.1.0.2-832f7c41", srcLocModule = "Ouroboros.Consensus.HardFork.History.EpochInfo", srcLocFile = "src/Ouroboros/Consensus/HardFork/History/EpochInfo.hs", srcLocStartLine = 40, srcLocStartCol = 9, srcLocEndLine = 40, srcLocEndCol = 52}),("epochInfoSlotToRelativeTime_",SrcLoc {srcLocPackage = "crdn-slttng-0.1.0.2-182a6d0a", srcLocModule = "Cardano.Slotting.EpochInfo.API", srcLocFile = "src/Cardano/Slotting/EpochInfo/API.hs", srcLocStartLine = 62, srcLocStartCol = 9, srcLocEndLine = 62, srcLocEndCol = 37}),("epochInfoSlotToRelativeTime",SrcLoc {srcLocPackage = "crdn-slttng-0.1.0.2-182a6d0a", srcLocModule = "Cardano.Slotting.EpochInfo.API", srcLocFile = "src/Cardano/Slotting/EpochInfo/API.hs", srcLocStartLine = 125, srcLocStartCol = 40, srcLocEndLine = 125, srcLocEndCol = 70}),("epochInfoSlotToRelativeTime_",SrcLoc {srcLocPackage = "crdn-slttng-0.1.0.2-182a6d0a", srcLocModule = "Cardano.Slotting.EpochInfo.API", srcLocFile = "src/Cardano/Slotting/EpochInfo/API.hs", srcLocStartLine = 62, srcLocStartCol = 9, srcLocEndLine = 62, srcLocEndCol = 37}),("epochInfoSlotToRelativeTime",SrcLoc {srcLocPackage = "crdn-slttng-0.1.0.2-182a6d0a", srcLocModule = "Cardano.Slotting.EpochInfo.API", srcLocFile = "src/Cardano/Slotting/EpochInfo/API.hs", srcLocStartLine = 91, srcLocStartCol = 30, srcLocEndLine = 91, srcLocEndCol = 63}),("epochInfoSlotToUTCTime",SrcLoc {srcLocPackage = "cardano-cli-1.36.0-inplace", srcLocModule = "Cardano.CLI.Shelley.Run.Query", srcLocFile = "src/Cardano/CLI/Shelley/Run/Query.hs", srcLocStartLine = 516, srcLocStartCol = 17, srcLocEndLine = 519, srcLocEndCol = 112})], pastHorizonExpression = Some (EPair (ERelToAbsTime (ERelSlotToTime (EAbsToRelSlot (ELit (SlotNo 7776000))))) (ESlotLength (ELit (SlotNo 7776000)))), pastHorizonSummary = [EraSummary {eraStart = Bound {boundTime = RelativeTime 0s, boundSlot = SlotNo 0, boundEpoch = EpochNo 0}, eraEnd = EraEnd (Bound {boundTime = RelativeTime 0s, boundSlot = SlotNo 0, boundEpoch = EpochNo 0}), eraParams = EraParams {eraEpochSize = EpochSize 100, eraSlotLength = SlotLength 1s, eraSafeZone = StandardSafeZone 20}},EraSummary {eraStart = Bound {boundTime = RelativeTime 0s, boundSlot = SlotNo 0, boundEpoch = EpochNo 0}, eraEnd = EraEnd (Bound {boundTime = RelativeTime 0s, boundSlot = SlotNo 0, boundEpoch = EpochNo 0}), eraParams = EraParams {eraEpochSize = EpochSize 500, eraSlotLength = SlotLength 0.1s, eraSafeZone = StandardSafeZone 300}},EraSummary {eraStart = Bound {boundTime = RelativeTime 0s, boundSlot = SlotNo 0, boundEpoch = EpochNo 0}, eraEnd = EraEnd (Bound {boundTime = RelativeTime 0s, boundSlot = SlotNo 0, boundEpoch = EpochNo 0}), eraParams = EraParams {eraEpochSize = EpochSize 500, eraSlotLength = SlotLength 0.1s, eraSafeZone = StandardSafeZone 300}},EraSummary {eraStart = Bound {boundTime = RelativeTime 0s, boundSlot = SlotNo 0, boundEpoch = EpochNo 0}, eraEnd = EraEnd (Bound {boundTime = RelativeTime 0s, boundSlot = SlotNo 0, boundEpoch = EpochNo 0}), eraParams = EraParams {eraEpochSize = EpochSize 500, eraSlotLength = SlotLength 0.1s, eraSafeZone = StandardSafeZone 300}},EraSummary {eraStart = Bound {boundTime = RelativeTime 0s, boundSlot = SlotNo 0, boundEpoch = EpochNo 0}, eraEnd = EraEnd (Bound {boundTime = RelativeTime 0s, boundSlot = SlotNo 0, boundEpoch = EpochNo 0}), eraParams = EraParams {eraEpochSize = EpochSize 500, eraSlotLength = SlotLength 0.1s, eraSafeZone = StandardSafeZone 300}},EraSummary {eraStart = Bound {boundTime = RelativeTime 0s, boundSlot = SlotNo 0, boundEpoch = EpochNo 0}, eraEnd = EraEnd (Bound {boundTime = RelativeTime 4450s, boundSlot = SlotNo 44500, boundEpoch = EpochNo 89}), eraParams = EraParams {eraEpochSize = EpochSize 500, eraSlotLength = SlotLength 0.1s, eraSafeZone = StandardSafeZone 300}}]}

This error gets hushed to null.

@newhoggy
Copy link
Contributor

newhoggy commented Feb 22, 2023

This is the relevant code:

https://github.com/input-output-hk/cardano-node/blob/master/cardano-cli/src/Cardano/CLI/Shelley/Run/Query.hs#L515-L518

     let time = epochInfoSlotToUTCTime
                  eInfo
                  (SystemStart $ protocolParamSystemStart gParams)
                  (fromIntegral $ oCertExpiryKesPeriod * fromIntegral (protocolParamSlotsPerKESPeriod gParams))

@newhoggy
Copy link
Contributor

epochInfoSlotToUTCTime has been modified to enforce a forecast horizon equal to the number of slots per KES period.

The above code passes in as the SlotNo parameter (the third parameter) some multiple of the number of slots per KES period, so this will definitely fail.

In my testnet, "qKesMaxKESEvolutions": 60, so that multiple is 60.

Anything outside the forecasting horizon is not reliable passed the HFC so if this functionality were fixed, it would only be an estimate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: kes-info bug Something isn't working comp: cardano-cli status: duplicate The PR or issue already exists type: bug Something is not working user type: internal Created by an IOG employee
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants