Skip to content

Commit

Permalink
Fix restarting after Pact 5 transition
Browse files Browse the repository at this point in the history
Change-Id: Id0000000d523a8dc8809e5ff12ae7bb53f82f393
  • Loading branch information
edmundnoble committed Jan 28, 2025
1 parent 2d5ec87 commit 1ed4ef3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Chainweb/Pact/PactService.hs
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ initializeCoinContract v cid pwo = do
Just currentBlockHeader ->
if currentBlockHeader /= ParentHeader genesisHeader
then
unless (pact5 v cid (view blockHeight genesisHeader)) $ do
unless (pact5 v cid (view (parentHeader . blockHeight . to succ) currentBlockHeader)) $ do
!mc <- Checkpointer.readFrom (Just currentBlockHeader)
(SomeBlockM $ Pair Pact4.readInitModules (error "pact5")) >>= \case
NoHistory -> throwM $ BlockHeaderLookupFailure
Expand Down
6 changes: 5 additions & 1 deletion test/multinode/MultiNodeNetworkTests.hs
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,16 @@ suite = independentSequentialTestGroup "MultiNodeNetworkTests"
withTempRocksDb "multinode-tests-timedconsensus-peterson-twenty-rocks" $ \rdb ->
withSystemTempDirectory "multinode-tests-timedconsensus-peterson-twenty-pact" $ \pactDbDir ->
Chainweb.Test.MultiNode.test loglevel (timedConsensusVersion petersonChainGraph twentyChainGraph) 10 30 rdb pactDbDir step
, testCaseSteps "ConsensusNetwork - FastTimedCPM pairChainGraph - 10 nodes - 30 seconds" $ \step ->
, testCaseSteps "ConsensusNetwork - FastTimedCPM singleChainGraph - 10 nodes - 30 seconds" $ \step ->
withTempRocksDb "multinode-tests-fasttimedcpm-single-rocks" $ \rdb ->
withSystemTempDirectory "multinode-tests-fasttimedcpm-single-pact" $ \pactDbDir ->
Chainweb.Test.MultiNode.test loglevel (fastForkingCpmTestVersion singletonChainGraph) 10 30 rdb pactDbDir step
, testCaseSteps "Replay - FastTimedCPM - 6 nodes" $ \step ->
withTempRocksDb "replay-test-fasttimedcpm-pair-rocks" $ \rdb ->
withSystemTempDirectory "replay-test-fasttimedcpm-pair-pact" $ \pactDbDir ->
Chainweb.Test.MultiNode.replayTest loglevel (fastForkingCpmTestVersion pairChainGraph) 6 rdb pactDbDir step
, testCaseSteps "Replay - TransitionTimedCPM - 6 nodes" $ \step ->
withTempRocksDb "replay-test-transitiontimedcpm-pair-rocks" $ \rdb ->
withSystemTempDirectory "replay-test-transitiontimedcpm-pair-pact" $ \pactDbDir ->
Chainweb.Test.MultiNode.replayTest loglevel (instantCpmTransitionTestVersion pairChainGraph) 1 rdb pactDbDir step
]

0 comments on commit 1ed4ef3

Please sign in to comment.