Commit Graph

23626 Commits

Author SHA1 Message Date
Wladimir J. van der Laan
a4bc4c1f79 doc: Update manual pages pre-rc1
Tree-SHA512: 88384fc1e1be9f2bcdbe725dae5306aa74427f63d0dc54d177b0008fde74bd3284a1073d446c04d54c491e970607b14fbd58592296575e99ba328c50b7cf55dc
v0.20.2rc1
2020-12-10 21:00:55 +01:00
Wladimir J. van der Laan
98c9d79d2b gui: Pre-rc1 translations update
Tree-SHA512: 3a262c501cdfe9bda7f33045c6d16fb4d3aa46c11ebfd6664302460413c2333ea39fb201fbd7b9edaddb76f92138a3e026ec2f0a9ba40eabff45ae451d5c6af3
2020-12-10 20:55:24 +01:00
Wladimir J. van der Laan
2808593b7c build: Bump version to 0.20.2rc1
Tree-SHA512: 05bd998383127dae969dbb811aa6170fe07a5f92af3b13dc6d7c135461aa93697e5e4a5a5fc98d4c0f848fdc0ed8317c3624e2a0a54c0ea18d25d5a585efc6ec
2020-12-10 20:26:35 +01:00
MarcoFalke
953dddbd20 Merge #19740: [0.20] wallet: Simplify and fix CWallet::SignTransaction
6a326cf66f tests: Test that a fully signed tx given to signrawtx is unchanged (Andrew Chow)
2d48d7dcfb Simplify and fix CWallet::SignTransaction (Andrew Chow)

Pull request description:

  Backport `CWallet::SignTransaction` from master which is simpler and not broken.

  Previously `CWallet::SignTransaction` would return false for a fully signed transaction. This is a regression and obviously incorrect - a fully signed transaction is always complete. This occurs because `CWallet::SignTransaction` would iterate through each input and skip any further checks if the input was already signed. It would then end up falling through to the `return false` catch-all thus erroneously saying a fully signed transaction is incomplete. The change to attempting to use all `ScriptPubKeyMan`s fixes this problem since the `LegacyScriptPubKeyMan` (the only spkm implemented in 0.20) will verify inputs during its signing attempt and correctly return that it is complete when the inputs verify. Thus a fully signed transaction will be correctly identified as complete, `LegacyScriptPubKeyMan::SignTranaction` will return true, and so `CWallet::Transaction` will return true too.

  Note that this is not a backport of any specific commit. Rather it is the end result of the changes we have made to this function in master.

  Fixes #19737

ACKs for top commit:
  fjahr:
    Code review ACK 6a326cf66f
  MarcoFalke:
    re-ACK 6a326cf66f 👓

Tree-SHA512: 7b8e04cfc264de01a2de08a99477c1a110fa0965dcbd4305bf4632a165f28b090746789195f5cb584eb6d85e27d4801a09d2dad28e508d7898c7c088e771812b
2020-12-10 20:06:35 +01:00
Andrew Chow
6a326cf66f tests: Test that a fully signed tx given to signrawtx is unchanged
Tests that a fully signed transaction given to
signrawtransactionwithwallet is both unchanged and marked as complete.
This tests for a regression in 0.20 where the transaction would not be
marked as complete.

Github-Pull: #20562
Rebased-From: 773c42b265
2020-12-05 13:50:30 -05:00
MarcoFalke
75bf23d861 Merge #20399: Revert "Merge #19606: Backport wtxid relay to v0.20"
fa074d2c7b Revert "Merge #19606: Backport wtxid relay to v0.20" (MarcoFalke)

