Commit graph

30695 commits

Author SHA1 Message Date
glozow
e0df41d7d5 [validation] default conflicting fees and size to 0
This should have no effect in practice, since we only ever call
PreChecks once per transaction.
2021-08-24 15:47:21 +01:00
glozow
b001b9f6de MOVEONLY: BIP125 max conflicts limit to policy/rbf.h
A circular dependency is added because policy now depends on txmempool and
txmempool depends on validation. It is natural for [mempool] policy to
rely on mempool; the problem is caused by txmempool depending on
validation. #22677 will resolve this.
2021-08-24 15:47:21 +01:00
Rafael Sadowski
acb7aad27e Fix build with Boost 1.77.0
BOOST_FILESYSTEM_C_STR changed to accept the path as an argument
2021-08-24 12:49:02 +02:00
fanquake
eb09c26724
Merge bitcoin/bitcoin#22741: test: Add generate* calls to test framework
fab2e23b57 Use generate* from TestFramework (MarcoFalke)
faf7e92804 test: Add generate* calls to test framework (MarcoFalke)

Pull request description:

  This is needed for #22567.

  By making the calls to `generate*` member function of the test framework, it paves the way to make it easier to implicitly call the `sync_all` member function.

ACKs for top commit:
  jnewbery:
    utACK fab2e23b57

Tree-SHA512: 7a7be6be71f0602119689df45d63a1adec309f323eac2330ee0f200676001afe825605859bd02c6a8a8dcf85d925dc1bc37370ef1ceb8ad1d85a66eec0dbfff9
2021-08-24 16:22:30 +08:00
MarcoFalke
dd455ecfa0
Merge bitcoin-core/gui#349: replace QDateTime::fromTime_t with QDateTime::fromSecsSinceEpoch
3ae503c95b refactor: replace QDateTime::toTime_t with QDateTime::toSecsSinceEpoch (fanquake)
27257b39bf refactor: replace QDateTime::fromTime_t with QDateTime::fromSecsSinceEpoch (fanquake)

