Skip to content

Conway hard forks on prot-ver 9 #4988

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

Merged
merged 2 commits into from
Mar 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion cardano-api/src/Cardano/Api/LedgerState.hs
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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