Pull request description:

  The 0.20 branch has bugfixes that should be released. However, a tag can currently not be created because the latest merge introduced a regression and is not a bugfix (https://github.com/bitcoin/bitcoin/pull/20317#issuecomment-723754509, https://github.com/bitcoin/bitcoin/pull/20317#issuecomment-727624755).

  Fix that by reverting the last merge. Can be reviewed by re-doing the revert or calling `git diff HEAD HEAD~2 | wc` and observing an empty diff.

ACKs for top commit:
  laanwj:
    Code review ACK fa074d2c7b

Tree-SHA512: 1a1314b9bb85f44696dc307845e80292998d6c9c000e7386c48405e74400d9cd22be6996e555f198da917e04024a1c8e609dfd830759a27fe4070168b0d272bb
2020-11-23 15:53:06 +01:00
MarcoFalke
a2fa11f9de Merge #20166: [0.20] Backports
7566af419f doc: Update data directory path comments (Hennadii Stepanov)
09261de6ed util: Add StripRedundantLastElementsOfPath function (Hennadii Stepanov)
8ef0dace86 macOS deploy: use the new plistlib API (Jonas Schnelli)
314e79581f build: fix mutex detection when building bdb on macOS (fanquake)
1f67a30e83 random: fixes read buffer resizing in RandAddSeedPerfmon (Ethan Heilman)
6113b547f4 net: Send post-verack handshake messages at most once (MarcoFalke)
bdf15d0d5d rpc: Adjust witness-tx deserialize error message (MarcoFalke)
731502a183 rpc: Properly deserialize txs with witness before signing (MarcoFalke)
ee0082b886 Avoid the use of abs64 in timedata (Pieter Wuille)
05bd0c220a docs: Correct description for getblockstats's txs field (Nadav Ivgi)

Pull request description:

  Backports the following PRs to the 0.20 branch:
  * https://github.com/bitcoin/bitcoin/pull/19777 - docs: Correct description for getblockstats's txs field
  * https://github.com/bitcoin/bitcoin/pull/19836 - rpc: Properly deserialize txs with witness before signing
  * https://github.com/bitcoin/bitcoin/pull/20080 - Strip any trailing `/` in -datadir and -blocksdir paths
  * https://github.com/bitcoin/bitcoin/pull/20082 - [bugfix] random: fixes read buffer to use min rather than max
  * https://github.com/bitcoin/bitcoin/pull/20141 - Avoid the use of abs64 in timedata
  * https://github.com/bitcoin/bitcoin/pull/20146 - net: Send post-verack handshake messages at most once
  * https://github.com/bitcoin/bitcoin/pull/20195 - build: fix mutex detection when building bdb on macOS
  * https://github.com/bitcoin/bitcoin/pull/20298 - macOS deploy: use the new plistlib API

  Will add additional commits as they become available.

ACKs for top commit:
  MarcoFalke:
    review ACK 7566af419f 🗡

Tree-SHA512: add6bb978313c12c3e07bc232636ae9d1ab0edd0b816705c5c70eeb1cc04097165fd5e29d60c706886943ceb1f749a422020766b4aa2d23be51e9f839157a4bb
2020-11-18 10:03:04 +01:00
MarcoFalke
fa074d2c7b Revert "Merge #19606: Backport wtxid relay to v0.20"
This reverts commit a339289c2e, reversing
changes made to b9ac31f2d2.
2020-11-16 07:50:27 +01:00
Hennadii Stepanov
7566af419f doc: Update data directory path comments
Github-Pull: #20080
Rebased-From: ad5cef5dfd
2020-11-06 15:47:47 +08:00
Hennadii Stepanov
09261de6ed util: Add StripRedundantLastElementsOfPath function
Co-authored-by: saibato <saibato.naga@pm.me>
Co-authored-by: MarcoFalke <falke.marco@gmail.com>

Github-Pull: 20080
Rebased-From: b19e88230f
2020-11-06 15:45:09 +08:00
Jonas Schnelli
8ef0dace86 macOS deploy: use the new plistlib API
See https://docs.python.org/3/library/plistlib.html.
The new API was added in 3.4 and old removed in 3.9.

Github-Pull: 20298
Rebased-From: 04a69c200e
2020-11-06 15:39:50 +08:00
Wladimir J. van der Laan
a339289c2e Merge #19606: Backport wtxid relay to v0.20
d4a1ee8f1d Further improve comments around recentRejects (Suhas Daftuar)
f082a13ab7 Disconnect peers sending wtxidrelay message after VERACK (Suhas Daftuar)
22effa51a7 test: Use wtxid relay generally in functional tests (Fabian Jahr)
e481681963 test: Add tests for wtxid tx relay in segwit test (Fabian Jahr)
6be398b6fb test: Update test framework p2p protocol version to 70016 (Fabian Jahr)
e364b2a2d8 Rename AddInventoryKnown() to AddKnownTx() (Suhas Daftuar)
879a3cf2c2 Make TX_WITNESS_STRIPPED its own rejection reason (Suhas Daftuar)
c1d6a1003d Delay getdata requests from peers using txid-based relay (Suhas Daftuar)
181ffadd16 Add p2p message "wtxidrelay" (Suhas Daftuar)
93826726e7 ignore non-wtxidrelay compliant invs (Anthony Towns)
2599277e9c Add support for tx-relay via wtxid (Suhas Daftuar)
be1b7a8916 Add wtxids to recentRejects (Suhas Daftuar)
73845211d1 Add wtxids of confirmed transactions to bloom filter (Suhas Daftuar)
606755b840 Add wtxid-index to orphan map (Suhas Daftuar)
3654937674 Add a wtxid-index to mapRelay (Suhas Daftuar)
f7833b5bd8 Just pass a hash to AddInventoryKnown (Suhas Daftuar)
4df3d139b7 Add a wtxid-index to the mempool (Suhas Daftuar)

Pull request description:

  We want wtxid relay to be widely deployed before taproot activation, so it should be backported to v0.20.

  The main difference from #18044 is removing the changes to the unbroadcast set (which was only added post-v0.20). The rest is mostly minor rebase conflicts (eg connman changed from a pointer to a reference in master, etc).

  We'll also want to backport #19569 after that's merged.

ACKs for top commit:
  fjahr:
    re-ACK d4a1ee8f1d
  instagibbs:
    reACK d4a1ee8f1d
  laanwj:
    re-ACK d4a1ee8f1d
  hebasto:
    re-ACK d4a1ee8f1d, only rebased since my [previous](https://github.com/bitcoin/bitcoin/pull/19606#pullrequestreview-492763028) review:

Tree-SHA512: 1bb8725dd2313a9a03cacf8fb7317986eed3d8d1648fa627528441256c37c793bb0fae6c8c139d05ac45d0c7a86265792834e8e09cbf45286426ca6544c10cd5
2020-11-05 15:10:27 +01:00
fanquake
314e79581f build: fix mutex detection when building bdb on macOS
Starting with the Clang shipped with Xcode 12, Apple has enabled
-Werror=implicit-function-declaration by default. This causes bdbs mutex
detection to fail when building on macOS (not cross-compiling):

checking for mutexes... UNIX/fcntl
configure: WARNING: NO SHARED LATCH IMPLEMENTATION FOUND FOR THIS PLATFORM.
configure: error: Unable to find a mutex implementation

as previously emitted warnings are being turned into errors. i.e:

error: implicitly declaring library function 'exit' with type 'void (int) __attribute__((noreturn))' [-Werror,-Wimplicit-function-declaration]

Append -Wno-error=implicit-function-declaration to cflags so that
-Wimplicit-function-declaration returns to being a warning, and the
configure checks will succeed.

Fixes #19411.

Github-Pull: #20195
Rebased-From: d0a829e963
2020-10-30 08:08:01 +08:00
Ethan Heilman
1f67a30e83 random: fixes read buffer resizing in RandAddSeedPerfmon
+ Replaces std::max with std::min to resize buffer in RandAddSeedPerfmon
+ Documents behavior of RandAddSeedPerfmon

Github-Pull: #20082
Rebased-From: bd5215103e
2020-10-23 08:50:19 +08:00
MarcoFalke
6113b547f4 net: Send post-verack handshake messages at most once
Github-Pull: #20146
Rebased-From: fa1f6f237d
2020-10-19 10:59:49 +08:00
MarcoFalke
bdf15d0d5d rpc: Adjust witness-tx deserialize error message
Github-Pull: #19836
Rebased-From: 3333077823
2020-10-16 12:09:17 +08:00
MarcoFalke
731502a183 rpc: Properly deserialize txs with witness before signing
Github-Pull: #19836
Rebased-From: cccc752569
2020-10-16 12:06:53 +08:00
Pieter Wuille
ee0082b886 Avoid the use of abs64 in timedata
Github-Pull: #20141
Rebased-From: d1292f25f2
2020-10-16 11:42:27 +08:00
Nadav Ivgi
05bd0c220a docs: Correct description for getblockstats's txs field
It does count the coinbase transaction.

Refs #19766

Github-Pull: #19777
Rebased-From: 4148f55dd0
2020-10-16 11:35:47 +08:00
MarcoFalke
b9ac31f2d2 Merge #20142: [0.20] build: set minimum required Boost to 1.48.0
3562c15be3 build: set minimum required Boost to 1.48.0 (fanquake)

Pull request description:

  Due to the use of [`boost::filesystem::canonical()`](80aa83aa40/src/wallet/load.cpp (L21)), the minimum required
  version of Boost is actually 1.48.0. Use of canonical was introduced
  in #14146.

  See also [Boost filesystem 1.48.0 release notes](6b5e38134a/doc/release_history.html (L508)). Also discussed in #20080.

ACKs for top commit:
  practicalswift:
    ACK 3562c15be3: correct is better than incorrect :)
  hebasto:
    ACK 3562c15be3, this is the status quo.

Tree-SHA512: 1d2226c60accb8e2276e023120a72f070392a6c1d3db97fb23e7759c174984226f81fed6d94f3203ef663fb4b3648e65960aaf15ed718895b6673e3ebeb082bd
2020-10-13 17:42:37 +02:00
fanquake
3562c15be3 build: set minimum required Boost to 1.48.0
Due to the use of boost::filesystem::canonical(), the minimum required
version of Boost is actually 1.48.0. Use of canonical was introduced
in #14146.

See also Boost filesystem 1.48.0 release notes:
6b5e38134a/doc/release_history.html (L508)
2020-10-13 12:22:02 +08:00
Suhas Daftuar
d4a1ee8f1d Further improve comments around recentRejects 2020-09-24 13:24:10 +01:00
Suhas Daftuar
f082a13ab7 Disconnect peers sending wtxidrelay message after VERACK 2020-09-24 13:24:10 +01:00
Fabian Jahr
22effa51a7 test: Use wtxid relay generally in functional tests 2020-09-24 13:24:10 +01:00
Fabian Jahr
e481681963 test: Add tests for wtxid tx relay in segwit test
Also cleans up some doublicate lines in the rest of the test.

co-authored-by: Anthony Towns <aj@erisian.com.au>
2020-09-24 13:24:10 +01:00
Fabian Jahr
6be398b6fb test: Update test framework p2p protocol version to 70016
This new p2p protocol version allows to use WTXIDs for tx relay.
2020-09-24 13:24:10 +01:00
Suhas Daftuar
e364b2a2d8 Rename AddInventoryKnown() to AddKnownTx() 2020-09-24 13:24:10 +01:00
Suhas Daftuar
879a3cf2c2 Make TX_WITNESS_STRIPPED its own rejection reason
Previously, TX_WITNESS_MUTATED could be returned during transaction validation
for either transactions that had a witness that was non-standard, or for
transactions that had no witness but were invalid due to segwit validation
rules.

However, for txid/wtxid-relay considerations, net_processing distinguishes the
witness stripped case separately, because it affects whether a wtxid should be
able to be added to the reject filter. It is safe to add the wtxid of a
witness-mutated transaction to the filter (as that wtxid shouldn't collide with
the txid, and hence it wouldn't interfere with transaction relay from
txid-relay peers), but it is not safe to add the wtxid (== txid) of a
witness-stripped transaction to the filter, because that would interfere with
relay of another transaction with the same txid (but different wtxid) when
relaying from txid-relay peers.

Also updates the comment explaining this logic, and explaining that we can get
rid of this complexity once there's a sufficient deployment of wtxid-relaying
peers on the network.
2020-09-24 13:24:10 +01:00
Suhas Daftuar
c1d6a1003d Delay getdata requests from peers using txid-based relay
Using both txid and wtxid-based relay with peers means that we could sometimes
download the same transaction twice, if announced via two different hashes from
different peers.

Use a heuristic of delaying txid-peer-getdata requests by 2 seconds, if we have
at least one wtxid-based peer.
2020-09-24 13:24:10 +01:00
Suhas Daftuar
181ffadd16 Add p2p message "wtxidrelay"
When sent to and received from a given peer, enables using wtxid's for
announcing and fetching transactions with that peer.
2020-09-24 13:24:10 +01:00
Anthony Towns
93826726e7 ignore non-wtxidrelay compliant invs 2020-09-24 13:24:10 +01:00
Suhas Daftuar
2599277e9c Add support for tx-relay via wtxid
This adds a field to CNodeState that tracks whether to relay transactions with
that peer via wtxid, instead of txid. As of this commit the field will always
be false, but in a later commit we will add a way to negotiate turning this on
via p2p messages exchanged with the peer.
2020-09-24 13:24:10 +01:00
Suhas Daftuar
be1b7a8916 Add wtxids to recentRejects
Previously, we only added txids to recentRejects if we were sure that the
transaction couldn't have had the wrong witness (either because the witness was
malleated or stripped).

