Commit Graph

28021 Commits

Author SHA1 Message Date
fanquake
06cd0da21f
build: qt 5.12.10
remove fix_configure_mac.patch
Fixed upstream: https://bugreports.qt.io/browse/QTBUG-67286

remove fix_riscv64_arch.patch
Was fixed upstream in 6a39e49a6cdeb28a04a3657bb6a22f848d5dfa9d

remove fix_rcc_determinism.patch
Fixed upstream in https://bugreports.qt.io/browse/QTBUG-62511

remove freetype_back_compat.patch
By the time we ship a release with Qt 5.12, we'll certainly no-longer be
supporting Ubuntu 14.04 and Ubuntu 16.04 ships with FreeType 2.6.1,
which is new enough that using the symbol is no-longer an issue.
The renaming of FT_Get_X11_Font_Format() happened in FreeType 2.6

remove xkb-default.patch
This was removed upstream in d5abf545971da717014d316127045fc19edbcd65

Co-authored-by: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com>
2021-03-10 12:57:22 +08:00
Hennadii Stepanov
3272e34f9c
build: Add xkbcommon 0.8.4
Co-authored-by: fanquake <fanquake@gmail.com>
2021-03-10 08:23:47 +08:00
fanquake
d769b3372d
build: only pass -optimized-tools to qt in debug mode
Qt's configure tells us that "-optimized-tools is not useful in -release
mode.", so don't use it there.
2021-03-10 08:04:04 +08:00
fanquake
bca5ee6f38
Merge #21400: build: Fix regression introduced in #21363
ffdd7de690 build, qt: Fix regression introduced in #21363 (Hennadii Stepanov)

Pull request description:

  After #21363 the `_BITCOIN_QT_CHECK_STATIC_PLUGIN` never fails due to the ill-formed code.

  Sorry for breaking it.

ACKs for top commit:
  fanquake:
    ACK ffdd7de690

Tree-SHA512: 0af3334af5332f3b349dba219565ee336090541c2c4fae53d7dc4dd2aa05291b3c7c13bfc506219f642fb854f3c887f0f9621b42d0df68d5d794e0563b2cf5d4
2021-03-10 08:03:32 +08:00
Hennadii Stepanov
ffdd7de690
build, qt: Fix regression introduced in #21363
Due to the ill-formed code _BITCOIN_QT_CHECK_STATIC_PLUGIN never fails.
2021-03-09 23:31:47 +02:00
MarcoFalke
ee0dc02c6f
Merge #21397: fuzz: Bump FuzzedDataProvider.h
fa7dc7ae95 fuzz: Bump FuzzedDataProvider.h (MarcoFalke)

Pull request description:

  Fixes #21309

ACKs for top commit:
  practicalswift:
    cr ACK fa7dc7ae95

Tree-SHA512: 7805a943ab173d8f3f1e7e55d76a1cc60f63abf9fbf4d537bfeeb0dcf84ecdfb0417d789bd3f3a0c1603fea38884abb643b4b26c27b262e617e6c9a82894f42e
2021-03-09 13:53:36 +01:00
MarcoFalke
fa7dc7ae95
fuzz: Bump FuzzedDataProvider.h
Latest version from 0cccccf0d2/compiler-rt/include/fuzzer/FuzzedDataProvider.h
2021-03-09 12:56:44 +01:00
fanquake
e175ca9c65
Merge #21370: Use C++11 member initializer in CNodeState
fa476f188e Use C++11 member initializer in CNodeState (MarcoFalke)

Pull request description:

  This removes a bunch of boilerplate, makes the code easier to read. Also, C++11 member initialization avoids accidental uninitialized members.

ACKs for top commit:
  practicalswift:
    cr ACK fa476f188e
  hebasto:
    cr ACK fa476f188e
  jnewbery:
    utACK fa476f188e

Tree-SHA512: 5c876717d30ded975e29bfbc77804012179588a13f950f0b2ec93fa9dbd5cf6b52fe86414fd5d1cce021db2ec77e271d533b0f7a8d6eeaac0feb9e6dbaec9ff2
2021-03-09 17:42:53 +08:00
fanquake
461f0c781e
Merge #21382: build: Clean remnants of QTBUG-34748 fix
173ef8980d build: Small libxcb.mk improvements (Hennadii Stepanov)
5129b36573 build: Clean remnants of QTBUG-34748 fix (Hennadii Stepanov)

