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

Precompute sighashes #8524

Merged
merged 3 commits into from Sep 1, 2016
Merged

Precompute sighashes #8524

merged 3 commits into from Sep 1, 2016

Conversation

@sipa
Copy link
Member

sipa commented Aug 16, 2016

Alternative to #8422.

This version simply precomputes the 3 overall hashes once per transaction, resulting in no more cache that needs updating during validation.

Original version by Nicolas Dorier. Precomputing version by Pieter Wuille.
@NicolasDorier

This comment has been minimized.

Copy link
Member

NicolasDorier commented Aug 16, 2016

utACK 67a2091463b7d9f3d33d86fb42a6feab127a9487 will test and time it soon. I prefer this version as well.

@sipa sipa force-pushed the sipa:noprecomputecachedhashes branch to ab48c5e Aug 16, 2016
@MarcoFalke MarcoFalke added this to the 0.13.1 milestone Aug 16, 2016
@instagibbs

This comment has been minimized.

Copy link
Member

instagibbs commented Aug 22, 2016

Prefer the simplicity of this one.

code review ACK and lightly tACK(it syncs testnet) ab48c5e

@dcousens

This comment has been minimized.

Copy link
Contributor

dcousens commented Aug 22, 2016

utACK ab48c5e

@@ -98,13 +98,20 @@ enum

bool CheckSignatureEncoding(const std::vector<unsigned char> &vchSig, unsigned int flags, ScriptError* serror);

struct CachedHashes

This comment has been minimized.

Copy link
@laanwj

laanwj Aug 26, 2016

Member

Nit: this struct name is too general, maybe CachedTransactionHashes?

This comment has been minimized.

Copy link
@sipa

sipa Aug 26, 2016

Author Member

It's actually not a cache either anymore.

What about PrecomputedTransactionData ?

This comment has been minimized.

Copy link
@sipa

sipa Aug 26, 2016

Author Member

Added a commit.

@laanwj

This comment has been minimized.

Copy link
Member

laanwj commented Aug 26, 2016

utACK ab48c5e, nice to get rid of some TODOs and spurious hashing

@sipa sipa force-pushed the sipa:noprecomputecachedhashes branch Aug 26, 2016
@sipa sipa force-pushed the sipa:noprecomputecachedhashes branch to 35fe039 Aug 26, 2016
@btcdrak

This comment has been minimized.

Copy link
Member

btcdrak commented Aug 28, 2016

utACK 35fe039

@sipa

This comment has been minimized.

Copy link
Member Author

sipa commented Aug 28, 2016

@laanwj Ok with the class name now?

@NicolasDorier NicolasDorier mentioned this pull request Aug 28, 2016
@sipa sipa merged commit 35fe039 into bitcoin:master Sep 1, 2016
1 check passed
1 check passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
sipa added a commit that referenced this pull request Sep 1, 2016
35fe039 Rename to PrecomputedTransactionData (Pieter Wuille)
ab48c5e Unit test for sighash caching (Nicolas DORIER)
d2c5d04 Precompute sighashes (Pieter Wuille)
@sipa sipa mentioned this pull request Sep 7, 2016
@str4d str4d mentioned this pull request Jan 25, 2018
zkbot added a commit to zcash/zcash that referenced this pull request Feb 8, 2018
Overwinter SignatureHash

Implements zcash/zips#129.

Includes code cherry-picked from the following upstream PRs:

- bitcoin/bitcoin#7276
- bitcoin/bitcoin#7976
- bitcoin/bitcoin#8118
- bitcoin/bitcoin#8149
  - Only amount validation and SignatureHash commits.
- bitcoin/bitcoin#6915
  - Only the rework of `mempool.check()` calls that the next PR depends on.
- bitcoin/bitcoin#8346
- bitcoin/bitcoin#8524

Part of  #2254. Closes #1408 and #2584.
zkbot added a commit to zcash/zcash that referenced this pull request Feb 8, 2018
Overwinter SignatureHash

Implements zcash/zips#129.

Includes code cherry-picked from the following upstream PRs:

- bitcoin/bitcoin#7276
- bitcoin/bitcoin#7976
- bitcoin/bitcoin#8118
- bitcoin/bitcoin#8149
  - Only amount validation and SignatureHash commits.
- bitcoin/bitcoin#6915
  - Only the rework of `mempool.check()` calls that the next PR depends on.
- bitcoin/bitcoin#8346
- bitcoin/bitcoin#8524

Part of  #2254. Closes #1408 and #2584.
zkbot added a commit to zcash/zcash that referenced this pull request Feb 19, 2018
Overwinter SignatureHash

Implements zcash/zips#129.

Includes code cherry-picked from the following upstream PRs:

- bitcoin/bitcoin#7276
- bitcoin/bitcoin#7976
- bitcoin/bitcoin#8118
- bitcoin/bitcoin#8149
  - Only amount validation and SignatureHash commits.