In preparation for wtxid-based relay, we can observe that txid == wtxid for
transactions that have no witness, and add the wtxid of rejected transactions,
provided the transaction wasn't a witness-stripped one. This means that we now
add more data to the filter (as prior to this commit, any transaction with a
witness that failed to be accepted was being skipped for inclusion in the
filter) but witness malleation should still not interfere with relay of a valid
segwit transaction, because the txid of a segwit transaction would not be added
to the filter after failing validation.

In the future, having wtxids in the recent rejects filter will allow us to
skip downloading the same wtxid multiple times, once our peers use wtxids for
transaction relay.

Also add the txid to recentRejects if the transaction failed for
TX_INPUTS_NOT_STANDARD.
2020-09-24 13:24:10 +01:00
Suhas Daftuar
73845211d1 Add wtxids of confirmed transactions to bloom filter
This is in preparation for wtxid-based invs (we need to be able to tell whether
we AlreadyHave() a transaction based on either txid or wtxid).

This also double the size of the bloom filter, which is overkill, but still
uses a manageable amount of memory.
2020-09-24 13:24:10 +01:00
Suhas Daftuar
606755b840 Add wtxid-index to orphan map 2020-09-24 13:24:10 +01:00
Suhas Daftuar
3654937674 Add a wtxid-index to mapRelay 2020-09-24 13:24:10 +01:00
Suhas Daftuar
f7833b5bd8 Just pass a hash to AddInventoryKnown
Since it's only used for transactions, there's no need to pass in an inv type.
2020-09-24 13:24:10 +01:00
Suhas Daftuar
4df3d139b7 Add a wtxid-index to the mempool 2020-09-24 13:24:10 +01:00
Wladimir J. van der Laan
80aa83aa40 Merge #20008: [Backport] #19839 and #19842 to v0.20
498b7cb6f3 Update the vcpkg checkout commit ID in appveyor config. (Aaron Clauson)
ad99777b57 Set appveyor vm version to previous Visual Studio 2019 release. (Aaron Clauson)

