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

Fix kes period info command #3945

Merged
merged 2 commits into from
Jun 4, 2022
Merged

Conversation

newhoggy
Copy link
Contributor

No description provided.

@newhoggy newhoggy force-pushed the newhoggy/fix-kes-period-info-command branch from a672abb to c096774 Compare May 31, 2022 12:42
@newhoggy newhoggy marked this pull request as ready for review May 31, 2022 12:42
@newhoggy
Copy link
Contributor Author

newhoggy commented May 31, 2022

Example output babbage:

$ CARDANO_NODE_SOCKET_PATH=example/node-spo1/node.sock cardano-cli query kes-period-info --testnet-magic 42 --op-cert-file example/node-spo1/opcert.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": 0,
    "qKesEndKesInterval": 60,
    "qKesKesKeyExpiry": null,
    "qKesMaxKESEvolutions": 60,
    "qKesNodeStateOperationalCertificateNumber": 0,
    "qKesOnDiskOperationalCertificateNumber": 0,
    "qKesRemainingSlotsInKesPeriod": 7775071,
    "qKesSlotsPerKesPeriod": 129600,
    "qKesStartKesInterval": 0
}

Example output alonzo:

$ CARDANO_NODE_SOCKET_PATH=example/node-bft1/node.sock cardano-cli query kes-period-info --testnet-magic 42 --op-cert-file example/node-pool1/shelley/node.cert
✓ Operational certificate's KES period is within the correct KES period interval
✗ No blocks minted so far with the operational certificate at: example/node-pool1/shelley/node.cert
  On disk operational certificate counter: 0
{
    "qKesCurrentKesPeriod": 0,
    "qKesEndKesInterval": 60,
    "qKesKesKeyExpiry": null,
    "qKesMaxKESEvolutions": 60,
    "qKesNodeStateOperationalCertificateNumber": null,
    "qKesOnDiskOperationalCertificateNumber": 0,
    "qKesRemainingSlotsInKesPeriod": 7775972,
    "qKesSlotsPerKesPeriod": 129600,
    "qKesStartKesInterval": 0
}

@newhoggy newhoggy force-pushed the newhoggy/fix-kes-period-info-command branch from c096774 to 047d9a2 Compare May 31, 2022 12:49
@newhoggy newhoggy requested a review from Jimbo4350 May 31, 2022 12:57
Copy link
Contributor

@Jimbo4350 Jimbo4350 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! We should ask @disassembler to test the command for us to double check its working. We should create an issue somewhere that after the hardfork we will only be able to bump the op cert counter by 1. We will need to update the command to do this check in the Babbage era onwards.

cardano-api/src/Cardano/Api/LedgerState.hs Outdated Show resolved Hide resolved
@CarlosLopezDeLara
Copy link
Contributor

LGTM! We should ask @disassembler to test the command for us to double check its working. We should create an issue somewhere that after the hardfork we will only be able to bump the op cert counter by 1. We will need to update the command to do this check in the Babbage era onwards.

Issue created--> #3963

@newhoggy newhoggy changed the title Newhoggy/fix kes period info command Fix kes period info command Jun 3, 2022
@newhoggy newhoggy force-pushed the newhoggy/fix-kes-period-info-command branch from 047d9a2 to e0ab865 Compare June 3, 2022 01:44
@newhoggy newhoggy force-pushed the newhoggy/fix-kes-period-info-command branch 3 times, most recently from 949e88d to 2a3c38c Compare June 3, 2022 03:29
@newhoggy newhoggy force-pushed the newhoggy/fix-kes-period-info-command branch 2 times, most recently from ad0c74a to 7b884a2 Compare June 4, 2022 00:57
@newhoggy newhoggy force-pushed the newhoggy/fix-kes-period-info-command branch from 7b884a2 to 52904be Compare June 4, 2022 01:03
@newhoggy newhoggy force-pushed the newhoggy/fix-kes-period-info-command branch from 52904be to ce69b3a Compare June 4, 2022 03:47
@newhoggy
Copy link
Contributor Author

newhoggy commented Jun 4, 2022

bors r+

@iohk-bors
Copy link
Contributor

iohk-bors bot commented Jun 4, 2022

Build succeeded:

@iohk-bors iohk-bors bot merged commit 102ea84 into master Jun 4, 2022
@iohk-bors iohk-bors bot deleted the newhoggy/fix-kes-period-info-command branch June 4, 2022 05:28
@gitmachtl
Copy link
Contributor

Example output babbage:

$ CARDANO_NODE_SOCKET_PATH=example/node-spo1/node.sock cardano-cli query kes-period-info --testnet-magic 42 --op-cert-file example/node-spo1/opcert.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": 0,
    "qKesEndKesInterval": 60,
    "qKesKesKeyExpiry": null,
    "qKesMaxKESEvolutions": 60,
    "qKesNodeStateOperationalCertificateNumber": 0,
    "qKesOnDiskOperationalCertificateNumber": 0,
    "qKesRemainingSlotsInKesPeriod": 7775071,
    "qKesSlotsPerKesPeriod": 129600,
    "qKesStartKesInterval": 0
}

is the plaintext output at the top written to /dev/stderr? otherwise it is a strang mixed format output of plaintext with json, thats not good.

@gitmachtl
Copy link
Contributor

question, will the qKesNodeStateOperationalCertificateNumber be set again to null if there was no block produced in the current KesPeriod? or will this value show the latest opcert number used on chain in the past?

@gitmachtl
Copy link
Contributor

gitmachtl commented Jun 4, 2022

this should not be greenlit with two checkmarks right? because the new opcert counter 3 is too high when the last one on chain is only 1. tested with a node in babbage-era. the current output looks like that:

✓ Operational certificate's KES period is within the correct KES period interval
✓ The operational certificate counter agrees with the node protocol state counter
{
    "qKesCurrentKesPeriod": 16,
    "qKesEndKesInterval": 136,
    "qKesKesKeyExpiry": null,
    "qKesMaxKESEvolutions": 120,
    "qKesNodeStateOperationalCertificateNumber": 1,
    "qKesOnDiskOperationalCertificateNumber": 3,
    "qKesRemainingSlotsInKesPeriod": 10342913,
    "qKesSlotsPerKesPeriod": 86400,
    "qKesStartKesInterval": 16
}

@@ -1352,22 +1356,22 @@ nextEpochEligibleLeadershipSlots sbe sGen serCurrEpochState _ptclState
then return ()
else Left $ LeaderErrStakeDistribUnstable tip stableStakeDistribSlot stabilityWindowSlots currentEpochLastSlot

-- Let's do a nonce check. The candidate nonce and the evolving nonce should not be equal.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why was the comment deleted?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants