Commit Graph

21948 Commits

Author SHA1 Message Date
MarcoFalke
fd852e5d8c
Merge #19777: docs: Correct description for getblockstats's txs field
4148f55dd016f940df50a44cf03d117cdb1dd929 docs: Correct description for getblockstats's txs field (Nadav Ivgi)

Pull request description:

  It does count the coinbase transaction.

  Refs #19766

ACKs for top commit:
  MarcoFalke:
    ACK 4148f55dd016f940df50a44cf03d117cdb1dd929
  theStack:
    ACK 4148f55dd016f940df50a44cf03d117cdb1dd929

Tree-SHA512: ccd420f19242efbbbecfe822c825363bc89e26618834de0d805f5cdb07461c8bdc6e077c61ea8cd0d40564a96c67d8a71c68175c8543bb849909d7ae375b2a92
2022-06-07 16:11:23 -05:00
fanquake
3dbbdf6775
Merge #19719: build: Add Werror=range-loop-analysis
fa55c1d5fdd88c4bc4d361da231cd63b20255b50 build: Add Werror=range-loop-analysis (MarcoFalke)

Pull request description:

  The warning is implicitly enabled for Bitcoin Core. Also explicitly since commit d92204c900d.

  To avoid "fix range loop" follow-up refactors, we have two options:

  * Disable the warning, so that issues never appear
  * Enable it as an error, so that issues are either caught locally or by ci

ACKs for top commit:
  fanquake:
    ACK fa55c1d5fdd88c4bc4d361da231cd63b20255b50
  practicalswift:
    ACK fa55c1d5fdd88c4bc4d361da231cd63b20255b50 -- pre-review fix-up is better than post-review fix-up
  hebasto:
    re-ACK fa55c1d5fdd88c4bc4d361da231cd63b20255b50

Tree-SHA512: 019aa133f254af8882c1d5d10c420d9882305db0fc2aa9dad7d285168e2556306c3eedcc03bd30e63f11eae4cc82b648d83fb6e9179d6a6364651fb602d70134
2022-06-07 16:11:23 -05:00
MarcoFalke
b7b4f37dca
Merge #19709: test: Fix 'make cov' with clang
35cd2da623e32b975fbc485c3605934e4aa8bdc5 test: Fix 'make cov' with clang (Hennadii Stepanov)

Pull request description:

  This is a follow up of #19688.

  With this PR it is possible to do the following:
  ```
  $ ./autogen.sh
  $ ./configure --enable-lcov CC=clang CXX=clang++
  $ make
  $ make cov
  ```

  Currently, on master (8a85377cd0b60cb00dae4f595d628d1afbd28bd5), `make cov` fails to `Processing src/test/test_bitcoin-util_tests.gcda`.

ACKs for top commit:
  vasild:
    ACK 35cd2da
  Crypt-iQ:
    ACK 35cd2da

Tree-SHA512: aaf56118e2644064e9738a8279889c617db5805c5c804c904469b24c496bd609f9c5fc2aebcf1a422f8a5ed2eb38bd6e76b484680310b55c36d922b73a4c33cf
2022-06-07 16:11:22 -05:00
Wladimir J. van der Laan
1be11a0d7c
Merge #19696: rpc: Fix addnode remove command error
a51d0ad2de89b9757d158df95ddeba2bfcb23935 rpc: Improve addnode remove command error message (Fabian Jahr)

Pull request description:

  The `addnode` RPC with the `remove` command parameter is used to remove a node from the "added nodes". It did not have test coverage and in case of failure to remove the node it responded with the confusing message "Error: Node has not been added.".

  This PR adds test coverage and introduces a new error code as well as changes the error message to something that makes sense.

ACKs for top commit:
  laanwj:
    Code review ACK a51d0ad2de89b9757d158df95ddeba2bfcb23935
  theStack:
    Tested ACK https://github.com/bitcoin/bitcoin/commit/a51d0ad2de

Tree-SHA512: 033ef5de0d4d49d58ef4df3759b838c9d19ee9dfb0aff9f814a3a63d124ca231a442c930efa7d343fe1f65727c4b59fc23dd5e26fe6ea69f9e84fda48b5c5cc2
2022-06-07 16:11:22 -05:00
Wladimir J. van der Laan
2b295a85b0
Merge #19028: test: Set -logthreadnames in unit tests
99993489da9bc003b823bcab10e5f5297b369431 test: Set -logthreadnames in unit tests (MarcoFalke)
fa4ea997b4da1ae0afafba223fff9efbeefaf555 init: Setup scheduler in tests and init in exactly the same way (MarcoFalke)

