Commit graph

34016 commits

Author SHA1 Message Date
Hennadii Stepanov
165903406e
build: Fix AC_CHECK_HEADERS and AC_CHECK_LIB for libnatpmp package 2022-04-24 15:55:04 +02:00
Hennadii Stepanov
65cddf604c
build: Fix AC_CHECK_HEADERS and AC_CHECK_LIB for miniupnpc package 2022-04-24 15:54:29 +02:00
Hennadii Stepanov
bbbcb96638
build, refactor: Fix indentation 2022-04-24 15:52:23 +02:00
MarcoFalke
b1c5991eeb
Merge bitcoin/bitcoin#24812: util/check: Add CHECK_NONFATAL identity function and NONFATAL_UNREACHABLE macro
ee02c8bd9a util/check: Add CHECK_NONFATAL identity function, NONFATAL_UNREACHABLE AND UNREACHABLE macros (Aurèle Oulès)

Pull request description:

  This PR replaces the macro `CHECK_NONFATAL` with an identity function.
  I simplified the usage of `CHECK_NONFATAL` where applicable in `src/rpc`.
  This function is useful in sanity checks for RPC and command-line interfaces.

  Context: https://github.com/bitcoin/bitcoin/pull/24804#discussion_r846182474.

  Also adds `UNREACHABLE_NONFATAL` macro.

ACKs for top commit:
  jonatack:
    ACK ee02c8bd9a
  MarcoFalke:
    ACK ee02c8bd9a 🍨

Tree-SHA512: 3cba09223cd7b22e62fe5d0b46c4a024c1d9957d4268ba6d3fb07fcc0a5854fc0886bb3266184e6a7df5df91373b3e84edd6adf6999c4e934aeef8c043b01aa2
2022-04-24 12:00:05 +02:00
Hennadii Stepanov
914076ed5f
guix: Improve error message about missed macOS SDK 2022-04-24 11:51:38 +02:00
Hennadii Stepanov
15069130c6
qt, test: Add tests for tableView in AddressBookPage dialog 2022-04-23 19:51:39 +02:00
Hennadii Stepanov
edae3ab699
qt: No need to force Qt::QueuedConnection for NotifyAddressBookChanged
This change simplifies tests for `AddressBookPage` class.
No user-faced behavior change.
2022-04-23 15:20:26 +02:00
Hennadii Stepanov
f70ee34c71
qt, refactor: Declare WalletModel member functions with const 2022-04-23 14:30:15 +02:00
Pavol Rusnak
51d06df874
contrib: macdeploy: fix permissions typo in gen-sdk script 2022-04-22 22:09:44 +02:00
Hennadii Stepanov
be7a5f2fc4
Merge bitcoin-core/gui#587: refactor: Replace GUIUtil::ObjectInvoke() with QMetaObject::invokeMethod()
6958a26aa1 Revert "qt: Add ObjectInvoke template function" (Hennadii Stepanov)
249984f4f9 qt: Replace `GUIUtil::ObjectInvoke()` with `QMetaObject::invokeMethod()` (Hennadii Stepanov)

Pull request description:

  A comment in 5659e73493 states that `GUIUtil::ObjectInvoke`
  > can be replaced by a call to the QMetaObject::invokeMethod functor overload after Qt 5.10

ACKs for top commit:
  w0xlt:
    tACK 6958a26aa1 on Ubuntu 21.10, Qt 5.15.2.
  promag:
    Code review ACK 6958a26aa1.