- bitcoin/bitcoin#6915
  - Only the rework of `mempool.check()` calls that the next PR depends on.
- bitcoin/bitcoin#8346
- bitcoin/bitcoin#8524

Part of #2074 and #2254. Closes #1408 and #2584.
zkbot added a commit to zcash/zcash that referenced this pull request Feb 20, 2018
Overwinter SignatureHash

Implements ZIP 143.

Includes code cherry-picked from the following upstream PRs:

- bitcoin/bitcoin#7276
- bitcoin/bitcoin#7976
- bitcoin/bitcoin#8118
- bitcoin/bitcoin#8149
  - Only amount validation and SignatureHash commits.
- bitcoin/bitcoin#8346
- bitcoin/bitcoin#8524

Part of #2074 and #2254. Closes #1408 and #2584.
zkbot added a commit to zcash/zcash that referenced this pull request Feb 20, 2018
Overwinter SignatureHash

Implements ZIP 143.

Includes code cherry-picked from the following upstream PRs:

- bitcoin/bitcoin#7276
- bitcoin/bitcoin#7976
- bitcoin/bitcoin#8118
- bitcoin/bitcoin#8149
  - Only amount validation and SignatureHash commits.
- bitcoin/bitcoin#8346
- bitcoin/bitcoin#8524

Part of #2074 and #2254. Closes #1408 and #2584.
@dagurval dagurval mentioned this pull request Mar 19, 2018
PastaPastaPasta added a commit to PastaPastaPasta/dash that referenced this pull request Jun 6, 2019
35fe039 Rename to PrecomputedTransactionData (Pieter Wuille)
ab48c5e Unit test for sighash caching (Nicolas DORIER)
d2c5d04 Precompute sighashes (Pieter Wuille)
PastaPastaPasta added a commit to PastaPastaPasta/dash that referenced this pull request Jun 7, 2019
35fe039 Rename to PrecomputedTransactionData (Pieter Wuille)
ab48c5e Unit test for sighash caching (Nicolas DORIER)
d2c5d04 Precompute sighashes (Pieter Wuille)

Signed-off-by: Pasta <Pasta@dash.org>
PastaPastaPasta added a commit to PastaPastaPasta/dash that referenced this pull request Jun 7, 2019
35fe039 Rename to PrecomputedTransactionData (Pieter Wuille)
ab48c5e Unit test for sighash caching (Nicolas DORIER)
d2c5d04 Precompute sighashes (Pieter Wuille)
PastaPastaPasta added a commit to PastaPastaPasta/dash that referenced this pull request Jun 7, 2019
35fe039 Rename to PrecomputedTransactionData (Pieter Wuille)
ab48c5e Unit test for sighash caching (Nicolas DORIER)
d2c5d04 Precompute sighashes (Pieter Wuille)
PastaPastaPasta added a commit to PastaPastaPasta/dash that referenced this pull request Jun 10, 2019
35fe039 Rename to PrecomputedTransactionData (Pieter Wuille)
ab48c5e Unit test for sighash caching (Nicolas DORIER)
d2c5d04 Precompute sighashes (Pieter Wuille)
PastaPastaPasta added a commit to PastaPastaPasta/dash that referenced this pull request Jun 10, 2019
35fe039 Rename to PrecomputedTransactionData (Pieter Wuille)
ab48c5e Unit test for sighash caching (Nicolas DORIER)
d2c5d04 Precompute sighashes (Pieter Wuille)
PastaPastaPasta added a commit to PastaPastaPasta/dash that referenced this pull request Jun 10, 2019
35fe039 Rename to PrecomputedTransactionData (Pieter Wuille)
ab48c5e Unit test for sighash caching (Nicolas DORIER)
d2c5d04 Precompute sighashes (Pieter Wuille)
PastaPastaPasta added a commit to PastaPastaPasta/dash that referenced this pull request Jun 11, 2019
35fe039 Rename to PrecomputedTransactionData (Pieter Wuille)
ab48c5e Unit test for sighash caching (Nicolas DORIER)
d2c5d04 Precompute sighashes (Pieter Wuille)

add missing change from bitcoinconsensus.cpp

Signed-off-by: Pasta <Pasta@dash.org>
PastaPastaPasta added a commit to PastaPastaPasta/dash that referenced this pull request Jun 11, 2019
35fe039 Rename to PrecomputedTransactionData (Pieter Wuille)
ab48c5e Unit test for sighash caching (Nicolas DORIER)
d2c5d04 Precompute sighashes (Pieter Wuille)
barrystyle added a commit to PACGlobalOfficial/PAC that referenced this pull request Jan 22, 2020
35fe039 Rename to PrecomputedTransactionData (Pieter Wuille)
ab48c5e Unit test for sighash caching (Nicolas DORIER)
d2c5d04 Precompute sighashes (Pieter Wuille)

add missing change from bitcoinconsensus.cpp

Signed-off-by: Pasta <Pasta@dash.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

7 participants
You can’t perform that action at this time.