Precompute sighashes #8524

pull sipa wants to merge 3 commits into bitcoin:master from sipa:noprecomputecachedhashes changing 8 files +159 −38
  1. sipa commented at 1:15 PM on August 16, 2016: member

    Alternative to #8422.

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

  2. Precompute sighashes
    Original version by Nicolas Dorier. Precomputing version by Pieter Wuille.
    d2c5d044d0
  3. NicolasDorier commented at 1:36 PM on August 16, 2016: contributor

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

  4. Unit test for sighash caching ab48c5e721
  5. sipa force-pushed on Aug 16, 2016
  6. MarcoFalke added the label Needs backport on Aug 16, 2016
  7. MarcoFalke added this to the milestone 0.13.1 on Aug 16, 2016
  8. instagibbs commented at 1:26 PM on August 22, 2016: member

    Prefer the simplicity of this one.

    code review ACK and lightly tACK(it syncs testnet) https://github.com/bitcoin/bitcoin/pull/8524/commits/ab48c5e72156b34300db4a6521cb3c9969be3937

  9. dcousens commented at 1:41 PM on August 22, 2016: contributor

    utACK ab48c5e

  10. in src/script/interpreter.h:None in ab48c5e721 outdated
      97 | @@ -98,13 +98,20 @@ enum
      98 |  
      99 |  bool CheckSignatureEncoding(const std::vector<unsigned char> &vchSig, unsigned int flags, ScriptError* serror);
     100 |  
     101 | +struct CachedHashes
    


    laanwj commented at 1:01 PM on August 26, 2016:

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


    sipa commented at 4:32 PM on August 26, 2016:

    It's actually not a cache either anymore.

    What about PrecomputedTransactionData ?


    sipa commented at 4:39 PM on August 26, 2016:

    Added a commit.

  11. laanwj commented at 1:19 PM on August 26, 2016: member

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

  12. sipa force-pushed on Aug 26, 2016
  13. Rename to PrecomputedTransactionData 35fe0393f2
  14. sipa force-pushed on Aug 26, 2016
  15. btcdrak commented at 9:18 AM on August 28, 2016: contributor

    utACK 35fe039

  16. sipa commented at 12:16 PM on August 28, 2016: member

    @laanwj Ok with the class name now?

  17. NicolasDorier cross-referenced this on Aug 28, 2016 from issue Cache hashes by NicolasDorier
  18. sipa merged this on Sep 1, 2016
  19. sipa closed this on Sep 1, 2016

  20. sipa referenced this in commit 19b0f33de0 on Sep 1, 2016
  21. sipa cross-referenced this on Sep 5, 2016 from issue Predeclare PrecomputedTransactionData as struct by sipa
  22. jl2012 cross-referenced this on Sep 6, 2016 from issue [WIP] Reuse sighash computations across evaluation by jl2012
  23. sipa cross-referenced this on Sep 7, 2016 from issue [0.13] Various backports by sipa
  24. MarcoFalke removed the label Needs backport on Sep 9, 2016
  25. sdaftuar cross-referenced this on Sep 28, 2016 from issue [qa] Split up slow RPC calls to avoid pruning test timeouts by sdaftuar
  26. str4d cross-referenced this on Jan 25, 2018 from issue Overwinter SignatureHash by str4d
  27. zkbot referenced this in commit 84c19b8a87 on Feb 8, 2018
  28. zkbot referenced this in commit e1f3a15fdc on Feb 8, 2018
  29. zkbot referenced this in commit eb3128ab0a on Feb 19, 2018
  30. zkbot referenced this in commit 6db10127a9 on Feb 20, 2018
  31. zkbot referenced this in commit 8487be8360 on Feb 20, 2018
  32. dagurval cross-referenced this on Mar 19, 2018 from issue Precompute sighashes by dagurval
  33. Empact cross-referenced this on Dec 2, 2018 from issue test: Correct ineffectual WithOrVersion from transactions_tests by Empact
  34. PastaPastaPasta referenced this in commit 56803dca64 on Jun 6, 2019
  35. PastaPastaPasta referenced this in commit 1e72c9308d on Jun 7, 2019
  36. PastaPastaPasta referenced this in commit 923fcfd430 on Jun 7, 2019
  37. PastaPastaPasta referenced this in commit b9a16505d9 on Jun 7, 2019
  38. PastaPastaPasta referenced this in commit 3ed43c9667 on Jun 10, 2019
  39. PastaPastaPasta referenced this in commit 7696cc9a22 on Jun 10, 2019
  40. PastaPastaPasta referenced this in commit c9db36882c on Jun 10, 2019
  41. PastaPastaPasta referenced this in commit 9be6722049 on Jun 11, 2019
  42. PastaPastaPasta referenced this in commit 2afd050865 on Jun 11, 2019
  43. barrystyle referenced this in commit 618457c5dd on Jan 22, 2020
  44. furszy cross-referenced this on Jun 6, 2020 from issue Base work for the Sapling signatureHash by furszy
  45. random-zebra referenced this in commit 5a092159f6 on Aug 5, 2020
  46. bitcoin locked this on Sep 8, 2021

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-05-19 06:55 UTC