Skip to content

Commit

Permalink
Delete Pact5Devnet and upgrade devnet to use pact 5
Browse files Browse the repository at this point in the history
  • Loading branch information
edmundnoble committed Jan 20, 2025
1 parent 464a9d7 commit c1c1ad6
Show file tree
Hide file tree
Showing 13 changed files with 55 additions and 239 deletions.
3 changes: 0 additions & 3 deletions chainweb.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,6 @@ library
, Chainweb.BlockHeader.Genesis.Pact5InstantTimedCPM1to9Payload
, Chainweb.BlockHeader.Genesis.QuirkedGasPact5InstantTimedCPM0Payload
, Chainweb.BlockHeader.Genesis.QuirkedGasPact5InstantTimedCPM1to9Payload
, Chainweb.BlockHeader.Genesis.Pact5Development0Payload
, Chainweb.BlockHeader.Genesis.Pact5Development1to19Payload
, Chainweb.BlockHeader.Genesis.Testnet040Payload
, Chainweb.BlockHeader.Genesis.Testnet041to19Payload
, Chainweb.BlockHeader.Genesis.Testnet050Payload
Expand Down Expand Up @@ -270,7 +268,6 @@ library
, Chainweb.Version.Development
, Chainweb.Version.Guards
, Chainweb.Version.Mainnet
, Chainweb.Version.Pact5Development
, Chainweb.Version.RecapDevelopment
, Chainweb.Version.Registry
, Chainweb.Version.Testnet04
Expand Down
7 changes: 0 additions & 7 deletions cwtools/ea/Ea.hs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ import Chainweb.Time
import Chainweb.Utils
import Chainweb.Version
import Chainweb.Version.Development (pattern Development)
import Chainweb.Version.Pact5Development (pattern Pact5Development)
import Chainweb.Version.RecapDevelopment (pattern RecapDevelopment)
import Chainweb.Version.Registry (registerVersion)
import Control.Concurrent.Async
Expand Down Expand Up @@ -75,12 +74,10 @@ main :: IO ()
main = do
registerVersion RecapDevelopment
registerVersion Development
registerVersion Pact5Development

