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

Commit 13a1552

Browse files
committed
Merge remote-tracking branch 'origin/pp/evm' into pp/evm
2 parents a28c3f4 + ddef14a commit 13a1552

File tree

83 files changed

+2093
-2278
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

83 files changed

+2093
-2278
lines changed

bench/Chainweb/Pact/Backend/ApplyCmd.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ benchApplyCmd ver rdb act =
100100
lgr <- testLogger
101101

102102
psEnvVar <- newEmptyMVar
103-
tid <- forkIO $ void $ withPactService ver chain0 lgr Nothing bhdb (_bdbPayloadDb tdb) sql testPactServiceConfig $ do
103+
tid <- forkIO $ void $ withPactService ver chain0 lgr Nothing bhdb (_bdbPayloadDb tdb) sql defaultPactServiceConfig $ do
104104
initialPayloadState ver chain0
105105
psEnv <- ask
106106
liftIO $ putMVar psEnvVar psEnv

bench/Chainweb/Pact/Backend/ForkingBench.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ withResources rdb trunkLength logLevel f = C.envWithCleanup create destroy unwra
248248

249249
startPact version l bhdb pdb mempool sqlEnv = do
250250
reqQ <- newPactQueue pactQueueSize
251-
a <- async $ runPactService version cid l Nothing reqQ mempool bhdb pdb sqlEnv testPactServiceConfig
251+
a <- async $ runPactService version cid l Nothing reqQ mempool bhdb pdb sqlEnv defaultPactServiceConfig
252252
{ _pactNewBlockGasLimit = 180_000
253253
, _pactPersistIntraBlockWrites = p
254254
}

bench/Chainweb/Pact/Backend/PactService.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ destroyFixture fx = do
166166
oneBlock :: ChainwebVersion -> RocksDb -> Word -> C.Benchmarkable
167167
oneBlock v rdb numTxs =
168168
let cid = unsafeChainId 0
169-
cfg = testPactServiceConfig
169+
cfg = defaultPactServiceConfig
170170

171171
setupEnv _ = do
172172
fx <- createFixture v rdb cfg

cabal.project

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ source-repository-package
101101
source-repository-package
102102
type: git
103103
location: https://github.com/kadena-io/pact-5.git
104-
tag: 166fdba5e6b50a5528eba72fc8e1ca835538899d
104+
tag: 18a8a1c192f30c9f22561a834478a7a664fcf4a3
105105
--sha256: 15bzwmhjh9733ngbqp83n95fxsncscsx6l144y964ydii47ri3i8
106106

107107
source-repository-package

cabal.project.freeze

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
active-repositories: hackage.haskell.org:merge
2-
constraints: any.Cabal ==3.10.2.0,
3-
any.Cabal-syntax ==3.10.2.0,
2+
constraints: any.Cabal ==3.14.1.0,
3+
any.Cabal-syntax ==3.14.2.0,
44
any.Decimal ==0.5.2,
55
any.Diff ==1.0.2,
66
any.Glob ==0.10.2,
@@ -332,7 +332,7 @@ constraints: any.Cabal ==3.10.2.0,
332332
any.random ==1.3.1,
333333
any.raw-strings-qq ==1.1,
334334
any.recover-rtti ==0.5.0,
335-
any.recv ==0.1.0,
335+
any.recv ==0.1.1,
336336
any.reducers ==3.12.5,
337337
any.reflection ==2.1.9,
338338
reflection -slow +template-haskell,
@@ -420,7 +420,7 @@ constraints: any.Cabal ==3.10.2.0,
420420
any.terminal-progress-bar ==0.4.2,
421421
any.terminal-size ==0.3.4,
422422
any.terminfo ==0.4.1.6,
423-
any.texmath ==0.12.9,
423+
any.texmath ==0.12.10,
424424
texmath -executable -server,
425425
any.text ==2.1.1,
426426
any.text-conversions ==0.3.1.1,
@@ -447,7 +447,7 @@ constraints: any.Cabal ==3.10.2.0,
447447
any.tls-session-manager ==0.0.8,
448448
any.token-bucket ==0.1.0.1,
449449
token-bucket +use-cbits,
450-
any.toml-parser ==2.0.1.0,
450+
any.toml-parser ==2.0.1.2,
451451
any.torsor ==0.1.0.1,
452452
any.transformers ==0.6.1.0,
453453
any.transformers-base ==0.4.6,
@@ -522,4 +522,4 @@ constraints: any.Cabal ==3.10.2.0,
522522
zip-archive -executable,
523523
any.zlib ==0.7.1.0,
524524
zlib -bundled-c-zlib +non-blocking-ffi +pkg-config
525-
index-state: hackage.haskell.org 2025-04-21T12:07:04Z
525+
index-state: hackage.haskell.org 2025-05-02T15:38:56Z

