Wrong maxKESEvolutions
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 38/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- haskell
- Domain
- cryptography, security
Research direction
Start with kes-agent-crypto/src/Cardano/KESAgent/Protocols/StandardCrypto.hs at the comparison noted in the issue, then trace EvolutionConfig in kes-agent-crypto/src/Cardano/KESAgent/KES/Evolution.hs. Determine how the genesis maxKESEvolutions value should reach the evolution logic instead of the fixed 2^6 limit. Done means the agent respects a genesis value of 60 and no longer evolves through period 64 in the described scenario.
Written by the indexing model from the issue text.
Description
I shortened slotsPerKesPeriod to test the evolutions:
shelley genesis has:
"maxKESEvolutions": 60,
however, in the kes-agent-control I see Current evolution: 12 / 64
kes-agent-control info --control
--- Agent ---
Agent version: 0.2.0.0-dev-20251203151322
Connected via: control.socket
Current time: 2025-12-03 22:34:58 UTC
Current KES period: 12
Current KES period started: 2025-12-03 22:31:33 UTC
Next KES period starts: 2025-12-03 22:35:43 UTC
--- Installed KES SignKey ---
Timestamp: 2025-12-03 21:42:29 UTC
VerKey: b2d8ab926ce326b2cbc6cfbe8906bae530a2956fe707973afc6af4c68b279da0
Valid from period: 0
Current evolution: 12 / 64
OpCert number: 1
OpCert signature: 419d7ec678f4a53831bd28aeb39e5cfa2950bd887e5e03f2f5a6c642d1de0637815c5b32bc7816af99d4b4275d33735dda3fb7f5b2ae7796e6077c60c2ce9d07
The kes-agent does evolve the key 64 times
1764813593.821 Notice Agent: key evolved (KESPeriod 61) (KESPeriod 62)
1764813843.815 Notice Agent: key evolved (KESPeriod 62) (KESPeriod 63)
1764814093.741 Warning Agent: key expired (KESPeriod 63) (KESPeriod 64)
On the node's side, as expected, we see it only evolves the key up to 60 (the value from genesis file), and we get a proper warning: Operational key will expire in 1 KES periods. In this cluster, slotsPerKesPeriod is set to 500, so in this run the next period starts at slot 15000, and indeed the very last block this pool produced was this one in the logs at slot 14994
[focus:cardano.node:Alert:42] [2025-12-04 01:51:27.00 UTC] Operational key will expire in 1 KES periods.
[focus:cardano.node.Forge:Debug:42] [2025-12-04 01:51:27.00 UTC] TraceLabelCreds "Cardano" (CurrentEraForgeStateUpdated S (S (S (S (S (S (Z (WrapForgeStateInfo {unwrapForgeStateInfo = KESInfo {kesStartPeriod = KESPeriod 0, kesEndPeriod = KESPeriod 60, kesEvolution = 59}}))))))))
[focus:cardano.node.Forge:Info:42] [2025-12-04 01:51:27.00 UTC] fromList [("credentials",String "Cardano"),("val",Object (fromList [("kind",String "TraceNodeIsLeader"),("slot",Number 14994.0)]))]
[focus:cardano.node.Forge:Debug:42] [2025-12-04 01:51:27.00 UTC] fromList [("credentials",String "Cardano"),("val",Object (fromList [("kind",String "TraceForgeTickedLedgerState"),("prev",String "721b11b6c186a7c95a38ce7a8e73c393e1e2aaaa7542c54e7327ca365344ca91@14988"),("slot",Number 14994.0)]))]
[focus:cardano.node.Forge:Debug:42] [2025-12-04 01:51:27.00 UTC] fromList [("credentials",String "Cardano"),("val",Object (fromList [("kind",String "TraceForgingMempoolSnapshot"),("mempoolHash",String "721b11b6c186a7c95a38ce7a8e73c393e1e2aaaa7542c54e7327ca365344ca91"),("mempoolSlot",Number 14989.0),("prev",String "721b11b6c186a7c95a38ce7a8e73c393e1e2aaaa7542c54e7327ca365344ca91@14988"),("slot",Number 14994.0)]))]
[focus:cardano.node.Forge:Info:42] [2025-12-04 01:51:27.00 UTC] fromList [("credentials",String "Cardano"),("val",Object (fromList [("block",String "124f5b64976cf3c20502ff5a981e84e5ce8e297eef8893145646cf15dbf7441b"),("blockNo",Number 1451.0),("blockPrev",String "721b11b6c186a7c95a38ce7a8e73c393e1e2aaaa7542c54e7327ca365344ca91"),("kind",String "TraceForgedBlock"),("slot",Number 14994.0)]))]
Thomas Vellekoop pointed out that it's probably this: https://github.com/input-output-hk/kes-agent/blob/6d0f51fba415d3c641a8a8da37130e7adfc3ea01/kes-agent-crypto/src/Cardano/KESAgent/Protocols/StandardCrypto.hs#L36 ,
we compare against 2^6 = 64, but it should compare from a genesis file
from EvolutionConfig it seems we are not trying to look into the genesis for maxKESevolutions
data EvolutionConfig
= EvolutionConfig
{ slotLength :: Int
, slotsPerKESPeriod :: Int
, systemStart :: UTCTime
}
deriving (Show, Eq, Ord)
- Dominant language
- Haskell
- Stars
- 2
- Forks
- 13
- PR merge metrics
- No merged PRs in 30d
Getting set up
- Ships a Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from IntersectMBO/kes-agent
-
Difficulty 4/5 3-5 days Newbie friendliness 30/100
IntersectMBO/kes-agent#109 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 52/100
IntersectMBO/kes-agent#102 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 45/100
IntersectMBO/kes-agent#78 · 1 reaction ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
IntersectMBO/kes-agent#70 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 42/100
IntersectMBO/kes-agent#69 ·
All issues in IntersectMBO/kes-agent
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 75/100
-
15-minutes 5-minutes algorithm any-language beginner-friendly c cpp csharp easy go good first issue hacktoberfest help wanted java javascript kotlin python rust swift typescript
Difficulty 1/5 Under an hour Newbie friendliness 68/100
Huerte/algo-solutions-python#260 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
IntersectMBO/cardano-ledger#6276 ·
Maintainers usually reply within 1 day