Skip to content
This repository was archived by the owner on Nov 24, 2025. It is now read-only.

Commit 1bc47f1

Browse files
committed
Merge branch 'master' into lars/replace-service-date-by-forknumbers
2 parents c737f82 + 1e3f632 commit 1bc47f1

File tree

15 files changed

+32
-203
lines changed

15 files changed

+32
-203
lines changed

.github/workflows/applications.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,6 @@ jobs:
364364
cabal build -j2 --ghc-options=-j2 \
365365
chainweb:bench:bench \
366366
exe:b64 \
367-
exe:calculate-release \
368367
exe:compact \
369368
exe:db-checksum \
370369
exe:ea \
@@ -403,7 +402,6 @@ jobs:
403402
mkdir -p artifacts/chainweb
404403
cp $(cabal list-bin b64) artifacts/chainweb
405404
cp $(cabal list-bin bench) artifacts/chainweb
406-
cp $(cabal list-bin calculate-release) artifacts/chainweb
407405
cp $(cabal list-bin chainweb-node) artifacts/chainweb
408406
cp $(cabal list-bin chainweb-storage-tests) artifacts/chainweb
409407
cp $(cabal list-bin chainweb-tests) artifacts/chainweb

.github/workflows/macos.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,6 @@ jobs:
120120
cabal build -j \
121121
chainweb:bench:bench \
122122
exe:b64 \
123-
exe:calculate-release \
124123
exe:compact \
125124
exe:db-checksum \
126125
exe:ea \

chainweb.cabal

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -563,7 +563,7 @@ library chainweb-test-utils
563563
, pact-time:numeric >=0.3.0.1
564564
, pact-tng >=5.0
565565
, pact-tng:pact-request-api >=5.0
566-
, property-matchers
566+
, property-matchers >= 0.7
567567
, quickcheck-instances >= 0.3
568568
, random >= 1.3
569569
, resourcet >= 1.3
@@ -731,7 +731,7 @@ test-suite chainweb-tests
731731
, pact-tng:pact-repl
732732
, patience >= 0.3
733733
, prettyprinter
734-
, property-matchers
734+
, property-matchers >= 0.7
735735
, pretty-show
736736
, quickcheck-instances >= 0.3
737737
, random >= 1.3
@@ -900,7 +900,7 @@ benchmark bench
900900
, pact
901901
, pact-tng
902902
, pact-tng:pact-request-api
903-
, property-matchers
903+
, property-matchers >= 0.7
904904
, random >= 1.3
905905
, safe-exceptions
906906
, streaming

cwtools/calculate-release/Main.hs

Lines changed: 0 additions & 63 deletions
This file was deleted.

cwtools/cwtools.cabal

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -92,24 +92,6 @@ executable b64
9292
, optparse-applicative
9393
, text
9494

95-
executable calculate-release
96-
import: warning-flags, debugging-flags
97-
default-language: Haskell2010
98-
ghc-options:
99-
-threaded
100-
hs-source-dirs: calculate-release
101-
main-is: Main.hs
102-
build-depends:
103-
-- internal
104-
, chainweb
105-
106-
-- external
107-
, base >= 4.12 && < 5
108-
, lens
109-
, lens-aeson
110-
, time
111-
, wreq
112-
11395
-- Compact pact state and RocksDB.
11496
executable compact
11597
import: warning-flags, debugging-flags