Pull request description:

  Generally the unit tests are single threaded, with the exception of the script check threads, the schedule, and optionally indexer threads.

  Like the functional tests, the thread name can serve additional debug information, so set `-logthreadnames` in unit tests.

  Can be tested with

  ```
  ./src/test/test_bitcoin -l test_suite -t validation_tests/test_combiner_all -- DEBUG_LOG_OUT

ACKs for top commit:
  laanwj:
    ACK 99993489da9bc003b823bcab10e5f5297b369431

Tree-SHA512: 3bdbfc211da146da64b50b0826246aff5c611a84b69ab896a55b3c9d1adc92c5975da36ab92aee577df82e229c4326b477f4105bfdd1a5df4c9a0b018cf61602
2022-06-07 16:11:22 -05:00
fanquake
b3510fc212
Merge #17907: doc: Fix improper Doxygen inline comments
498cdbb42616bc1e6c44492c907678b4dce41870 Fix improper Doxygen inline comments (Ben Woosley)

Pull request description:

  The proper syntax is `//!<`
  http://www.doxygen.nl/manual/docblocks.html#memberdoc

  Identified via `-Wdocumentation`:

  ```
  In file included from ./util/system.h:26:
  ./util/settings.h:74:41: error: not a Doxygen trailing comment [-Werror,-Wdocumentation]
      const SettingsValue* begin() const; //<! Pointer to first non-negated value.
                                          ^~~~
                                          ///<
  ./util/settings.h:75:41: error: not a Doxygen trailing comment [-Werror,-Wdocumentation]
      const SettingsValue* end() const;   //<! Pointer to end of values.
                                          ^~~~
                                          ///<
  ./util/settings.h:76:41: error: not a Doxygen trailing comment [-Werror,-Wdocumentation]
      bool empty() const;                 //<! True if there are any non-negated values.
                                          ^~~~
                                          ///<
  ./util/settings.h:77:41: error: not a Doxygen trailing comment [-Werror,-Wdocumentation]
      bool last_negated() const;          //<! True if the last value is negated.
                                          ^~~~
                                          ///<
  ./util/settings.h:78:41: error: not a Doxygen trailing comment [-Werror,-Wdocumentation]
      size_t negated() const;             //<! Number of negated values.
                                          ^~~~
                                          ///<
  ```

ACKs for top commit:
  fanquake:
    ACK 498cdbb42616bc1e6c44492c907678b4dce41870

Tree-SHA512: 2851fc1cbbcf700d198d82ce4923b2ef4a700f8ce19dff431ecf24f4e6fecda9fed1b4b4d148f3c1adfb6b0c6bff5d5315ee01bbcd855eb3d83e1a69b0c98893
2022-06-07 16:11:17 -05:00
MarcoFalke
ebb25818f7
Merge #16236: fuzz: Log output even if fuzzer failed
fa410f67aa test: Suppress false positive leak in secure_allocator<RNGState> (MarcoFalke)
fa35c4239f test: Log output even if fuzzer failed (MarcoFalke)

Pull request description:

  Also suppress a false positive detected leak

ACKs for commit fa410f:
  practicalswift:
    utACK fa410f67aa1d0ccd306dc16e438c1a034b8cc049