Pull request description:

  Required for appveyor builds to succeed for other v0.20 backports. For example #19606 fails to build on appveyor without these commits, and succeeds with them.

  The first commit is actually reversed by the second commit (which also changes `VCPKG_COMMIT_ID`), but I'm backporting them both so that they're clean cherrypicks.

ACKs for top commit:
  laanwj:
    ACK 498b7cb6f3

Tree-SHA512: 723a834fd86c8b5f58e71b9f1abfa8b3ad67376fab8e7d3699330142a6fde98547209b2b5fa6fdf9b934a447b29bf866e2258d0c303cec1062401e924e83f297
2020-09-24 14:07:47 +02:00
Aaron Clauson
498b7cb6f3 Update the vcpkg checkout commit ID in appveyor config. 2020-09-24 09:34:33 +01:00
Aaron Clauson
ad99777b57 Set appveyor vm version to previous Visual Studio 2019 release.
Latest vm version has updated cmake and the berkeleydb vcpkg now fails to build.
2020-09-24 09:34:33 +01:00
fanquake
30926997fa Merge #19680: 0.20: Add txids with non-standard inputs to reject filter
107cf1515e test addition of unknown segwit spends to txid reject filter (Gregory Sanders)
06f9c5c3be Add txids with non-standard inputs to reject filter (Suhas Daftuar)

