test: Test improvements for UTXO set hash tests #21390

pull fjahr wants to merge 3 commits into bitcoin:master from fjahr:19145_followup changing 4 files +19 −21
  1. fjahr commented at 8:17 pm on March 8, 2021: member

    Follow-ups to #19145:

    • Small improvement on the help text of RPC gettxoutsetinfo
    • Using deterministic blockchain in the test functional/feature_utxo_set_hash.py
    • Removing wallet dependency in the test functional/feature_utxo_set_hash.py

    Split out of #19521.

  2. fjahr force-pushed on Mar 8, 2021
  3. DrahtBot added the label RPC/REST/ZMQ on Mar 8, 2021
  4. DrahtBot commented at 4:27 am on March 9, 2021: 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:

    • #21144 (test: convert feature_bip68_sequence.py to use MiniWallet by danben)

    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.

  5. brunoerg commented at 11:45 pm on March 9, 2021: member

    tACK 7a1af9036d1579bae7f70512de37d842372f4419 MacOS 11.1

    Screen Shot 2021-03-09 at 10 07 18

  6. leonardojobim approved
  7. leonardojobim commented at 4:41 am on March 10, 2021: none
  8. jonatack commented at 11:41 am on March 23, 2021: member
    Concept ACK. Revewing and testing #19521, then reviewing this patch.
  9. in src/node/coinstats.cpp:18 in f33a9f7a76 outdated
    14@@ -15,6 +15,7 @@
    15 
    16 #include <map>
    17 
    18+// Database-independent, meaningless metric indicating the UTXO set size
    


    MarcoFalke commented at 2:23 pm on March 23, 2021:
    0// Database-independent metric indicating the UTXO set size
    

    nit: It means to represent the size, so not meaningless


    fjahr commented at 7:50 pm on March 23, 2021:
    done
  10. in test/functional/feature_utxo_set_hash.py:35 in f33a9f7a76 outdated
    33+        blocks = node.generatetoaddress(10, node.get_deterministic_priv_key().address)
    34+
    35+        assert_equal(node.gettxoutsetinfo()['hash_serialized_2'], "9411e505b12619bc0d464ead3c2a14823f53d288380adf3742c7f86b64e3d6f1")
    36+        assert_equal(node.gettxoutsetinfo("muhash")['muhash'], "75d363bf768ebe52102613792ceeb345364874b86f4579eb8030ff835799ecc9")
    37+
    38+        node.invalidateblock(blocks[0])
    


    MarcoFalke commented at 2:41 pm on March 23, 2021:

    Any reason to test determinism separate from consistency? It should be ok to just move the assert_equal down a bit:

     0diff --git a/test/functional/feature_utxo_set_hash.py b/test/functional/feature_utxo_set_hash.py
     1index 233a0ccec7..d25803d883 100755
     2--- a/test/functional/feature_utxo_set_hash.py
     3+++ b/test/functional/feature_utxo_set_hash.py
     4@@ -25,20 +25,9 @@ class UTXOSetHashTest(BitcoinTestFramework):
     5         self.log.info("Test deterministic UTXO set hash results")
     6 
     7         node = self.nodes[0]
     8+        wallet = MiniWallet(node)
     9         mocktime = node.getblockheader(node.getblockhash(0))['time'] + 1
    10         node.setmocktime(mocktime)
    11-        blocks = node.generatetoaddress(10, node.get_deterministic_priv_key().address)
    12-
    13-        assert_equal(node.gettxoutsetinfo()['hash_serialized_2'], "9411e505b12619bc0d464ead3c2a14823f53d288380adf3742c7f86b64e3d6f1")
    14-        assert_equal(node.gettxoutsetinfo("muhash")['muhash'], "75d363bf768ebe52102613792ceeb345364874b86f4579eb8030ff835799ecc9")
    15-
    16-        node.invalidateblock(blocks[0])
    17-
    18-    def test_muhash_implementation(self):
    19-        self.log.info("Test MuHash implementation consistency")
    20-
    21-        node = self.nodes[0]
    22-        wallet = MiniWallet(node)
    23 
    24         # Generate 100 blocks and remove the first since we plan to spend its
    25         # coinbase
    26@@ -78,10 +67,11 @@ class UTXOSetHashTest(BitcoinTestFramework):
    27         node_muhash = node.gettxoutsetinfo("muhash")['muhash']
    28 
    29         assert_equal(finalized[::-1].hex(), node_muhash)
    30+        assert_equal(node.gettxoutsetinfo()['hash_serialized_2'], "5b1b44097406226c0eb8e1362cd17a1f346522cf9390a8175a57a5262cb1963f")
    31+        assert_equal(node.gettxoutsetinfo("muhash")['muhash'], "4b8803075d7151d06fad3e88b68ba726886794873fbfa841d12aefb2cc2b881b")
    32 
    33     def run_test(self):
    34         self.test_deterministic_hash_results()
    35-        self.test_muhash_implementation()
    36 
    37 
    38 if __name__ == '__main__':
    

    fjahr commented at 7:50 pm on March 23, 2021:
    makes sense, done
  11. MarcoFalke approved
  12. MarcoFalke commented at 2:41 pm on March 23, 2021: member

    review ACK d7a679302401395501840cfdf8645e41c59189ec 🚸

    Signature:

     0-----BEGIN PGP SIGNED MESSAGE-----
     1Hash: SHA512
     2
     3review ACK d7a679302401395501840cfdf8645e41c59189ec 🚸
     4-----BEGIN PGP SIGNATURE-----
     5
     6iQGzBAEBCgAdFiEE+rVPoUahrI9sLGYTzit1aX5ppUgFAlwqrYAACgkQzit1aX5p
     7pUgNbgv/U5gjZHfU+bFqnoYuakKR67EJNZHxltGhQOtAh/LrftPjc4oTmh3z4qQl
     8EvcqZlPAUzevvCU1RpxZKeMgnjpktj67Z4nGwRV8i6YqETYja53zr51e6a4RDZRs
     91MxsWEloP9kHfv0bj9M8tEQ+EB3C0122hMdY0qTH1RheWyXct8ID2u6vYLJFmOV8
    10qRhQKwyaCfswbCsb2PZiFVr/jXv1bwy3QzTNUTe/47m899AjRjZVeqEy8KncBVQD
    11Ggu7DD7hGgQW5lOkZhkBP8TCF7SwERsL0xTKlFC9jRpZ9HwWOGvQ2CYoV/NCXfOl
    12IxEQTnEo4Wws/qgsZQWuvPja8Qysm7Ypll44rpeHBQIiUYHh2UqHUPfPWv/6UcjQ
    13bQx5BEVblViGk7OqDRxxWxusnZJOfDKW8+blWIs2cNrmd4Tc+DxN2e0wM+/W8XAr
    14joBBJP7s9028P6c6J1Wf5KPfoBT0rmtHoH9UO60Jq9BoF5k8ht12KEswXyOKR0Xs
    15WyZ4OyB0
    16=3TUk
    17-----END PGP SIGNATURE-----
    

    Timestamp of file with hash 77191ae7c24a373f7b4fa14a63f9a8762f9c8c844c6f84b706a595b934dc11c2 -

  13. MarcoFalke commented at 2:43 pm on March 23, 2021: member
    fun fact: This has three “ACKs”, but only one is mentioning the correct commit hash.
  14. MarcoFalke commented at 2:43 pm on March 23, 2021: member

    review ACK f33a9f7a7648c7af6fdc9a1549ab648c7498e45b 🔰

    Signature:

     0-----BEGIN PGP SIGNED MESSAGE-----
     1Hash: SHA512
     2
     3review ACK f33a9f7a7648c7af6fdc9a1549ab648c7498e45b 🔰
     4-----BEGIN PGP SIGNATURE-----
     5
     6iQGzBAEBCgAdFiEE+rVPoUahrI9sLGYTzit1aX5ppUgFAlwqrYAACgkQzit1aX5p
     7pUhlBgv/WA4HWKOJGB2xXvyc2+rgEFouD7yssPmdp7cvyqntVuKHCfhYr7V+WxUC
     8hqoEA88KLF5GQx2Lt1+7Rv8TU3UQTSCKmzPvypr/81VWripr8uh8VpHYMAEqh2hd
     9X2PKUeZEspkWodr0CrFy0K3QFU1WoiGJvOl6hfPEmzXboQrvrh93b3uh4EygRvhm
    10WJSd5NmCDPE5mAWVuqSHCyqI+9ZVUPFcz9w0umrht3LYGQkg2nPjHogowLs8xtzS
    11KThB32l4VgyE8hxpAYK4DjcC6EwfXe0XuxqVdIlZEj4EurgGYgcLlrzBq19wuoXh
    12bQm2FlerMT8RR0dr92TOC+zuIkNMpmZrgQ37MCMyOPtleqfZLTncYj0fnpKkPksY
    13Xf3Ngk6iFa3ySEnZw6CR/3mUeo8MAHvDDref7jYw9USrlaz9rCcIvzNJho3SUY/r
    14BnCy1PujaWg6pDuq8etDmluZkinX0fNeB0KPLPhGV/JUmsJ0magZHjTRi8Fjrdqf
    151PwPRR2R
    16=ndTs
    17-----END PGP SIGNATURE-----
    

    Timestamp of file with hash 4a2e7bb742ec362fb28376a4b87efe766247e29a659fb64940354a2212c8b214 -

  15. rpc: Improve gettxoutsetinfo help 1a27af1d7b
  16. test: Remove wallet dependency of utxo set hash test 4973c5175c
  17. test: Use deterministic chain in utxo set hash test
    Also melts the previously separated test cases into one.
    4f2653a890
  18. fjahr force-pushed on Mar 23, 2021
  19. fjahr commented at 7:51 pm on March 23, 2021: member
    Took @MarcoFalke ’s suggestions
  20. MarcoFalke commented at 6:39 am on March 24, 2021: member

    review ACK 4f2653a89018fa4d24bd2a551832a7410b682600 👲

    Signature:

     0-----BEGIN PGP SIGNED MESSAGE-----
     1Hash: SHA512
     2
     3review ACK 4f2653a89018fa4d24bd2a551832a7410b682600 👲
     4-----BEGIN PGP SIGNATURE-----
     5
     6iQGzBAEBCgAdFiEE+rVPoUahrI9sLGYTzit1aX5ppUgFAlwqrYAACgkQzit1aX5p
     7pUj6Vgv9E2pJl5otpsc5E3bFAPvBcLt0uXlvWUouIDIko9KH46ueeURuanPHo0ON
     8460JbDk75RNcH1xMGhp/JlXVaTH+N9HBtKtJFooZECfr42RSM+X/LHYpJ4gyPDSN
     9aPuDxi71fhz3H+R+5RbHwqBvKPUEA4EuKPtbTmOL4bS9fyBUQ04N1JQfGkuSsCjK
    101msR3kEfr5LaNQvqBrDrH1DSC0JleQyeqixpwelYuXlLbrXMwAGG+yp34/Bc6cJr
    11sZaSi1RJ2Gv5uAv5UyoZ3pGAuGX8F3a58pqzRoBUKei3EgIE1ZlNN+cDP27CQtrE
    12U6BFX1p6lNnHfZNtI7KPKzxH3dWxP5UFSFxJ8nksH8iRRnIfvUqY0H3HpQ61PKsx
    13PbIfdq8fVTJxMi22Hc4gqPiVAJzsOZdu9XmpUsDSyhJXJ3cQ+5JRY36i053PlNOL
    14AFkHohFjeowx8jBTxWWNxNeGqrkAg9EygZe8xG9DeTFeYM5g/0lQlO2ZdPi/YQHM
    15PkQJKw53
    16=14N0
    17-----END PGP SIGNATURE-----
    

    Timestamp of file with hash ce3e75ebeace1e189987faeb3cfec5408339b7c7faa321bac4f4435d1dd5e06c -

  21. MarcoFalke merged this on Mar 26, 2021
  22. MarcoFalke closed this on Mar 26, 2021

  23. sidhujag referenced this in commit a571a3e6a8 on Mar 26, 2021
  24. DrahtBot locked this on Aug 16, 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-11-23 09:12 UTC

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