Skip to content

Commit

Permalink
Conway hard forks on prot-ver 9
Browse files Browse the repository at this point in the history
  • Loading branch information
newhoggy committed Mar 17, 2023
1 parent 26125a0 commit 3ca7578
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
7 changes: 6 additions & 1 deletion cardano-api/src/Cardano/Api/LedgerState.hs
Expand Up @@ -854,9 +854,14 @@ instance FromJSON NodeConfig where
parseConwayHardForkEpoch o =
asum
[ Consensus.TriggerHardForkAtEpoch <$> o .: "TestConwayHardForkAtEpoch"
, pure $ Consensus.TriggerHardForkAtVersion 8 -- Mainnet default
, pure $ Consensus.TriggerHardForkAtVersion 9 -- Mainnet default
]

----------------------------------------------------------------------
-- WARNING When adding new entries above, be aware that if there is an
-- intra-era fork, then the numbering is not consecutive.
----------------------------------------------------------------------

parseNodeConfig :: ByteString -> Either Text NodeConfig
parseNodeConfig bs =
case Yaml.decodeEither' bs of
Expand Down
9 changes: 8 additions & 1 deletion cardano-node/src/Cardano/Node/Protocol/Cardano.hs
Expand Up @@ -257,6 +257,8 @@ mkSomeConsensusProtocolCardano NodeByronProtocolConfiguration {
-- Version 5 is Alonzo
-- Version 6 is Alonzo (intra era hardfork)
-- Version 7 is Babbage
-- Version 8 is Babbage (intra era hardfork)
-- Version 9 is Conway
--
-- But we also provide an override to allow for simpler test setups
-- such as triggering at the 0 -> 1 transition .
Expand Down Expand Up @@ -311,11 +313,16 @@ mkSomeConsensusProtocolCardano NodeByronProtocolConfiguration {
transitionTrigger =
case npcTestConwayHardForkAtEpoch of
Nothing -> Consensus.TriggerHardForkAtVersion
(maybe 8 fromIntegral npcTestConwayHardForkAtVersion)
(maybe 9 fromIntegral npcTestConwayHardForkAtVersion)
Just epochNo -> Consensus.TriggerHardForkAtEpoch epochNo

}

----------------------------------------------------------------------
-- WARNING When adding new entries above, be aware that if there is an
-- intra-era fork, then the numbering is not consecutive.
----------------------------------------------------------------------

------------------------------------------------------------------------------
-- Errors
--
Expand Down

0 comments on commit 3ca7578

Please sign in to comment.