Skip to content

Commit

Permalink
Merge pull request #4988 from input-output-hk/newhoggy/conway-hardfor…
Browse files Browse the repository at this point in the history
…ks-on-prot-ver-9

Conway hard forks on prot-ver 9
  • Loading branch information
newhoggy committed Mar 17, 2023
2 parents 26125a0 + 3d50f70 commit b63c325
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 4 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
16 changes: 13 additions & 3 deletions cardano-node/src/Cardano/Node/Protocol/Cardano.hs
Expand Up @@ -90,7 +90,7 @@ mkSomeConsensusProtocolCardano NodeByronProtocolConfiguration {
npcConwayGenesisFileHash
}
NodeHardForkProtocolConfiguration {
-- npcTestEnableDevelopmentHardForkEras,
npcTestEnableDevelopmentHardForkEras,
-- During testing of the Alonzo era, we conditionally declared that we
-- knew about the Alonzo era. We do so only when a config option for
-- testing development/unstable eras is used. This lets us include
Expand Down Expand Up @@ -233,7 +233,10 @@ mkSomeConsensusProtocolCardano NodeByronProtocolConfiguration {
-- version that this node will declare that it understands, when it
-- is in the Babbage era. Since Babbage is currently the last known
-- protocol version then this is also the Babbage protocol version.
Praos.conwayProtVer = ProtVer 9 0,
Praos.conwayProtVer =
if npcTestEnableDevelopmentHardForkEras
then ProtVer 9 0
else ProtVer 8 0,
Praos.conwayMaxTxCapacityOverrides =
TxLimits.mkOverrides TxLimits.noOverridesMeasure
}
Expand All @@ -257,6 +260,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 +316,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 b63c325

Please sign in to comment.