Pull request description:

  Backport of #19620 to 0.20.

ACKs for top commit:
  instagibbs:
    utACK 107cf1515e
  fjahr:
    utACK 107cf1515e
  jnewbery:
    utACK 107cf1515e

Tree-SHA512: d89c75fefdb6b50f40adfcf3cfdb2a791122e4d6a5903cb553c664042963577beb97a73319f9d1cb8320d32846778233c95255812c37fb4c7b1b25da161a6595
2020-09-04 20:11:47 +08:00
Andrew Chow
2d48d7dcfb Simplify and fix CWallet::SignTransaction
Backport CWallet::SignTransaction from master which is simpler and not
broken.
2020-08-16 21:37:27 -04:00
Gregory Sanders
107cf1515e test addition of unknown segwit spends to txid reject filter
Github-Pull: #19620
Rebased-From: 9f88ded82b
2020-08-07 12:45:03 -04:00
Suhas Daftuar
06f9c5c3be Add txids with non-standard inputs to reject filter
Our policy checks for non-standard inputs depend only on the non-witness
portion of a transaction: we look up the scriptPubKey of the input being
spent from our UTXO set (which is covered by the input txid), and the p2sh
checks only rely on the scriptSig portion of the input.

Consequently it's safe to add txids of transactions that fail these checks to
the reject filter, as the witness is irrelevant to the failure. This is helpful
for any situation where we might request the transaction again via txid (either
from txid-relay peers, or if we might fetch the transaction via txid due to
parent-fetching of orphans).