default.nix

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,6 @@ let haskellSrc = with nix-filter.lib; filter {
117117
name = "cwtools";
118118
exes = [
119119
"b64"
120-
"calculate-release"
121120
"compact"
122121
"db-checksum"
123122
"ea"

node/src/ChainwebNode.hs

Lines changed: 29 additions & 103 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
{-# LANGUAGE DerivingStrategies #-}
77
{-# LANGUAGE FlexibleContexts #-}
88
{-# LANGUAGE FlexibleInstances #-}
9+
{-# LANGUAGE ImportQualifiedPost #-}
910
{-# LANGUAGE LambdaCase #-}
1011
{-# LANGUAGE MultiWayIf #-}
1112
{-# LANGUAGE NumericUnderscores #-}
@@ -45,40 +46,6 @@ module Main
4546
, main
4647
) where
4748

48-
import Configuration.Utils hiding (Error)
49-
import Configuration.Utils.Validation (validateFilePath)
50-
51-
import Control.Concurrent
52-
import Control.Concurrent.Async
53-
import Control.DeepSeq
54-
import Control.Exception
55-
import Control.Lens hiding ((.=))
56-
import Control.Monad
57-
import Control.Monad.Managed
58-
59-
import Data.Text (Text)
60-
import qualified Data.Text as T
61-
import Data.Time
62-
import Data.Typeable
63-
64-
import GHC.Generics hiding (from)
65-
import GHC.Stack
66-
import GHC.Stats
67-
68-
import qualified Network.HTTP.Client as HTTP
69-
import qualified Network.HTTP.Client.TLS as HTTPS
70-
71-
import qualified Streaming.Prelude as S
72-
73-
import System.Directory
74-
import System.FilePath
75-
import System.IO
76-
import qualified System.Logger as L
77-
import System.LogLevel
78-
import System.Mem
79-
80-
-- internal modules
81-
8249
import Chainweb.BlockHeader
8350
import Chainweb.Chainweb
8451
import Chainweb.Chainweb.Configuration
@@ -94,35 +61,50 @@ import Chainweb.Mempool.Consensus (ReintroducedTxsLog)
9461
import Chainweb.Mempool.InMemTypes (MempoolStats(..))
9562
import Chainweb.Miner.Coordinator (MiningStats)
9663
import Chainweb.Pact.Backend.DbCache (DbCacheStats)
97-
import Chainweb.Pact.Service.PactQueue (PactQueueStats)
9864
import Chainweb.Pact.RestAPI.Server (PactCmdLog(..))
65+
import Chainweb.Pact.Service.PactQueue (PactQueueStats)
9966
import Chainweb.Pact.Types
10067
import Chainweb.Payload
10168
import Chainweb.Payload.PayloadStore
69+
import Chainweb.Storage.Table.RocksDB
10270
import Chainweb.Time
103-
import Data.Time.Format.ISO8601
10471
import Chainweb.Utils
10572
import Chainweb.Utils.RequestLog
10673
import Chainweb.Version
10774
import Chainweb.Version.Mainnet
108-
import Chainweb.Version.Testnet04 (testnet04)
10975
import Chainweb.Version.Registry
110-
111-
import Chainweb.Storage.Table.RocksDB
112-
76+
import Configuration.Utils hiding (Error)
77+
import Configuration.Utils.Validation (validateFilePath)
78+
import Control.Concurrent
79+
import Control.Concurrent.Async
80+
import Control.DeepSeq
81+
import Control.Exception
82+
import Control.Lens hiding ((.=))
83+
import Control.Monad
84+
import Control.Monad.Managed
11385
import Data.LogMessage
114-
86+
import Data.Text (Text)
87+
import Data.Typeable
88+
import GHC.Generics hiding (from)
89+
import GHC.Stack
90+
import GHC.Stats
91+
import Network.HTTP.Client qualified as HTTP
92+
import Network.HTTP.Client.TLS qualified as HTTPS
11593
import P2P.Node
116-
11794
import PkgInfo
118-
95+
import Streaming.Prelude qualified as S
96+
import System.Directory
97+
import System.FilePath
98+
import System.IO
99+
import System.LogLevel
100+
import System.Logger qualified as L
101+
import System.Mem
102+
import Utils.CheckRLimits
103+
import Utils.InstallSignalHandlers
119104
import Utils.Logging
120105
import Utils.Logging.Config
121106
import Utils.Logging.Trace
122107

123-
import Utils.CheckRLimits
124-
import Utils.InstallSignalHandlers
125-
126108
-- -------------------------------------------------------------------------- --
127109
-- Configuration
128110

@@ -479,60 +461,6 @@ mkTelemetryLogger
479461
mkTelemetryLogger mgr = configureHandler
480462
$ withJsonHandleBackend @a (sshow $ typeRep $ Proxy @a) mgr pkgInfoScopes
481463

482-
-- -------------------------------------------------------------------------- --
483-
-- Service Date
484-
485-
newtype ServiceDate = ServiceDate Text
486-
487-
instance Show ServiceDate where
488-
show (ServiceDate t) = "Service interval end: " <> T.unpack t
489-
490-
instance Exception ServiceDate where
491-
fromException = asyncExceptionFromException
492-
toException = asyncExceptionToException
493-
494-
withServiceDate
495-
:: ChainwebVersion
496-
-> (LogLevel -> Text -> IO ())
497-
-> Maybe UTCTime
498-
-> IO a
499-
-> IO a
500-
withServiceDate v lf msd inner = case msd of
501-
Nothing -> do
502-
inner
503-
Just sd -> do
504-
if _versionCode v == _versionCode mainnet || _versionCode v == _versionCode testnet04
505-
then do
506-
race (timer sd) inner >>= \case
507-
Left () -> error "Service date thread terminated unexpectedly"
508-
Right a -> return a
509-
else do
510-
inner
511-
where
512-
timer t = runForever lf "ServiceDate" $ do
513-
now <- getCurrentTime
514-
when (now >= t) $ do
515-
lf Error shutdownMessage
516-
throw $ ServiceDate shutdownMessage
517-
518-
let w = diffUTCTime t now
519-
let micros = round $ w * 1_000_000
520-
lf Warn warning
521-
threadDelay $ min (10 * 60 * 1_000_000) micros
522-
523-
where
524-
warning :: Text
525-
warning = T.concat
526-
[ "This version of chainweb node will stop working at " <> sshow t <> "."
527-
, " Please upgrade to a new version before that date."
528-
]
529-
530-
shutdownMessage :: Text
531-
shutdownMessage = T.concat
532-
[ "Shutting down. This version of chainweb was only valid until " <> sshow t <> "."
533-
, " Please upgrade to a new version."
534-
]
535-
536464
-- -------------------------------------------------------------------------- --
537465
-- Encode Package Info into Log mesage scopes
538466

@@ -575,9 +503,7 @@ main = do
575503
, Handler $ \(e :: SomeException) ->
576504
logFunctionJson logger Error (ProcessDied $ show e) >> throwIO e
577505
] $ do
578-
kt <- mapM iso8601ParseM (_versionServiceDate v)
579-
withServiceDate (_configChainwebVersion (_nodeConfigChainweb conf)) (logFunctionText logger) kt $ void $
580-
race (node conf logger) (gcRunner (logFunctionText logger))
506+
void $ race (node conf logger) (gcRunner (logFunctionText logger))
581507
where
582508
gcRunner lf = runForever lf "GarbageCollect" $ do
583509
performMajorGC

src/Chainweb/RestAPI/NodeInfo.hs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,6 @@ data NodeInfo = NodeInfo
7070
-- ^ Genesis heights of each chain.
7171
, nodeHistoricalChains :: NE.NonEmpty (BlockHeight, [(ChainId, [ChainId])])
7272
-- ^ All graph upgrades
73-
, nodeServiceDate :: Maybe Text
74-
-- ^ The upcoming service date for the node.
7573
, nodeBlockDelay :: BlockDelay
7674
-- ^ The PoW block delay of the node (microseconds)
7775
}
@@ -96,7 +94,6 @@ nodeInfoHandler v (SomeCutDb (CutDbT db :: CutDbT cas v)) = do
9694
, nodeLatestBehaviorHeight = latestBehaviorAt v
9795
, nodeGenesisHeights = map (\c -> (chainIdToText c, genesisHeight v c)) $ HS.toList (chainIds v)
9896
, nodeHistoricalChains = ruleElems $ fmap (HM.toList . HM.map HS.toList . toAdjacencySets) $ _versionGraphs v
99-
, nodeServiceDate = T.pack <$> _versionServiceDate v
10097
, nodeBlockDelay = _versionBlockDelay v
10198
}
10299

src/Chainweb/Version.hs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,6 @@ module Chainweb.Version
7575
, versionGenesis
7676
, versionVerifierPluginNames
7777
, versionQuirks
78-
, versionServiceDate
7978
, versionForkNumber
8079
, genesisBlockPayload
8180
, genesisBlockPayloadHash
@@ -507,8 +506,6 @@ data ChainwebVersion
507506
-- ^ Verifier plugins that can be run to verify transaction contents.
508507
, _versionQuirks :: VersionQuirks
509508
-- ^ Modifications to behavior at particular blockheights
510-
, _versionServiceDate :: Maybe String
511-
-- ^ The node service date for this version.
512509
, _versionForkNumber :: ForkNumber
513510
-- ^ The current fork number for this version. Starting with
514511
-- chainweb-node version 2.33, fork numbers replace named forks. Fork

src/Chainweb/Version/Development.hs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,5 @@ devnet = ChainwebVersion
6464
, _versionVerifierPluginNames = AllChains $ Bottom
6565
(minBound, Set.fromList $ map VerifierName ["hyperlane_v3_message", "allow", "signed_list"])
6666
, _versionQuirks = noQuirks
67-
, _versionServiceDate = Nothing
6867
, _versionForkNumber = 0
6968
}

0 commit comments

Comments
 (0)