Tree-SHA512: 6a840289568113cf38df6c1092821d626c2d206768a21d4dc6846b9dcccb4130477adb45ba718bb6bc15a3041871a7df3238983ac03db80406732be597693266
2022-04-22 18:51:37 +02:00
pasta
ab1ea29ba1 refactor: make GetRand a template, remove GetRandInt 2022-04-22 09:04:39 -05:00
fanquake
505ba39665
Merge bitcoin/bitcoin#22910: net: Encapsulate asmap in NetGroupManager
36f814c0e8 [netgroupman] Remove NetGroupManager::GetAsmap() (John Newbery)
4709fc2019 [netgroupman] Move asmap checksum calculation to NetGroupManager (John Newbery)
1b978a7e8c [netgroupman] Move GetMappedAS() and GetGroup() logic to NetGroupManager (John Newbery)
ddb4101e63 [net] Only use public CNetAddr functions and data in GetMappedAS() and GetGroup() (John Newbery)
6b2268162e [netgroupman] Add GetMappedAS() and GetGroup() (John Newbery)
19431560e3 [net] Move asmap into NetGroupManager (John Newbery)
17c24d4580 [init] Add netgroupman to node.context (John Newbery)
9b3836710b [build] Add netgroup.cpp|h (John Newbery)

Pull request description:

  The asmap data is currently owned by addrman, but is used by both addrman and connman. #22791 made the data const and private (so that it can't be updated by other components), but it is still passed out of addrman as a reference to const, and used by `CNetAddress` to calculate the group and AS of the net address.

  This RFC PR proposes to move all asmap data and logic into a new `NetGroupManager` component. This is initialized at startup, and the client components addrman and connman simply call `NetGroupManager::GetGroup(const CAddress&)` and `NetGroupManager::GetMappedAS(const CAddress&)` to get the net group and AS of an address.

ACKs for top commit:
  mzumsande:
    Code Review ACK 36f814c0e8
  jnewbery:
    CI failure seems spurious. I rebased onto latest master to trigger a new CI run, but whilst I was doing that, mzumsande ACKed 36f814c0e8, so I've reverted to that.
  dergoegge:
    Code review ACK 36f814c0e8

Tree-SHA512: 244a89cdfd720d8cce679eae5b7951e1b46b37835fccb6bdfa362856761bb110e79e263a6eeee8246140890f3bee2850e9baa7bc14a388a588e0e29b9d275175
2022-04-22 14:43:14 +01:00
Sebastian Falbesoner
a498acce45 test: MiniWallet: skip mempool check if mempool_valid=False
MiniWallet's core method for creating txs (`create_self_transfer`)
right now always executes the `testmempoolaccept` RPC to check for
mempool validity or invalidity. In some test cases where we use
MiniWallet to create a huge number of transactions this can lead
to performance issues (e.g. feature_fee_estimation.py where the
execution time after MiniWallet usage almost doubled). Providing
the possibility to skip the mempool checks is a mitigation for
this.

master branch:
$ time ./test/functional/feature_fee_estimation.py
real    3m20.771s
user    2m52.360s
sys     0m39.340s

PR branch:
$ time ./test/functional/feature_fee_estimation.py
real    2m1.386s
user    1m42.510s
sys     0m22.980s
2022-04-22 15:07:10 +02:00
Sebastian Falbesoner
01552e8f67 test: MiniWallet: always rehash after signing (P2PK mode)
Also explicitly rehash in the cases where we modify a tx after signing
in feature_csv_activation.py. Parts of this test relied on the fact that
rehashing of transactions is done in the course of calculating a block's
merkle root (`calc_merkle_root`), which only works if no hash was
calculated before due to a caching mechanism.

