-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Backport missing PRs from Bitcoin 0.13 - Part 2 #1790
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
Backport missing PRs from Bitcoin 0.13 - Part 2 #1790
Conversation
086da92 Add tags to mempool's mapTx indices (Suhas Daftuar)
7d2f84c remove unused NOBLKS_VERSION_{START,END} constants (Pavel Vasin)
8fc81e0 mempool: Reduce ERROR logging for mempool rejects (Wladimir J. van der Laan)
72c2651 [Wallet] move wallet help string creation to CWallet (Jonas Schnelli)
2ab835a Check if zmq is installed in tests, update docs (Elliot Olds)
2fdaa25 Move GetTempPath() to testutil. (Mustafa) 393b22e Add a source file for unit test utils. (Mustafa)
8d1de43 Remove internal miner (Leviathn)
8a253b3 Make the generate RPC call function for non-regtest (Pieter Wuille)
a6ee0ca use cached block hash in blockToJSON() (Pavel Vasin)
…ages fa19b18 [wallet] Move hardcoded file name out of log messages (MarcoFalke)
3d7e973 Fix torcontrol.cpp unused private field warning (Jonas Schnelli)
ce019bf Check all ancestor state in CTxMemPool::check() (Suhas Daftuar) e2eeb5d Add ancestor feerate index to mempool (Suhas Daftuar) 72abd2c Add ancestor tracking to mempool (Suhas Daftuar) 76a7632 Remove work limit in UpdateForDescendants() (Suhas Daftuar) 5de2baa Rename CTxMemPool::remove -> removeRecursive (Suhas Daftuar) 7659438 CTxMemPool::removeForBlock now uses RemoveStaged (Suhas Daftuar)
c90036f Always disconnect old nodes which request filtered connections. (Patrick Strateman)
0f17692 Improve COutPoint less operator (João Barbosa)
c5825d2 Correct importaddress help reference to importpubkey (Denis Lukianov)
bb16c88 Prevent multiple calls to CWallet::AvailableCoins (João Barbosa)
c85f475 [Depends] Latest config.guess & config.sub (fanquake) 5fd2318 [Depends] Miniupnpc 1.9.20160209 (fanquake)
…ress d5c5c71 RPC tests for generatetoaddress (Andrew C) fe00ca7 Create generatetoaddress rpc (Andrew C)
68d4282 Fix calculation of balances and available coins. (Alex Morcos)
df9e923 Fix lockunspents help message (João Barbosa)
f11c5a3 devtools: make github-merge.py use py3 (Wladimir J. van der Laan)
…ation cef8bdf [Wallet][RPC] add missing abandon status documentation (Jonas Schnelli)
Due to out of order backporting this was missed in the past
72fd008 Fix quoting of copyright holders in configure.ac. (Daniel Kraft)
…kip ci] a22bde9 Fix typo: Optimizaton -> Optimization (paveljanik)
… serials cf5c786 [build-aux] Update Boost & check macros to latest serials (fanquake)
25340b7 [Wallet] refactor wallet/init interaction (Jonas Schnelli)
… installer. 4b9dfd6 Add note about using the Qt official binary installer. (Pavel Janík)
60361ca RPC: fix generatetoaddress failing to parse address and add unit test (mruddy)
3373c43 [doc] Update port in tor.md (Adam Brown)
…erge 10d3ae1 devtools: Auto-set branch to merge to in github-merge (Wladimir J. van der Laan)
…r JSON results 92107d5 RPC: add versionHex in getblock and getblockheader JSON results; expand data in getblockchaininfo bip9_softforks field. (mruddy)
190c1e2 Doc: change Precise to Trusty in gitian-building.md (JeremyRand)
…rotoc calls 0087f26 Use relative paths instead of absolute paths (Pavel Janík)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
See inline comments
src/version.h
Outdated
|
|
||
| //! DIP0001 was activated in this version | ||
| static const int DIP0001_PROTOCOL_VERSION = 70208; | ||
| static const int DIP0001_PROTOCOL_VERSION = 99999; // disable for now (clarify deployment later) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
???
src/test/rpc_tests.cpp
Outdated
| { | ||
| UniValue result; | ||
|
|
||
| BOOST_CHECK_NO_THROW(result = RPCConvertValues("generatetoaddress", boost::assign::list_of("101")("mkESjLZW66TmHhiFX8MCaBjrhZ543PPh9a"))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All addresses here should be dashifyed.
src/wallet/wallet.cpp
Outdated
| walletInstance->GenerateNewHDChain(); | ||
|
|
||
| // ensure this wallet.dat can only be opened by clients supporting HD | ||
| pwalletMain->SetMinVersion(FEATURE_HD); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/pwalletMain/walletInstance/
src/init.cpp
Outdated
|
|
||
| if (!CWallet::ParameterInteraction()) | ||
| return false; | ||
| std::string strWalletFile = GetArg("-wallet", DEFAULT_WALLET_DAT); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line should be moved closer to the only place it's actually used now (AutoBackupWallet at L1238).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
few more issues
qa/rpc-tests/disablewallet.py
Outdated
|
|
||
| # Checking mining to an address without a wallet | ||
| try: | ||
| self.nodes[0].generatetoaddress(1, 'mneYUmWYsuk7kySiURxCi3AGxrAqZxLgPZ') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/mneYUmWYsuk7kySiURxCi3AGxrAqZxLgPZ/ycwedq2f3sz2Yf9JqZsBCQPxp18WU3Hp4J/
qa/rpc-tests/disablewallet.py
Outdated
| assert("Couldn't create new block" not in e.error['message']) | ||
|
|
||
| try: | ||
| self.nodes[0].generatetoaddress(1, '3J98t1WpEZ73CNmQviecrnyiWrnqRhWNLy') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/3J98t1WpEZ73CNmQviecrnyiWrnqRhWNLy/7TSBtVu959hGEGPKyHjJz9k55RpWrPffXz/
qa/rpc-tests/importprunedfunds.py
Outdated
|
|
||
| assert('No addresses' in errorString) | ||
|
|
||
| balance1 = self.nodes[1].getbalance("", 0, True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/getbalance("", 0/getbalance("", 0, False/g
|
Pushed your suggested fixes. Thanks for that 👍 The |
f41c1f6 to
8d3c2aa
Compare
8d3c2aa to
f235b6a
Compare
This fixes the gitian MacOSX build, it was broken in bitcoin#7723. The patch to `native_mac_alias` should probably make it upstream.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK
- Add iterations parameter - Ref dashpay/dash#1790 (and bitcoin/bitcoin#7663)
* content - Mempool related RPC updates - Add getmempoolancestors, getmempooldescendants, and getmempoolentry RPCs - Update Ref and Table * content - Generate RPCs updated - Mark get/setgenerate as removed - Add generatetoaddress details - Update Ref and Table * content - Debug RPC updated - Change delimiter to + instead of comma - Update Ref and Table * content - GetInfo RPCs updated - getaddednodeinfo, getmemoryinfo, getnetworkinfo - Update Ref and Table * content - Added PreciousBlock RPC - Update Ref and Table * content - Added and update RPCs - Debug, estimatepriority, estimatesmartpriority, listunspent, signmessagewithprivkey, validateaddress - Update Ref and Table * Update GObject Getcurrentvotes with shortened outpoint output - Update example and Vote Info field - Ref #24 * content - Update generate RPC - Add iterations parameter - Ref dashpay/dash#1790 (and bitcoin/bitcoin#7663) * content - Update rawtransaction and generate RPCs - CreateRawTransaction, GetRawTransaction, and FundRawTransaction minor updates - Some minor generate RPC updates for removed commands * content - Update RPCs - Update GetBlockChainInfo and GetBlockTemplate - Add ImportMulti - Some minor generate RPC updates for removed commands * content - Update Dash RPCs - Update GetGovernanceInfo and MasternodeList * content - Update Pruning related RPCs - Update PruneBlockchain, ImportPrunedFunds, and RemovePrunedFunds * content - RPC table - Minor updates * content - Add SetBIP69Enabled RPC * build - Update Makefile check to allow numbers in summary name * content - Add example of RPC with named parameter
* content - Mempool related RPC updates - Add getmempoolancestors, getmempooldescendants, and getmempoolentry RPCs - Update Ref and Table * content - Generate RPCs updated - Mark get/setgenerate as removed - Add generatetoaddress details - Update Ref and Table * content - Debug RPC updated - Change delimiter to + instead of comma - Update Ref and Table * content - GetInfo RPCs updated - getaddednodeinfo, getmemoryinfo, getnetworkinfo - Update Ref and Table * content - Added PreciousBlock RPC - Update Ref and Table * content - Added and update RPCs - Debug, estimatepriority, estimatesmartpriority, listunspent, signmessagewithprivkey, validateaddress - Update Ref and Table * Update GObject Getcurrentvotes with shortened outpoint output - Update example and Vote Info field - Ref dash-docs#24 * content - Update generate RPC - Add iterations parameter - Ref dashpay/dash#1790 (and bitcoin/bitcoin#7663) * content - Update rawtransaction and generate RPCs - CreateRawTransaction, GetRawTransaction, and FundRawTransaction minor updates - Some minor generate RPC updates for removed commands * content - Update RPCs - Update GetBlockChainInfo and GetBlockTemplate - Add ImportMulti - Some minor generate RPC updates for removed commands * content - Update Dash RPCs - Update GetGovernanceInfo and MasternodeList * content - Update Pruning related RPCs - Update PruneBlockchain, ImportPrunedFunds, and RemovePrunedFunds * content - RPC table - Minor updates * content - Add SetBIP69Enabled RPC * build - Update Makefile check to allow numbers in summary name * content - Add example of RPC with named parameter
* content - Mempool related RPC updates - Add getmempoolancestors, getmempooldescendants, and getmempoolentry RPCs - Update Ref and Table * content - Generate RPCs updated - Mark get/setgenerate as removed - Add generatetoaddress details - Update Ref and Table * content - Debug RPC updated - Change delimiter to + instead of comma - Update Ref and Table * content - GetInfo RPCs updated - getaddednodeinfo, getmemoryinfo, getnetworkinfo - Update Ref and Table * content - Added PreciousBlock RPC - Update Ref and Table * content - Added and update RPCs - Debug, estimatepriority, estimatesmartpriority, listunspent, signmessagewithprivkey, validateaddress - Update Ref and Table * Update GObject Getcurrentvotes with shortened outpoint output - Update example and Vote Info field - Ref dash-docs#24 * content - Update generate RPC - Add iterations parameter - Ref dashpay/dash#1790 (and bitcoin/bitcoin#7663) * content - Update rawtransaction and generate RPCs - CreateRawTransaction, GetRawTransaction, and FundRawTransaction minor updates - Some minor generate RPC updates for removed commands * content - Update RPCs - Update GetBlockChainInfo and GetBlockTemplate - Add ImportMulti - Some minor generate RPC updates for removed commands * content - Update Dash RPCs - Update GetGovernanceInfo and MasternodeList * content - Update Pruning related RPCs - Update PruneBlockchain, ImportPrunedFunds, and RemovePrunedFunds * content - RPC table - Minor updates * content - Add SetBIP69Enabled RPC * build - Update Makefile check to allow numbers in summary name * content - Add example of RPC with named parameter
, bitcoin#25005, bitcoin#25410, bitcoin#24236, bitcoin#25438, bitcoin#25036, bitcoin#25489, bitcoin#25544, bitcoin#25594, bitcoin#13226, partial bitcoin#25218, bitcoin#26005 (wallet backports: part 6) 175970e merge bitcoin#13226: Optimize SelectCoinsBnB by tracking the selection by index rather than by position (Kittywhiskers Van Gogh) 27933a7 merge bitcoin#25594: Return BResult from restoreWallet (Kittywhiskers Van Gogh) b75f1ad partial bitcoin#26005: Fix error handling (copy_file failure in RestoreWallet, and in general via interfaces) (Kittywhiskers Van Gogh) 9f5845c partial bitcoin#25218: introduce generic 'Result' class and connect it to CreateTransaction and GetNewDestination (Kittywhiskers Van Gogh) db7e174 merge bitcoin#25544: don't iter twice when getting the cached debit/credit amount (Kittywhiskers Van Gogh) 48f5c10 merge bitcoin#25489: change `ScanForWalletTransactions` to use `Ticks(Dur2 d)` (Kittywhiskers Van Gogh) 4aafd98 merge bitcoin#25036: Save wallet scan progress (Kittywhiskers Van Gogh) e2f053a merge bitcoin#25438: remove unused methods in classes `CDBIterator,CDBWrapper,CCoinsViewDBCursor` (Kittywhiskers Van Gogh) 79fcd30 merge bitcoin#24236: Remove utxo db upgrade code (Kittywhiskers Van Gogh) d13ff52 fix: use URL quoting for password fields due to Base64 in pre-v0.12.2.x (Kittywhiskers Van Gogh) 7b6af94 fix: allow argument-free RPC calls with nodes running v0.12.2.x and lower (Kittywhiskers Van Gogh) 1026f11 fix: make `get_previous_release.py` translate triples for pre-v0.12.2.x (Kittywhiskers Van Gogh) a0b2c7d fix: make `get_previous_releases.py` understand windows target triples (Kittywhiskers Van Gogh) 51237c9 merge bitcoin#25410: fix warning: "argument name 'feerate' in comment does not match parameter name" (Kittywhiskers Van Gogh) 2438b9f merge bitcoin#25005: remove extra wtx lookup in 'AvailableCoins' + several code cleanups (Kittywhiskers Van Gogh) a498336 refactor: use initializer to set `nCoinType` instead of manual assignment (Kittywhiskers Van Gogh) ae24276 merge bitcoin#25083: Set effective_value when initializing a COutput (Kittywhiskers Van Gogh) a883a8e merge bitcoin#24666: Fix coinselection.h include, Make COutput a struct (Kittywhiskers Van Gogh) f447b5d merge bitcoin#24711: Postpone wallet loading notification for encrypted wallets (Kittywhiskers Van Gogh) 39557f9 fix: include `BOOST_AUTO_TEST_SUITE_END` within namespace `wallet` (Kittywhiskers Van Gogh) Pull request description: ## Additional Information * When backporting [bitcoin#23497](bitcoin#23497) (see [dash#6732](#6732)), some `BOOST_AUTO_TEST_SUITE_END()`s were placed _outside_ the `wallet` namespace scope, which resulted in incorrect behavior when rebasing this pull request over [dash#6732](#6732). This has been resolved. * Backports of [bitcoin#25083](bitcoin#25083) and [bitcoin#25005](bitcoin#25005) do not include changes to `wallet/rpc/spend.cpp` as the `sendall()` RPC has not been implemented in `develop` (f453998) as of this writing. * Backporting [bitcoin#24236](bitcoin#24236) required a fair number of additional considerations, firstly because the pull request introduces a test, `feature_unsupported_utxo_db.py`, that requires the last-capable of version Dash Core to generate a legacy UTXO database (the current database format debuted in [dash#1701](#1701), included in v0.12.2.2) and secondly, because v0.15 is the earliest expected version of Dash Core to work smoothly with our test framework ([source](https://github.com/dashpay/dash/blob/f453998bb76dee8fe016138da664dc281fc7f1d3/test/functional/mempool_compatibility.py#L29)). As we require the last release cycle that generates the legacy UTXO database by default, we used the last version of the v0.12.1.x family, v0.12.1.5 as the old node used in `feature_unsupported_utxo_db.py`. This brings unique challenges which are elaborated on below. * The test framework relies on `generatetoaddress`, a wallet-independent RPC call that was introduced in [bitcoin#7671](bitcoin#7671) to replace the old wallet-dependent `generate` RPC. It was backported as 760d58e in [dash#1790](#1790) and debuted in v0.12.3. We cannot use the `self.generate()` helper as simply dispatches a `generatetoaddress` ([source](https://github.com/dashpay/dash/blob/f453998bb76dee8fe016138da664dc281fc7f1d3/test/functional/test_framework/test_node.py#L343-L345)), which does not exist in v0.12.1.5. We work around this by using the more archaic `self.nodes[0].rpc.generate()`, in line with usage in `rpc_generate.py` ([source](https://github.com/dashpay/dash/blob/f453998bb76dee8fe016138da664dc281fc7f1d3/test/functional/rpc_generate.py#L25-L26)). * Releases before v0.12.3.x did not include the target triples in their naming convention (see tag [`v0.12.3.1`](https://github.com/dashpay/dash/releases/tag/v0.12.3.1) vs [`v0.12.1.5`](https://github.com/dashpay/dash/releases/tag/v0.12.1.5)), which causes problems when fetching packages based on the target `HOST` of the build environment. This has been remedied by introducing awareness for `RPi2`, `osx` and `linux{32,64}` labels. * Note, `RPi2` corresponds to `arm-linux-gnueabihf` based on the Gitian descriptor that was removed in [dash#2183](#2183) ([source](https://github.com/dashpay/dash/blob/dac090964fbdd96d896f725932aada71db736abf/contrib/gitian-descriptors/gitian-rpi2.yml#L26)) * This was also taken as an opportunity to introduce awareness for the `win32` and `win64` labels which persist even now (see tag [`v22.1.2`](https://github.com/dashpay/dash/releases/tag/v22.1.2)) * Currently, when we want to make RPC calls without arguments, a blank object is sent to by the RPC dispatcher. This is acceptable as objects are supported since [bitcoin#8811](bitcoin#8811) (backported as eb7a6b0 in [dash#1851](#1858)), included in v0.12.3. Unfortunately, since we are dealing with a version of Dash that is ancient even by previous release standards, this prevents the dispatcher from even acknowledging the RPC server is active (see below). <details> <summary>Test failure:</summary> ``` $ ./test/functional/feature_unsupported_utxo_db.py 2025-06-24T15:06:53.642000Z TestFramework (INFO): PRNG seed is: 1995903613070947610 2025-06-24T15:06:53.642000Z TestFramework (INFO): Initializing test directory /tmp/dash_func_test_1tqzf43o 2025-06-24T15:06:53.642000Z TestFramework (INFO): Create previous version (v0.12.1.5) utxo db 2025-06-24T15:06:53.895000Z TestFramework (ERROR): JSONRPC error Traceback (most recent call last): File "/home/eclair/Repositories/dashpay/dash/test/functional/test_framework/test_framework.py", line 161, in main self.run_test() File "/home/eclair/Repositories/dashpay/dash/./test/functional/feature_unsupported_utxo_db.py", line 35, in run_test self.start_node(0) File "/home/eclair/Repositories/dashpay/dash/test/functional/test_framework/test_framework.py", line 647, in start_node node.wait_for_rpc_connection() File "/home/eclair/Repositories/dashpay/dash/test/functional/test_framework/test_node.py", line 276, in wait_for_rpc_connection rpc.getblockcount() File "/home/eclair/Repositories/dashpay/dash/test/functional/test_framework/coverage.py", line 49, in __call__ return_val = self.auth_service_proxy_instance.__call__(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/eclair/Repositories/dashpay/dash/test/functional/test_framework/authproxy.py", line 144, in __call__ raise JSONRPCException(response['error'], status) test_framework.authproxy.JSONRPCException: Params must be an array (-32600) 2025-06-24T15:06:53.947000Z TestFramework (INFO): Stopping nodes [...] ``` </details> * This is worked around by dispatching an empty array instead of an empty object, it has the same practical effect (conveying the lack of arguments) and is forwards-compatible. * Currently, the password used for RPC authentication in Base16 encoded. This is a result of [dash#1454](#1454), which switched away from Base64. Unfortunately, this benefit only extends to v0.12.2.0 onwards, which is too new for the old node needed in our functional test. Worse still, it was not the URL-safe variant of Base64, so attempting to establish a connection with the old node resulted in sporadic failures (see below). <details> <summary>Test failure:</summary> ``` $ ./test/functional/feature_unsupported_utxo_db.py 2025-06-24T15:13:27.517000Z TestFramework (INFO): PRNG seed is: 3228606794541395700 2025-06-24T15:13:27.518000Z TestFramework (INFO): Initializing test directory /tmp/dash_func_test_97d987gf 2025-06-24T15:13:27.518000Z TestFramework (INFO): Create previous version (v0.12.1.5) utxo db 2025-06-24T15:13:27.769000Z TestFramework (ERROR): Unexpected exception caught during testing Traceback (most recent call last): File "/home/eclair/Repositories/dashpay/dash/test/functional/test_framework/test_framework.py", line 161, in main self.run_test() File "/home/eclair/Repositories/dashpay/dash/./test/functional/feature_unsupported_utxo_db.py", line 35, in run_test self.start_node(0) File "/home/eclair/Repositories/dashpay/dash/test/functional/test_framework/test_framework.py", line 647, in start_node node.wait_for_rpc_connection() File "/home/eclair/Repositories/dashpay/dash/test/functional/test_framework/test_node.py", line 270, in wait_for_rpc_connection rpc = get_rpc_proxy( ^^^^^^^^^^^^^^ File "/home/eclair/Repositories/dashpay/dash/test/functional/test_framework/util.py", line 341, in get_rpc_proxy proxy = AuthServiceProxy(url, **proxy_kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/eclair/Repositories/dashpay/dash/test/functional/test_framework/authproxy.py", line 78, in __init__ authpair = user + b':' + passwd ~~~~~^~~~~~ TypeError: unsupported operand type(s) for +: 'NoneType' and 'bytes' 2025-06-24T15:13:27.822000Z TestFramework (INFO): Stopping nodes [...] ``` </details> * This is worked around by escaping URL special characters for the password field. It is practically a no-op for the Base16 passwords generated from v0.12.2.0 onwards but allows connection and authentication with older versions of Dash Core. ## How Has This Been Tested? A full CoinJoin session run on 89cd497  ## Breaking Changes None expected. ## Checklist - [x] I have performed a self-review of my own code - [x] I have commented my code, particularly in hard-to-understand areas - [x] I have added or updated relevant unit/integration/functional/e2e tests - [x] I have made corresponding changes to the documentation **(note: N/A)** - [x] I have assigned this pull request to a milestone _(for repository code-owners and collaborators only)_ ACKs for top commit: UdjinM6: utACK 175970e PastaPastaPasta: utACK 175970e Tree-SHA512: 6a6fe593e25cc5c99da41333a334655010cc387f8c3e390d472de29782aaa6aa67276e2e00a90609facabe4f1817fa0152e6b6765f97e07541fd378ef0f4d566
Continuation of #1770