Skip to content

Commit

Permalink
Fix coinbase caching (#861)
Browse files Browse the repository at this point in the history
  • Loading branch information
Stuart Popejoy committed Jan 4, 2020
1 parent ef75579 commit 4b6a2d3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions src/Chainweb/Pact/PactService.hs
Expand Up @@ -1237,6 +1237,11 @@ applyPactCmd isGenesis dbEnv cmdIn miner mcache dl = do
pd <- mkPublicData "applyPactCmd" (publicMetaOf $ payloadObj <$> cmdIn)
spv <- use psSpvSupport
liftIO $! applyCmd logger dbEnv miner gasModel pd spv cmdIn mcache excfg
{- the following can be used instead of above to nerf transaction execution
return $! T2 (P.CommandResult (P.cmdToRequestKey cmdIn) Nothing
(P.PactResult (Right (P.PLiteral (P.LInteger 1))))
0 Nothing Nothing Nothing)
mcache -}

when isGenesis $
psInitCache <>= mcache'
Expand Down
2 changes: 1 addition & 1 deletion src/Chainweb/Pact/TransactionExec.hs
Expand Up @@ -266,7 +266,7 @@ applyCoinbase v logger dbEnv (Miner mid mks) reward@(ParsedDecimal d) pd parentH
tenv = TransactionEnv Transactional dbEnv logger pd noSPVSupport
Nothing 0.0 rk 0 restrictiveExecutionConfig
txst = TransactionState mc mempty 0 Nothing (_geGasModel freeGasEnv)
initState = initCapabilities [magic_COINBASE]
initState = setModuleCache mc $ initCapabilities [magic_COINBASE]
chash = Pact.Hash (sshow $ _blockHash parentHeader)
rk = RequestKey chash

Expand Down

0 comments on commit 4b6a2d3

Please sign in to comment.