In the following commit the txid in MiniWallet is calculated via
`rehash()`, i.e. this doesn't work anymore and we always have to
explicitely have the right hash before we calculate the merkle root.
2022-04-22 15:06:44 +02:00
hiago
172c2333f0 Porting lint-assertions.sh to lint-assertions.py 2022-04-22 09:45:12 -03:00
akankshakashyap
3f8def51d5 add 3 new test cases for SelectCoins()
1. More coins should be selected when effective fee < long term fee.
2. Less coin should be selected when effective fee > long term fee.
3. If a coin is preselected, it should be selected even if disadvantageous.
2022-04-22 14:49:49 +05:30
w0xlt
709af67add p2p: replace RecursiveMutex m_total_bytes_sent_mutex with Mutex 2022-04-22 05:40:24 -03:00
w0xlt
8be75fd0f0 p2p: add assertions and negative TS annotations for m_total_bytes_sent_mutex
Co-authored-by: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com>
2022-04-22 05:40:24 -03:00
Andrew Chow
9f5ab670e7 tests: Use descriptor that requires both legacy and segwit 2022-04-21 21:00:36 -04:00
Dimitri
035eef4be6 lint: Convert lint-python-utf8-encoding.sh to Python 2022-04-21 23:26:45 +02:00
Dimitri
3043a1bc9d lint: Make known violations more specific in lint-locale-dependence 2022-04-21 20:03:32 +02:00
Dimitri
229917d3d4 lint: Convert lint-locale-dependence.sh to Python 2022-04-21 19:31:41 +02:00
Ryan Ofsky
f64aa9c411 Disallow more unsafe string->path conversions allowed by path append operators
Add more fs::path operator/ and operator+ overloads to prevent unsafe
string->path conversions on Windows that would cause strings to be
decoded according to the current Windows locale & code page instead of
the correct string encoding.

Update application code to deal with loss of implicit string->path
conversions by calling fs::u8path or fs::PathFromString explicitly, or
by just changing variable types from std::string to fs::path to avoid
conversions altoghther, or make them happen earlier.

In all cases, there's no change in behavior either (1) because strings
only contained ASCII characters and would be decoded the same regardless
of what encoding was used, or (2) because of the 1:1 mapping between
paths and strings using the PathToString and PathFromString functions.

Co-authored-by: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com>
2022-04-21 12:01:00 -05:00
MarcoFalke
7a4ac713aa
Merge bitcoin/bitcoin#24936: test: compare /mempool/contents response with getrawmempool RPC
bef61496ab test: compare `/mempool/contents` response with `getrawmempool` RPC (brunoerg)
5bc5cbaf31 doc: add reference to `getrawmempool` RPC in `/mempool/contents` REST doc (brunoerg)

Pull request description:

  This PR is similar to #24797, it compares `/mempool/contents` REST response with `getrawmempool` RPC (verbose=True) since they use the same `MempoolToJSON` function.

  Also, adds a reference to `getrawmempool` RPC help to get details about the fields from `/mempool/contents`.

ACKs for top commit:
  0xB10C:
    ACK bef6149

Tree-SHA512: b7e9e9c765ee837986ba167b9234a9b95c9ef0a9ebcc2a03d50f6be6d3aba1480bd77c78111d95df1e4023cde6dfc64bf1e7908d9e5b6f96ca46b76611a4a9b4
2022-04-21 19:01:00 +02:00
laanwj
173c796268
Merge bitcoin/bitcoin#24854: Remove not needed ArithToUint256 roundtrips in tests
fad6d4f952 Remove not needed ArithToUint256 roundtrips in tests (MarcoFalke)
fa456ccb22 Remove duplicate static_asserts (MarcoFalke)

Pull request description:

  No need to go from `arith_uint256`->`uint256` when a `uint256` can be constructed right away.

ACKs for top commit:
  laanwj:
    Code review ACK fad6d4f952

Tree-SHA512: bea901ea5904bf61a0dadf7168c6b126f7e62ff1180d4aa72063c28930a01a8baa57ab0d324226bd4de72fb59559455c29c049d90061f888044198aae1426dcb
2022-04-21 18:05:47 +02:00
Andrew Chow
ab5af9ca72 test: Add test for coinselection tracepoints 2022-04-21 11:17:00 -04:00
Andrew Chow
ca02b68e8a doc: document coin selection tracepoints 2022-04-21 11:11:02 -04:00
laanwj
2513499348
Merge bitcoin/bitcoin#24803: lint: convert submodule linter test to Python
4a9e36dbaf lint: convert submodule linter test to Python (Eunoia)