mapConcurrently_ id
[ recapDevnet
, devnet
, pact5Devnet
, fastnet
, instantnet
, pact5Instantnet
Expand All @@ -105,10 +102,6 @@ main = do
[ fastDevelopment0
, fastDevelopmentN
]
pact5Devnet = mkPayloads
[ pact5Development0
, pact5DevelopmentN
]
fastnet = mkPayloads [fastTimedCPM0, fastTimedCPMN]
instantnet = mkPayloads [instantCPM0, instantCPMN]
pact5Instantnet = mkPayloads [pact5InstantCPM0, pact5InstantCPMN]
Expand Down
20 changes: 0 additions & 20 deletions cwtools/ea/Ea/Genesis.hs
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ module Ea.Genesis
, recapDevelopmentKAD
, fastDevelopment0
, fastDevelopmentN
, pact5Development0
, pact5DevelopmentN

-- * Testing Genesis Txs
, fastTimedCPM0
Expand Down Expand Up @@ -75,7 +73,6 @@ import Chainweb.Graph
import Chainweb.Test.TestVersions
import Chainweb.Version
import Chainweb.Version.Development
import Chainweb.Version.Pact5Development
import Chainweb.Version.RecapDevelopment
import Chainweb.Version.Mainnet
import Chainweb.Version.Testnet04
Expand Down Expand Up @@ -217,23 +214,6 @@ fastDevelopmentN = fastDevelopment0
& txChainIds .~ mkChainIdRange 1 19
& coinbase ?~ devNGrants

pact5Development0 :: Genesis
pact5Development0 = Genesis
{ _version = Pact5Development
, _tag = "Pact5Development"
, _txChainIds = onlyChainId 0
, _coinbase = Just dev0Grants
, _keysets = Just devKeysets
, _allocations = Just devAllocations
, _namespaces = Just devNs2
, _coinContract = [fungibleAssetV1, fungibleXChainV1, fungibleAssetV2, installCoinContractV6, gasPayer]
}

pact5DevelopmentN :: Genesis
pact5DevelopmentN = pact5Development0
& txChainIds .~ mkChainIdRange 1 19
& coinbase ?~ devNGrants

devNs2 :: FilePath
devNs2 = "pact/genesis/ns-v2.yaml"

Expand Down
20 changes: 10 additions & 10 deletions src/Chainweb/BlockHeader/Genesis/Development0Payload.hs

Large diffs are not rendered by default.

20 changes: 10 additions & 10 deletions src/Chainweb/BlockHeader/Genesis/Development1to19Payload.hs

Large diffs are not rendered by default.

39 changes: 0 additions & 39 deletions src/Chainweb/BlockHeader/Genesis/Pact5Development0Payload.hs

This file was deleted.

39 changes: 0 additions & 39 deletions src/Chainweb/BlockHeader/Genesis/Pact5Development1to19Payload.hs

This file was deleted.

3 changes: 1 addition & 2 deletions src/Chainweb/Chainweb/Configuration.hs
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,6 @@ import Chainweb.Payload.RestAPI (PayloadBatchLimit(..), defaultServicePayloadBat
import Chainweb.Utils
import Chainweb.Version
import Chainweb.Version.Development
import Chainweb.Version.Pact5Development
import Chainweb.Version.RecapDevelopment
import Chainweb.Version.Mainnet
import Chainweb.Version.Registry
Expand Down Expand Up @@ -441,7 +440,7 @@ validateChainwebVersion v = do
, "just yet."
]
where
isDevelopment = _versionCode v `elem` [_versionCode dv | dv <- [recapDevnet, devnet, pact5Devnet]]
isDevelopment = _versionCode v `elem` [_versionCode dv | dv <- [recapDevnet, devnet]]

validateBackupConfig :: ConfigValidation BackupConfig []
validateBackupConfig c =
Expand Down
3 changes: 0 additions & 3 deletions src/Chainweb/Version/Development.hs
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,6 @@ devnet = ChainwebVersion
{ _versionCode = ChainwebVersionCode 0x00000002
, _versionName = ChainwebVersionName "development"
, _versionForks = tabulateHashMap $ \case
-- TODO: for now, Pact 5 is never enabled on devnet.
-- this will change as it stabilizes.
Pact5Fork -> AllChains ForkNever
_ -> AllChains ForkAtGenesis
, _versionUpgrades = AllChains mempty
, _versionGraphs = Bottom (minBound, twentyChainGraph)
Expand Down
67 changes: 0 additions & 67 deletions src/Chainweb/Version/Pact5Development.hs

This file was deleted.

66 changes: 33 additions & 33 deletions src/Chainweb/Version/RecapDevelopment.hs
Original file line number Diff line number Diff line change
Expand Up @@ -44,39 +44,39 @@ recapDevnet = ChainwebVersion
, _versionName = ChainwebVersionName "recap-development"

, _versionForks = tabulateHashMap $ \case
SlowEpoch -> AllChains $ ForkAtBlockHeight $ BlockHeight 0
Vuln797Fix -> AllChains $ ForkAtBlockHeight $ BlockHeight 0
CoinV2 -> onChains $ [(unsafeChainId 0, ForkAtBlockHeight $ BlockHeight 3)] <> [(unsafeChainId i, ForkAtBlockHeight $ BlockHeight 4) | i <- [1..19]]
PactBackCompat_v16 -> AllChains $ ForkAtBlockHeight $ BlockHeight 0
SkipTxTimingValidation -> AllChains $ ForkAtBlockHeight $ BlockHeight 2
OldTargetGuard -> AllChains $ ForkAtBlockHeight $ BlockHeight 0
SkipFeatureFlagValidation -> AllChains $ ForkAtBlockHeight $ BlockHeight 0
ModuleNameFix -> AllChains $ ForkAtBlockHeight $ BlockHeight 2
ModuleNameFix2 -> AllChains $ ForkAtBlockHeight $ BlockHeight 2
OldDAGuard -> AllChains $ ForkAtBlockHeight $ BlockHeight 13
PactEvents -> AllChains $ ForkAtBlockHeight $ BlockHeight 40
SPVBridge -> AllChains $ ForkAtBlockHeight $ BlockHeight 50
Pact4Coin3 -> AllChains $ ForkAtBlockHeight $ BlockHeight 80
EnforceKeysetFormats -> AllChains $ ForkAtBlockHeight $ BlockHeight 100
Pact42 -> AllChains $ ForkAtBlockHeight $ BlockHeight 90
CheckTxHash -> AllChains $ ForkAtBlockHeight $ BlockHeight 110
Chainweb213Pact -> AllChains $ ForkAtBlockHeight $ BlockHeight 95
Chainweb214Pact -> AllChains $ ForkAtBlockHeight $ BlockHeight 115
Chainweb215Pact -> AllChains $ ForkAtBlockHeight $ BlockHeight 165
Pact44NewTrans -> AllChains $ ForkAtBlockHeight $ BlockHeight 0
Chainweb216Pact -> AllChains $ ForkAtBlockHeight $ BlockHeight 215
Chainweb217Pact -> AllChains $ ForkAtBlockHeight $ BlockHeight 470
Chainweb218Pact -> AllChains $ ForkAtBlockHeight $ BlockHeight 500
Chainweb219Pact -> AllChains $ ForkAtBlockHeight $ BlockHeight 550
Chainweb220Pact -> AllChains $ ForkAtBlockHeight $ BlockHeight 560
Chainweb221Pact -> AllChains $ ForkAtBlockHeight $ BlockHeight 580
Chainweb222Pact -> AllChains $ ForkAtBlockHeight $ BlockHeight 590
Chainweb223Pact -> AllChains $ ForkAtBlockHeight $ BlockHeight 600
Chainweb224Pact -> AllChains $ ForkAtBlockHeight $ BlockHeight 610
Chainweb225Pact -> AllChains $ ForkAtBlockHeight $ BlockHeight 620
Chainweb226Pact -> AllChains $ ForkAtBlockHeight $ BlockHeight 630
Chainweb227Pact -> AllChains ForkNever
Pact5Fork -> AllChains ForkNever
SlowEpoch -> AllChains $ ForkAtBlockHeight $ BlockHeight 0
Vuln797Fix -> AllChains $ ForkAtBlockHeight $ BlockHeight 0
CoinV2 -> onChains $ [(unsafeChainId 0, ForkAtBlockHeight $ BlockHeight 3)] <> [(unsafeChainId i, ForkAtBlockHeight $ BlockHeight 4) | i <- [1..19]]
PactBackCompat_v16 -> AllChains $ ForkAtBlockHeight $ BlockHeight 0
SkipTxTimingValidation -> AllChains $ ForkAtBlockHeight $ BlockHeight 2
OldTargetGuard -> AllChains $ ForkAtBlockHeight $ BlockHeight 0
SkipFeatureFlagValidation -> AllChains $ ForkAtBlockHeight $ BlockHeight 0
ModuleNameFix -> AllChains $ ForkAtBlockHeight $ BlockHeight 2
ModuleNameFix2 -> AllChains $ ForkAtBlockHeight $ BlockHeight 2
OldDAGuard -> AllChains $ ForkAtBlockHeight $ BlockHeight 13
PactEvents -> AllChains $ ForkAtBlockHeight $ BlockHeight 40
SPVBridge -> AllChains $ ForkAtBlockHeight $ BlockHeight 50
Pact4Coin3 -> AllChains $ ForkAtBlockHeight $ BlockHeight 80
EnforceKeysetFormats -> AllChains $ ForkAtBlockHeight $ BlockHeight 100
Pact42 -> AllChains $ ForkAtBlockHeight $ BlockHeight 90
CheckTxHash -> AllChains $ ForkAtBlockHeight $ BlockHeight 110
Chainweb213Pact -> AllChains $ ForkAtBlockHeight $ BlockHeight 95
Chainweb214Pact -> AllChains $ ForkAtBlockHeight $ BlockHeight 115
Chainweb215Pact -> AllChains $ ForkAtBlockHeight $ BlockHeight 165
Pact44NewTrans -> AllChains $ ForkAtBlockHeight $ BlockHeight 0
Chainweb216Pact -> AllChains $ ForkAtBlockHeight $ BlockHeight 215
Chainweb217Pact -> AllChains $ ForkAtBlockHeight $ BlockHeight 470
Chainweb218Pact -> AllChains $ ForkAtBlockHeight $ BlockHeight 500
Chainweb219Pact -> AllChains $ ForkAtBlockHeight $ BlockHeight 550
Chainweb220Pact -> AllChains $ ForkAtBlockHeight $ BlockHeight 560
Chainweb221Pact -> AllChains $ ForkAtBlockHeight $ BlockHeight 580
Chainweb222Pact -> AllChains $ ForkAtBlockHeight $ BlockHeight 590
Chainweb223Pact -> AllChains $ ForkAtBlockHeight $ BlockHeight 600
Chainweb224Pact -> AllChains $ ForkAtBlockHeight $ BlockHeight 610
Chainweb225Pact -> AllChains $ ForkAtBlockHeight $ BlockHeight 620
Chainweb226Pact -> AllChains $ ForkAtBlockHeight $ BlockHeight 630
Chainweb227Pact -> AllChains $ ForkAtBlockHeight $ BlockHeight 640
Pact5Fork -> AllChains $ ForkAtBlockHeight $ BlockHeight 650

, _versionUpgrades = foldr (chainZip HM.union) (AllChains mempty)
[ indexByForkHeights recapDevnet
Expand Down
5 changes: 1 addition & 4 deletions src/Chainweb/Version/Registry.hs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ import GHC.Stack

import Chainweb.Version
import Chainweb.Version.Development
import Chainweb.Version.Pact5Development
import Chainweb.Version.RecapDevelopment
import Chainweb.Version.Mainnet
import Chainweb.Version.Testnet04
Expand Down Expand Up @@ -139,7 +138,6 @@ lookupVersionByCode code
notRegistered
| code == _versionCode recapDevnet = "recapDevnet version used but not registered, remember to do so after it's configured. " <> perhaps
| code == _versionCode devnet = "devnet version used but not registered, remember to do so after it's configured. " <> perhaps
| code == _versionCode pact5Devnet = "Pact 5 devnet version used but not registered, remember to do so after it's configured. " <> perhaps
| otherwise = "version not registered with code " <> show code <> ", have you seen Chainweb.Test.TestVersions.testVersions?"

perhaps = "Perhaps you are attempting to run a different devnet version than a previous run, and you need to delete your db directory before restarting devnet with the new version?"
Expand All @@ -160,7 +158,6 @@ lookupVersionByName name
notRegistered
| name == _versionName recapDevnet = "recapDevnet version used but not registered, remember to do so after it's configured"
| name == _versionName devnet = "devnet version used but not registered, remember to do so after it's configured"
| name == _versionName pact5Devnet = "Pact 5 devnet version used but not registered, remember to do so after it's configured"
| otherwise = "version not registered with name " <> show name <> ", have you seen Chainweb.Test.TestVersions.testVersions?"

fabricateVersionWithName :: HasCallStack => ChainwebVersionName -> ChainwebVersion
Expand All @@ -169,7 +166,7 @@ fabricateVersionWithName name =

-- | Versions known to us by name.
knownVersions :: [ChainwebVersion]
knownVersions = [mainnet, testnet04, testnet05, recapDevnet, devnet, pact5Devnet]
knownVersions = [mainnet, testnet04, testnet05, recapDevnet, devnet]

-- | Look up a known version by name, usually with `m` instantiated to some
-- configuration parser monad.
Expand Down
2 changes: 0 additions & 2 deletions test/unit/ChainwebTests.hs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ import Chainweb.BlockHeader
import Chainweb.BlockHeaderDB
import Chainweb.Storage.Table.RocksDB
import Chainweb.Version.Development
import Chainweb.Version.Pact5Development
import Chainweb.Version.RecapDevelopment
import Chainweb.Version.Registry

Expand Down Expand Up @@ -100,7 +99,6 @@ main :: IO ()
main = do
registerVersion RecapDevelopment
registerVersion Development
registerVersion Pact5Development
withTempRocksDb "chainweb-tests" $ \rdb ->
runResourceT $ do
(h0, db) <- withToyDB rdb toyChainId
Expand Down

0 comments on commit c1c1ad6

Please sign in to comment.