HomePhabricator

Faster sigcache nonce

Description

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

Reviewers: #bitcoin_abc, majcosta

Reviewed By: #bitcoin_abc, majcosta

Differential Revision: https://reviews.bitcoinabc.org/D9212

Details

Provenance
Jeremy Rubin <j@rubin.io>Authored on Jul 24 2019, 20:36
FabienCommitted on Feb 12 2021, 08:18
FabienPushed on Feb 12 2021, 08:20
Reviewer
Restricted Project
Differential Revision
D9212: Faster sigcache nonce
Parents
rABC6663fa2cfd63: [Cashtab] Clean up onboarding page + docs link
Branches
Unknown
Tags
Unknown