Tree-SHA512: 224a72ae0dd9bbe7debda17cd626c01cfbd0e45d7df47a2b591ce8ea386951ad94f4c0677dd268079a4caac382c5acac03199146015a95c308a633e9e4f84c09
2022-06-07 16:11:17 -05:00
Nathan Marley
35def0ef7e
refactor: add superblock trigger maturity window to DashCore (#4865)
This was previously hard-coded in Sentinel, and can be useful to refactor
future versions of Sentinel (in progress), as well as to bring superblock logic
into DashCore in the future.
2022-06-08 00:10:05 +03:00
UdjinM6
3db52f9469
feat(qt): Let users resend stuck txes one by one via context menu (#4861)
* feat(qt): Let users resend stuck txes one by one via context menu

The corresponding rpc was removed due to privacy concerns (resending many txes at once can hurt privacy). On the other hand by the time users try to resend txes by hand they would be locked via IS already (normally). We don't resend IS-locked txes which means we can be pretty sure that (in most cases) no IS lock means no such txes were ever broadcasted for some reason. With this in mind resending txes one by one is probably ok-ish since it would be similar to regular tx creation/sending.

* Only allow tx resend for single row selections

* format
2022-06-08 00:07:27 +03:00
UdjinM6
95b538cc20
fix(llmq): Actually remove old masternode quorum connections (#4859) 2022-06-08 00:06:40 +03:00
UdjinM6
8c2d8d992e
Merge pull request #4864 from kittywhiskers/deglob4
backport: bitcoin#18526, #15457, #16344, #18662, #18926, #15358, #19561, #19098, #19779 (deglobalization part 4)
2022-06-08 00:05:53 +03:00
Kittywhiskers Van Gogh
0567951c90 merge bitcoin#19779: Remove gArgs global from init 2022-06-07 09:21:29 +05:30
Kittywhiskers Van Gogh
402e283036 merge bitcoin#19098: Remove duplicate NodeContext hacks 2022-06-07 09:21:29 +05:30
Kittywhiskers Van Gogh
266622c80e merge bitcoin#19561: Pass ArgsManager into functions that register args 2022-06-07 09:21:29 +05:30
Kittywhiskers Van Gogh
1253e6d0a9 merge bitcoin#15358: Add SetupHelpOptions() 2022-06-07 09:21:28 +05:30
Kittywhiskers Van Gogh
de80587810 merge bitcoin#18926: Pass ArgsManager into getarg_tests 2022-06-07 09:21:28 +05:30
Kittywhiskers Van Gogh
a7bcb03918 merge bitcoin#18662: Replace gArgs with local argsman in bench 2022-06-07 09:21:28 +05:30
Kittywhiskers Van Gogh
4d56d2bd7f merge bitcoin#16344: use #if HAVE_SYSTEM instead of defined(HAVE_SYSTEM) 2022-06-07 09:21:28 +05:30
Kittywhiskers Van Gogh
6627bc9688 merge bitcoin#15457: Check std::system for -[alert|block|wallet|instantsend]notify 2022-06-07 09:21:28 +05:30
Kittywhiskers Van Gogh
589afdc824 merge bitcoin#18526: Remove PID file at the very end 2022-06-07 09:21:28 +05:30
PastaPastaPasta
398c0bcb7f
Merge pull request #4844 from kittywhiskers/deglobalization3
backport: bitcoin#15934, #15864, #19188, #18338, #19413, #18571, #18575 (deglobalization part 3)
2022-06-06 20:29:40 -05:00
UdjinM6
3e35e11a4a
feat(qt): Add an option to keep custom change address (#4860) 2022-06-03 22:00:58 +03:00
UdjinM6
ab3b4a520a
Merge pull request #4849 from knst/bc-bp-1
Bitcoing backports #17648 #17702 #17694 #17647 #17699 #17685 #17658 #17650 #17670 #17573
2022-06-03 22:00:16 +03:00
Kittywhiskers Van Gogh
104d4d6d99 qt: fetch existing parameters when building parameter list
Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>
2022-06-03 20:56:16 +05:30
Kittywhiskers Van Gogh
b9f1ddf766 merge bitcoin#18575: Remove requirement that all benches use same testing setup 2022-06-03 20:56:15 +05:30
Kittywhiskers Van Gogh
0af1a5a969 merge bitcoin#18571: Disable debug log file 2022-06-03 18:25:38 +05:30
Kittywhiskers Van Gogh
3b3a41efe5 merge bitcoin#19413: Remove confusing (Prev)BlockIndex global
Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>
2022-06-03 18:25:34 +05:30
Kittywhiskers Van Gogh
359eb74cc8 merge bitcoin#18338: Fix wallet unload race condition 2022-06-03 18:25:34 +05:30
Kittywhiskers Van Gogh
63b9860cf2 merge bitcoin#19188: Avoid overwriting the NodeContext member of the testing setup [-Wshadow-field]
Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>
2022-06-03 18:25:28 +05:30
Kittywhiskers Van Gogh
d44ff7dc9d merge bitcoin#15864: Fix datadir handling 2022-06-03 18:25:27 +05:30
Kittywhiskers Van Gogh
b37a692571 merge bitcoin#15934: Merge settings one place instead of five places
Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>
2022-06-03 18:25:21 +05:30
Kittywhiskers Van Gogh
3ebe6db923 revert dash#4715: Fix Repair tab 2022-06-03 18:25:21 +05:30
Kittywhiskers Van Gogh
cb4d60159d revert dash#1494: Don't try to create empty datadir before the real path is known 2022-06-03 18:25:21 +05:30
Kittywhiskers Van Gogh
c34638d20b test: Check return value of ParseParameters(...)
This commit is from 145fe95ec7 but the commit wasn't titled as such,
this to prevent confusion due to a potentially misleading commit title as the change doesn't match the pull request title's description per-se.
2022-06-03 18:25:20 +05:30
Kittywhiskers Van Gogh
b747bdbd42 test: don't pass null pointer reference into PeerLogicValidation
Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>
2022-06-03 18:24:39 +05:30
PastaPastaPasta
875305a901
Merge pull request #4839 from Munkybooty/backports-0.20-pr2
backport: v0.20 pr2
2022-06-01 13:53:54 -05:00
MarcoFalke
3f71883a4e Merge #17366: test: Reset global args between test suites
fa07b8beb598642655b1207afd275b801ff8cec2 test: Reset global args between test suites (MarcoFalke)

Pull request description:

  Ideally there wouldn't be any globals in Bitcoin Core. However, as we still have globals, they need to be reset between runs of test cases. One way to do this is to run each suite in a different process. `make check` does that. However, `./src/test/test_bitcoin` when run manually or on appveyor is a single process, where all globals are preserved between test cases.

  This leads to hard to debug issues such as https://github.com/bitcoin/bitcoin/pull/15845#pullrequestreview-310852164.

  Fix that by resetting the global arg for each test suite. Note that this wont reset the arg between test cases, as the constructor/destructor is not called for them.

  Addendum: This is not a general fix, only for `-segwitheight`. I don't know if clearing all args can be done with today's argsmanager.  Nor do I know if it makes sense. Maybe we want datadir set to a temp path to not risk accidentally corrupting the default data dir?

ACKs for top commit:
  laanwj:
    ACK fa07b8beb598642655b1207afd275b801ff8cec2
  practicalswift:
    ACK fa07b8beb598642655b1207afd275b801ff8cec2
  mzumsande:
    ACK fa07b8beb598642655b1207afd275b801ff8cec2, I also tested that this fixes the issue in #15845.

Tree-SHA512: 1e30b06f0d2829144a61cc1bc9bdd6a694cbd911afff83dd3ad2a3f15b577fd30acdf9f1469f8cb724d0642ad5d297364fd5a8a2a9c8619a7a71fa9ae2837cdc
2022-05-31 12:06:32 -04:00
MarcoFalke
6bb8f5e192 Merge #17349: Remove redundant copy constructors
fa8919889f3c1bd3e2700ecbb56493e3cd1e25ad bench: Remove redundant copy constructor in mempool_stress (MarcoFalke)
29f84343681831baf02a17d3af566c5c57ecf3c2 refactor: Remove redundant PSBT copy constructor (Hennadii Stepanov)

Pull request description:

  I fail to see why people add these copy constructors manually without explanation, when the compiler can generate them at least as good automatically with less code.

ACKs for top commit:
  promag:
    ACK fa8919889f3c1bd3e2700ecbb56493e3cd1e25ad.
  hebasto:
    ACK fa8919889f3c1bd3e2700ecbb56493e3cd1e25ad, nit s/constructor/operator/ in commit fa8919889f3c1bd3e2700ecbb56493e3cd1e25ad message, as @promag [mentioned](https://github.com/bitcoin/bitcoin/pull/17349#discussion_r341776389) above.
  jonatack:
    ACK fa8919889f3c1bd3e2700ecbb56493e3cd1e25ad

Tree-SHA512: ce024fdb894328f41037420b881169b8b1b48c87fbae5f432edf371a35c82e77e21468ef97cda6f54d34f1cf9bb010235d62904bb0669793457ed1c3b2a89723
2022-05-31 12:06:32 -04:00
MarcoFalke
2c1e51e6b7 Merge #17233: travis: Run unit and functional tests on native arm
facc0da63a8fa4bd6fc2782cbe92eb9f920f2256 travis: Run unit and functional tests on native arm (MarcoFalke)
fafa064d2a8dbe24303545ab582ec84cde52ab5b ci: Remove ccache requirement on the host (MarcoFalke)

Pull request description:

  This keeps the cross-compilation to make it easy to run the ci on non-arm hardware. To run this locally in qemu-user as it used to be, just `export QEMU_USER_CMD="qemu-arm -L /usr/arm-linux-gnueabihf/"`.

ACKs for top commit:
  laanwj:
    LGTM ACK facc0da63a8fa4bd6fc2782cbe92eb9f920f2256
  practicalswift:
    ACK facc0da63a8fa4bd6fc2782cbe92eb9f920f2256 -- diff looks correct and Travis seems happy

Tree-SHA512: 0dc1bc82eb93e2bd8b159e044f20fe3055f8cdfd73aaa238bd2e178397582144dfc0c6a87bd8270115dafea1a623e642bde5d5f30254f94140f1a2cdb12fc2da
2022-05-31 12:06:32 -04:00
MarcoFalke
f27bb545e7 Merge #17327: test: add rpc_fundrawtransaction logging
ff22751417c6fbbd22f4eefd0e23431a83335c13 test: rm ascii art in rpc_fundrawtransaction (Jon Atack)
94fcc08541cf58bee864ab7c28a6c77e42472f17 test: add rpc_fundrawtransaction logging (Jon Atack)

Pull request description:

  `test/functional/rpc_fundrawtransaction.py` is fairly slow to run and has no logging, so it can appear to be stalled.

  This commit adds info logging at each test to provide feedback on the test run.

ACKs for top commit:
  instagibbs:
    utACK ff22751417
  jnewbery:
    tACK ff22751417c6fbbd22f4eefd0e23431a83335c13

Tree-SHA512: f4fabad8ef51c29981351bb4e66fb0c0e0517418a4a15892ef804df11d16b2d2ae1a1abc958d2b121819850278de90a2003b0edb8d7098d00360b89fa76e9062
2022-05-31 12:06:32 -04:00
Wladimir J. van der Laan
37ef9bb465 Merge #17282: contrib: remove accounts from bash completion
dd94cc46e4377b14515be24894fd1cb42e233151 contrib: remove accounts from bash completion (fanquake)

Pull request description:

  Also removes `setgenerate`.

ACKs for top commit:
  jonasschnelli:
    utACK dd94cc46e4377b14515be24894fd1cb42e233151

Tree-SHA512: 218aa06841f4a347bb083c7f408c07fe80df7a30f7ce7a1126ec95971a9b66aff7c3c049d269da2c15f629bbde80e8c303bf6562bd5c1a36a6f6fd61ce9133e2
2022-05-31 12:06:32 -04:00
UdjinM6
edc8621619
Merge pull request #4820 from Munkybooty/misc-backports-18
backport: Misc backports 18
2022-05-30 19:35:27 +03:00
UdjinM6
c20c40fab4
chore(tests): Create/destroy g_txindex in TestChainSetup (#4855) 2022-05-30 19:29:52 +03:00
Wladimir J. van der Laan
0e68ae560e Merge #17648: doc: rename wallet-tool references to bitcoin-wallet
e7ad4a2f8c07a82d6424b473f0d51dbd8f897b10 doc: rename wallet-tool references to bitcoin-wallet (Wilson Ccasihue S)

Pull request description:

  Fix. text reference to executable bitcoin-wallet instead of wallet-tool, there is not a wallet-tool at bin/ folder.

ACKs for top commit:
  fanquake:
    ACK e7ad4a2f8c07a82d6424b473f0d51dbd8f897b10 - thanks for following up.

Tree-SHA512: aed41b08947728a4ff3a97a62858ee7c86e2e5d57dcbbd0aab492dae3d8a548bb60541924e68cf3a0aa3d53d7db0012b489462b466919cd83f05b2aa88b7fff7
2022-05-30 19:09:39 +07:00
Konstantin Akimov
3511d69609 qt: adds more setPlaceholderText by form .ui instead code aproach 2022-05-30 19:09:39 +07:00
MarcoFalke
e043d4b98b Merge #17702: gui: Move static placeholder texts to forms
a652dc5521e2caf5734ffb797c7f2fc80685fef1 qt: Normalize placeholder to avoid using "address book" in sendcoinsentry (Wladimir J. van der Laan)
67f36e0b2ce0f99b90578e7e1dd9e0624026bcfa gui: Move static placeholder texts to forms (Wladimir J. van der Laan)

Pull request description:

  There was an issue around the time of Qt 4.6 when placeholder text was introduced, that caused a compile failure when it was specified in the form.

  As a workaround the placeholder texts were moved to the code.

  Qt 4 hasn't been relevant to us for ages. So move all (non-parametrized) placeholder texts to the form files instead.

  It's better to keep this kind of text content together. Translate/no-translate status is kept as it is.

  Proof that they still work:
  ![win1](https://user-images.githubusercontent.com/126646/70428014-0e80b300-1a76-11ea-9a6d-be78a0bf14ed.png)

  ![win2](https://user-images.githubusercontent.com/126646/70428019-10e30d00-1a76-11ea-8016-ffa0c4eafe34.png)

  ![win3](https://user-images.githubusercontent.com/126646/70428021-13456700-1a76-11ea-9449-9413487e39f6.png)

  ![win4](https://user-images.githubusercontent.com/126646/70428025-150f2a80-1a76-11ea-92ad-be5f3c171c43.png)

ACKs for top commit:
  hebasto:
    Re-ACK a652dc5521e2caf5734ffb797c7f2fc80685fef1, `tooltip` and `placeholderText` are identical now.
  MarcoFalke:
    ACK a652dc5521e2caf5734ffb797c7f2fc80685fef1 🚿
  fanquake:
    ACK a652dc5521e2caf5734ffb797c7f2fc80685fef1 - checked that placeholder text still appears.

Tree-SHA512: 7d3c1faeef2eb5d4b195d9d78f2a3f161296d869e5059b5e8d308167e3c6c668a3ebabec93dc592762ba15bfc86d51985e20c4e17f1065c8dce84fec036ff5ee
2022-05-30 19:09:39 +07:00
fanquake
4c1477c7b3 Merge #17694: ui: disable 3rd-party tx-urls when wallet disabled
48a5c92f9ef6634375a3f52812cf3d511c37699d ui: disable 3rd-party tx-urls when wallet disabled (Harris)

Pull request description:

  This PR closes #17683 by removing 3rd-party Url-Label and -TextBox from Display Options in wallet-disabled mode.

ACKs for top commit:
  laanwj:
    Code review ACK 48a5c92f9ef6634375a3f52812cf3d511c37699d
  fanquake:
    ACK 48a5c92f9ef6634375a3f52812cf3d511c37699d - tested with and without wallet (compiled out and `-disablewallet`).

Tree-SHA512: 3cc89825409fc0a3eec501c4dab5ff1caaa4ce410746a4b6ab200222fff986f4483eab90cda53a98a144be6acf1b6ca8650ab18242c39446f3335b3a9a537066
2022-05-30 19:09:39 +07:00
MarcoFalke
f1995b6ef9 Merge #17647: lcov: filter depends from coverage reports
f736f6920b160c9e7d7072500ddd0459c5181f86 lcov: filter /usr/lib64 from coverage report (nijynot)
a5a705b46dd32f93857e916311e3b71cae8be6b7 lcov: filter depends from coverage report (nijynot)

Pull request description:

  If you build the binaries with the `depends` folder and then generate coverage reports with `make cov`, `depends` will be included in the coverage reports. Coverage of the dependencies are not that interesting and should be filtered.

ACKs for top commit:
  laanwj:
    code review ACK f736f6920b160c9e7d7072500ddd0459c5181f86
  MarcoFalke:
    ACK f736f6920b160c9e7d7072500ddd0459c5181f86 🐇

Tree-SHA512: 57c3e09f32e71523afff6ddc4f92bc35ab7b783f26f7a7380ae7556222954111cccce4c6dbc99305c424818f91e15bf5fe3532a7dca1daaa8ad71315d1dd857c
2022-05-30 19:09:39 +07:00
Wladimir J. van der Laan
7b0981e210 Merge #17699: Make env data logging optional
0ccad08fb25e00fcf41ffbad6ce2501e363a0033 Make env data logging optional (Pieter Wuille)

Pull request description:

  The dynamic env feeding logging is a bit chatty, make it dependent on `-debug=rand`.

ACKs for top commit:
  practicalswift:
    ACK 0ccad08fb25e00fcf41ffbad6ce2501e363a0033 -- less noise is good and diff looks correct
  laanwj:
    ACK 0ccad08fb25e00fcf41ffbad6ce2501e363a0033
  promag:
    ACK 0ccad08fb25e00fcf41ffbad6ce2501e363a0033.
  jonatack:
    ACK 0ccad08fb25e00fcf41ffbad6ce2501e363a0033, was considering to propose this.

Tree-SHA512: 01d7f9ac134852c2c0d5f66f96ee4395f0ff7a60573e648f3d01054073624042148c8e8b9f69a29c9a41c296e1f4be77c2015a642ee4113a2fd8779b62aa137d
2022-05-30 19:09:39 +07:00
MarcoFalke
166be67407 Merge #17685: tests: Fix bug in the descriptor parsing fuzzing harness (descriptor_parse)
6338c0203416a5f86e9422b6cd479da8af277f2f tests: Fix fuzzing harness for descriptor parsing (descriptor_parse) (practicalswift)

Pull request description:

  Fix bug in the descriptor parsing fuzzing harness (`descriptor_parse`) by making sure `secp256k1_context_verify` is properly initialized (via `ECCVerifyHandle`).

  Background:

  When fuzzing `Parse(…)` with `libFuzzer` I eventually reached the test case `combo(020000000000000000000000000000000000000000000000000000000000000000)`. That input triggers a call to `CPubKey::IsFullyValid()` which in turns requires an initialized `secp256k1_context_verify`.

  The fuzzing harness did not fulfil that pre-condition prior to this commit (sorry, my fault!) :)

  Before:

  ```
  $ mkdir descriptors/
  $ echo -n 'combo(020000000000000000000000000000000000000000000000000000000000000000)' > descriptors/input
  $ UBSAN_OPTIONS="print_stacktrace=1:halt_on_error=1" src/test/fuzz/descriptor_parse -runs=1 descriptors/
  …
  pubkey.cpp:210:38: runtime error: null pointer passed as argument 1, which is declared to never be null
  secp256k1/include/secp256k1.h:305:3: note: nonnull attribute specified here
      #0 0x561c032ccf25 in CPubKey::IsFullyValid() const src/pubkey.cpp:210:12
      #1 0x561c022139c3 in (anonymous namespace)::ParsePubkeyInner(Span<char const> const&, bool, FlatSigningProvider&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&) src/script/descriptor.cpp:674:24
      #2 0x561c02207680 in (anonymous namespace)::ParsePubkey(Span<char const> const&, bool, FlatSigningProvider&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&) src/script/descriptor.cpp:730:42
      #3 0x561c0220080e in (anonymous namespace)::ParseScript(Span<char const>&, (anonymous namespace)::ParseScriptContext, FlatSigningProvider&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&) src/script/descriptor.cpp:774:23
      #4 0x561c021ffb07 in Parse(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, FlatSigningProvider&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, bool) src/script/descriptor.cpp:994:16
      #5 0x561c0218d5d4 in test_one_input(std::vector<unsigned char, std::allocator<unsigned char> > const&) src/test/fuzz/descriptor_parse.cpp:20:9
  …
  $
  ```

  After:

  ```
  $ mkdir descriptors/
  $ echo -n 'combo(020000000000000000000000000000000000000000000000000000000000000000)' > descriptors/input
  $ UBSAN_OPTIONS="print_stacktrace=1:halt_on_error=1" src/test/fuzz/descriptor_parse -runs=1 descriptors/
  …
  Done 2 runs in 0 second(s)
  $
  ```

ACKs for top commit:
  paymog:
    ACK 6338c0203416a5f86e9422b6cd479da8af277f2f
  MarcoFalke:
    ACK 6338c0203416a5f86e9422b6cd479da8af277f2f 🕊

Tree-SHA512: bf24c404e1f64183761b057d2f210c3db85277f4415122977c315d7d6835acb5e897b5d64032615e9e44ad4a16dfe857e94481f6e4b57b6dfa8cb37adb2528a5
2022-05-30 19:09:39 +07:00