Pull request description:

  Hope, this PR will make [transit](https://github.com/bitcoin/bitcoin/pull/21376) to Qt 5.12.10 neater.

  A fix for [QTBUG-34748](https://bugreports.qt.io/browse/QTBUG-34748) was introduced in #5915 (v0.11.0, Qt 5.2.1).

  [QTBUG-34748](https://bugreports.qt.io/browse/QTBUG-34748) was [fixed](b19b080894) in Qt 5.3.0.

  The separated [`fix-xcb-include-order.patch`](bb44d9e754/depends/patches/qt/fix-xcb-include-order.patch), provided by #5915, was dropped in #12971 while bumping Qt to 5.9.4 (5.9.6). But `libxcb.mk` remained unchanged.

  This PR reverts #5915 for `libxcb.mk` as well.

ACKs for top commit:
  practicalswift:
    cr ACK 173ef8980d: patch looks correct
  fanquake:
    ACK 173ef8980d

Tree-SHA512: 9815a7e532ff4aa08f9623ded8d5708eca1c9c73ac7a2684419a18c125da7627b44ac3191f2e7978946942c8d0580e73b1a93df624986fb2a13791a68ce1e025
2021-03-09 15:46:57 +08:00
fanquake
738fc4a595
Merge #21363: build, qt: Improve Qt static plugins/libs check code
32b8dc648f build, refactor: Fix indentation (Hennadii Stepanov)
57b65225dc build, qt: Make Qt static libs check regardless of plugindir (Hennadii Stepanov)
6203457915 build, refactor: Rename internal _BITCOIN_QT_FIND_STATIC_PLUGINS macro (Hennadii Stepanov)
bf2477402d build, qt: Refactor internal _BITCOIN_QT_CHECK_STATIC_PLUGINS macro (Hennadii Stepanov)

Pull request description:

  Qt version bump is around the corner (#21376).

  As a preparation, this PR makes Qt static plugins/libs check code more correct, and easier to reason about.

  `configure` script log (for `HOST=x86_64-pc-linux-gnu`):
  - master (b4d22654fe):
  ```
  checking for static Qt plugins: -lqminimal... yes
  checking for static Qt plugins: -lqxcb -lxcb-static... yes
  ```

  - this PR:
  ```
  checking for QMinimalIntegrationPlugin (-lqminimal)... yes
  checking for QXcbIntegrationPlugin (-lqxcb -lxcb-static)... yes
  ```

ACKs for top commit:
  fanquake:
    ACK 32b8dc648f

Tree-SHA512: a9ed8178cdbe3586898adc145b474355804ca00c5cee85dcdb8fb33a16575fc469298ef532c973d3aae53e1cb49569a9232595d609f232fae2bf05862fb34781
2021-03-09 15:34:19 +08:00
MarcoFalke
6c156e49cb
Merge #18842: wallet: Mark replaced tx to not be in the mempool anymore
fa4e088cba wallet: Mark replaced tx to not be in the mempool anymore (MarcoFalke)

Pull request description:

  The wallet does not mark the replaced tx as out-of-mempool. This causes failures in user scripts, because later RPCs may depend on this state change from `bumpfee`.

  For example, the following might fail on current master:

  ```
  txid = sendtoaddress(...)
  bumpfee(txid)
  abandontransaction(txid)  # fails because txid is still marked as "in mempool"
  ```

  Fixes #18831

ACKs for top commit:
  meshcollider:
    utACK fa4e088cba
  ryanofsky:
    Code review ACK fa4e088cba, and previous ACK faeedff5c87091fd83d2fb2b29eb49c948363f29 is also still valid in case there's a preference for the original fix

Tree-SHA512: 9858f40f5fb5a43a7b584b5c4268b6befa82e6a84583be5206fe721bcb6c255e8d35479d347d0b9aed72703df49887c02b14ab680e8efdd28b90dd6b93d9439a
2021-03-09 07:54:18 +01:00
Samuel Dobson
a8b0892b74
Merge #20536: wallet: Error with "Transaction too large" if the funded tx will end up being too large after signing
48a0319bab Add a test that selects too large if BnB is used (Andrew Chow)
3e69939b78 Fail if maximum weight is too large (Andrew Chow)
51e2cd322c Have CalculateMaximumSignedTxSize also compute tx weight (Andrew Chow)

Pull request description:

  Currently the `Transaction too large` is calculated on the transaction that is returned from `CreateTransaction`. This does not make sense for when `CreateTransaction` is being used for `fundrawtransaction` as no signing occurs so the final returned transaction is missing signatures. Thus users may successfully fund a transaction but fail to broadcast it after it has been fully signed.

  So instead we should figure out whether the transaction we are funding will be too large after it is signed. We can do this by having `CalculateMaximumSignedTxSize` also return the transaction weight and then comparing that weight against the maximum weight.

ACKs for top commit:
  instagibbs:
    ACK 48a0319bab
  meshcollider:
    utACK 48a0319bab
  Xekyo:
    utACK with nits 48a0319bab

Tree-SHA512: 1700c60b07f67e2d5c591c5ccd131ac9f1861fab3def961c3c9c4b3281ec1063fe8e4f0f7f1038cac72692340856406bcee8fb45c8104d2ad34357a0ec878ac7
2021-03-09 10:42:21 +13:00
MarcoFalke
2067f9e5e8
Merge bitcoin-core/gui#233: qt test: Don't bind to regtest port
e21276a82a qt test: Don't bind to regtest port (Andrew Chow)

Pull request description:

  The qt tests don't need to bind to the regtest port. By not binding, it will no longer conflict with existing regtest instances and the tests will run as normal.

  Fixes #10

ACKs for top commit:
  MarcoFalke:
    cr ACK e21276a82a
  jarolrod:
    re-ACK e21276a82a, tested on macOS 11.2

Tree-SHA512: 5a269ee043f9aff7900e092c166de71912a2bf86ebe2982b3fb0e26bdebfb91869ee5d0f62082fd608c1288bfb7981f6c8647e504b11176711d7fec993a09164
2021-03-08 19:52:25 +01:00
MarcoFalke
a22653a636
Merge #21371: fuzz: fix gcc Woverloaded-virtual build warnings
36aa2955b8 fuzz: fix gcc Woverloaded-virtual build warnings (Jon Atack)

Pull request description:

  Possible fixup to gcc build warnings since merge of b22d4c1607. Closes #21369.

ACKs for top commit:
  practicalswift:
    cr ACK 36aa2955b8: patch looks correct
  achow101:
    ACK 36aa2955b8
  kristapsk:
    ACK 36aa2955b8, this fixes compiler warnings for me with GCC 9.3.0.

Tree-SHA512: b6c99690ff72b809ce8105696744546252691b618f54311a9d930d9975fc692071ef408450f618fbb4aa99ee5390028a6eabbc968e22b2e8d2bd56bbafef49f8
2021-03-08 08:23:10 +01:00
MarcoFalke
e797388f8b
Merge #21384: doc: add signet to bitcoin.conf documentation
4a285107c1 doc: add signet to doc/bitcoin-conf.md (Jon Atack)
21b6a23373 doc: add signet to share/examples/bitcoin.conf (Jon Atack)

Pull request description:

ACKs for top commit:
  jarolrod:
    ACK 4a285107c1 🥃
  kristapsk:
    ACK 4a285107c1

Tree-SHA512: 2c2aa58ce5316cf986a1f3b7638b42d3939a482c38becb346d6aeab2887e57adf5c0e961de33f7721c89936881769e76b46504445428737ee810d21f4d9fb1a4
2021-03-08 08:15:11 +01:00
Jon Atack
4a285107c1
doc: add signet to doc/bitcoin-conf.md 2021-03-08 00:44:54 +01:00
Jon Atack
21b6a23373
doc: add signet to share/examples/bitcoin.conf 2021-03-08 00:22:57 +01:00
Hennadii Stepanov
173ef8980d
build: Small libxcb.mk improvements 2021-03-07 23:17:28 +02:00
Hennadii Stepanov
5129b36573
build: Clean remnants of QTBUG-34748 fix
A fix for QTBUG-34748 was introduced in #5915 (v0.11.0, Qt 5.2.1).
QTBUG-34748 was fixed in version 5.3.0.
The separated patch file, provided by #5915, was dropped in #12971 while
bumping Qt to 5.9.4 (5.9.6). But libxcb.mk remained unchanged.

This change reverts #5915 for libxcb.mk.
2021-03-07 23:03:38 +02:00
MarcoFalke
1a4a9305c2
Merge bitcoin-core/gui#221: qt, refactor: rpcconsole translatable string fixes and improvements
6242beeb06 Hoist repeated translated strings to RPCConsole struct members (Jon Atack)
0f035c12fb RPCConsole::updateDetailWidget: convert strings to translated strings (Jon Atack)

Pull request description:

  - fixups from #206 review feedback (thanks!), see commit message for details
  - hoists repeatedly used translatable strings to the `RPCConsole` class for reuse

ACKs for top commit:
  hebasto:
    re-ACK 6242beeb06
  Talkless:
    tACK 6242beeb06, tested on Debian Sid with Qt 5.15.2. I see "Ban for.." translated to my native language as before, "To/From/Yes/No" are not but that's expected, as `.ts` files are not updated.
  jarolrod:
    ACK 6242beeb06

Tree-SHA512: 20a296511c5ac03a816766237fa2731b0360dedebf1bea02711eb21d7e4eae2a63a051fe48f4726052edc3e6318952f01fef920cd4b22a8196c39c23d8e5cc3a
2021-03-07 18:56:23 +01:00
MarcoFalke
8c049fe9af
Merge #19771: net: Replace enum CConnMan::NumConnections with enum class ConnectionDirection
c77de622dd net: Replace enum CConnMan::NumConnections with enum class ConnectionDirection (Luke Dashjr)

Pull request description:

  Refactor split out of #17167

ACKs for top commit:
  practicalswift:
    cr ACK c77de622dd: patch looks correct & `enum class` is strictly better

Tree-SHA512: 40a1bf69d8ab2651b04ba6adbab789369a5a1a29a64ba764c3e6aab575b7943ea8dfd6e35b0abf5bcffa10e7265f4b523a93aa899c0fd581a84fc51ae5377b90
2021-03-07 14:21:02 +01:00
MarcoFalke
8c21562180
Merge bitcoin-core/gui#166: refactor: Use enum type as switch argument in *TableModel
1d5d832d5c qt, refactor: Use enum type as switch argument in TransactionTableModel (Hennadii Stepanov)
52f122c11f qt, refactor: Use enum type as switch argument in PeerTableModel (Hennadii Stepanov)
a35223f1cd qt, refactor: Use enum type as switch argument in BanTableModel (Hennadii Stepanov)
ab8a747d1c qt, refactor: Use enum type as switch argument in AddressTableModel (Hennadii Stepanov)

Pull request description:

  This PR makes code more maintainable by leveraging `-Wswitch` compiler warnings.

  Only the `RecentRequestsTableModel` is not refactored, because its `enum ColumnIndex` contains additional `NUMBER_OF_COLUMNS` value.

  No behavior change.

ACKs for top commit:
  hebasto:
    Do you mind mentioning the _top_ pr commit with your ACK, i.e., 1d5d832d5c, not ab8a747d1ced9f20ca32f9898418be70670da71a?
  jarolrod:
    ACK 1d5d832d5c, tested on macOS 11.1 Qt 5.15.2
  leonardojobim:
    ACK 1d5d832d5c, tested on Ubuntu 20.04 Qt 5.12.8
  promag:
    Code review ACK 1d5d832d5c.

Tree-SHA512: 0d474d226a2fa0069495d1aa5ec13b2470708ec7b8a6ab35402236c7bf57cb9939577677a30dfa54f5e3bc0477c6cfffd20ed6f19e4eb394a938569cc9347851
2021-03-07 13:04:30 +01:00
MarcoFalke
1020b04c39
Merge #21334: test: Additional (refactored) BIP9 tests
0c471a5f30 tests: check never active versionbits (Anthony Towns)
3ba9283a47 tests: more helpful errors for failing versionbits tests (Anthony Towns)

Pull request description:

  Extracted from #19573 to make review easier. I also reviewed it myself.

  I added some comments to the test: bae9a45219 (r585486781)

  I also moved some `TestState` changes from the second to the first commit, to reduce the latter diff.

ACKs for top commit:
  ajtowns:
    ACK 0c471a5f30
  MarcoFalke:
    review ACK 0c471a5f30 🔓

Tree-SHA512: 61f8d1ecaf38a6cd13db1cf71c89b8c4d2f5852ef77c5e7ecb9bd78eb216545037411641bb101cf0740c5c47845ac327954ee25b676d63779c5f148719ac5caf
2021-03-07 12:47:50 +01:00
MarcoFalke
fa4e088cba
wallet: Mark replaced tx to not be in the mempool anymore 2021-03-07 12:18:15 +01:00
Andrew Chow
e21276a82a qt test: Don't bind to regtest port
The qt tests don't need to bind to the regtest port. By not binding, it
will no longer conflict with existing regtest instances and the tests
will run as normal.
2021-03-06 15:19:08 -05:00
fanquake
48725e64fb
Merge #21209: build: use newer source for libnatpmp
7af25024e9 build: compile libnatpmp with -DNATPMP_STATICLIB on Windows (fanquake)
ee35745754 build: use newer source for libnatpmp (fanquake)

Pull request description:

  The source we are currently using is from 2015. The upstream repo has
  received a small number of bug fixes and improvements since then.
  Including one that fixes an issue for Windows users:  https://github.com/miniupnp/libnatpmp/pull/13.

  The source we are currently using is the most recent "official" release,
  however I don't think it's worth waiting for a new one. The maintainer
  was prompted to do so in Oct 2020, then again in Jan of this year, and
  no release has eventuated. Given libnatpmp is a new inclusion into our
  repository, I think we should be using this newer source.

  This also cleans up a few warnings we currently see in Windows depends builds:
  ```bash
  Extracting libnatpmp...
  /home/ubuntu/bitcoin/depends/sources/libnatpmp-20150609.tar.gz: OK
  Preprocessing libnatpmp...
  Configuring libnatpmp...
  Building libnatpmp...
  make[1]: Entering directory '/home/ubuntu/bitcoin/depends/work/build/x86_64-w64-mingw32/libnatpmp/20150609-13efa1beb87'
  x86_64-w64-mingw32-gcc -Os -fPIC -Wall -DENABLE_STRNATPMPERR   -c -o natpmp.o natpmp.c
  x86_64-w64-mingw32-gcc -Os -fPIC -Wall -DENABLE_STRNATPMPERR   -c -o getgateway.o getgateway.c
  natpmp.c:42: warning: "EWOULDBLOCK" redefined
     42 | #define EWOULDBLOCK WSAEWOULDBLOCK
        |
  In file included from natpmp.c:38:
  /usr/share/mingw-w64/include/errno.h:166: note: this is the location of the previous definition
    166 | #define EWOULDBLOCK 140
        |
  natpmp.c:43: warning: "ECONNREFUSED" redefined
     43 | #define ECONNREFUSED WSAECONNREFUSED
        |
  In file included from natpmp.c:38:
  /usr/share/mingw-w64/include/errno.h:110: note: this is the location of the previous definition
    110 | #define ECONNREFUSED 107
        |
  natpmp.c:271:5: warning: ‘readnatpmpresponseorretry’ redeclared without dllimport attribute: previous dllimport ignored [-Wattributes]
    271 | int readnatpmpresponseorretry(natpmp_t * p, natpmpresp_t * response)
        |     ^~~~~~~~~~~~~~~~~~~~~~~~~
  ar crs libnatpmp.a natpmp.o getgateway.o
  make[1]: Leaving directory '/home/ubuntu/bitcoin/depends/work/build/x86_64-w64-mingw32/libnatpmp/20150609-13efa1beb87'
  Staging libnatpmp...
  Postprocessing libnatpmp...
  Caching libnatpmp...
  ```

ACKs for top commit:
  hebasto:
    ACK 7af25024e9

Tree-SHA512: 6939014ea986149a5bfdd42b516d563a65ae643516e234579d3f28e7c2f877b0270cc4305ae7c7cb131d6d946a6e0aedc84b4cc880a412612a878a333398b9d7
2021-03-06 09:20:03 +08:00
Jon Atack
36aa2955b8
fuzz: fix gcc Woverloaded-virtual build warnings 2021-03-05 22:30:00 +01:00
MarcoFalke
fa476f188e
Use C++11 member initializer in CNodeState 2021-03-05 11:46:13 +01:00
MarcoFalke
ed25cb58f6
Merge bitcoin-core/gui#217: qt: Make warning label look clickable
67c59ae479 qt: Make warning label look clickable (Jarol Rodriguez)

Pull request description:

  The warning icon on the overview page indicates that there is something important the user should know about, but a user may not be aware that they can click it because, on `master`, the warning label does not look clickable. As detailed in issue #23, the reason to make it look clickable is that it if they "had a more clickable-appearance (borders or beveled button edges) it could help users more quickly understand what they are being alerted to."

  This PR removes the `flat` property from both `QPushButton`'s to make them look like a button, and therefore clickable. Furthermore, it updates the `Maximum Width` to `45` to fix the small hit-box issue outlined in issue #215.

  Below are screenshots showing how the warning icon looks under `master` and this `PR`:

  **macOS 11.1: Qt 5.15**
  | Master        | PR               |
  | ----------- | ----------- |
  |  <img width="754" alt="Screen Shot 2021-02-22 at 5 00 40 PM" src="https://user-images.githubusercontent.com/23396902/108776135-f6d50380-752f-11eb-9f96-25163c6a2a02.png"> | <img width="754" alt="Screen Shot 2021-02-22 at 3 08 40 PM" src="https://user-images.githubusercontent.com/23396902/108776068-e0c74300-752f-11eb-9545-3580e2b8f187.png"> |

  **Ubuntu 20.04: Qt 5.12**

  | Master        | PR               |
  | ----------- | ----------- |
  | <img width="783" alt="Screen Shot 2021-02-22 at 4 57 32 PM" src="https://user-images.githubusercontent.com/23396902/108776249-284dcf00-7530-11eb-8325-7fe13a9243a7.png"> |   ![Screen Shot 2021-02-22 at 4 12 54 PM](https://user-images.githubusercontent.com/23396902/108776428-60eda880-7530-11eb-8999-59ddd70de85f.png) |

  Closes #23
  Closes #215

ACKs for top commit:
  Talkless:
    tACK 67c59ae479, tested on Debian Sid. Does look as expected.

Tree-SHA512: 2b7302fb990ea49e2f01df6f4a23e2bc3de0797da89deaeb299742e6b285a0c21ea80d8259dc0222640cccc2bccc4ea09df443b9a11bf8b88a828e5fb2aec12c
2021-03-05 08:20:44 +01:00
MarcoFalke
f7653eb5ae
Merge #21345: test: bring p2p_leak.py up to date
a061a29970 test: bring p2p_leak.py up to date. (Martin Zumsande)

Pull request description:

  After the introduction of wtxidrelay and sendaddrv2 messages during version handshake, extend p2p_leak.py test to reflect this.
  Also, some minor fixes and doc improvements.

  I also added a test that peers not completing the version handshake will be disconnected for timeout, as suggested by MarcoFalke in https://github.com/bitcoin/bitcoin/pull/19723#issuecomment-699540294.

ACKs for top commit:
  brunoerg:
    Tested ACK a061a29970
  theStack:
    Tested ACK a061a29970

Tree-SHA512: 26c601491fa8710fc972d1b8f15da6b387a95b42bbfb629ec4c668769ad3824b6dd6a33d97363bca2171e403d8d1ce08abf3e5c9cab34f98d53e0109b1c7a0e5
2021-03-05 08:18:42 +01:00
Hennadii Stepanov
32b8dc648f
build, refactor: Fix indentation 2021-03-05 09:11:13 +02:00
Hennadii Stepanov
57b65225dc
build, qt: Make Qt static libs check regardless of plugindir
Qt static libs reside in libdir.
2021-03-05 09:11:12 +02:00
Hennadii Stepanov
6203457915
build, refactor: Rename internal _BITCOIN_QT_FIND_STATIC_PLUGINS macro
New _BITCOIN_QT_CHECK_STATIC_LIBS name describes the macro functionality
more precisely.
2021-03-05 09:11:12 +02:00
Hennadii Stepanov
bf2477402d
build, qt: Refactor internal _BITCOIN_QT_CHECK_STATIC_PLUGINS macro
This change puts Q_IMPORT_PLUGIN(...) boilerplate into the macro, which
now accepts only one plugin to check, and it is renamed (plural ->
singular).
2021-03-05 09:10:56 +02:00
fanquake
da8c7edffe
Merge #21364: fuzz: Avoid -Wreturn-type warnings
3f3646855c fuzz: Avoid -Wreturn-type warnings (practicalswift)

Pull request description:

  Avoid `-Wreturn-type` warnings.

  Closes #21355.

ACKs for top commit:
  MarcoFalke:
    cr ACK 3f3646855c
  fanquake:
    ACK 3f3646855c - thanks for cleaning this up.

Tree-SHA512: 6fa2640a26e64d2bea60e016ad14b5c434137fedc0b3bf2ac244f02f9b1cd303d1ebac4ac4e6791534560f8311c4cbe9395c2ce94d7ec022d3b192f1ea070809
2021-03-05 10:42:38 +08:00
fanquake
fbf5d16238
Merge #21246: doc: Correction for VerifyTaprootCommitment comments
6a0a6e7d05 Correction for VerifyTaprootCommitment comments (Russell O'Connor)

Pull request description:

  According to BIP-341, 'p' is called the taproot *internal* key, not inner key.

ACKs for top commit:
  sipa:
    ACK 6a0a6e7d05
  benthecarman:
    ACK 6a0a6e7d05
  theStack:
    ACK 6a0a6e7d05

Tree-SHA512: 94f553476a8404bff4b2d5724a1a54c5f530b987a616cd00a3800095f245c06e3c7a9066c729976f32069a56029406859a70ba523151d333dc1ed874f242bce8
2021-03-05 10:30:33 +08:00
fanquake
2620ac4ec3
Merge #21354: build, doc: Drop no longer required packages from macOS cross-compiling dependencies
f7f3829a68 build, doc: Drop libbz2-dev from macOS cross-compiling dependencies (Hennadii Stepanov)
d8239362e2 build, doc: Drop libcap-dev from macOS cross-compiling dependencies (Hennadii Stepanov)

Pull request description:

  The `libcap-dev` and `libbz2-dev` packages are no longer required when cross-compiling for macOS.

ACKs for top commit:
  fanquake:
    ACK f7f3829a68

Tree-SHA512: 820cdc2724f3346c0942d4d4115fc7206f7bf02889d9fa6cbdbd1d9e3afa03a067c1c3fa64dff596aefdc74898178b7c7d64027a6501486e3b606f4760de04ae
2021-03-05 09:41:33 +08:00
practicalswift
3f3646855c fuzz: Avoid -Wreturn-type warnings 2021-03-04 20:29:28 +00:00
Luke Dashjr
c77de622dd net: Replace enum CConnMan::NumConnections with enum class ConnectionDirection 2021-03-04 19:54:17 +00:00
Wladimir J. van der Laan
b4d22654fe
Merge #21337: guix: Update darwin native packages dependencies
c967fb7fb9 guix: Remove libcap from manifest (Hennadii Stepanov)
7bbb409314 guix: Update darwin native packages dependencies (Hennadii Stepanov)

Pull request description:

  It is a #20470 follow up.

ACKs for top commit:
  fanquake:
    ACK c967fb7fb9

Tree-SHA512: 66ce05770f578ba61a44c58747c5a2669f425a989ed987838058bd86e3b49e342ac5a4f8852fc49f2b3a86b58fb6a340fdf3e34c1fc19bdab910729febba4bc7
2021-03-04 16:01:25 +01:00
Wladimir J. van der Laan
702cfc8c53
Merge #21055: [Bundle 3/n] Prune remaining g_chainman usage in validation functions
e11b649650 validation: CVerifyDB::VerifyDB: Use locking annotation (Carl Dong)
03f75c42e1 validation: Use existing chain member in CChainState::LoadGenesisBlock (Carl Dong)
5e4af77380 validation: Use existing chain member in CChainState::AcceptBlock (Carl Dong)
fee73347c0 validation: Pass in chain to FindBlockPos+SaveBlockToDisk (Carl Dong)
a9d28bcd8d validation: Use *this in CChainState::ActivateBestChainStep (Carl Dong)
4744efc9ba validation: Pass in chainstate to CTxMemPool::check (Carl Dong)
1fb7b2c595 validation: Use *this in CChainState::InvalidateBlock (Carl Dong)
8cdb2f7e58 validation: Move LoadBlockIndexDB to CChainState (Carl Dong)
8b99efbcc0 validation: Move invalid block handling to CChainState (Carl Dong)
2bdf37fe18 validation: Pass in chainstate to CVerifyDB::VerifyDB (Carl Dong)
31eac50c72 validation: Remove global ::VersionBitsTip{State,SinceHeight,Statistics} (Carl Dong)
63e4c7316a validation: Pass in chainstate to ::PruneBlockFilesManual (Carl Dong)
4bada76237 validation: Pass in chainstate to UpdateTip (Carl Dong)
a3ba08ba7d validation: Remove global ::{{Precious,Invalidate}Block,ResetBlockFailureFlags} (Carl Dong)
4927c9e699 validation: Remove global ::LoadGenesisBlock (Carl Dong)
9da106be4d validation: Check chain tip is non-null in CheckFinalTx (Carl Dong)

Pull request description:

  Overall PR: #20158 (tree-wide: De-globalize ChainstateManager)

  Based on:
  - [x] #20750 | [Bundle 2/n] Prune g_chainman usage in mempool-related validation functions

  Note to reviewers:
  1. This bundle may _apparently_ introduce usage of `g_chainman` or `::Chain(state|)Active()` globals, but these are resolved later on in the overall PR. [Commits of overall PR](https://github.com/bitcoin/bitcoin/pull/20158/commits)
  2. There may be seemingly obvious local references to `ChainstateManager` or other validation objects which are not being used in callers of the current function in question, this is done intentionally to **_keep each commit centered around one function/method_** to ease review and to make the overall change systematic. We don't assume anything about our callers. Rest assured that once we are considering that particular caller in later commits, we will use the obvious local references. [Commits of overall PR](https://github.com/bitcoin/bitcoin/pull/20158/commits)
  3. When changing a function/method that has many callers (e.g. `LookupBlockIndex` with 55 callers), it is sometimes easier (and less error-prone) to use a scripted-diff. When doing so, there will be 3 commits in sequence so that every commit compiles like so:
  1. Add `new_function`, make `old_function` a wrapper of `new_function`, divert all calls to `old_function` to `new_function` **in the local module only**
  2. Scripted-diff to divert all calls to `old_function` to `new_function` **in the rest of the codebase**
  3. Remove `old_function`

  Note to self:
  - [x] Address: https://github.com/bitcoin/bitcoin/pull/20750#discussion_r579400663

ACKs for top commit:
  laanwj:
    Code review ACK e11b649650

Tree-SHA512: 205a451a741e32f17d5966de289f2f5a3f0817738c0087b70ff4755ddd217b53d01050ed396669bda2b1d216a88d927b9778777f9ff95ab1fe20e59c5f341776
2021-03-04 14:55:47 +01:00
fanquake
83bdbbd300
Merge #21003: test: Move MakeNoLogFileContext to libtest_util, and use it in bench
fa576b4532 Move MakeNoLogFileContext to common libtest_util, and use it in bench (MarcoFalke)

Pull request description:

  To avoid verbose code duplication, which may lead to accidental mishaps https://github.com/bitcoin/bitcoin/pull/20998/files#r563624041.

  Also fix a nit I found in https://github.com/bitcoin/bitcoin/pull/20946#discussion_r561949731.

ACKs for top commit:
  dongcarl:
    Light Code-Review ACK fa576b4532
  fanquake:
    ACK fa576b4532

Tree-SHA512: d39ac9c0957813ebb20ed13bd25a8ef8469377ce2651245638bd761c796feac2a17e30dd16f1e5c8db57737fb918c81d56a3d784c33258275e426a1b11e69eb2
2021-03-04 20:29:09 +08:00
fanquake
7450a01691
Merge #21358: fuzz: Add missing include (test/util/setup_common.h)
fa59ad5130 fuzz: Add missing include (test/util/setup_common.h) (MarcoFalke)

Pull request description:

  `src/test/fuzz/socks5.cpp` is using the symbol `BasicTestingSetup`, which is defined in `src/test/util/setup_common.h`.

  Currently compilation happens to succeed because the needed dependency is indirectly included. Compilation will break as soon as the indirect dependency is broken. According to the dev notes, everything that is used must be included.

  Fix the issue by including the missing include.

ACKs for top commit:
  fanquake:
    ACK fa59ad5130

Tree-SHA512: 9359d5d288ebc5a53d753ebed1ee8d49ddcfe12aeb56054ea43654c0d915337bb0dce7c8a7178e94711ff8dacd1b3ea0a2871b21b1709cd9786efc0c1ef532b3
2021-03-04 20:20:43 +08:00
fanquake
33921379b6
Merge #21015: Make all of net_processing (and some of net) use std::chrono types
0eaea66e8b Make tx relay data structure use std::chrono types (Pieter Wuille)
55e82881a1 Make all Poisson delays use std::chrono types (Pieter Wuille)
c733ac4d8a Convert block/header sync timeouts to std::chrono types (Pieter Wuille)
4d98b401fb Change all ping times to std::chrono types (Pieter Wuille)

Pull request description:

  (Picking up #20044. Rebased against master.)

  This changes various uses of integers to represent timestamps and durations to `std::chrono` duration types with type-safe conversions, getting rid of various `.count()`, constructors, and conversion factors.

ACKs for top commit:
  jnewbery:
    utACK 0eaea66e8b
  vasild:
    ACK 0eaea66e8b
  MarcoFalke:
    re-ACK 0eaea66e8b, only changes: minor rename, using C++11 member initializer, using 2min chrono literal, rebase 🤚
  ajtowns:
    utACK 0eaea66e8b

Tree-SHA512: 2dbd8d53bf82e98f9b4611e61dc14c448e8957d1a02575b837fadfd59f80e98614d0ccf890fc351f960ade76a6fb8051b282e252e81675a8ee753dba8b1d7f57
2021-03-04 20:13:43 +08:00
Wladimir J. van der Laan
92b7efcf54
Merge #21148: Split orphan handling from net_processing into txorphanage
5e50e2d1b9 txorphanage: comment improvements (Anthony Towns)
eeeafb324e net_processing: move AddToCompactExtraTransactions into PeerManagerImpl (Anthony Towns)
f8c0688b94 scripted-diff: Update txorphanage naming convention (Anthony Towns)
6bd4963c06 txorphanage: Move functions and data into class (Anthony Towns)
03257b832d txorphanage: Extract EraseOrphansForBlock (Anthony Towns)
3c4c3c2fdd net_processing: drop AddOrphanTx (Anthony Towns)
26d1a6ccd5 denialofservices_tests: check txorphanage's AddTx (Anthony Towns)
1041616d7e txorphanage: Extract OrphanageAddTx (Anthony Towns)
f294da7274 txorphanage: Extract GetOrphanTx (Anthony Towns)
83679ffc60 txorphanage: Extract HaveOrphanTx (Anthony Towns)
ee135c8d5b txorphanage: Extract AddChildrenToWorkSet (Anthony Towns)
38a11c355a txorphanage: Add lock annotations (Anthony Towns)
81dd57e5b1 txorphanage: Pass uint256 by reference instead of value (Anthony Towns)
9d5313df7e move-only: Add txorphanage module (Anthony Towns)

Pull request description:

  Splits orphan handling into its own module and reduces global usage.

ACKs for top commit:
  jnewbery:
    utACK 5e50e2d1b9
  amitiuttarwar:
    utACK 5e50e2d1b9
  glozow:
    re ACK 5e50e2d1b9, comment updates
  laanwj:
    Code review ACK 5e50e2d1b9

Tree-SHA512: 92a959bb5dd414c96f78cb8dcaa68adb85faf16b8b843a2cbe0bb2aa08df13ad6bd9424d29b98f57a82ec29c942fbdbea3011883d00bf0b0feb643e295174e46
2021-03-04 10:16:38 +01:00
MarcoFalke
fa59ad5130
fuzz: Add missing include (test/util/setup_common.h) 2021-03-04 08:39:27 +01:00
MarcoFalke
d099894ec1
Merge #20969: test: check that getblockfilter RPC fails without block filter index
233a886b42 test: check that getblockfilter RPC fails without block filter index (Sebastian Falbesoner)

Pull request description:

  If a node was started without compact block filter index (parameter `--blockfilterindex=0`), the `getblockfilter` RPC call should fail.

ACKs for top commit:
  MarcoFalke:
    review ACK 233a886b42

Tree-SHA512: c8824373fad7d1de2dcb43c1d9541d736b478235be243080d2b7479c2588eac0e5722337ec1307394b331e0002fbcabb368e4955c2dc98dd5fce76d8c089e8a1
2021-03-04 08:37:10 +01:00
fanquake
7af25024e9
build: compile libnatpmp with -DNATPMP_STATICLIB on Windows
This fixes linking issues and mirrors what we do with miniupnpc.
2021-03-04 12:34:46 +08:00
fanquake
ee35745754
build: use newer source for libnatpmp
The source we are currently using is from 2015. The upstream repo has
received a small number of bug fixes and improvements since then.
Including one that fixes an issue for Windows users:
https://github.com/miniupnp/libnatpmp/pull/13.

The source we are currently using is the most recent "official" release,
however I don't think it's worth waiting for a new one. The maintainer
was prompted to do so in Oct 2020, then again in Jan of this year, and
no release has eventuated. Given libnatpmp is a new inclusion into our
repository, I think we should be using this newer source.

This also cleans up a few warnings we currently see in depends builds:
```bash
Extracting libnatpmp...
/home/ubuntu/bitcoin/depends/sources/libnatpmp-20150609.tar.gz: OK
Preprocessing libnatpmp...
Configuring libnatpmp...
Building libnatpmp...
make[1]: Entering directory '/home/ubuntu/bitcoin/depends/work/build/x86_64-w64-mingw32/libnatpmp/20150609-13efa1beb87'
x86_64-w64-mingw32-gcc -Os -fPIC -Wall -DENABLE_STRNATPMPERR   -c -o natpmp.o natpmp.c
x86_64-w64-mingw32-gcc -Os -fPIC -Wall -DENABLE_STRNATPMPERR   -c -o getgateway.o getgateway.c
natpmp.c:42: warning: "EWOULDBLOCK" redefined
   42 | #define EWOULDBLOCK WSAEWOULDBLOCK
      |
In file included from natpmp.c:38:
/usr/share/mingw-w64/include/errno.h:166: note: this is the location of the previous definition
  166 | #define EWOULDBLOCK 140
      |
natpmp.c:43: warning: "ECONNREFUSED" redefined
   43 | #define ECONNREFUSED WSAECONNREFUSED
      |
In file included from natpmp.c:38:
/usr/share/mingw-w64/include/errno.h:110: note: this is the location of the previous definition
  110 | #define ECONNREFUSED 107
      |
natpmp.c:271:5: warning: ‘readnatpmpresponseorretry’ redeclared without dllimport attribute: previous dllimport ignored [-Wattributes]
  271 | int readnatpmpresponseorretry(natpmp_t * p, natpmpresp_t * response)
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~
ar crs libnatpmp.a natpmp.o getgateway.o
make[1]: Leaving directory '/home/ubuntu/bitcoin/depends/work/build/x86_64-w64-mingw32/libnatpmp/20150609-13efa1beb87'
Staging libnatpmp...
Postprocessing libnatpmp...
Caching libnatpmp...
```
2021-03-04 10:34:18 +08:00
Hennadii Stepanov
f7f3829a68
build, doc: Drop libbz2-dev from macOS cross-compiling dependencies 2021-03-03 22:43:08 +02:00