Pull request description:

  `QDateTime::fromTime_t` has [been obsoleted](https://doc.qt.io/qt-5.12/qdatetime-obsolete.html#fromTime_t) in favour of [`QDateTime::fromSecsSinceEpoch`](https://doc.qt.io/qt-5.12/qdatetime.html#fromSecsSinceEpoch), which is available from Qt 5.8+.

ACKs for top commit:
  hebasto:
    ACK 3ae503c95b

Tree-SHA512: 774243bccb4c4bd9e8ceeee0450d4f57b5665bdef8bcec0538d29664922fd354189d48718ca62ca49048b8b90c9b31ed184e1eefd7ff4529c55ba7d2b079e51e
2021-08-24 10:09:53 +02:00
fanquake
3ae503c95b
refactor: replace QDateTime::toTime_t with QDateTime::toSecsSinceEpoch 2021-08-24 15:08:04 +08:00
fanquake
27257b39bf
refactor: replace QDateTime::fromTime_t with QDateTime::fromSecsSinceEpoch 2021-08-24 15:06:46 +08:00
Kiminuo
25de4e77fe Use context.args in CWallet::Create instead of gArgs. 2021-08-24 07:46:52 +02:00
Kiminuo
aa5e7c9471 Fix typo in bitcoin-cli.cpp 2021-08-24 07:44:09 +02:00
fanquake
b20ad0eb16
Merge bitcoin/bitcoin#22772: refactor: hasher cleanup (follow-up to 19935)
4c69571e6e doc: remove outdated comment (Martin Zumsande)
16652a93ea refactor: Remove unused KeyIDHasher (Martin Zumsande)

Pull request description:

  Small follow-ups to  #19935:

  - Removal of unused `KeyIDHasher`  class ([comment in 19935](https://github.com/bitcoin/bitcoin/pull/19935#discussion_r544464524))
  - Removal of an outdated comment, which referred to an old problem with the no longer supported Boost 1.46 and `boost::unordered_map`, now replaced by `std::unordered_map`. ([comment in 19935](https://github.com/bitcoin/bitcoin/pull/19935#discussion_r540911134))

ACKs for top commit:
  Saviour1001:
    Tested ACK <code>[4c69571](4c69571e6e)</code>
  Zero-1729:
    ACK 4c69571e6e
  theStack:
    ACK 4c69571e6e 🆗

Tree-SHA512: 243fda2120bfac6c40a268ca2c0f34482ce27e71fbc50005c0d13c2ad5db9ee72a037f9937c37cc50ed0f9f6f11ee6afee4ac50e5031d6876ec942f41f38dadf
2021-08-24 11:12:15 +08:00
fanquake
61a843e43b
Merge bitcoin/bitcoin#22220: util: make ParseMoney return a std::optional<CAmount>
f7752adba5 util: check MoneyRange() inside ParseMoney() (fanquake)
5ef2738089 util: make ParseMoney return a std::optional<CAmount> (fanquake)

Pull request description:

  Related discussion in #22193.

ACKs for top commit:
  MarcoFalke:
    review ACK f7752adba5 📄

Tree-SHA512: 88453f9e28f668deff4290d4bc0b2468cbd54699a3be1bfeac63a512276d309354672e7ea7deefa01466c3d9d826e837cc1ea244d4d74b4fa9c11c56f074e098
2021-08-24 10:43:38 +08:00
Andrew Chow
d9d3ec07cf Consolidate XOnlyPubKey lookup hack
The places where we need to lookup information for a XOnlyPubKey
currently implement a hack which makes both serializations of the full
pubkey in order to try the CKeyIDs for the lookup functions. Instead of
duplicating this everywhere it is needed, we can consolidate the CKeyID
generation into a function, and then have wrappers around GetPubKey,
GetKey, and GetKeyOrigin which takes the XOnlyPubKey, retrieves all of
the CKeyIDs (using the new GetKeyIDs() function in XOnlyPubKey), and
tries their respective underlying lookup function.
2021-08-23 21:38:34 -04:00
Hennadii Stepanov
d3203a99d8
Merge bitcoin-core/gui#408: Add missing mnemonics in menu bar options
7c33e3a572 qt: Add missing mnemonics in menu bar options (Shashwat)

Pull request description:

  Since #362 we have defaulted to add mnemonic shortcuts for the context menus.
  The Window -> Minimize option and File -> Load PSBT from clipboard were hitherto missing a mnemonic shortcut. This PR adds mnemonic shortcuts for them

  Changes introduced in this PR:
  | Master | PR |
  | ----------| ---- |
  | ![Screenshot from 2021-08-23 23-10-07](https://user-images.githubusercontent.com/85434418/130494098-c65ec9da-c3f1-4243-9b3d-0c87cb677825.png) | ![Screenshot from 2021-08-23 23-08-41](https://user-images.githubusercontent.com/85434418/130494083-849ffd14-05e9-4a6d-bdc3-b3e55b8a8861.png)|
  |![Screenshot from 2021-08-23 23-10-21](https://user-images.githubusercontent.com/85434418/130494233-1b2e8838-c5d4-48a8-9abf-a4acc8d6146c.png)|![Screenshot from 2021-08-23 23-09-00](https://user-images.githubusercontent.com/85434418/130494181-dcdbf119-a2c6-469d-a6c9-3021506ab40b.png)|

ACKs for top commit:
  jarolrod:
    tACK 7c33e3a572
  hebasto:
    ACK 7c33e3a572, tested on Linux Mint 20.2 (Qt 5.12.8).

Tree-SHA512: 32f201ae7716b19ca123856292f8bfa0d805f6c7271ac1b5e08eff6b95017443754c8a76e8396ccca1869a57384e11016cbd99d63ccdd2fae6da4eaf3ae32298
2021-08-23 22:15:29 +03:00
MarcoFalke
ec6db8e858
Merge bitcoin/bitcoin#22769: fuzz: Use LIMITED_WHILE instead of limit_max_ops
faa5fa9a78 fuzz: Use LIMITED_WHILE instead of limit_max_ops (MarcoFalke)

Pull request description:

  This avoids the local stack variable `limit_max_ops` and makes it easier to grep for limited loops. Also, it is less code.

ACKs for top commit:
  theStack:
    Code-review ACK faa5fa9a78 🍷
  Zero-1729:
    crACK faa5fa9a78 🥤

Tree-SHA512: b10d89f4ce57bac0d6e9de9db7d4db85bae81bc02536d46a910be8c0e77333f2d9a547c7fe03df57f5ff9fd90b6994b09996d8e148573fb7ecd840d08b5c0c7d
2021-08-23 20:57:07 +02:00
Shashwat
7c33e3a572 qt: Add missing mnemonics in menu bar options
The Window -> Minimize an File -> Load PSBT from clipboard options were missing a mnemonic
shortcut. This PR adds mnemonic shortcuts for them.
2021-08-23 23:06:55 +05:30
W. J. van der Laan
b1c4a4ed39
Merge bitcoin-core/gui#406: Handle new added plurals in bitcoin_en.ts
2b3d8f3dde qt: Handle new added plurals in bitcoin_en.ts (Hennadii Stepanov)

Pull request description:

  This step was missed. See [`translation_process.md`](https://github.com/bitcoin/bitcoin/blob/master/doc/translation_process.md#handling-plurals-in-source-files).

  Transifex is smart enough to handle `%n` in strings as a plural form. Therefore, only two English strings are broken in the GUI on master (and in 22.0).

ACKs for top commit:
  laanwj:
    ACK 2b3d8f3dde

Tree-SHA512: d39c0da8a295fd7a42e7f2ca3cf5b4f7704c2bdeccdeb10392b37e06dc8577295c9fefbdd5442824639f31c3d014b025a9b937f0b3f630a8ebc977451a5f14f5
2021-08-23 19:27:27 +02:00
W. J. van der Laan
1bbe289f20
Merge bitcoin/bitcoin#22565: [script] signet's getcoins.py improvements
b0c8246cac Add cleaner errors for unsuccessful faucet transactions (NikhilBartwal)
1c612b274b [script] Update signet getcoins.py for custom network (NikhilBartwal)

Pull request description:

  Currently, using the getcoins.py with a custom signet executes successfully and shows the transfer of 0.001 testBTC as complete, however for obvious reasons, it should not. In fact, upon verification it does not actually execute the transaction, but rather gives the output that it did, as shown below which can be misleading:

  ```
  [nikhilb@nikhil-PC bitcoin]$ echo $datadir
  /home/nikhilb/signet-custom
  [nikhilb@nikhil-PC bitcoin]$ contrib/signet/getcoins.py -- -datadir=$datadir
  Payment of 0.00100000 BTC sent with txid dd22c7d996e95f3e5baf20f73140d517ff48f1b26d0e4fefd61e3c37991b8f86
  [nikhilb@nikhil-PC bitcoin]$ bitcoin-cli -datadir=$datadir getrawtransaction dd22c7d996e95f3e5baf20f73140d517ff48f1b26d0e4fefd61e3c37991b8f86
  error code: -5
  error message:
  No such mempool or blockchain transaction. Use gettransaction for wallet transactions.
  [nikhilb@nikhil-PC bitcoin]$ bitcoin-cli -datadir=$datadir gettransaction dd22c7d996e95f3e5baf20f73140d517ff48f1b26d0e4fefd61e3c37991b8f86
  error code: -5
  error message:
  Invalid or non-wallet transaction id

  ```
  This PR adds a sanity check for custom signet by comparing the current network's first block hash (the block after the genesis block) with global signet's respective block hash (since all signet networks share the same genesis block) and if a custom network is detected, the user is prompted to either work on the global signet or setup their own faucet.

  The PR was checked to be working successfully, giving the output as below:

  ```
  [nikhilb@nikhil-PC bitcoin]$ git checkout update_signet_getcoins
  Switched to branch 'update_signet_getcoins'
  Your branch is ahead of 'upstream/master' by 1 commit.
    (use "git push" to publish your local commits)
  [nikhilb@nikhil-PC bitcoin]$ contrib/signet/getcoins.py -- -datadir=$datadir
  The global faucet cannot be used with a custom Signet network. Please use the global signet or setup your custom faucet for the same.

  You can have a look here for setting up your own faucet: https://en.bitcoin.it/wiki/Signet

  ```

ACKs for top commit:
  prayank23:
    utACK b0c8246cac
  kallewoof:
    ACK b0c8246cac
  arnabsen1729:
    utACK b0c8246
  prakash1512:
    utACK b0c8246
  0xB10C:
    Tested ACK b0c8246cac
  theStack:
    Tested ACK b0c8246cac
  Zero-1729:
    crACK b0c8246 🧉

Tree-SHA512: 144b47a83008521a5cda13f4c1b12809a125a744f865a8e0f792132d52fdb88926d4f4f4d7230452c2e129b5879892cdbeda981b8af10b789e9fc0cda2905a5d
2021-08-23 19:19:00 +02:00
MarcoFalke
fa9c075f72
doc: Remove incorrect INIT_PROTO_VERSION from nTime comment 2021-08-23 18:53:34 +02:00
MarcoFalke
dbcb5742c4
Merge bitcoin/bitcoin#20541: Move special CAddress-without-nTime logic to net_processing
75290ae61e Drop us=... message in net debug for sending version message (Pieter Wuille)
5d47860334 refactor: move CAddress-without-nTime logic to net_processing (Pieter Wuille)

Pull request description:

  Historically, the VERSION message contains an "addrMe" and an "addrYou". As these are sent before version negotiation is complete, the protocol version is INIT_PROTO_VERSION (209), and in that protocol, CAddress is serialized without nTime.

  This is in fact the only situation left where a CAddress is (de)serialized without nTime. As it's such a simple structure (CService for ip/port + uint64_t for nServices), just inline that structure in the few places where it occurs, and remove the logic for dealing with missing nTime from CAddress.

ACKs for top commit:
  Zero-1729:
    crACK 75290ae61e
  jonatack:
    ACK 75290ae61e
  vasild:
    ACK 75290ae61e

Tree-SHA512: ccd9f478e1766fb2ad845d512b090e6297b82100640545ca490d930785801da3b429d40400bc2eb2cbe9057d5d12362ab33f8d650a1ca9e9e85857aef36ec414
2021-08-23 18:19:52 +02:00
Sebastian Falbesoner
7720d4f650 test: fix failure in feature_nulldummy.py on single-core machines
On single-core machines, executing the test feature_nulldummy.py results in
the following assertion error:

...
2021-08-18T15:37:58.805000Z TestFramework (INFO): Test 4: Non-NULLDUMMY base multisig transaction is invalid after activation
2021-08-18T15:37:58.814000Z TestFramework (ERROR): Assertion failed
Traceback (most recent call last):
  File "[...]/test/functional/test_framework/test_framework.py", line 131, in main
    self.run_test()
  File "[...]/test/functional/feature_nulldummy.py", line 107, in run_test
    self.block_submit(self.nodes[0], [test4tx], accept=False)
  File "[...]/test/functional/feature_nulldummy.py", line 134, in block_submit
    assert_equal(None if accept else 'block-validation-failed', node.submitblock(block.serialize().hex()))
  File "[...]/test/functional/test_framework/util.py", line 49, in assert_equal
    raise AssertionError("not(%s)" % " == ".join(str(arg) for arg in (thing1, thing2) + args))
AssertionError: not(block-validation-failed == non-mandatory-script-verify-flag (Dummy CHECKMULTISIG argument must be zero))
2021-08-18T15:37:58.866000Z TestFramework (INFO): Stopping nodes
...

The behaviour can be reproduced on a multi-core machine by simply changing the
function GetNumCores() (in src/util/system.cpp) to return 1:

int GetNumCores()
{
    return 1;
}
2021-08-23 18:11:37 +02:00
Sebastian Falbesoner
646b3885f7 test: refactor: use named args for block_submit in feature_nulldummy.py 2021-08-23 18:11:37 +02:00
Zero-1729
f6e4db27ce
test: add aarch64-apple-darwin platform entry to get_previous_releases 2021-08-23 15:58:49 +01:00
MarcoFalke
f6f7a12462
Merge bitcoin/bitcoin#22622: util: Check if specified config file cannot be opened
127b4608e9 test: Check if specified config file cannot be opened (nthumann)
6bb54708e6 util: Check if specified config file cannot be opened (nthumann)

Pull request description:

  Fixes https://github.com/bitcoin/bitcoin/issues/22612.
  When running e.g. `./src/bitcoind -datadir=/tmp/bitcoin -regtest -conf=/tmp/bitcoin/regtest/bitcoin.conf` and the specified config cannot be opened (doesn't exist, permission denied, ...), the initialization silently uses the default config.

  As voidburn already noted:
  > I can't think of a situation in which a config file is specified explicitly (in the startup options, as per service unit linked above), but inaccessible, where the fail condition should be to keep booting using defaults instead.

  With this patch applied, the initialization will fail immediately, if the specified config file cannot be opened. If no config file is explicitly specified, the behavior is unchanged. This not only affects `bitcoind`, but also `bitcoin-cli` and `bitcoin-qt`.

  In the example below the datadir is accessible, but the config file is not due to insufficient permissions:
  ```
  $ ./src/bitcoind -datadir=/tmp/bitcoin -regtest --debug=1 -conf=/tmp/bitcoin/regtest/bitcoin.conf
  Error: Error reading configuration file: specified config file "/tmp/bitcoin/regtest/bitcoin.conf" could not be opened.
  ```

ACKs for top commit:
  0xB10C:
    ACK 127b4608e9
  Zero-1729:
    tACK 127b4608e9
  theStack:
    Tested ACK 127b4608e9

Tree-SHA512: 4fe487921485426f1d1da8d256c388af517b984b639d776aec7b159b3e23b669824093d3bdd31139d9415ed5f5de405b3e6a51b110c8ab471f12b9c99ac67cc1
2021-08-23 12:58:01 +02:00
MarcoFalke
489beb3984
Merge bitcoin/bitcoin#22641: test: Split rpc_signmessage test for disabled wallet
a3b559c970 test: added test for disabled wallet (Shubhankar Gambhir)

Pull request description:

  This PR enables a part of the non-wallet functional test  (rpc_signmessage.py) to be run even with the Bitcoin Core wallet disabled, it is inspired by #20078.

  Divided tests in rpc_signmessage.py into 2 files wallet_signmessagewithaddress.py and rpc_signmessagewithprivkey.py, latter one can run even when wallet is disabled that provides extra test which was not performed earlier.

  * we need bitcoincore wallet to run  rpc_signmessage.py, but it is olny required for signing messages with address and not for signing messages wih private key, so latter one can be in a seperate test which can run without wallet
  * verifying message doesn't require wallet, so it can be used in both tests without any problem
  * 2 tests are named as wallet_signmessagewithaddress.py and rpc_signmessagewithprivkey.py to provide clarity of what they are testing.

ACKs for top commit:
  vasild:
    ACK a3b559c970
  theStack:
    Code-review ACK a3b559c970

Tree-SHA512: 1bfca3baf3123a02f0a2389e55e141d64430c3bed40ff5a5fb97ef2c66e2853c46e4b2dff62b948eb94dc574cb89d061769330f0535e2d5d1be76b60101136ac
2021-08-23 09:34:28 +02:00
MarcoFalke
58b559fab0
Merge bitcoin/bitcoin#20769: net: fixes #20657 - Advertised address where nobody is listening
a38137479b net: do not advertise address where nobody is listening (Jadi)

Pull request description:

  If the bitcoind starts when listen=0 but listenonion=1, the daemon will
  advertise its onion address but nothing is listening for it.

  This update will enforce listenonion=0 when the listen is 0.

ACKs for top commit:
  vasild:
    ACK a38137479b
  jarolrod:
    ACK a38137479b
  amitiuttarwar:
    ACK a38137479b

Tree-SHA512: e84a0a9a51f2217edf35d06c6cd9085d1e664452655ba92027195a1e88ba081d157310c84e9709a99ce5d46c94f231477ca2d36f010648b0c8b4f2a737d54e5d
2021-08-23 09:01:08 +02:00
fanquake
e826b22da2
Merge bitcoin/bitcoin#22275: A few follow-ups for taproot signing
08f57a0057 Assert that IsComplete() in GetSpendData() (Pieter Wuille)
d8f4b976d5 Remove default nHashTypeIn arguments to MutableTransactionSignatureCreator (Pieter Wuille)
c7048aae95 Simplify SignTransaction precomputation loop (Pieter Wuille)
addb9b5a71 Improve comments in taproot signing logic (Pieter Wuille)

Pull request description:

  This addresses a few review comments from #21365 that were left at the time of merge (as well as some from #22166 applying to the commit it shared with #21365).

  I do not think any are blockers for a 22.0 release.

ACKs for top commit:
  theStack:
    re-ACK 08f57a0057 🌴
  Zero-1729:
    crACK 08f57a0
  jonatack:
    Code review ACK 08f57a0057 per `git range-diff e9d6eb1 9336670 08f57a0` followed by re-code review per commit to swap context back into memory and debug build/run unit tests + feature_taproot.py as a sanity check

Tree-SHA512: 968750109ba8d6faf3016035a38f81c6aefb724c632a3cab0bbf43cf31b9d187b6b0fddd8772768f57338df11eb07ab9c4c6dacdf3cf35b71f29699c67a301ea
2021-08-23 12:25:49 +08:00
fanquake
a93e7a4422
Merge bitcoin/bitcoin#22748: refactor: Avoid temporary vectors/uint256s in VerifyTaprootCommitment
2f0190320d Avoid temporary vectors/uint256s in VerifyTaprootCommitment (Pieter Wuille)

Pull request description:

  As XOnlyPubKey has a Span-based constructor, that can be used directly without needing to first convert the byte sequence into a vector, only to convert that to a uint256, which only then can then be passed as a span to the constructor.

  Reported by @ roconnor-blockstream.

ACKs for top commit:
  Zero-1729:
    crACK 2f0190320d
  theStack:
    re-ACK 2f0190320d
  jonatack:
    ACK 2f0190320d

Tree-SHA512: f5e809d693cf6f6e899278cd706548eb4341e73b3f7ca8926b5fb50afb2098077d691579aea84fd7db2a7edd76be8e400aa2ed886091ee3416651b8a36efba37
2021-08-23 11:40:18 +08:00
Martin Zumsande
4c69571e6e doc: remove outdated comment
No longer relevant because Boost 1.46 is no longer supported and
std::unordered_map is used instead of boost::unordered_map in CCoinsMap.
2021-08-22 17:32:43 +02:00
Martin Zumsande
16652a93ea refactor: Remove unused KeyIDHasher 2021-08-22 17:31:58 +02:00
Samuel Dobson
3755dea3c5
Merge bitcoin/bitcoin#22781: wallet: fix the behavior of IsHDEnabled, return false in case of a blank hd wallet.
8733a8e84c the result of CWallet::IsHDEnabled() was initialized with true. (Saibato)

Pull request description:

  the result of CWallet::IsHDEnabled() was initialized with true.

  But in case of no keys or a blank hd wallet the iterator would be skipped
  and not set to false but true, since the loop would be not entered.

  That had resulted in a wrong return and subsequent false HD and watch-only
  icon display in GUi when reloading a wallet after closing.

ACKs for top commit:
  achow101:
    ACK 8733a8e84c
  hebasto:
    ACK 8733a8e84c
  theStack:
    utACK 8733a8e84c
  meshcollider:
    utACK 8733a8e84c

Tree-SHA512: 79b976594f7174d05c29fe3819037ead59aaef27498d95415ceba74d633a8e035f6b03b521000ac3370684a8cb09319d8be1a443ce2d29b3ff4089e399f6b719
2021-08-22 13:18:44 +12:00
Saibato
8733a8e84c the result of CWallet::IsHDEnabled() was initialized with true.
But in case of no keys or a blank hd wallet the iterator would be skipped
and not set to false but true, since the loop would be not entered.

That had resulted in a wrong return and subsequent false HD and watch-only
icon display in gui when reloading a wallet after closing.

Update src/wallet/wallet.cpp

Co-authored-by: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com>
2021-08-24 05:10:33 -04:00
Pieter Wuille
75290ae61e Drop us=... message in net debug for sending version message
The us=... message in the debug log when sending a version message is
always [::]:0, because we no longer send our own address there.
Therefore, this information is entirely redundant. Remove it.
2021-08-21 19:16:47 -04:00
Pieter Wuille
5d47860334 refactor: move CAddress-without-nTime logic to net_processing
Historically, the VERSION message contains an "addrMe" and an "addrYou". As
these are sent before version negotiation is complete, the protocol version is
INIT_PROTO_VERSION (209), and in that protocol, CAddress is serialized without
nTime.

This is in fact the only situation left where a CAddress is (de)serialized
without nTime. As it's such a simple structure (CService for ip/port + uint64_t
for nServices), just inline that structure in the few places where it occurs,
and remove the logic for dealing with missing nTime from CAddress.
2021-08-21 19:16:47 -04:00
Hennadii Stepanov
2b3d8f3dde
qt: Handle new added plurals in bitcoin_en.ts
This step was missed. See translation_process.md
2021-08-22 00:03:31 +03:00
MarcoFalke
faa5fa9a78
fuzz: Use LIMITED_WHILE instead of limit_max_ops 2021-08-21 19:25:33 +02:00
MarcoFalke
f5a406f003
Merge bitcoin/bitcoin#22633: refactor: Replace remaining binascii method calls
021daedfa1 refactor: replace remaining binascii method calls (Zero-1729)

Pull request description:

  This PR removes the remaining `binascii` method calls outside `test/functional` and `test_framework`, as pointed out here  https://github.com/bitcoin/bitcoin/pull/22619#pullrequestreview-722153458.

  Follow-up to #22593 and #22619
  Closes #22605

ACKs for top commit:
  josibake:
    re-ACK 021daedfa1
  theStack:
    re-ACK 021daedfa1

Tree-SHA512: 2ae9fee8917112c91a5406f219ca70f24cd8902b903db5a61fc2de85ad640d669a772f5c05970be0fcee6ef1cdd32fae2ca5d1ec6dc9798b43352c8160ddde6f
2021-08-21 16:29:55 +02:00
Pieter Wuille
2f0190320d Avoid temporary vectors/uint256s in VerifyTaprootCommitment
As XOnlyPubKey has a Span-based constructor, that can be used directly
without needing to first convert the byte sequence into a vector, only
to convert that to a uint256, which only then can then be passed as a
span to the constructor.
2021-08-20 14:30:59 -04:00
Pieter Wuille
08f57a0057 Assert that IsComplete() in GetSpendData() 2021-08-20 14:29:23 -04:00
Pieter Wuille
d8f4b976d5 Remove default nHashTypeIn arguments to MutableTransactionSignatureCreator
These were unused except in tests, and were also overlooked when changing
SIGHASH_ALL -> SIGHASH_DEFAULT.
2021-08-20 14:29:23 -04:00
Pieter Wuille
c7048aae95 Simplify SignTransaction precomputation loop 2021-08-20 14:29:23 -04:00
Pieter Wuille
addb9b5a71 Improve comments in taproot signing logic 2021-08-20 14:29:23 -04:00
MarcoFalke
4fc15d1566
Merge bitcoin/bitcoin#22707: test: refactor use of getrawmempool in functional tests for efficiency
47c48b5f35 test: only use verbose for getrawmempool when necessary in functional tests (Michael Dietz)
77349713b1 test: use getmempoolentry instead of getrawmempool in functional tests when appropriate (Michael Dietz)
86dbd54ae8 test: improve mempool_updatefrom efficiency by using getmempoolentry for specific txns (Michael Dietz)

Pull request description:

  I don't think this changes the intention of the test. But it does shave ~30 seconds off the time it takes to run. From what I've seen our CI `macOS 11 native [gui] [no depends]` runs `mempool_updatefrom.py` in ~135 seconds. After this PR it should run in ~105 seconds

  I noticed this improvement should probably be made when testing performance/runtimes of https://github.com/bitcoin/bitcoin/pull/22698. But I wanted to separate this out from that PR so the affects of each is decoupled

  Edit: The major change in this PR is improving mempool_updatefrom.py's runtime as this is a very long running test. Then made the same efficiency improvements across all the functional tests as it made since to do that here

ACKs for top commit:
  theStack:
    Tested ACK 47c48b5f35

Tree-SHA512: 40f553715f3d4649dc18c2738554eafaca9ea800c4b028c099217896cc1c466ff457ae814d59cf8564c782a8964d8fac3eda60c1b6ffb08bbee1439b2d34434b
2021-08-20 17:39:17 +02:00
MarcoFalke
fa20f815a9
Remove txindex migration code 2021-08-20 16:59:41 +02:00
MarcoFalke
fae8786033
doc: Fix validation typo 2021-08-20 16:55:34 +02:00
MarcoFalke
fab89006d6
Add missing includes and forward declarations, remove unused ones 2021-08-20 16:55:27 +02:00
MarcoFalke
fa2547fc52
fuzz: Avoid timeout in blockfilter fuzz target 2021-08-20 15:45:15 +02:00
MarcoFalke
192a959b65
Merge bitcoin/bitcoin#22749: ci: Run arm task on arm64 hardware
fa35efa84b ci: Run arm task on arm64 hardware (MarcoFalke)

Pull request description:

  It will still run cross-compilation to armhf, but run the binaries on the hardware itself, not qemu.

  There shouldn't be any significant difference, other than maybe a slight speedup.

ACKs for top commit:
  hebasto:
    re-ACK fa35efa84b

Tree-SHA512: d03bb2b55d0a6b5021243eedff6e143f4fad03a1a8913000c2c5c74665e4bb1c77cb30aa112dbddbc0bb7c645bec18f6b8b8ba91049587b464bbe5ec07dd46bd
2021-08-20 11:21:15 +02:00
fanquake
ff1e633897
Merge bitcoin/bitcoin#22730: ci: Run fuzzer task for the master branch only
5a9e255e5a ci: Run fuzzer task for the master branch only (Hennadii Stepanov)

Pull request description:

  https://github.com/bitcoin/bitcoin/pull/22629#issuecomment-896454270:
  > I think we need to decide whether running the fuzzer CI in any branch other than master is something we want to be doing / maintaining. This seems pretty unsustainable unless we at least make changes in regards to the fuzz inputs being used by the different branches. I'm pretty sure Marco has mentioned this before.

  This PR makes CI ignore fuzz tests by forcing `RUN_FUZZ_TESTS=false` for all cases when it is not the master branch or a PR based on it.

  See #22731 as a demo for the 22.x branch.

ACKs for top commit:
  MarcoFalke:
    cr ACK 5a9e255e5a no opinion on the concept, also didn't test
  fanquake:
    ACK 5a9e255e5a - didn't test other than to look at #22731.

Tree-SHA512: 48f8f02f1814d4f15293a8804b76d544a08784ea7acd930b5c6d4608564d30aa5a608b1a511386ffda6975feec700c1bbeb86a30a75a7e48a1c5b167a227dbdd
2021-08-20 15:17:01 +08:00
fanquake
d3169349a9
Merge bitcoin/bitcoin#22654: guix: Don't include directory name in SHA256SUMS
132cae44f2 doc: Mention the flat directory structure for uploads (Andrew Chow)
fb17c99e35 guix: Don't include directory name in SHA256SUMS (Andrew Chow)

Pull request description:

  The SHA256SUMS file can be used in a sha256sum -c command to verify downloaded binaries. However users are likely to download just a single file and not place this file in the correct directory relative to the SHA256SUMS file for the simple verification command to work. By not including the directory name in the SHA256SUMS file, it will be easier for users to verify downloaded binaries.

ACKs for top commit:
  Zero-1729:
    re-ACK 132cae44f2
  fanquake:
    ACK 132cae44f2

Tree-SHA512: c9ff416b8dfb2f3ceaf4d63afb84aac9fcaefbbf9092f9e095061b472884ec92c7a809e6530c7132a82cfe3ab115a7328e47994a412072e1d4feb26fc502c8c5
2021-08-20 15:10:26 +08:00
fanquake
602c8eb8f0
Merge bitcoin/bitcoin#22697: addrman: Remove CAddrMan::Clear() function
4d2fa97031 [addrman] Clean up ctor (John Newbery)
7e6e65918f [addrman] inline Clear() into CAddrMan ctor (John Newbery)
406be5ff96 [addrman] Remove all public uses of CAddrMan.Clear() from the tests (John Newbery)
ed9ba8af08 [tests] Remove CAddrMan.Clear() call from CAddrDB::Read() (John Newbery)
e8e7392311 [addrman] Don't call Clear() if parsing peers.dat fails (John Newbery)
181a1207ba [addrman] Move peers.dat parsing to init.cpp (John Newbery)

Pull request description:

  `CAddrMan::Clear()` exists to reset the internal state of `CAddrMan`. It's currently used in two places:

  - on startup, if deserializing peers.dat fails, `Clear()` is called to reset to an empty addrman
  - in tests, `Clear()` is called to reset the addrman for more tests

  In both cases, we can simply destruct the `CAddrMan` and construct a new, empty addrman. That approach is safer - it's possible that `Clear()` could 'reset' the addrman to a state that's not equivalent to a freshly constructed addrman (one actual example of this is that `Clear()` does not clear the `m_tried_collisions` set). On the other hand, if we destruct and then construct a fresh addrman, we're guaranteed that the new object is empty.

  This wasn't possible when addrman was initially implemented, since it was a global, and so it would only be destructed on shutdown. However, addrman is now owned by `node.context`, so we have control over its destruction/construction.

ACKs for top commit:
  laanwj:
    Code review ACK 4d2fa97031
  vasild:
    ACK 4d2fa97031
  Zero-1729:
    crACK 4d2fa97031

Tree-SHA512: f715bf2cbff4f8c3a9dbc613f8c7f11846b065d6807faf3c7d346a0b0b29cbe7ce1dc0509465c2c9b88a8ad55299c9182ea53f5f743e47502a69a0f375e09408
2021-08-20 14:33:25 +08:00