Page MenuHomePhabricator

Cache script execution on a per transaction basis
ClosedPublic

Authored by deadalnix on Sep 6 2017, 12:21.

Details

Summary

This ensure that we do not run the same script twice with the same set of flags. because we check script when accepting a transaction in the mempool, this shoudl ensure that we do not run the script when connecting a new block.

This is based on core's PR10192 , but the structure is somewhat different (the cache is moved in its own file for instance).

Test Plan
make check
../qa/pull-tester/rpc-tests.py -extended

Run a node on testnet for a day, it looks like it all works well.

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

sickpig added inline comments.
src/script/scriptcache.cpp
1 ↗(On Diff #1330)

missing licence?

dagurval added a subscriber: dagurval.
dagurval added inline comments.
src/script/scriptcache.cpp
55 ↗(On Diff #1344)

If IsKeyInScriptCache requires cs_main, shouldn't inserting also require cs_main? (AssertLockHeld(cs_main))

This revision is now accepted and ready to land.Sep 7 2017, 19:53
src/script/scriptcache.cpp
55 ↗(On Diff #1344)

Yes.

This revision was automatically updated to reflect the committed changes.