aboutsummaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2021-03-01Merge #21170: bench: Add benchmark to write JSON into a stringWladimir J. van der Laan
e3e0a2432c587ee06e469c37ffae133b7ac55c77 Add benchmark to write JSON into a string (Martin Ankerl) Pull request description: The benchmark `BlockToJsonVerbose` only tests generating (and destroying) the JSON data structure, but serializing into a string is also a performance critical aspect of the RPC calls. Extracts test setup into a `struct TestBlockAndIndex`, and uses it in both `BlockToJsonVerbose` and `BlockToJsonVerboseWrite`. Also, use `ankerl::nanobench::doNotOptimizeAway` to make sure the compiler can't optimize the result of the calls away. Here are benchmark results on my Intel i7-8700: | ns/op | op/s | err% | ins/op | cyc/op | IPC | bra/op | miss% | total | benchmark |--------------------:|--------------------:|--------:|----------------:|----------------:|-------:|---------------:|--------:|----------:|:---------- | 71,807,017.00 | 13.93 | 0.4% | 555,782,961.00 | 220,788,645.00 | 2.517 | 102,279,341.00 | 0.4% | 0.80 | `BlockToJsonVerbose` | 27,916,835.00 | 35.82 | 0.1% | 235,084,034.00 | 89,033,525.00 | 2.640 | 42,911,139.00 | 0.3% | 0.32 | `BlockToJsonVerboseWrite` ACKs for top commit: laanwj: Code review ACK e3e0a2432c587ee06e469c37ffae133b7ac55c77 Tree-SHA512: bc4d6d1588d47d4bd7af8e7908e44b8561bc391a2d73eccd7c0aa37fc40e8a9ce1fa1f3c29b416eef24a73c6bce3036839c0bbfe1b8dbd6d1bba3718b7ca5383
2021-03-01Merge #18466: rpc: fix invalid parameter error codes for ↵Wladimir J. van der Laan
{sign,verify}message RPCs a5cfb40e27bd281354bd0d14d91f83efb6bfce9f doc: release note for changed {sign,verify}message error codes (Sebastian Falbesoner) 9e399b9b2d386b28c0c0ff59fc75d31dbec31d9c test: check parameter validity in rpc_signmessage.py (Sebastian Falbesoner) e62f0c71f10def124b1c1219d790cef246a32c3e rpc: fix {sign,message}verify RPC errors for invalid address/signature (Sebastian Falbesoner) Pull request description: RPCs that accept address parameters usually return the intended error code `RPC_INVALID_ADDRESS_OR_KEY` (-5) if a passed address is invalid. The two exceptions to the rule are `signmessage` and `verifymessage`, which return `RPC_TYPE_ERROR` (-3) in this case instead. Oddly enough `verifymessage` returns `RPC_INVALID_ADDRESS_OR_KEY` when the _signature_ was malformed, where `RPC_TYPE_ERROR` would be more approriate. This PR fixes these inaccuracies and as well adds tests to `rpc_signmessage.py` that check the parameter validity and error codes for the related RPCs `signmessagewithprivkey`, `signmessage` and `verifymessage`. master branch: ``` $ ./bitcoin-cli signmessage invalid_addr message error code: -3 error message: Invalid address $ ./bitcoin-cli verifymessage invalid_addr dummy_sig message error code: -3 error message: Invalid address $ ./bitcoin-cli verifymessage 12c6DSiU4Rq3P4ZxziKxzrL5LmMBrzjrJX invalid_sig message error code: -5 error message: Malformed base64 encoding ``` PR branch: ``` $ ./bitcoin-cli signmessage invalid_addr message error code: -5 error message: Invalid address $ ./bitcoin-cli verifymessage invalid_addr dummy_sig message error code: -5 error message: Invalid address $ ./bitcoin-cli verifymessage 12c6DSiU4Rq3P4ZxziKxzrL5LmMBrzjrJX invalid_sig message error code: -3 error message: Malformed base64 encoding ``` ACKs for top commit: laanwj: Code review ACK a5cfb40e27bd281354bd0d14d91f83efb6bfce9f meshcollider: utACK a5cfb40e27bd281354bd0d14d91f83efb6bfce9f Tree-SHA512: bae0c4595a2603cea66090f6033785601837b45fd853052312b3a39d8520566c581994b68f693dd247c22586c638c3b7689c849085cce548cc36b9bf0e119d2d
2021-02-28Merge #21286: build: Bump minimum Qt version to 5.9.5fanquake
faa06ecc9c357428f3fa7a8f86b41b1220809951 build: Bump minimum Qt version to 5.9.5 (Hennadii Stepanov) Pull request description: Close #20104. ACKs for top commit: laanwj: Code review ACK faa06ecc9c357428f3fa7a8f86b41b1220809951 jarolrod: ACK faa06ecc9c357428f3fa7a8f86b41b1220809951 fanquake: ACK faa06ecc9c357428f3fa7a8f86b41b1220809951 - this should be ok to do now. Tree-SHA512: 7295472b5fd37ffb30f044e88c39d375a5a5187d3f2d44d4e73d0eb0c7fd923cf9949c2ddab6cddd8c5da7e375fff38112b6ea9779da4fecce6f024d05ba9c08
2021-02-26Merge #21277: wallet: listdescriptors uses normalized descriptor formWladimir J. van der Laan
a69c3b35f8974b378a87a3e42d331bd4147e07df wallet: listdescriptors uses normalized descriptor form (Ivan Metlushko) Pull request description: Rationale: show importable descriptors with `listdescriptors` RPC It uses #19136 to derive xpub at the last hardened step. **Before**: ``` [ { "desc": "wpkh(tpubD6NzVbkrYhZ4YUQRJL49TWw1VR5v3QKUNYaGGMUfJUm19x5ZqQ2hEiPiYbAQvD2nHoPGQGPg3snLPM8sjmYpvx7XQhkmyfk8xhsUwKbXzyh/84'/1'/0'/0/*)#p4cn3erf", "timestamp": 1613982591, "active": true, "internal": false, "range": [ 0, 999 ], "next": 0 }, ... ] ``` **After**: ``` [ { "desc": "wpkh([d4ade89c/84'/1'/0']tpubDDUEYcVXy6Vh5meHvcXN3sAr4k3fWwLZGpAHbkAHL8EnkDxp4d99CjNhJHfM2fUJicANvAKnCZS6XaVAgwAeKYc1KesGCN5qbQ25qQHrRxM/0/*)#8wq8rcft", "timestamp": 1613982591, "active": true, "internal": false, "range": [ 0, 999 ], "next": 0 }, ... ] ``` ACKs for top commit: achow101: ACK a69c3b35f8974b378a87a3e42d331bd4147e07df Tree-SHA512: 4f92e726cb8245aa0b520729cfd272945f0c66830f0555544e0618883aca516318543fa6ab1862058c64b4e4ed54ad1da953e032f4846eef7454122031c1b005
2021-02-25Merge bitcoin-core/gui#226: Add "Last Block" and "Last Tx" rows to peer ↵MarcoFalke
details area 70d3c5d0b987411873d557440607aa4f3f65b1ec gui: add "Last Block" (CNodeStats::nLastBlockTime) to peer details (Jon Atack) a21be7c401e1b885bb338645248f40023af7a88f gui: add "Last Tx" (CNodeStats::nLastTXTime) to peer details (Jon Atack) 4dc2fd6c37f8d85c2e9f19d5f03c72c5a1707455 qt: add RPCConsole::TimeDurationField helper, call systime only once (Jon Atack) Pull request description: - add `RPCConsole::TimeDurationField` helper to replace repeated code and call system time only once in `RPCConsole::updateDetailWidget` - add "Last Tx" (`CNodeStats::nLastTXTime`) field to peer details - add "Last Block" (`CNodeStats::nLastBlockTime`) field to peer details ACKs for top commit: hebasto: re-ACK 70d3c5d0b987411873d557440607aa4f3f65b1ec Tree-SHA512: 2611b71fd358ba9ffb6a6206275c08ecb5e683b6f87d022faaaba9802a15030430113afdb434814a9ae2681d04429aa733164bc110b64337ceaae12a0420f4f1
2021-02-25Merge #21264: fuzz: Two scripted diff renamesMarcoFalke
fae216a73d71441432cf07212313d18771ce7deb scripted-diff: Rename MakeFuzzingContext to MakeNoLogFileContext (MarcoFalke) fa4fbec03e4395a6ab75ea98a696bee6d768e97e scripted-diff: Rename PROVIDE_MAIN_FUNCTION -> PROVIDE_FUZZ_MAIN_FUNCTION (MarcoFalke) Pull request description: Split out two renames from #21003: * `PROVIDE_FUZZ_MAIN_FUNCTION`. *Reason*: This in only used by fuzzing, so the name should indicate that. * `MakeNoLogFileContext`. *Reason*: Better reflects what the helper does. Also, prepares it to be used in non-fuzz tests in the future. ACKs for top commit: practicalswift: cr ACK fae216a73d71441432cf07212313d18771ce7deb: scripted-diff looks correct Tree-SHA512: e5d347746f5da72b0c86fd4f07ac2e4b3016e88e8c97a830c73bd79d0af6d0245fe7712487fc20344d6cc25958941716c1678124a123930407e3a437265b71df
2021-02-25gui: add "Last Block" (CNodeStats::nLastBlockTime) to peer detailsJon Atack
2021-02-25gui: add "Last Tx" (CNodeStats::nLastTXTime) to peer detailsJon Atack
2021-02-25qt: add RPCConsole::TimeDurationField helper, call systime only onceJon Atack
2021-02-25Merge bitcoin-core/gui#223: qt: Re-add and rename transaction "Edit Label" ↵MarcoFalke
action 5440c074579f5588cdcff3d33bd1350cee0b7bff qt: Rename "Edit label" to "Edit address label" (Wladimir J. van der Laan) 22664d6287dda243ebf06df4409b50ab509603e1 Revert "qt: Remove Transactionview Edit Label Action" (Wladimir J. van der Laan) Pull request description: This reverts PR #211. I disagree with this change, I use the functionality a lot, it was the primary way I used to organize and edit transactions labels and am sad to see this go. > you can edit a sending address in the send tab Address Book Using the address book should not be encouraged at all! A while ago it was even proposed to remove it. There's rarely need to scroll through all historical addresses used and unused. The transaction list does just fine for this. > While all other actions apply directly to the selected transaction, the Edit Label action applies to the selected transaction's address. **In practice** when bitcoin is used in the commonly advised way, generate a new address for each transaction, those are equivalent though. I doubt I (and **luke-jr**) will be the only users that will stumblle on this. Further discussion here: https://github.com/bitcoin-core/gui/pull/211#issuecomment-784755998 ACKs for top commit: hebasto: ACK 5440c074579f5588cdcff3d33bd1350cee0b7bff, verified that 22664d6287dda243ebf06df4409b50ab509603e1 is a clean revert of 8f9644890a167a093d95ecef1f12a20dce1bc581. Tree-SHA512: 3a86a730279bc454d0bd25d874dbfb6b1c0492480e66c3164e7c60d8658d622d4522de11bf8564876dc3ee056b53db71ecbe8a37281bf25d41a27e6e0d72ad8f
2021-02-25Merge bitcoin-core/gui#214: qt: Disable requests context menu actions when ↵MarcoFalke
appropriate bb3da8fe410285887f22679c6f08a1f40bcfac8f qt: Disable requests context menu actions when appropriate (Jarol Rodriguez) Pull request description: The recent requests table will allow you to copy data points even if they do not exist. This PR implements checks to disable the `copy label`, `copy message`, and `copy amount` context menu actions if the respective fields are empty. This brings the recent requests table context menu behavior closer to the behavior seen in the transaction view. On a payment request entry which does not have a value for label, message, or amount: | Master | PR | | ----------- | ----------- | |<img width="169" alt="Screen Shot 2021-02-19 at 1 22 28 AM" src="https://user-images.githubusercontent.com/23396902/108466086-167adc00-7251-11eb-8bd6-13984042bdb3.png">| <img width="169" alt="Screen Shot 2021-02-19 at 1 21 49 AM" src="https://user-images.githubusercontent.com/23396902/108466185-3e6a3f80-7251-11eb-9dd8-492ed07fd638.png">| `copy URI` never needs to be disabled as an entry in the recent requests table must have a URI even if it doesn't have a label, message, or amount. #213 will add a `copy address` context menu action. This also does not need a check as an entry must be associated with an address. Below are some more examples of how this PR will behave: **Has Label, Message, and Amount** <img width="780" alt="Screen Shot 2021-02-19 at 12 05 38 AM" src="https://user-images.githubusercontent.com/23396902/108466507-c18b9580-7251-11eb-8875-f3aeb9c4c8e9.png"> **Has Label and Amount, but no Message** <img width="780" alt="Screen Shot 2021-02-19 at 12 05 58 AM" src="https://user-images.githubusercontent.com/23396902/108466421-9b65f580-7251-11eb-97eb-a3bfaa21fa7d.png"> ACKs for top commit: hebasto: re-ACK bb3da8fe410285887f22679c6f08a1f40bcfac8f Tree-SHA512: d98f1a6e05ebf6d9d056bc5754aca78ca7ecda93f497dba88187b947ca4a261eb7dc5e8c872956315acaa0008cc39320fb5806e17117e0c873090ad917ca4a3d
2021-02-25Merge bitcoin-core/gui#219: qt: Prevent the main window popup menuMarcoFalke
ca5bd1c8e5fee29a3c2f0a3fbc879ee74f892266 qt: Prevent the main window popup menu (Hennadii Stepanov) Pull request description: https://github.com/bitcoin/bitcoin/issues/11168 is not fixed by https://github.com/bitcoin/bitcoin/pull/11169 completely, as users are allowed to right click on the menu bar: ![Screenshot from 2021-02-23 14-18-24](https://user-images.githubusercontent.com/32963518/108842753-699eb700-75e2-11eb-92ec-3aff9aa80bd4.png) This PR moves the context menu prohibition from `QToolBar` instance to its parent `BitcoinGUI` instance, which is derived from `QMainWindow`. ACKs for top commit: jarolrod: ACK ca5bd1c8e5fee29a3c2f0a3fbc879ee74f892266, tested on Ubuntu 20.04 Qt 5.12. Confirming that I can replicate the behavior described on `master` and this `PR` fixes it. leonardojobim: tACK https://github.com/bitcoin-core/gui/pull/219/commits/ca5bd1c8e5fee29a3c2f0a3fbc879ee74f892266 Tree-SHA512: a654ecf7ee35bb271df039be77077c1e1f9514e332587ba8622cea18da6a5b3ae8a7eb421e404ec5993c31a2f4d028e0e456fcc01facdbf61a2bc3b1e8423982
2021-02-24test: Replace accidentally placed bit-OR with logical-ORHennadii Stepanov
2021-02-24Merge #18017: txmempool: split epoch logic into classWladimir J. van der Laan
fd6580e405699ccb051fd2a34525e48d3253673d [refactor] txmempool: split epoch logic into class (Anthony Towns) Pull request description: Splits the epoch logic introduced in #17925 into a separate class. Uses clang's thread safety annotations and encapsulates the data more strongly to reduce chances of bugs from API misuse. ACKs for top commit: jonatack: ACK fd6580e405699ccb051fd2a34525e48d3253673d using clang thread safety annotations looks like a very good idea, and the encapsulation this change adds should improve robustness (and possible unit test-ability) of the code. Verified that changing some of the locking duly provoked build-time warnings with Clang 9 on Debian and that small changes in the new `Epoch` class were covered by failing functional test assertions in `mempool_updatefromblock.py`, `mempool_resurrect.py`, and `mempool_reorg.py` hebasto: re-ACK fd6580e405699ccb051fd2a34525e48d3253673d, since my [previous](https://github.com/bitcoin/bitcoin/pull/18017#pullrequestreview-569619362) review: Tree-SHA512: 7004623faa02b56639aa05ab7a078320a6d8d54ec62d8022876221e33f350f47df51ddff056c0de5be798f8eb39b5c03c2d3f035698555d70abc218e950f2f8c
2021-02-24qt: Rename "Edit label" to "Edit address label"Wladimir J. van der Laan
This makes it more specific what the action refers to. (Suggested by Pieter Wuille)
2021-02-24Revert "qt: Remove Transactionview Edit Label Action"Wladimir J. van der Laan
This reverts commit 8f9644890a167a093d95ecef1f12a20dce1bc581.
2021-02-23build: Bump minimum Qt version to 5.9.5Hennadii Stepanov
2021-02-23wallet: fix doc typo in signer optionWilliam Casarin
Signed-off-by: William Casarin <jb55@jb55.com>
2021-02-23Merge #21250: build: make HAVE_O_CLOEXEC available outside LevelDB (bugfix)Wladimir J. van der Laan
9bac71350d98580cc7441957fc7c3fa2f4158553 build: make HAVE_O_CLOEXEC available outside LevelDB (bugfix) (Sebastian Falbesoner) 584fd91d2d294883e6896dbd64a2176528e94581 init: only use pipe2 if availabile, check in configure (Sebastian Falbesoner) Pull request description: The result of the O_CLOEXEC availability check is currently only set in the Makefile and passed to LevelDB (see `LEVELDB_CPPFLAGS_INT` in `src/Makefile.leveldb.include`), but not defined to be used in our codebase. This means that code within the preprocessor conditional `#if HAVE_O_CLOEXEC` was actually never compiled. On the master branch this is currently used for pipe creation in `src/shutdown.cpp`, PR #21007 moves this part to a new module (I found the issue while testing that PR). The fix is similar to the one in #19803, which solved the same problem for HAVE_FDATASYNC. In the course of working on the PR it turned out that pipe2 is not available an all platforms, hence a configure check and a corresponding define HAVE_PIPE2 is introduced and used. The PR can be tested by anyone with a system that has pipe2 and O_CLOEXEC available by putting gibberish into the HAVE_O_CLOEXEC block: on master, everything should compile fine, on PR, the compiler should abort with an error. At least that's my naive way of testing preprocessor logic, happy to hear more sophisticated ways :-) ACKs for top commit: laanwj: Code review ACK 9bac71350d98580cc7441957fc7c3fa2f4158553 Tree-SHA512: aec89faf6ba52b6f014c610ebef7b725d9e967207d58b42a4a71afc9f1268fcb673ecc85b33a2a3debba8105a304dd7edaba4208c5373fcef2ab83e48a170051
2021-02-23Merge #21053: rpc, test: document {previous,next}blockhash as optionalMarcoFalke
ba7e17e073f833eccd4c7c111ae9058c3f123371 rpc, test: document {previous,next}blockhash as optional (Sebastian Falbesoner) Pull request description: This PR updates the result help of the following RPCs w.r.t. the `previousblockhash` and `nextblockhash` fields: - getblockheader - getblock Also adds trivial tests on genesis block (should not contain "previousblockhash") and best block (should not contain "nextblockhash"). Top commit has no ACKs. Tree-SHA512: ef42c5c773fc436e1b4a67be14e2532e800e1e30e45e54a57431c6abb714d2c069c70d40ea4012d549293b823a1973b3f569484b3273679683b28ed40abf46bb
2021-02-23Merge #16546: External signer support - Wallet Box editionWladimir J. van der Laan
f75e0c1edde39a91cc353b0102638e232def9476 doc: add external-signer.md (Sjors Provoost) d4b0107d68a91ed4d1a5c78c8ca76251329d3f3c rpc: send: support external signer (Sjors Provoost) 245b4457cf9265190a05529a0a97e1cb258cca8a rpc: signerdisplayaddress (Sjors Provoost) 7ebc7c0215979c53b92a436acc8b5b607b8d735a wallet: ExternalSigner: add GetDescriptors method (Sjors Provoost) fc5da520f5c72287f59823b8a6d748dda49c574a wallet: add GetExternalSigner() (Sjors Provoost) 259f52cc33817a00b91ec9c7d078c07b88db7ab4 test: external_signer wallet flag is immutable (Sjors Provoost) 2655197e1c2dea9536c32afe1482ced4a1f481e9 rpc: add external_signer option to createwallet (Sjors Provoost) 2700f09c4130af6167ce71f46960e92ca800e205 rpc: signer: add enumeratesigners to list external signers (Sjors Provoost) 07b7c940a7da138d55a484ef83fee19ebf58a867 rpc: add external signer RPC files (Sjors Provoost) 8ce7767071779a0170364e6426bd393ed71bf281 wallet: add ExternalSignerScriptPubKeyMan (Sjors Provoost) 157ea7c614950d61bfe405310e2aaabcee31f7a3 wallet: add external_signer flag (Sjors Provoost) f3e6ce78fba2b31173fe7b606aa9edb5b615bff3 test: add external signer test (Sjors Provoost) 8cf543f96dcd6fdfac1367b9e2b1d7d51be8bb76 wallet: add -signer argument for external signer command (Sjors Provoost) f7eb7ecc6750ab267a979d9268ce5b5d151c26de test: framework: add skip_if_no_external_signer (Sjors Provoost) 87a97941f667483bbf2ab00929e03a2199cb8a62 configure: add --enable-external-signer (Sjors Provoost) Pull request description: Big picture overview in [this gist](https://gist.github.com/Sjors/29d06728c685e6182828c1ce9b74483d). This PR lets `bitcoind` call an arbitrary command `-signer=<cmd>`, e.g. a hardware wallet driver, where it can fetch public keys, ask to display an address, and sign a transaction (using PSBT under the hood). It's design to work with https://github.com/bitcoin-core/HWI, which supports multiple hardware wallets. Any command with the same arguments and return values will work. It simplifies the manual procedure described [here](https://github.com/bitcoin-core/HWI/blob/master/docs/bitcoin-core-usage.md). Usage is documented in [doc/external-signer.md]( https://github.com/Sjors/bitcoin/blob/2019/08/hww-box2/doc/external-signer.md), which also describes what protocol a different signer binary should conform to. Use `--enable-external-signer` to opt in, requires Boost::Process: ``` Options used to compile and link: with wallet = yes with gui / qt = no external signer = yes ``` It adds the following RPC methods: * `enumeratesigners`: asks <cmd> for a list of signers (e.g. devices) and their master key fingerprint * `signerdisplayaddress <address>`: asks <cmd> to display an address It enhances the following RPC methods: * `createwallet`: takes an additional `external_signer` argument and fetches keys from device * `send`: automatically sends transaction to device and waits Usage TL&DR: * clone HWI repo somewhere and launch `bitcoind -signer=../HWI/hwi.py` * check if you can see your hardware device: `bitcoin-cli enumeratesigners` * create wallet and auto import keys `bitcoin-cli createwallet "hww" true true "" true true true` * display address on device: `bitcoin-cli signerdisplayaddress ...` * to spend, use `send` RPC and approve transaction on device Prerequisites: - [x] #21127 load wallet flags before everything else - [x] #21182 remove mostly pointless BOOST_PROCESS macro Potentially useful followups: - GUI support: bitcoin-core/gui#4 - bumpfee support - (automatically) verify (a subset of) keys on the device after import, through message signing ACKs for top commit: laanwj: re-ACK f75e0c1edde39a91cc353b0102638e232def9476 Tree-SHA512: 7db8afd54762295c1424c3f01d8c587ec256a72f34bd5256e04b21832dabd5dc212be8ab975ae3b67de75259fd569a561491945750492f417111dc7b6641e77f
2021-02-23qt: Disable requests context menu actions when appropriateJarol Rodriguez
The recent requests table will allow you to copy data points even if they do not exist. This PR implements checks to disable the 'copy label', 'copy message', and 'copy amount' context menu action if the respective fields are empty.
2021-02-23Merge #21222: log: Clarify log message when file does not existMarcoFalke
faf48f20f196e418b2eea390a0140db3604cfa15 log: Clarify log message when file does not exist (MarcoFalke) Pull request description: Shorter and broader alternative to #21181 Rendered diff: ```diff @@ -1,4 +1,4 @@ -Bitcoin Core version v21.99.0-db656db2ed5a (release build) +Bitcoin Core version v21.99.0-faf48f20f196 (release build) Qt 5.15.2 (dynamic), plugin=wayland (dynamic) No static plugins. Style: adwaita / Adwaita::Style @@ -24,8 +24,8 @@ scheduler thread start Using wallet directory /tmp/test_001/regtest/wallets init message: Verifying wallet(s)... init message: Loading banlist... -ERROR: DeserializeFileDB: Failed to open file /tmp/test_001/regtest/banlist.dat -Invalid or missing banlist.dat; recreating +Missing or invalid file /tmp/test_001/regtest/banlist.dat +Recreating banlist.dat SetNetworkActive: true Failed to read fee estimates from /tmp/test_001/regtest/fee_estimates.dat. Continue anyway. Using /16 prefix for IP bucketing @@ -63,9 +63,9 @@ Bound to [::]:18444 Bound to 0.0.0.0:18444 Bound to 127.0.0.1:18445 init message: Loading P2P addresses... -ERROR: DeserializeFileDB: Failed to open file /tmp/test_001/regtest/peers.dat -Invalid or missing peers.dat; recreating -ERROR: DeserializeFileDB: Failed to open file /tmp/test_001/regtest/anchors.dat +Missing or invalid file /tmp/test_001/regtest/peers.dat +Recreating peers.dat +Missing or invalid file /tmp/test_001/regtest/anchors.dat 0 block-relay-only anchors will be tried for connections. init message: Starting network threads... net thread start ACKs for top commit: jnewbery: utACK faf48f20f196e418b2eea390a0140db3604cfa15 amitiuttarwar: utACK faf48f20f1, 👍 for consistency. also checked where we create / load other `.dat` files, looks good to me. practicalswift: cr ACK faf48f20f196e418b2eea390a0140db3604cfa15 Tree-SHA512: 697a728ef2b9f203363ac00b03eaf23ddf80bee043ecd3719265a0d884e8cfe88cd39afe946c86ab849edd1c836f05ec51125f052bdc14fe184b84447567756f
2021-02-23rpc: send: support external signerSjors Provoost
2021-02-23rpc: signerdisplayaddressSjors Provoost
2021-02-23wallet: ExternalSigner: add GetDescriptors methodSjors Provoost
2021-02-23wallet: add GetExternalSigner()Sjors Provoost
2021-02-23rpc: add external_signer option to createwalletSjors Provoost
2021-02-23rpc: signer: add enumeratesigners to list external signersSjors Provoost
2021-02-23rpc: add external signer RPC filesSjors Provoost
2021-02-23wallet: add ExternalSignerScriptPubKeyManSjors Provoost
2021-02-23wallet: add external_signer flagSjors Provoost
2021-02-23wallet: add -signer argument for external signer commandSjors Provoost
Create basic ExternalSigner class with contructor. A Signer(<cmd>) is added to CWallet on load if -signer=<cmd> is set.
2021-02-23Merge #21274: assumptions: Assume C++17MarcoFalke
5e531e6beb5381c0be5efaa24b7e423e593568e4 assumptions: check C++17 assumption with MSVC (fanquake) c7b46489f8c4d880382248fb47266d81948bbce0 assumptions: assume a C++17 compiler (fanquake) Pull request description: This has been the case since #20413. This should also enable the check for MSVC. From my reading of https://docs.microsoft.com/en-us/cpp/build/reference/zc-cplusplus?view=msvc-160 and https://devblogs.microsoft.com/cppblog/msvc-now-correctly-reports-__cplusplus/ if we set the `/Zc:__cplusplus` switch in additional options, MSVC will report the correct value for `__cplusplus`. However I have not tested this. ACKs for top commit: laanwj: Code review ACK 5e531e6beb5381c0be5efaa24b7e423e593568e4 hebasto: ACK 5e531e6beb5381c0be5efaa24b7e423e593568e4, checked the MS docs, and AppVeyor build is green. practicalswift: ACK 5e531e6beb5381c0be5efaa24b7e423e593568e4 Tree-SHA512: a4fb525cf5c33abc944c614edb0313a39c8a39a1637a03c09342c15ba0925f4eb037062e65e51b42ade667506b7e554c7159acf86e6b8c35d0a87dd79a6f239b
2021-02-23qt: Prevent the main window popup menuHennadii Stepanov
By default, a popup menu contains checkable entries for the toolbars and dock widgets present in the main window. This allows users to accidentally hide the toolbar.
2021-02-23Merge #19698: test: apply strict verification flags for transaction tests ↵Wladimir J. van der Laan
and assert backwards compatibility 5786a818e1a96bc1dd65b0e81b05998876357a74 Verify that all validation flags are backward compatible (gzhao408) b10ce9aa48c8937cb91fca05e29c68098a364d93 [test] check verification flags are minimal/maximal (gzhao408) a260c22cad0672dda11f42f649ebdc7cfa53b16a [test] Check for invalid flag combinations (gzhao408) a7098a2a8d2d23ee3be1d71ab8c71475bf5a31ee [refactor] use CheckTxScripts, TrimFlags, FillFlags (gzhao408) 7a77727b2f66f3d723e03e917f0cabb459c49d62 Apply minimal validation flags to tx_invalid tests (gzhao408) 9532591bedaecf7c2debe779dec0a0debec2623b [test] add BADTX setting for invalid txns that fail CheckTransaction (gzhao408) 4c06ebf1281f0f387ab7493fe15176a05247525e [test] fix two witness tests in invalid tests with empty vout (gzhao408) 158a0b268ca2f73a5d504791359d1eff2cf27715 Apply maximal validation flags to tx_valid tests (gzhao408) 0a76a39b633760d4668d39859605c05629ee0025 [test] fix CSV test missing OP_ADD (gzhao408) 19db590d044efe7d474a16720e5b56e7b55db54c [test] remove unnecessary OP_1s from CSV and CLTV tests (gzhao408) Pull request description: This uses the first 4 commits of #15045, rebased and added some comments. The diff is quite large already and I want to make it easy to review, so I'm splitting it into 2 PRs (transaction and script). Script one is WIP, I'll link it when I open it. Interpretation of scripts is dependent on the script verification flags passed in. In tests, we should always apply **maximal** verification flags when checking that a transaction is **valid**; any additional flags should invalidate the transaction. A transaction should not be valid because we forgot to include a flag, and we should apply all flags by default. We should apply **minimal** verification flags when asserting that a transaction is **invalid**; if verification flags are applied, removing any one of them should mean the transaction is valid. New verify flags must be backwards compatible; tests should check backwards compatibility and apply the new flags by default. All `tx_invalid` tests should continue to be invalid with the exact same verify flags. All `tx_valid` tests that don't pass with new flags should _explicitly_ indicate that the flags need to be excluded, and fail otherwise. 1. Flip the meaning of `verifyFlags` in tx_valid.json to mean _excluded_ verification flags instead of included flags. Edit the test data accordingly. 2. Trim unneeded flags from tx_invalid.json. 3. Add check to verify that tx_valid tests have maximal flags and tx_invalid tests have minimal flags. 4. Add checks to verify that flags are soft forks (#10699) i.e. adding any flag should only decrease the number of acceptable scripts. Test by adding/removing random flags. ACKs for top commit: achow101: ACK 5786a818e1a96bc1dd65b0e81b05998876357a74 laanwj: ACK 5786a818e1a96bc1dd65b0e81b05998876357a74 Tree-SHA512: 19195d8cf3299e62f47dd3443ae4a95430c5c9d497993a18ab80de9e24b1869787af972774993bf05717784879bc4592fdabaae0fddebd437963d8f3c96d9a73
2021-02-23Merge bitcoin-core/gui#213: qt: Add Copy Address Action to Payment RequestsMarcoFalke
e348d7ea2c0b5d2eb8039dab33b0b9a48655885f qt: Add Copy Address Action to Payment Requests (Jarol Rodriguez) Pull request description: Currently, the only way to copy the address of a payment request is to double-click on the payment request and then click on the copy address button. This PR adds a convenient context menu action to copy the address of a payment request. | Master | PR | | ----------- | ------------ | |<img width="169" alt="Screen Shot 2021-02-18 at 8 33 08 PM" src="https://user-images.githubusercontent.com/23396902/108444489-b6703f80-7228-11eb-8684-945fbcd04772.png"> |<img width="169" alt="Screen Shot 2021-02-18 at 8 33 50 PM" src="https://user-images.githubusercontent.com/23396902/108444505-c12ad480-7228-11eb-9eee-473fee877ad7.png">| ACKs for top commit: hebasto: re-ACK e348d7ea2c0b5d2eb8039dab33b0b9a48655885f, only suggested changes since my [previous](https://github.com/bitcoin-core/gui/pull/213#pullrequestreview-595520204) review. Tree-SHA512: 2b75930ca326ef1d695afc1c6f25853ef55d06d20b66c3c3c372188a6cdfa4686c07f9c56824b766e46b660c731f8a9c2e5b935aa26b316fd46f9e396b29b802
2021-02-23wallet: listdescriptors uses normalized descriptor formIvan Metlushko
2021-02-23assumptions: check C++17 assumption with MSVCfanquake
From my reading of https://docs.microsoft.com/en-us/cpp/build/reference/zc-cplusplus?view=msvc-160 and https://devblogs.microsoft.com/cppblog/msvc-now-correctly-reports-__cplusplus/ if we set the `/Zc:__cplusplus` switch in additional options, MSVC will report the correct value for `__cplusplus`.
2021-02-23assumptions: assume a C++17 compilerfanquake
This has already been the case since #20413.
2021-02-22qt: Add Copy Address Action to Payment RequestsJarol Rodriguez
Currently, the only way to copy the address of a payment request is to double-click on the payment request and then click on the copy address button. This commit adds a convenient context menu action to copy the address of a payment request.
2021-02-22init: only use pipe2 if availabile, check in configureSebastian Falbesoner
2021-02-22Merge #79: Embed monospaced fontWladimir J. van der Laan
67f26319a0ca7e34e3db17d9330133622a40de09 gui: Add monospaced font settings (Hennadii Stepanov) 22e0114d055b0ac6cdc47af2968b5dc742ba055a qt: Choose monospaced font in C++ code rather in `*.ui` file (Hennadii Stepanov) 623de12d040af89ff7c25de6eb0a19c67179dc5f qt: Make GUIUtil::fixedPitchFont aware of embedded font (Hennadii Stepanov) 89e421918ee8b9c8439317f747e5c37f0733d94b gui: Add Roboto Mono font (Hennadii Stepanov) Pull request description: Qt does not guarantee that the actual applied font matches to the requested one. It was noted (https://github.com/bitcoin/bitcoin/pull/16432#issuecomment-514486077): > the monospace font looks a bit weird no macOS ... because it is _not_ monospaced. Also some discrepancies I've noted on Windows while testing Qt 5.15 ([#19716](https://github.com/bitcoin/bitcoin/pull/19716)). Of course, we could check the actual font with `QFontInfo`, and try to choose another font. But this PR suggests to just embed a monospaced font, and get the GUI look (partially) independent from a platform. [Roboto Mono](https://fonts.google.com/specimen/Roboto+Mono) was chosen after discussion with Bitcoin Design community, and due to its [Apache License, Version 2.0](https://fonts.google.com/specimen/Roboto+Mono#license). Changes are scoped to the Overview page only. --- Screenshots on macOS 10.15.6 (images are simulated by code patching): - master (ca30d34cf94b7797272ef1920ca4b48716e7f999) ![Screenshot from 2020-09-03 14-10-03](https://user-images.githubusercontent.com/32963518/92107902-30357d80-edef-11ea-8a4f-b4c758eebf66.png) - this PR (3fdd5b6bd17a679d6e3876682266092159c52d59) ![Screenshot from 2020-09-03 15-41-36](https://user-images.githubusercontent.com/32963518/92116277-4b5aba00-edfc-11ea-8cb9-22fc44460bfb.png) --- More screenshots added after https://github.com/bitcoin-core/gui/pull/79#issuecomment-782909149: - Linux Mint 20.1 + Cinnamon DE ![DeepinScreenshot_select-area_20210221205410](https://user-images.githubusercontent.com/32963518/108635739-b327be80-7489-11eb-8851-ac89f61199ee.png) - Windows 10 (with depends) ![DeepinScreenshot_select-area_20210221205056](https://user-images.githubusercontent.com/32963518/108635741-b6bb4580-7489-11eb-8b6b-66be5551eb8c.png) - macOS Big Sur (with depends) ![DeepinScreenshot_select-area_20210221202917](https://user-images.githubusercontent.com/32963518/108635746-bd49bd00-7489-11eb-8cd2-cf4bb2273a6d.png) ACKs for top commit: laanwj: Tested ACK 67f26319a0ca7e34e3db17d9330133622a40de09 Tree-SHA512: a59775570b8ce314669ede50a0b69f53e8a47a41e7eea428835013240f0ce9afcff6e4c258895455b56806417ed877e5b7a9522f1904e95a5f435db8ccf6078c
2021-02-22scripted-diff: Rename MakeFuzzingContext to MakeNoLogFileContextMarcoFalke
-BEGIN VERIFY SCRIPT- # Rename sed -i -e 's/MakeFuzzingContext/MakeNoLogFileContext/g' $(git grep -l MakeFuzzingContext) # Bump the copyright of touched files in this scripted diff to avoid touching them again later ./contrib/devtools/copyright_header.py update ./src/test/fuzz/ -END VERIFY SCRIPT-
2021-02-22scripted-diff: Rename PROVIDE_MAIN_FUNCTION -> PROVIDE_FUZZ_MAIN_FUNCTIONMarcoFalke
-BEGIN VERIFY SCRIPT- sed -i -e 's/PROVIDE_MAIN_FUNCTION/PROVIDE_FUZZ_MAIN_FUNCTION/g' $(git grep -l PROVIDE_MAIN_FUNCTION) -END VERIFY SCRIPT-
2021-02-22Merge #21202: [validation] Two small clang lock annotation improvementsMarcoFalke
25c57d640992255ed67964a44b17afbfd4bed0cf [doc] Add a note about where lock annotations should go. (Amiti Uttarwar) ad5f01b96045f304b6cf9100879592b835c49c40 [validation] Move the lock annotation from function definition to declaration (Amiti Uttarwar) Pull request description: Based on reviewing #21188 the first commit switches the lock annotations on `CheckInputScripts` to be on the function declaration instead of on the function definition. this ensures that all call sites are checked, not just ones that come after the definition. the second commit adds a note to the developer-notes section to clarify where the annotations should be applied. ACKs for top commit: MarcoFalke: ACK 25c57d640992255ed67964a44b17afbfd4bed0cf 🥘 promag: Code review ACK 25c57d640992255ed67964a44b17afbfd4bed0cf. Tree-SHA512: 61b6ef856bf6c6016d535fbdd19daf57b9e59fe54a1f30d47282a071b9b9d60b2466b044ee57929e0320cb1bdef52e7a1687cacaa27031bbc43d058ffffe22ba
2021-02-22Merge #20845: net: Log to net debug in MaybeDiscourageAndDisconnect except ↵MarcoFalke
for noban and manual peers fa55159b9ede4a915f8ef9e5b90e3e99eadedf91 net: Log to net debug in MaybeDiscourageAndDisconnect except for noban and manual peers (MarcoFalke) Pull request description: The goal is to avoid local peers (e.g. untrusted peers on the local network or inbound onion peers via a local onion proxy) filling the debug log (and thus the disk). ACKs for top commit: practicalswift: ACK fa55159b9ede4a915f8ef9e5b90e3e99eadedf91 vasild: ACK fa55159b9ede4a915f8ef9e5b90e3e99eadedf91 Tree-SHA512: de233bf57334580f9b91f369fafd131d71c5ae25db25b09cc8fa8cbf34c0648f083c52260a6a912238751467e3c3c5f5d2309c145710753058d44a0003f88f4f
2021-02-22Merge bitcoin-core/gui#211: qt: Remove Transactionview Edit Label ActionMarcoFalke
8f9644890a167a093d95ecef1f12a20dce1bc581 qt: Remove Transactionview Edit Label Action (Jarol Rodriguez) Pull request description: This PR removes the `Edit Label` action from the `transactionview` context menu. Since the `Edit Label` action will no longer be utilized in the `transactionview`, the `Edit Label` function logic is also removed. | Master | PR | | ----------- | ----------- | |<img width="248" alt="Screen Shot 2021-02-17 at 8 34 34 PM" src="https://user-images.githubusercontent.com/23396902/108292189-9b86c800-7161-11eb-9e80-6238523bc27e.png">|<img width="248" alt="Screen Shot 2021-02-17 at 8 35 10 PM" src="https://user-images.githubusercontent.com/23396902/108292204-a17ca900-7161-11eb-8582-7f33d3e2ba8f.png">| Among the context menu actions for each transaction in the `transactionview` is the `Edit Label` action. While all other actions apply directly to the selected transaction, the `Edit Label` action applies to the selected transaction's address. As documented in issue #209 and [#1168](https://github.com/bitcoin/bitcoin/issues/1168) , this is an "unfortunate" placement for such an action. The current placement creates a confusing UX scenario where the outcome of the action is ambiguous. **Example of Ambiguous Behavior:** The context menu gives the wrong impression that the `Edit Label` action will edit a `Label` for the specific transaction that has been right-clicked on. This impression can be because all other actions in this menu will relate to the specific transaction and the misconception between `Comment` and `Label`. <img width="1062" alt="editlabel-start" src="https://user-images.githubusercontent.com/23396902/108296385-6da48200-7167-11eb-89f0-b21ccc58f6f4.png"> Let's say I wanted to give the transaction selected in the screenshot above a comment of "2-17[17:43]". Given all the context clues, it will be reasonable to assume that the `Edit Label` function will give a label to this transaction. Instead, it edits the `Label` for the address behind this transaction. Thus, changing the `Label` for all transactions associated with this address. <img width="971" alt="editlabel-end" src="https://user-images.githubusercontent.com/23396902/108297179-e35d1d80-7168-11eb-86a9-0d2796c51829.png"> **Maintaining `Edit Label` Functionality:** The action of Editing a Label should instead be reserved for the respective address tables of the `Send` and `Receive` tabs. As documented in this [comment](https://github.com/bitcoin-core/gui/issues/209#issuecomment-780922101), `Edit Label` is currently implemented in the `Send` tab and is missing in the `Receive` tab. A follow-up PR can add the `Edit Label` functionality to the `Receive` tab. ACKs for top commit: MarcoFalke: review ACK 8f9644890a167a093d95ecef1f12a20dce1bc581 Talkless: tACK 8f9644890a167a093d95ecef1f12a20dce1bc581, tested on Debian Sid. Tree-SHA512: 70bbcc8be3364b0d4f476a9760aa14ad1ad1f53b0b130ce0ffe75190d76c386e6e26c530c0a55d1742402fe2b45c68a2af6dbfaf58ee9909ad93b06f0b6559d4
2021-02-22Merge bitcoin-core/gui#206: Display fRelayTxes and bip152_highbandwidth_{to, ↵MarcoFalke
from} in peer details 142807af8b82e2372a03df893c50df4f4a96aca4 gui: display BIP152 high bandwidth relay in peer details (Jon Atack) 9476886353dffb730dcb75799f2bd5e143425795 gui: display fRelayTxes in peer details (Jon Atack) Pull request description: This pull adds two fields to the peer details, "Wants Tx Relay" (fRelayTxes) and "High Bandwidth" (bip152_highbandwidth to/from). See the added tooltips for more info. ACKs for top commit: MarcoFalke: review ACK 142807af8b82e2372a03df893c50df4f4a96aca4 jarolrod: ACK 142807af8b82e2372a03df893c50df4f4a96aca4 Tree-SHA512: 956c7fa54c9c2ea76ee879d370711be0bed4af05484a17d35a1dd77713ed34ff441ed3957d0ef3a7ca7cf59a2f5d898be49b12af609a16b3e3cbfc4a1ba8f54e
2021-02-22Merge bitcoin-core/gui#205: Save/restore TransactionView and ↵MarcoFalke
recentRequestsView tables column sizes 964885d04801c6ab77ce4705cff01c9d83bc3ed8 qt: Save/restore recentRequestsView table column sizes (Hennadii Stepanov) f5c8093e778069f4930a84452398c339aad58e79 qt: Move recentRequestsView properties settings to constructor (Hennadii Stepanov) 9c5f4f2169cc4494d3e22fd62afe40e000a9eace qt: Save/restore TransactionView table column sizes (Hennadii Stepanov) 788205c3f783fb20bfdfd403be6befba149772ca qt: Move transactionView properties settings to constructor (Hennadii Stepanov) ecdbaf71c0e1a4363e7eb019dabeb0018522ef70 qt, refactor: Drop intermediate assignment (Hennadii Stepanov) Pull request description: Save/restore TransactionView and recentRequestsView tables column sizes. Sorting order is not saved/restored intentionally. Based on #204 (the first commit). ACKs for top commit: jarolrod: ACK 964885d04801c6ab77ce4705cff01c9d83bc3ed8, tested on macOS 11.1 Qt 5.15.2 Talkless: tACK 964885d04801c6ab77ce4705cff01c9d83bc3ed8, tested on Debian Sid, saving/restoring and resetting (with `-resetguisettings`) works as expected. Tree-SHA512: c24e41bf4d95bb33dce16e9a0b952ffd0912e95f4d2a1bc5292fcf5a27100e70fea73433c4ff246d05b174fc23a7b6de1790a2e8b990a9089e4deca79a00dedc