Skip to content

Commit

Permalink
update version forks for Chainweb 2.24
Browse files Browse the repository at this point in the history
Change-Id: I82023a0ceb73b8de32e9f3512de67b477d6bbfa0
  • Loading branch information
chessai authored and edmundnoble committed May 21, 2024
1 parent 5b63bcf commit 00efb0f
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 4 deletions.
4 changes: 2 additions & 2 deletions node/ChainwebNode.hs
Original file line number Diff line number Diff line change
Expand Up @@ -535,10 +535,10 @@ pkgInfoScopes =
-- -------------------------------------------------------------------------- --
-- main

-- SERVICE DATE for version 2.23
-- SERVICE DATE for version 2.24
--
serviceDate :: Maybe String
serviceDate = Just "2024-05-29T00:00:00Z"
serviceDate = Just "2024-08-21T00:00:00Z"

mainInfo :: ProgramInfo ChainwebNodeConfiguration
mainInfo = programInfoValidate
Expand Down
3 changes: 3 additions & 0 deletions src/Chainweb/Version.hs
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@ data Fork
| Chainweb222Pact
| Chainweb223Pact
| Chainweb224Pact
| Chainweb225Pact
-- always add new forks at the end, not in the middle of the constructors.
deriving stock (Bounded, Generic, Eq, Enum, Ord, Show)
deriving anyclass (NFData, Hashable)
Expand Down Expand Up @@ -239,6 +240,7 @@ instance HasTextRepresentation Fork where
toText Chainweb222Pact = "chainweb222Pact"
toText Chainweb223Pact = "chainweb223Pact"
toText Chainweb224Pact = "chainweb224Pact"
toText Chainweb225Pact = "chainweb225Pact"

fromText "slowEpoch" = return SlowEpoch
fromText "vuln797Fix" = return Vuln797Fix
Expand Down Expand Up @@ -269,6 +271,7 @@ instance HasTextRepresentation Fork where
fromText "chainweb222Pact" = return Chainweb222Pact
fromText "chainweb223Pact" = return Chainweb223Pact
fromText "chainweb224Pact" = return Chainweb224Pact
fromText "chainweb225Pact" = return Chainweb225Pact
fromText t = throwM . TextFormatException $ "Unknown Chainweb fork: " <> t

instance ToJSON Fork where
Expand Down
4 changes: 4 additions & 0 deletions src/Chainweb/Version/Guards.hs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ module Chainweb.Version.Guards
, chainweb222Pact
, chainweb223Pact
, chainweb224Pact
, chainweb225Pact
, pact44NewTrans
, pactParserVersion
, maxBlockGasLimit
Expand Down Expand Up @@ -253,6 +254,9 @@ chainweb223Pact = checkFork atOrAfter Chainweb223Pact
chainweb224Pact :: ChainwebVersion -> ChainId -> BlockHeight -> Bool
chainweb224Pact = checkFork atOrAfter Chainweb224Pact

chainweb225Pact :: ChainwebVersion -> ChainId -> BlockHeight -> Bool
chainweb225Pact = checkFork atOrAfter Chainweb225Pact

pactParserVersion :: ChainwebVersion -> ChainId -> BlockHeight -> PactParserVersion
pactParserVersion v cid bh
| chainweb213Pact v cid bh = PactParserChainweb213
Expand Down
3 changes: 2 additions & 1 deletion src/Chainweb/Version/Mainnet.hs
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,8 @@ mainnet = ChainwebVersion
Chainweb221Pact -> AllChains (ForkAtBlockHeight $ BlockHeight 4_177_889) -- 2023-10-20 00:00:00+00:00
Chainweb222Pact -> AllChains (ForkAtBlockHeight $ BlockHeight 4_335_753) -- 2023-12-14 00:00:00+00:00
Chainweb223Pact -> AllChains (ForkAtBlockHeight $ BlockHeight 4_577_530) -- 2024-03-07 00:00:00+00:00
Chainweb224Pact -> AllChains ForkNever
Chainweb224Pact -> AllChains (ForkAtBlockHeight $ BlockHeight 4_819_246) -- 2024-05-30 00:00:00+00:00
Chainweb225Pact -> AllChains ForkNever

, _versionGraphs =
(to20ChainsMainnet, twentyChainGraph) `Above`
Expand Down
3 changes: 2 additions & 1 deletion src/Chainweb/Version/Testnet.hs
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,8 @@ testnet = ChainwebVersion
Chainweb221Pact -> AllChains $ ForkAtBlockHeight $ BlockHeight 3_702_250 -- 2023-10-19 12:00:00+00:00
Chainweb222Pact -> AllChains $ ForkAtBlockHeight $ BlockHeight 3_859_808 -- 2023-12-13 12:00:00+00:00
Chainweb223Pact -> AllChains $ ForkAtBlockHeight $ BlockHeight 4_100_681 -- 2024-03-06 12:00:00+00:00
Chainweb224Pact -> AllChains ForkNever
Chainweb224Pact -> AllChains $ ForkAtBlockHeight $ BlockHeight 4_333_587 -- 2024-05-29 12:00:00+00:00
Chainweb225Pact -> AllChains ForkNever

, _versionGraphs =
(to20ChainsTestnet, twentyChainGraph) `Above`
Expand Down
2 changes: 2 additions & 0 deletions test/Chainweb/Test/TestVersions.hs
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ fastForks = tabulateHashMap $ \case
Chainweb222Pact -> AllChains $ ForkAtBlockHeight $ BlockHeight 36
Chainweb223Pact -> AllChains $ ForkAtBlockHeight $ BlockHeight 38
Chainweb224Pact -> AllChains $ ForkAtBlockHeight $ BlockHeight 40
Chainweb225Pact -> AllChains $ ForkAtBlockHeight $ BlockHeight 42

-- | A test version without Pact or PoW, with only one chain graph.
barebonesTestVersion :: ChainGraph -> ChainwebVersion
Expand Down Expand Up @@ -282,6 +283,7 @@ slowForks = tabulateHashMap \case
Chainweb222Pact -> AllChains $ ForkAtBlockHeight (BlockHeight 115)
Chainweb223Pact -> AllChains $ ForkAtBlockHeight (BlockHeight 120)
Chainweb224Pact -> AllChains $ ForkAtBlockHeight (BlockHeight 125)
Chainweb225Pact -> AllChains $ ForkAtBlockHeight (BlockHeight 130)

-- | CPM version (see `cpmTestVersion`) with forks and upgrades slowly enabled.
slowForkingCpmTestVersion :: ChainGraph -> ChainwebVersion
Expand Down

0 comments on commit 00efb0f

Please sign in to comment.