Pull request description:

  Refs #24783

ACKs for top commit:
  laanwj:
    Tested ACK 4a9e36dbaf

Tree-SHA512: ca25b59acf75cebc79588a6c51dc5c313c8d0bd1d492127815d7b81b36aaffd02815a515d97b355582002f71efc33d46435d0b28fce24497bb99799d9ba57228
2022-04-21 17:10:43 +02:00
laanwj
43bb106613
Merge bitcoin/bitcoin#24213: refactor: use Span in random.*
3ae7791bca refactor: use Span in random.* (pasta)

Pull request description:

  ~This PR does two things~
  1. use a Span<unsigned char> for GetRandBytes and GetStrongRandBytes

  ~2. make GetRand a template for which any integral type can be used, where the default behavior is to return a random integral up to the max of the integral unless a max is provided.
  This simplifies a lot of code from `GetRand(std::numeric_limits<uint64_t>::max()` -> `GetRand<uint64_t>()`~

  MarcoFalke this was inspired by your comment here: https://github.com/bitcoin/bitcoin/pull/24185#issuecomment-1025514263 about using Span, so hopefully I'll be able to get this PR done and merged 😂

  ~Also, if requested I could revert the `GetRand(std::numeric_limits<uint64_t>::max()` -> `GetRand<uint64_t>()` related changes if it ends up causing too many conflicts~

ACKs for top commit:
  laanwj:
    Thank you! Code review re-ACK 3ae7791bca

Tree-SHA512: 12375a83b68b288916ba0de81cfcab4aac14389a66a36811ae850427435eb67dd55e47df9ac3ec47db4e214f4330139e548bec815fff8a3f571484ea558dca79
2022-04-21 16:38:04 +02:00
MarcoFalke
fafd67479a
test: Remove previous release check 2022-04-21 14:58:55 +02:00
MarcoFalke
346e780442
Merge bitcoin/bitcoin#24918: test: Remove unused taproot node from wallet_taproot.py
fa2153b05b test: Remove unused taproot node from wallet_taproot.py (MarcoFalke)

Pull request description:

  Now that the wallet considers taproot always active after commit 064c729a96, there is no need to test for it.

ACKs for top commit:
  dunxen:
    Code review ACK fa2153b
  brunoerg:
    crACK fa2153b05b

Tree-SHA512: 24e4a66e43d1391acb63fd0c0c52677b0eef7f618b87a5b1a75224a9be58c9c3f8bba2de3b7510f25a686865b027f7f535e653d40d519d0e00ace38f0c7aba0c
2022-04-21 14:45:22 +02:00
Hennadii Stepanov
ab73d5985d
Do not pass WalletModel* to queued connection
Passing a `WalletModel*` object to a queued connection when the
`ENABLE_WALLET` macro is undefined make code flawed.
2022-04-21 14:04:56 +02:00
Hennadii Stepanov
fdf7285950
refactor: Make RPCExecutor* a member of the RPCConsole class 2022-04-21 13:35:59 +02:00
brunoerg
bef61496ab test: compare /mempool/contents response with getrawmempool RPC 2022-04-21 08:31:01 -03:00
fanquake
1c6fcea205
Merge bitcoin/bitcoin#24586: doc: add more info to dependencies.md
abcb8769bf  doc: add more info to dependencies.md (Pavol Rusnak)

Pull request description:

  Follow-up to https://github.com/bitcoin/bitcoin/pull/23565

  I added more info to dependencies.md - especially links to `depends/packages/*.mk` files and link to PRs where used versions were bumped.

  Preview at: https://github.com/prusnak/bitcoin/blob/dependencies/doc/dependencies.md

ACKs for top commit:
  fanquake:
    ACK abcb8769bf - I didn't click on or test all of the links, but this looks ok.