chainweb.cabal

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -550,6 +550,7 @@ library chainweb-test-utils
550550
, quickcheck-instances >= 0.3
551551
, random >= 1.3
552552
, resourcet >= 1.3
553+
, resource-pool >= 0.4
553554
, retry >= 0.7
554555
, rocksdb-haskell-kadena >= 1.1.0
555556
, safe-exceptions >= 0.1
@@ -726,7 +727,7 @@ test-suite chainweb-tests
726727
Chainweb.Test.Pact.HyperlanePluginTests
727728
Chainweb.Test.Pact.PactServiceTest
728729
Chainweb.Test.Pact.RemotePactTest
729-
Chainweb.Test.Pact.SPVTest
730+
-- Chainweb.Test.Pact.SPVTest
730731
Chainweb.Test.Pact.TransactionExecTest
731732
Chainweb.Test.Pact.TransactionTests
732733
Chainweb.Test.RestAPI

cwtools/cwtools.cabal

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,12 +174,14 @@ executable ea
174174
, async
175175
, base
176176
, chainweb-storage
177+
, filepath
177178
, lens
178179
, loglevel
179180
, pact-json
180181
, pact-tng:pact-request-api
181182
, pact-tng
182183
, resource-pool
184+
, resourcet
183185
, temporary
184186
, text
185187
, vector

