Page MenuHomePhabricator

Faster sigcache nonce
ClosedPublic

Authored by Fabien on Thu, Feb 11, 13:13.

Details

Reviewers
majcosta
Group Reviewers
Restricted Project
Commits
rABC95d0162dae28: Faster sigcache nonce
Summary
This PR replaces nonces in two places with pre-salted hashers.

The nonce is chosen to be 64 bytes long so that it forces the SHA256
hasher to process the chunk. This leaves the next 64 (or 56 depending if
final chunk) open for data. In the case of the script execution cache,
this does not make a big performance improvement because the nonce was
already properly padded to fit into one buffer, but does make the code a
little simpler. In the case of the sig cache, this should reduce the
hashing overhead slightly because we are less likely to need an
additional processing step.

Backport of core PR13204.

Test Plan
ninja all check-all
ninja bench-bitcoin

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

Fabien requested review of this revision.Thu, Feb 11, 13:13
This revision is now accepted and ready to land.Thu, Feb 11, 15:00
This revision was automatically updated to reflect the committed changes.