Tree-SHA512: e91deb639afebeb37f7bf05dddad8f70547b51688e938a30692e59dbd7c9e49d52b7f9bfacb74ef60c98862b6f8f444199d0ae06973c42dc647314bc1ffc22d5
2022-04-21 09:29:22 +01:00
Hennadii Stepanov
efa3a807a6
build: No longer need to hack the PATH variable in config.site
Now all of the tools have well-defined absolute paths to them.
2022-04-21 10:09:55 +02:00
Hennadii Stepanov
f3af4f7a18
build: Let the depends build system define a path to dsymutil tool 2022-04-21 10:08:46 +02:00
Hennadii Stepanov
b0a8ddabe5
build: Pass missed darwin-specific tools via config.site 2022-04-21 10:08:46 +02:00
Hennadii Stepanov
f87594da14
build: No need to provide defaults for darwin-specific tools 2022-04-21 10:08:46 +02:00
Hennadii Stepanov
80cd99322f
scripted-diff: Rename INSTALLNAMETOOL -> INSTALL_NAME_TOOL
This change makes naming of `install_name_tool` consistent across
the whole build system.

-BEGIN VERIFY SCRIPT-
sed --in-place --expression='s/INSTALLNAMETOOL/INSTALL_NAME_TOOL/g' $(git grep --files-with-matches 'INSTALLNAMETOOL')
-END VERIFY SCRIPT-
2022-04-21 10:08:45 +02:00
Hennadii Stepanov
a4fd440741
build: Pass missed strip tool via config.site 2022-04-21 10:08:37 +02:00
fanquake
bfbce6cbfe
Merge bitcoin/bitcoin#24031: build: don't compress macOS DMG
1dd8cbfbc6 build: don't compress macOS DMG (fanquake)

Pull request description:

  Skip compressing the macOS DMG, and drop related build steps and dependencies. Uncompressed the DMG increases from ~16mb to ~30mb, which compared to other software a user may download, (Firefox 125mb, VLC 52mb, Open Office 176mb), is still relatively small. When contrasted against the 100's of GB of blockchain data a node will download, an additional 15mb to get the release binary, isn't much additional overhead. Note that if / when we build with LTO enabled for releases, this size will shrink back down significantly again.

  `native_libdmg-hfsplus` is not maintained, and I doubt the DMG creation feature will ever be fixed. If at some point `xorrisofs` supports compressing dmgs, we could enable that.

  Guix Build on x86_64:
  ```bash
  25b7c8bb7bc8ea014d43cebb844a842d2ac8d5a343039a820d24b649c9e6bc8a  guix-build-1dd8cbfbc631/output/arm64-apple-darwin/SHA256SUMS.part
  16beb5c52c9bf51b5ce9ef5a0d17c0038238a833383586a1b14acbca78533e4b  guix-build-1dd8cbfbc631/output/arm64-apple-darwin/bitcoin-1dd8cbfbc631-arm64-apple-darwin-unsigned.dmg
  d8f89a61a7448d6334dbb3639386a7b6340542393933f35421a9e6dfc724e455  guix-build-1dd8cbfbc631/output/arm64-apple-darwin/bitcoin-1dd8cbfbc631-arm64-apple-darwin-unsigned.tar.gz
  11617dc261ef602433f5bb29956a40a9085dbc783f519f75fbe06e80970148d0  guix-build-1dd8cbfbc631/output/arm64-apple-darwin/bitcoin-1dd8cbfbc631-arm64-apple-darwin.tar.gz
  aa8550d4a394d3161d14ec5e6012ed07354135afb022e905a1946785b4665664  guix-build-1dd8cbfbc631/output/dist-archive/bitcoin-1dd8cbfbc631.tar.gz
  2b837f2f971a9738d0b7b8497f7ded740ef5e67c8baa7f30ca33e6b7d826eec8  guix-build-1dd8cbfbc631/output/x86_64-apple-darwin/SHA256SUMS.part
  db972b2c06dbde5525a3f9e6ceb9c20a8120bc9a6f15e1d852a4bfac09d88569  guix-build-1dd8cbfbc631/output/x86_64-apple-darwin/bitcoin-1dd8cbfbc631-x86_64-apple-darwin-unsigned.dmg
  50fe990c3f9923ee92195125faf6517396e7c1b017a8f4f7d52e991ebce52f0c  guix-build-1dd8cbfbc631/output/x86_64-apple-darwin/bitcoin-1dd8cbfbc631-x86_64-apple-darwin-unsigned.tar.gz
  1d9022b0ae46ead41046c40f82291ce363760660a3cd6e6ef6a5b1128b90faef  guix-build-1dd8cbfbc631/output/x86_64-apple-darwin/bitcoin-1dd8cbfbc631-x86_64-apple-darwin.tar.gz
  ```

  Guix Build on arm64:
  ```bash
  ```

