Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix coinbase caching #861

Merged
merged 1 commit into from Jan 4, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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