cwtools/ea/Ea.hs

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ import Chainweb.Logger (genericLogger)
3333
import Chainweb.Miner.Pact (noMiner)
3434
import Chainweb.Pact.Backend.Utils
3535
import Chainweb.Pact.PactService
36-
import Chainweb.Pact.Types (testPactServiceConfig)
36+
import Chainweb.Pact.Types (defaultPactServiceConfig, GenesisConfig(..))
3737
import Chainweb.Pact.Utils (toTxCreationTime, emptyPayload)
3838
import Chainweb.Pact.Transaction qualified as Pact
3939
import Chainweb.Pact.Validations (defaultMaxTTLSeconds)
@@ -48,6 +48,8 @@ import Chainweb.Version.RecapDevelopment (pattern RecapDevelopment)
4848
import Chainweb.Version.Registry (registerVersion)
4949
import Control.Concurrent.Async
5050
import Control.Exception
51+
import Control.Monad.Trans.Resource
52+
import Control.Monad.IO.Class
5153
import Control.Lens
5254
import Data.Aeson qualified as Aeson
5355
import Data.Foldable
@@ -63,6 +65,7 @@ import Data.Traversable
6365
import Data.Vector qualified as V
6466
import Ea.Genesis
6567
import GHC.Exts(the)
68+
import System.FilePath
6669
import System.LogLevel
6770
import System.IO.Temp
6871
import Text.Printf
@@ -155,11 +158,11 @@ genPayloadModule :: ChainwebVersion -> Text -> Chainweb.ChainId -> [Pact.Transac
155158
genPayloadModule v tag cid cwTxs = do
156159
let logger = genericLogger Warn TIO.putStrLn
157160
pdb <- newPayloadDb
158-
withSystemTempDirectory "ea-pact-db" $ \pactDbDir -> do
159-
payloadWO <- withSqliteDb cid logger pactDbDir False $ \readWriteSql -> do
160-
roPool <- Pool.newPool $ Pool.defaultPoolConfig (startReadSqliteDb cid logger pactDbDir) stopSqliteDb 10 10
161-
withPactService v cid Nothing mempty logger Nothing pdb roPool readWriteSql (testPactServiceConfig emptyPayload) $ \serviceEnv ->
162-
execNewGenesisBlock logger serviceEnv (V.fromList cwTxs)
161+
withSystemTempDirectory "ea-pact-db" $ \pactDbDir -> runResourceT $ do
162+
readWriteSql <- withSqliteDb cid logger pactDbDir False
163+
roPool <- withReadSqlitePool cid pactDbDir
164+
serviceEnv <- withPactService v cid Nothing mempty logger Nothing pdb roPool readWriteSql defaultPactServiceConfig GeneratingGenesis
165+
payloadWO <- liftIO $ execNewGenesisBlock logger serviceEnv (V.fromList cwTxs)
163166
return $ TL.toStrict $ TB.toLazyText $ payloadModuleCode tag payloadWO
164167

165168
mkChainwebTxs :: [FilePath] -> IO [Pact.Transaction]

cwtools/ea/Ea/Genesis.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ module Ea.Genesis
6161
import Control.Lens
6262
import Control.Monad
6363

64-
import Data.Text
64+
import Data.Text (Text)
6565
import Data.Word
6666

6767
import Chainweb.Graph

node/Setup.hs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
{-# LANGUAGE CPP #-}
99
{-# LANGUAGE LambdaCase #-}
1010
{-# LANGUAGE MultiWayIf #-}
11+
{-# LANGUAGE ViewPatterns #-}
1112
{-# LANGUAGE OverloadedStrings #-}
1213
{-# LANGUAGE ScopedTypeVariables #-}
1314

@@ -133,7 +134,7 @@ import System.Directory
133134
doesFileExist, getCurrentDirectory)
134135
import System.Environment (lookupEnv)
135136
import System.Exit (ExitCode(ExitSuccess))
136-
import System.FilePath (isDrive, takeDirectory, (</>))
137+
import System.FilePath (isDrive, takeDirectory)
137138

138139
-- | Include this function when your setup doesn't contain any
139140
-- extra functionality.
@@ -183,7 +184,7 @@ mkPkgInfoModulesPostConf hook args flags pkgDesc bInfo = do
183184

184185
updatePkgInfoModule :: PackageDescription -> LocalBuildInfo -> ComponentLocalBuildInfo -> IO ()
185186
updatePkgInfoModule pkgDesc bInfo clbInfo = do
186-
createDirectoryIfMissing True dirName
187+
createDirectoryIfMissing True $ interpretSymbolicPathCWD dirName
187188
moduleBytes <- pkgInfoModule moduleName cName pkgDesc bInfo
188189
updateFile fileName moduleBytes
189190

@@ -196,19 +197,19 @@ updatePkgInfoModule pkgDesc bInfo clbInfo = do
196197
cName = unUnqualComponentName <$> componentNameString (componentLocalName clbInfo)
197198

198199
moduleName = pkgInfoModuleName
199-
fileName = dirName ++ "/" ++ moduleName ++ ".hs"
200+
fileName = dirName </> unsafeMakeSymbolicPath moduleName <.> ".hs"
200201

201202
legacyModuleName = legacyPkgInfoModuleName cName
202-
legacyFileName = dirName ++ "/" ++ legacyModuleName ++ ".hs"
203+
legacyFileName = dirName </> unsafeMakeSymbolicPath legacyModuleName <.> ".hs"
203204

204205
-- -------------------------------------------------------------------------- --
205206
-- Generate PkgInfo Module
206207

207208
pkgInfoModuleName :: String
208209
pkgInfoModuleName = "PkgInfo"
209210

210-
updateFile :: FilePath -> B.ByteString -> IO ()
211-
updateFile fileName content = do
211+
updateFile :: SymbolicPath from to -> B.ByteString -> IO ()
212+
updateFile (interpretSymbolicPathCWD -> fileName) content = do
212213
x <- doesFileExist fileName
213214
if | not x -> update
214215
| otherwise -> do

0 commit comments

Comments
 (0)