ACKs for top commit:
  Sjors:
    re-tACK 1dd8cbfbc6 on Intel macOS
  laanwj:
    Build system changes code review ACK 1dd8cbfbc6, I don't know anything about MacOS application formats and their internals so do not have an opinion on the contents of this change.
  jarolrod:
    ACK 1dd8cbfbc6

Tree-SHA512: 04c5bf78f26a9877777093ec4c50c457107bef59d720839ea5e7d7e4f7961dfee9f86b40cf791524a9e60e9e77403a797e9fcdae3849b60b759f9f66cc31b6ab
2022-04-21 08:54:13 +01:00
laanwj
6f55ab57cb
Merge bitcoin/bitcoin#24534: contrib: macdeploy: make gen-sdk deterministic
ba30a5407e contrib: macdeploy: monkey-patch gen-sdk to be deterministic (Pavol Rusnak)
1868a17e5a contrib: macdeploy: make gen-sdk deterministic (Pavol Rusnak)

Pull request description:

  This PR attempts to make `contrib/macdeploy/gen-sdk` deterministic

  Can anyone with the `Xcode_12.2.xip` confirm that `gen-sdk` produces the same hash? => `e7ca56bc8804d16624fad68be2e71647747d6629cacaaa3de5fbfa7f444e9eae `

ACKs for top commit:
  laanwj:
    Tested ACK ba30a5407e
  jarolrod:
    Tested ACK ba30a5407e

Tree-SHA512: 1638ceaf28e87ef0d21a1a71ef02989f75942b60a12f07236ac709bde96f08f39f816767e35a0fe68c26bf5978e63e74f5385be9d4b8f80a2e89b30f163f4526
2022-04-21 09:38:09 +02:00
brunoerg
5bc5cbaf31 doc: add reference to getrawmempool RPC in /mempool/contents REST doc 2022-04-20 18:12:39 -03:00
Smlep
79635c79e0 lint: Convert lint-circular-dependencies.sh to Python 2022-04-20 22:40:50 +02:00
Hennadii Stepanov
61457c179a
refactor: Guard RPCConsole::{add,remove}Wallet() with ENABLE_WALLET 2022-04-20 16:57:47 +02:00
Eunoia
2c838cc309 lint: convert shell locale linter test to Python 2022-04-20 14:37:52 +00:00
brydinh
d5fdec5cf8 Convert lint-include-guards.sh to python
Specify encoding when reading header files, add docstring

Update test/lint/lint-include-guards.py  include guard count logic

Co-authored-by: Kevin Musgrave <tkm45@cornell.edu>

Update test/lint/lint-include-guards.py by removing whitespace
2022-04-20 09:52:58 -04:00
John Newbery
36f814c0e8 [netgroupman] Remove NetGroupManager::GetAsmap()
asmap no longer needs to be exposed anywhere outside NetGroupManager.
2022-04-20 14:35:53 +01:00
John Newbery
4709fc2019 [netgroupman] Move asmap checksum calculation to NetGroupManager 2022-04-20 14:35:53 +01:00