validation: Rename CheckInputs to CheckInputScripts #16658

pull jnewbery wants to merge 2 commits into bitcoin:master from jnewbery:2019-08-rename-CheckInputs changing 5 files +41 −39
  1. jnewbery commented at 4:13 pm on August 19, 2019: member

    CheckInputs() used to check no double spends, scripts & sigs and amounts. Since 832e074, the double spend and amount checks have been moved to CheckTxInputs(), and CheckInputs() now just validates input scripts. Rename the function to CheckInputScripts().

    Also fix incorrect comments.

  2. jnewbery commented at 4:13 pm on August 19, 2019: member
    This builds on #13868. Please review that PR first.
  3. DrahtBot added the label Tests on Aug 19, 2019
  4. DrahtBot added the label Validation on Aug 19, 2019
  5. DrahtBot commented at 6:29 pm on August 19, 2019: member

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    Conflicts

    Reviewers, this pull request conflicts with the following ones:

    • #17399 (validation: Templatize ValidationState instead of subclassing by jkczyz)

    If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

  6. jnewbery force-pushed on Aug 25, 2019
  7. jnewbery renamed this:
    [validation] Rename CheckInputs to CheckInputScripts
    validation: Rename CheckInputs to CheckInputScripts
    on Aug 25, 2019
  8. jnewbery renamed this:
    validation: Rename CheckInputs to CheckInputScripts
    [WIP] validation: Rename CheckInputs to CheckInputScripts
    on Aug 26, 2019
  9. fanquake commented at 2:39 am on September 2, 2019: member

    Concept ACK

    This builds on #13868. Please review that PR first.

    I have reviewed the base PR.

    Should 046cd7555e909d9f62a14c44ef0c09eac209b287 be a scripted-diff? This should produce the same change:

    0gsed -i 's/\<CheckInputs\>/CheckInputScripts/g' src/*.h src/*.cpp src/**/*.h src/**/*.cpp
    

    This needs a couple functional test changes for the expected messages: https://github.com/bitcoin/bitcoin/blob/7d6f63cc2c2b9c4f07a43619eef0b7314474fffd/test/functional/feature_dersig.py#L127 https://github.com/bitcoin/bitcoin/blob/7d6f63cc2c2b9c4f07a43619eef0b7314474fffd/test/functional/feature_cltv.py#L141

  10. DrahtBot added the label Needs rebase on Sep 2, 2019
  11. jnewbery force-pushed on Sep 2, 2019
  12. jnewbery renamed this:
    [WIP] validation: Rename CheckInputs to CheckInputScripts
    validation: Rename CheckInputs to CheckInputScripts
    on Sep 2, 2019
  13. jnewbery commented at 3:25 pm on September 2, 2019: member

    Rebased and removed WIP tag.

    Thanks for the review @fanquake

    This needs a couple functional test changes for the expected messages.

    Fixed. Thanks.

    Should 046cd75 be a scripted-diff?

    I think this is small enough to be a non-scripted commit, and I’d need to add more to your suggested one-liner to make the test changes atomic with the validation.cpp changes. I’m leaving as it is for now, but can change if other reviewers agree that scripted would be better.

  14. DrahtBot removed the label Needs rebase on Sep 2, 2019
  15. ajtowns commented at 11:57 am on September 3, 2019: member

    I’d need to add more to your suggested one-liner to make the test changes atomic with the validation.cpp changes

    FWIW, I believe a valid scripted-diff line for 3623a8f946c55c3fd897a057ac38acb85817f593 would be:

    sed -i -E -e 's/CheckInputs\b/CheckInputScripts/g' $(git grep -l CheckInputs | grep -v doc/)

  16. in src/validation.cpp:1287 in 41d152860f outdated
    1280@@ -1284,8 +1281,10 @@ void InitScriptExecutionCache() {
    1281 }
    1282 
    1283 /**
    1284- * Check whether all inputs of this transaction are valid (no double spends, scripts & sigs, amounts)
    1285- * This does not modify the UTXO set.
    1286+ * Check whether all of this transaction's input scripts succeed.
    1287+ *
    1288+ * This involves ECDSA signature checks so can be computationally intensive. This function should
    1289+ * only be called after the basic tx amount tests in CheckTxInputs passed.
    


    MarcoFalke commented at 8:05 pm on September 3, 2019:
    This seems to imply that when the basic tx amount tests pass, the amount fields in the tx are correct. However, you can only know that the amount fields are correct when all subsequent check (including signature checks have been run). I’d rather say something like “all cheap sanity checks passed”, to be not overly specific.

    jnewbery commented at 10:32 pm on September 4, 2019:
    agree. Fixed
  17. jnewbery force-pushed on Sep 4, 2019
  18. jnewbery commented at 10:32 pm on September 4, 2019: member

    FWIW, I believe a valid scripted-diff line for 3623a8f would be…

    I’ve updated the commit to use your scripted diff one-liner. Thanks!

  19. michaelfolkson commented at 12:49 pm on September 7, 2019: contributor
    Concept ACK. I ran a git grep on CheckInputs in this PR branch and apart from old release notes that obviously won’t change, there is a ValidateCheckInputsForAllFlags function in src/test/txvalidationcache_tests.cpp, a CheckInputsAndUpdateCoins function in src/txmempool.cpp and CheckInputsFromMempoolAndCache function in src/validation.cpp. Should they be changed too?
  20. fanquake commented at 8:10 am on September 8, 2019: member

    @jnewbery Looks like the scripted diff needs fixing:

    0$ set -o errexit; source ./ci/lint/06_script.sh
    1Error: script block marker but no scripted-diff in title
    2Failed
    
  21. jnewbery commented at 2:59 pm on September 8, 2019: member

    Looks like the scripted diff needs fixing

    Thanks. Will fix next week.

  22. jnewbery force-pushed on Sep 10, 2019
  23. jnewbery commented at 12:56 pm on September 10, 2019: member

    Looks like the scripted diff needs fixing

    should be fixed

  24. DrahtBot added the label Needs rebase on Sep 18, 2019
  25. jnewbery force-pushed on Oct 1, 2019
  26. jnewbery commented at 2:18 pm on October 1, 2019: member
    rebased
  27. DrahtBot removed the label Needs rebase on Oct 1, 2019
  28. MarcoFalke commented at 7:21 pm on October 11, 2019: member

    ACK 3ee9ad76803c0f9fdcb21ac1ad6162df79df07da thanks for fixing documentation

    Signature:

     0-----BEGIN PGP SIGNED MESSAGE-----
     1Hash: SHA512
     2
     3ACK 3ee9ad76803c0f9fdcb21ac1ad6162df79df07da thanks for fixing documentation
     4-----BEGIN PGP SIGNATURE-----
     5
     6iQGzBAEBCgAdFiEE+rVPoUahrI9sLGYTzit1aX5ppUgFAlwqrYAACgkQzit1aX5p
     7pUg1jQwAystQNbOYRs28u4UXVAow/cWruoKgEWgtVxmszf3FIl6XOkkK35LHsXD8
     8P0YZ/7XAaGIXufQYGkMr4Iaq/lONZjw6oQOqkgCNfq5UjPS4JesEuj/QtKwrQGPp
     9xFYdGzuU4CE5NQlAtx1bXK5CebOc03FgFYuN9u74579t7nl0P5dp/VjaIUVcdZFE
    10Wgxgwfa2DboOnI5sv9drQvcX9nLJcUPfBZWufb9RUCE+rklB0hjTomISPUbF75fd
    112XFUuOFgIonwwrFkgg6ChTaecDHaphCsttauGRigKxWyOsk3NIjwc8DfAyDK2+H8
    12HZcMguMNy183bqRFbzbL/VEJD3rDYvj8dtg8cwGlejcP20tj3g1yZqJIerqXU8GZ
    135t6xENcNWHjOuL8HpuRg9JiRBM1E12/c39IUAKaG/5W3K4tODI3ziRfu8JQMKpDH
    14CrDHoaB23mTzzjYxq7R9aMWDSdA0oLzTKL1kGi1Y3SEOWs06e7JSAMhdnoOiueg4
    15st2HgDxb
    16=CD9a
    17-----END PGP SIGNATURE-----
    

    Timestamp of file with hash 2fb4b49625388db44b56838d9617fb9d4d07331a02b3a6db6af05658e13fad54 -

  29. MarcoFalke removed the label Tests on Oct 11, 2019
  30. MarcoFalke added the label Docs on Oct 11, 2019
  31. DrahtBot added the label Needs rebase on Oct 25, 2019
  32. jnewbery commented at 1:31 pm on October 25, 2019: member
    rebased
  33. jnewbery force-pushed on Oct 25, 2019
  34. fanquake removed the label Needs rebase on Oct 25, 2019
  35. MarcoFalke commented at 3:44 pm on October 25, 2019: member

    re-ACK 44d20b86b74445adb6d96f20e44efd1afae36035 only change is rebase the scripted diff

    Signature:

     0-----BEGIN PGP SIGNED MESSAGE-----
     1Hash: SHA512
     2
     3re-ACK 44d20b86b74445adb6d96f20e44efd1afae36035 only change is rebase the scripted diff
     4-----BEGIN PGP SIGNATURE-----
     5
     6iQGzBAEBCgAdFiEE+rVPoUahrI9sLGYTzit1aX5ppUgFAlwqrYAACgkQzit1aX5p
     7pUhQBgv/f7OOsZwi+esjzjBssh0Bf6JMXRjjbZ+ARDo7KEqKjlf6x09B1ViMqC+X
     8+emq0IRC9dNzDLW6foblXUGvNwwsBCoULWmI7gXL+m6wZxkD2Byiuq1RDrLLvty1
     9cadiGJUbhIrMzUHXPsYPx/nt/Wq3kRc9UX09DU/JbkjBcZYYYsrMy96mqPt+2q+e
    10/hQ/1JsfofAqqS6cFNSNvnxSUG/vywJb6dgKd/c5+2SYAuZ1Nl4eTQiTeueP67nL
    11lypZt55WRlWoGo+1zUQIE6dDQxkfyNJfdsRQa8tNWS8wRdsBJNafuNRPiRpTcV6T
    12PJKq/J5syT7AYBQiyfyLyqYKaPve4j/nR4opIBtnZZzc02eQZH0MnHPhpamzV+LO
    13/Mqm5IYPC7xR5csWzTJas7lRaum81DWSKVowL7MO69M+TUmKH2K4n7vZ0kj1YKCY
    14dxvTZIzkglBR7uD9vRKUPv7KhVTNPiCSm1SreLyUSJJuE82Mex1JXAXt4Hj7UUSH
    15foyxWkSG
    16=oHWs
    17-----END PGP SIGNATURE-----
    

    Timestamp of file with hash 0630b39dafbd879abe6610f1a999b11bd28a1e6e9f1c97ebdfa437aa875e56fa -

  36. promag commented at 3:55 pm on October 25, 2019: member

    TIL git grep -l CheckInputs -- ':!doc'.

    Code review ACK.

  37. DrahtBot added the label Needs rebase on Oct 30, 2019
  38. jnewbery force-pushed on Oct 30, 2019
  39. jnewbery commented at 4:47 pm on October 30, 2019: member
    Rebased on master
  40. DrahtBot removed the label Needs rebase on Oct 30, 2019
  41. DrahtBot commented at 4:31 pm on November 7, 2019: member
  42. DrahtBot added the label Needs rebase on Nov 7, 2019
  43. MarcoFalke commented at 5:18 pm on November 7, 2019: member
    This is a trivial fix that should be ready for merge after rebase
  44. scripted-diff: [validation] Rename CheckInputs to CheckInputScripts
    CheckInputs() used to check no double spends, scripts & sigs and amounts. Since
    832e0744cb8b1e1625cdb19b257f97316ac16a90, the double spend and amount checks
    have been moved to CheckTxInputs(), and CheckInputs() now just validates
    input scripts. Rename the function to CheckInputScripts().
    
    -BEGIN VERIFY SCRIPT-
    sed -i -E -e 's/CheckInputs\b/CheckInputScripts/g' $(git grep -l CheckInputs | grep -v doc/)
    -END VERIFY SCRIPT-
    6f6465cefc
  45. [validation] fix comments in CheckInputScripts() 3bd8db80d8
  46. jnewbery force-pushed on Nov 7, 2019
  47. jnewbery commented at 6:53 pm on November 7, 2019: member
    Rebased
  48. fanquake removed the label Needs rebase on Nov 7, 2019
  49. MarcoFalke commented at 7:04 pm on November 7, 2019: member

    re-ACK 3bd8db80d8d335ab63ece4f110b0fadd562e80b7, did the rebase myself, checked the scripted diff 👡

    Signature:

     0-----BEGIN PGP SIGNED MESSAGE-----
     1Hash: SHA512
     2
     3re-ACK 3bd8db80d8d335ab63ece4f110b0fadd562e80b7, did the rebase myself, checked the scripted diff 👡
     4-----BEGIN PGP SIGNATURE-----
     5
     6iQGzBAEBCgAdFiEE+rVPoUahrI9sLGYTzit1aX5ppUgFAlwqrYAACgkQzit1aX5p
     7pUjh4wv/WSY4eMrYXocYlXm6kXbisKRQM+4z5HS9drtint6Mf3u/Zj3zioAxEApI
     8sIk6tuwzracrSYy2D6YtZnSSjpMwrtCRYy48OOt8e0WDnlUpZwTUyjCwp+l4nsMa
     9Bc+MUtTe9Eq8ICEAyFbNVGr+yvt18WlqM/h5DEIchFlGIE76BajPBTRxnf1QVe5o
    10OiC7ErXnpj79LzBYP5MF8/R7AMb66y+++Xop9pZeMkLAWM//0exTlsGrJU7V/GJW
    112Mx/wApRUFjTz/NNDl5iArpayOa7KFcPZ9MhzvfBV0v+vihH3HzDKmvT9NYTDgox
    126WvsBr1nj2F1ONV/fZQ9h8SK0jj4ewguDgNJ8cwB2uJQBqUOaWayNNNbE1egJIOv
    1333VpHuFdUIHsuRJMufZPpuNrK2/h0HguHVunuIM8jIvdG0dt+ioFYabXmKkywPi8
    14EQjw/j4DyvGzKILVKFpHatAFHLET87oGMH2Ph7ComQKOmYjsuyXvnys04y6KOwlg
    154n7UJzLs
    16=3RbB
    17-----END PGP SIGNATURE-----
    

    Timestamp of file with hash 4aa6710c657c2553e2de927e5918efcd786d8c666d5ddcdb193f75684907f609 -

  50. promag commented at 7:06 pm on November 7, 2019: member
    ACK 3bd8db80d8d335ab63ece4f110b0fadd562e80b7 :trollface:
  51. MarcoFalke referenced this in commit 3f8dbcd655 on Jan 2, 2020
  52. MarcoFalke merged this on Jan 2, 2020
  53. MarcoFalke closed this on Jan 2, 2020

  54. jnewbery deleted the branch on Jan 2, 2020
  55. sidhujag referenced this in commit 607d4e89fd on Jan 2, 2020
  56. sidhujag referenced this in commit a49fcbce2c on Nov 10, 2020
  57. Fabcien referenced this in commit 925120cac2 on Jan 13, 2021
  58. DrahtBot locked this on Feb 15, 2022

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: 2024-12-19 03:12 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me