diff --git a/chainweb.cabal b/chainweb.cabal index d7dc341fd3..417465bc51 100644 --- a/chainweb.cabal +++ b/chainweb.cabal @@ -237,6 +237,7 @@ library , Chainweb.Utils.RequestLog , Chainweb.Utils.Rule , Chainweb.Utils.Serialization + , Chainweb.VerifierPlugin , Chainweb.Version , Chainweb.Version.Development , Chainweb.Version.FastDevelopment diff --git a/src/Chainweb/VerifierPlugin.hs b/src/Chainweb/VerifierPlugin.hs index 5c40519212..d2654f6b87 100644 --- a/src/Chainweb/VerifierPlugin.hs +++ b/src/Chainweb/VerifierPlugin.hs @@ -1,6 +1,7 @@ {-# language DerivingStrategies #-} {-# language EmptyCase #-} {-# language GeneralizedNewtypeDeriving #-} +{-# language OverloadedStrings #-} {-# language TupleSections #-} {-# language TypeApplications #-} diff --git a/src/Chainweb/Version.hs b/src/Chainweb/Version.hs index c36fb22054..99b8e702be 100644 --- a/src/Chainweb/Version.hs +++ b/src/Chainweb/Version.hs @@ -63,6 +63,7 @@ module Chainweb.Version , versionName , versionWindow , versionGenesis + , versionVerifierPlugins , genesisBlockPayload , genesisBlockPayloadHash , genesisBlockTarget @@ -134,11 +135,6 @@ import Data.HashMap.Strict (HashMap) import qualified Data.HashMap.Strict as HM import qualified Data.HashSet as HS import Data.Map.Strict(Map) -import qualified Data.Map.Strict as Map -import qualified Data.Map.Merge.Strict as Merge -import Data.Set(Set) -import qualified Data.Set as Set -import Data.Maybe import Data.Proxy import qualified Data.Text as T import Data.Word diff --git a/src/Chainweb/Version/Development.hs b/src/Chainweb/Version/Development.hs index 2d3e3b2eeb..28973bee5d 100644 --- a/src/Chainweb/Version/Development.hs +++ b/src/Chainweb/Version/Development.hs @@ -67,6 +67,7 @@ devnet = ChainwebVersion Chainweb219Pact -> AllChains $ ForkAtBlockHeight $ BlockHeight 550 Chainweb220Pact -> AllChains $ ForkAtBlockHeight $ BlockHeight 560 Chainweb221Pact -> AllChains $ ForkAtBlockHeight $ BlockHeight 580 + EnableVerifiers -> AllChains ForkNever , _versionUpgrades = foldr (chainZip HM.union) (AllChains mempty) [ forkUpgrades devnet @@ -109,4 +110,5 @@ devnet = ChainwebVersion { _disablePeerValidation = True , _disableMempoolSync = False } + , _versionVerifierPlugins = AllChains $ End $ mempty } diff --git a/src/Chainweb/Version/FastDevelopment.hs b/src/Chainweb/Version/FastDevelopment.hs index 984daf3983..3f1a7f61ad 100644 --- a/src/Chainweb/Version/FastDevelopment.hs +++ b/src/Chainweb/Version/FastDevelopment.hs @@ -55,4 +55,5 @@ fastDevnet = ChainwebVersion { _disablePeerValidation = True , _disableMempoolSync = False } + , _versionVerifierPlugins = AllChains $ End $ mempty } diff --git a/src/Chainweb/Version/Mainnet.hs b/src/Chainweb/Version/Mainnet.hs index 75494fb991..23491aa926 100644 --- a/src/Chainweb/Version/Mainnet.hs +++ b/src/Chainweb/Version/Mainnet.hs @@ -141,6 +141,7 @@ mainnet = ChainwebVersion Chainweb219Pact -> AllChains (ForkAtBlockHeight $ BlockHeight 3_774_423) -- 2023-06-02 00:00:00+00:00 Chainweb220Pact -> AllChains (ForkAtBlockHeight $ BlockHeight 4_056_499) -- 2023-09-08 00:00:00+00:00 Chainweb221Pact -> AllChains (ForkAtBlockHeight $ BlockHeight 4_177_889) -- 2023-10-20 00:00:00+00:00 + EnableVerifiers -> AllChains ForkNever , _versionGraphs = (to20ChainsMainnet, twentyChainGraph) `Above` @@ -201,4 +202,5 @@ mainnet = ChainwebVersion { _disablePeerValidation = False , _disableMempoolSync = False } + , _versionVerifierPlugins = AllChains $ End $ mempty } diff --git a/src/Chainweb/Version/Testnet.hs b/src/Chainweb/Version/Testnet.hs index c6e198c052..e0d15a7eaa 100644 --- a/src/Chainweb/Version/Testnet.hs +++ b/src/Chainweb/Version/Testnet.hs @@ -121,6 +121,7 @@ testnet = ChainwebVersion Chainweb219Pact -> AllChains $ ForkAtBlockHeight $ BlockHeight 3_299_753 -- 2023-06-01 12:00:00+00:00 Chainweb220Pact -> AllChains $ ForkAtBlockHeight $ BlockHeight 3_580_964 -- 2023-09-08 12:00:00+00:00 Chainweb221Pact -> AllChains $ ForkAtBlockHeight $ BlockHeight 3_702_250 -- 2023-10-19 12:00:00+00:00 + EnableVerifiers -> AllChains ForkNever , _versionGraphs = (to20ChainsTestnet, twentyChainGraph) `Above` @@ -172,4 +173,5 @@ testnet = ChainwebVersion { _disablePeerValidation = False , _disableMempoolSync = False } + , _versionVerifierPlugins = AllChains $ End $ mempty } diff --git a/test/Chainweb/Test/TestVersions.hs b/test/Chainweb/Test/TestVersions.hs index a79066ae13..b030ed44d0 100644 --- a/test/Chainweb/Test/TestVersions.hs +++ b/test/Chainweb/Test/TestVersions.hs @@ -109,6 +109,7 @@ testVersionTemplate v = v & versionWindow .~ WindowWidth 120 & versionMaxBlockGasLimit .~ End (Just 2_000_000) & versionBootstraps .~ [testBootstrapPeerInfos] + & versionVerifierPlugins .~ AllChains (End mempty) -- | A set of fork heights which are relatively fast, but not fast enough to break anything. fastForks :: HashMap Fork (ChainMap ForkHeight) @@ -139,6 +140,7 @@ fastForks = tabulateHashMap $ \case Chainweb219Pact -> AllChains $ ForkAtBlockHeight $ BlockHeight 27 Chainweb220Pact -> AllChains $ ForkAtBlockHeight $ BlockHeight 30 Chainweb221Pact -> AllChains $ ForkAtBlockHeight $ BlockHeight 33 + EnableVerifiers -> AllChains $ ForkAtBlockHeight $ BlockHeight 35 -- | A test version without Pact or PoW, with only one chain graph. barebonesTestVersion :: ChainGraph -> ChainwebVersion @@ -260,6 +262,7 @@ slowForkingCpmTestVersion g = buildTestVersion $ \v -> v Chainweb219Pact -> AllChains $ ForkAtBlockHeight (BlockHeight 71) Chainweb220Pact -> AllChains $ ForkAtBlockHeight (BlockHeight 85) Chainweb221Pact -> AllChains $ ForkAtBlockHeight (BlockHeight 100) + EnableVerifiers -> AllChains $ ForkAtBlockHeight (BlockHeight 110) -- | CPM version (see `cpmTestVersion`) with forks and upgrades quickly enabled. fastForkingCpmTestVersion :: ChainGraph -> ChainwebVersion @@ -275,4 +278,3 @@ noBridgeCpmTestVersion g = buildTestVersion $ \v -> v & cpmTestVersion g & versionName .~ ChainwebVersionName ("nobridge-CPM-" <> toText g) & versionForks .~ (fastForks & at SPVBridge ?~ AllChains ForkNever) -