Make signature caching optional, and move it out.#4890
Make signature caching optional, and move it out.#4890laanwj merged 3 commits intobitcoin:masterfrom
Conversation
ef0289b to
035a4de
Compare
|
@TheBlueMatt fwiw, this pull-tester false-negative is the same one we get on Travis: http://jenkins.bluematt.me/pull-tester/p4890_035a4de88b03fcdfd9e0bf747f301fcc8f1bb299/test.log So it seems it's not anything related to a specific setup. Not really worth worrying about, just pointing it out. |
|
@jtimon Yes indeed; this would allow #4692 to do checking without needing to depend on the cache, by using SignatureChecker() and not CachingSignatureChecker(). And you're very right: the flags passing through CheckSig and VerifySignature is ugly, as SCRIPT_VERIFY_NOCACHE shouldn't be an interpreter flag at all, as it's no longer a feature of the interpreter. I added a commit that removes that flag, and turns it into a constructor argument to CachingSignatureChecker. |
82acca7 to
4e8f7e1
Compare
|
Haven't verified code movements, but I like these code changes. |
bc889ef to
078ff4a
Compare
|
@laanwj Would you mind verifying code movement? |
|
Yes I'll take a look. |
There was a problem hiding this comment.
flags doesn't match against signature EvalScript(std::vector<std::vector<unsigned char> >& stack, const CScript& script, unsigned int flags, const BaseSignatureChecker& checker)
There was a problem hiding this comment.
Indeed, the false should be 0 or SCRIPT_VERIFY_NONE, but I didn't want to touch that here.
There was a problem hiding this comment.
Okay, agreed, didn't notice that was the case in the original code as well.
|
This comment about NOCACHE script flag can also be removed: https://github.com/bitcoin/bitcoin/blob/master/src/test/transaction_tests.cpp#L34 |
src/main.h
Outdated
There was a problem hiding this comment.
I think this argument should be called cacheWrite or cacheStore, to make it apparent that the cache is always used, but the difference that this boolean makes is whether the result is stored.
|
utACK apart from above nits, going to test this |
|
Addressed all nits, I think. |
|
Automatic sanity-testing: PASSED, see http://jenkins.bluematt.me/pull-tester/p4890_c41cd3a3b2424748a701437d49f3622afd9ca5be/ for binaries and test log. |
|
Bleh, needs rebase after #5017 (a trivial debug message change). |
|
Rebased. |
|
utACK. Can we move this one forward? |
CHECKLOCKTIMEVERIFY patch because EvalScript() no longer receives txTo and nIn.
This will make it easier to export the script verification code to a thread-agnostic library.
By moving some of the parameters into a SignatureChecker object, some of the long argument lists are reduced.
Builds on top of (a rebased version of) #4555.