Further, in preparation for future witness versions being deployed on the
network, ensure that WITNESS_UNKNOWN transactions are rejected in
AreInputsStandard(), so that transactions spending v1 (or greater) witness
outputs will fall into this category of having their txid added to the reject
filter.

Github-Pull: #19620
Rebased-From: 7989901c7e
2020-08-07 12:44:24 -04:00
Wladimir J. van der Laan
bf0dc356ac Merge #19636: doc: Update 0.20.1 release notes with psbt changes
7c1c15329e doc: Update 0.20.1 release notes with psbt changes (Andrew Chow)

Pull request description:

  #19215 was missing from the list. Also felt it was important to mention this change.

Top commit has no ACKs.

Tree-SHA512: b795cf73954ff493747a793039918a5e19c377d9325e6156a8e23ba8f510af12f48b2d63854f57d482640531a865190f1fe1ece0c78a5e45d6926f9533c6d695
2020-08-01 14:15:21 +02:00
Andrew Chow
7c1c15329e doc: Update 0.20.1 release notes with psbt changes 2020-07-31 18:03:24 -04:00
Wladimir J. van der Laan
7ff64311be build: Bump version to 0.20.1-final
Tree-SHA512: 7edd91cdb03cf55201987775e5d14bfa61e3eff54abd04eaf249889e5216b12ad722188e12bb51eabb81bcd66014fd349484533744dc777e7af68a78fbc7f51b
v0.20.1
2020-07-31 14:02:21 +02:00
MarcoFalke
6acb21e724 Merge #19612: [0.20] lint: fix shellcheck URL in CI install
7ee4769cd4 [0.20] lint: fix shellcheck URL in CI install (fanquake)

Pull request description:

  This is causing the tests to fail for backports i.e #19606. If you look in the Travis logs there, the output is:
  ```bash
  You are downloading ShellCheck from an outdated URL!
  Please update to the new URL:
  https://github.com/koalaman/shellcheck/releases/download/v0.6.0/shellcheck-v0.6.0.linux.x86_64.tar.xz
  For more information, see:
  https://github.com/koalaman/shellcheck/issues/1871
  PS: Sorry for breaking your build. The hosting costs were getting out of hand :(
  ```

ACKs for top commit:
  MarcoFalke:
    review ACK 7ee4769cd4

Tree-SHA512: 62470291e53954ab541a7109e530390410d9b8a4d3ed6f4128ab8807d2225f368b8c984342f92de802a60dd082292cb59557599b4112413a29fc9ad8e8bcd0ee
2020-07-28 14:21:44 +02:00
fanquake
7ee4769cd4 [0.20] lint: fix shellcheck URL in CI install
This is causing the tests to fail for backports etc.
2020-07-28 20:13:06 +08:00