Commit Graph

42597 Commits

Author SHA1 Message Date
Kiminuo
1d566c067c test: Add mempool fee histogram test coverage
Original commit: 0b6ba66238

Co-authored-by: João Barbosa <joao.paulo.barbosa@gmail.com>
Co-authored-by: Jon Atack <jon@atack.com>

Github-Pull: #21422
Rebased-From: c5e53d0d21
2025-02-21 23:31:39 +00:00
Kiminuo
c7560421eb Introduce fee histogram in getmempoolinfo RPC command
Co-authored-by: Jonas Schnelli <dev@jonasschnelli.ch>
Co-authored-by: Jon Atack <jon@atack.com>

Github-Pull: #21422
Rebased-From: d242aa52de
2025-02-21 23:31:39 +00:00
Luke Dashjr
c6557a3ce1 Merge branch 'rpcarg_type_per_name' into fee_histogram+pr15836_api 2025-02-21 23:29:29 +00:00
Luke Dashjr
d83bf929e2 depends: Qt 5.15.16 2025-02-21 16:03:15 +00:00
Luke Dashjr
93cdbea466 rpccookieperms: Set permissions on temporary file, prior to writing the cookie
Github-Pull: na
Rebased-From: 74cc11bbde33dad0f4856731bf16cb674069b3c4
2025-02-21 16:01:47 +00:00
Luke Dashjr
f974c82c2a Merge branch 'improve_args_pr31212-28' into fix_rpccookieperms_early-28+knots 2025-02-21 16:01:42 +00:00
Luke Dashjr
248c26411d lint: exception for fix_leveldb_ptrarith_pr31671 2025-02-21 16:00:05 +00:00
David Benjamin
19e8086b9f Fix invalid pointer arithmetic in Hash (#1222)
It is UB to exceed the bounds of the buffer when doing pointer
arithemetic. That means the following is not a valid bounds check:

    if (start + 4 <= limit)

Because if we were at the end of the buffer, we wouldn't be
allowed to add 4 anyway. Instead, this must be written as:

    if (limit - start >= 4)

Basic forms of this issue are flagged by UBSan. If building with
-fsanitize=undefined, the following test trips an error:

    [ RUN      ] HASH.SignedUnsignedIssue
    .../leveldb/util/hash.cc:30:15: runtime error: applying non-zero offset 4 to null pointer
    SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /usr/local/google/home/davidben/leveldb/util/hash.cc:30:15 in
    [       OK ] HASH.SignedUnsignedIssue (1 ms)

(cherry picked from commit 578eeb702ec0fbb6b9780f3d4147b1076630d633)

Github-Pull: #31671
Rebased-From: a8844b23ab02a48a05940987f70bf23d4fa76f58
2025-02-21 16:00:05 +00:00
Luke Dashjr
17542e42df Revert exFAT docs for now 2025-02-21 15:55:04 +00:00
Luke Dashjr
e824b906df GUI/Intro: Warn if choosing an ExFAT fs on macOS 2025-02-21 15:55:04 +00:00
willcl-ark
d4d9bdfa49 util: detect and warn when using exFAT on macOS
exFAT is known to cause corruption on macOS. See #28552.

Therefore we should warn when using this fs format for either the blocks
or data directories.

Github-Pull: #31453
Rebased-From: df1ba101419729aafa382d970ee605e2a6273e26
2025-02-21 15:55:04 +00:00
Luke Dashjr
633ed70980 Merge branch 'improve_args_pr31212-28' into macos_exfat_warning-28+knots 2025-02-21 15:54:52 +00:00
Vasil Dimov
c2ef3896f8 test: avoid generating non-loopback traffic from p2p_dns_seeds.py
`p2p_dns_seeds.py` would try to connect to the DNS server configured on
the machine and resolve `dummySeed.invalid`.

To block that configure an unavailable proxy which will be used also to
connect to the name server. The test needs 2 successful connections to
other peers (two Python `P2PInterface`s) and they work in spite of the
unavailable proxy because they are on `127.0.0.1` (`NET_UNROUTABLE`) and
the proxy is not used for that.

Github-Pull: #31646
Rebased-From: 2ed161c5ce
2025-02-21 15:38:43 +00:00
Vasil Dimov
a015a39bc5 test: avoid generating non-loopback traffic from feature_config_args.py
`feature_config_args.py` uses a proxy address of `1.2.3.4`. This results
in actually trying to open TCP connections over the internet to
`1.2.3.4:9050`.

The test does not need those to succeed so use `127.0.0.1:1` instead.

Also avoid `-noconnect=0` because that is interpreted as `-connect=1`
which is interpreted as `-connect=0.0.0.1` and a connection to
`0.0.0.1:18444` is attempted.

Github-Pull: #31646
Rebased-From: a5746dc559
2025-02-21 15:38:43 +00:00
Vasil Dimov
95f8bfd162 QA/test_framework: Add UNREACHABLE_PROXY_ARG
Github-Pull: #31646
Rebased-From: 6b3f6eae70 (partial)
2025-02-21 15:38:43 +00:00
Luke Dashjr
3b22ea1c77 Merge branch 'improve_args_pr31212-28' into qafix_inet_access_pr31646-28 2025-02-21 15:38:36 +00:00
Hodlinator
c58ca376e2 chore: Typo Overriden -> Overridden
Github-Pull: #31433
Rebased-From: 41d934c72d
2025-02-21 15:32:09 +00:00
Luke Dashjr
e99b16626c RPC/rawtransaction: getrawtransaction: Move "confirmations" to "confirmations_assumed" when assumeutxo is applicable 2025-02-21 15:31:21 +00:00
Luke Dashjr
9d12661cfc RPC/blockchain: gettxout: Move "confirmations" to "confirmations_assumed" when assumeutxo is applicable 2025-02-21 15:31:21 +00:00
Luke Dashjr
529fea94db lint/python-dead-code: Just warn, but allow 2025-02-21 15:27:23 +00:00
Luke Dashjr
f1c9717c7e lint/circular-dependencies: Only check for real circular dependencies 2025-02-21 15:27:23 +00:00
Luke Dashjr
3248ebd754 lint/includes: Ignore duplicate includes in .cpp files 2025-02-21 15:27:23 +00:00
Luke Dashjr
2011d6f969 configure: Never error for unused-function warnings 2025-02-21 15:25:57 +00:00
Luke Dashjr
ed77ceddd8 Revert "build: Enable -Wunreachable-code"
This partially reverts commit fa8adbe7c1.
2025-02-17 02:40:35 +00:00
Karl-Johan Alm
6fc46bfe11 test: add test to segwit tests for fee rate when signing raw tx 2025-02-14 21:09:22 +00:00
Karl-Johan Alm
b9cc3aec47 wallet: Display fee rate in signrawtransaction* 2025-02-14 21:09:22 +00:00
Karl-Johan Alm
5d91e03e63 wallet: Show fee in results for signrawtransaction* when known
The fee is considered known when all inputs are segwit inputs (which means amounts are enforced/known)..
2025-02-14 21:09:22 +00:00
Luke Dashjr
7a1133787f script: Return total sum of input amounts from SignTransaction when available 2025-02-14 21:08:40 +00:00
Luke Dashjr
1796674827 Revert "guix: temporarily disable powerpcle taget"
This reverts commit 10d56530e0 (#27897)
2025-02-14 20:46:49 +00:00
Eval EXEC
06c0746152 In InitHardwareRand, do trail test for RNDRRS by VerifyRNDRRS, and fallback to GetRNDR for GetRNDRRS
Signed-off-by: Eval EXEC <execvy@gmail.com>

Github-Pull: #31826
Rebased-From: 585aba6eec858e5b1411ae9a8684ef8f82a7e435
2025-02-14 20:39:14 +00:00
Hennadii Stepanov
b6dcac3f32 depends: Fix CMake-generated libzmq.pc file
See https://github.com/zeromq/libzmq/pull/4706.

Github-Pull: #30508
Rebased-From: 371910a768
2025-02-14 20:33:29 +00:00
Luke Dashjr
b2221bd0ae GUI: Adjust recommended # of blocks confirmed to 16
Using the Antpool conglomerate's 48% would make this absurd (800+ blocks), so instead base it on Foundry at 31%
2025-02-08 22:40:09 +00:00
Luke Dashjr
d4d90dfcd8 RPC/Wallet: Move wtx "confirmations" to "confirmations_assumed" if assumeutxo is applicable 2025-02-08 18:48:56 +00:00
Luke Dashjr
9070630df1 GUI: Treat assumed-confirmed txs as unconfirmed also in TransactionDesc 2025-02-08 18:48:56 +00:00
Luke Dashjr
bcc23f39e0 GUI: Treat assumed-confirmed txs as unconfirmed 2025-02-08 18:48:56 +00:00
Luke Dashjr
bac04ff352 Merge branch 'assumeutxo_unconfirmed_ux_Sjors-28' into assumeutxo_unconfirmed_ux-28 2025-02-08 18:45:53 +00:00
Luke Dashjr
ac55776817 Diff-minimise 2025-02-08 18:40:03 +00:00
Sjors Provoost
f637b331aa gui: add assumed confirmed state
Create a separate status for transactions that are confirmed in
a block that is assumed valid pending background validation.

Use the same icon as for transactions with a single confirmation.

Github-Pull: #28616
Rebased-From: 3e281590c7dfa6d97191c41792d3b9604632d1a7
2025-02-08 18:40:03 +00:00
Sjors Provoost
d8a448249a wallet: add IsTxAssumed() to WalletTxStatus
Determine if a given transaction belongs to a block that is assumed to be valid pending background validation.

Add this information to WalletTxStatus.

Github-Pull: #28616
Rebased-From: a6c53bb24436ecc1ae717b032c0cccdd704044eb
2025-02-08 18:40:02 +00:00
Sjors Provoost
2904c57bc4 wallet: track background validation height
Github-Pull: #28616
Rebased-From: 3f3dbb60d190e76074ec2da7b303d68f89fe28ee
2025-02-08 18:39:55 +00:00
Luke Dashjr
ca56c7c9c4 Diff-minimise 2025-01-25 16:04:47 +00:00
Cory Fields
145dd295d9 tests: add a test for the new blocksdir lock
Github-Pull: #31674
Rebased-From: 2656a5658c
2025-01-25 16:04:47 +00:00
Cory Fields
fac2c9e1a5 init: lock blocksdir in addition to datadir
This guards against 2 processes running with separate datadirs but the same
blocksdir.

It's not likely to happen currently, but may be more relevant in the future
with applications using the kernel.

Note that the kernel does not currently do any dir locking, but it should.

Github-Pull: #31674
Rebased-From: bdc0a68e67
2025-01-25 16:04:47 +00:00
Cory Fields
68e55e2818 refactor: introduce a more general LockDirectories for init
No functional change. This is in preparation for adding additional directory
locks on startup.

Github-Pull: #31674
Rebased-From: cabb2e5c24
2025-01-25 16:04:47 +00:00
Cory Fields
2e7f96e42f init: allow a new xor key to be written if the blocksdir is newly created
A subsequent commit will add a .lock file to this dir at startup, meaning that
the blocksdir is never empty by the time the xor key is being read/written.

Ignore all hidden files when determining if this is the first run.

Github-Pull: #31674
Rebased-From: 1db331ba76
2025-01-25 16:04:46 +00:00
Hennadii Stepanov
b8bf1154e9 depends: Override default build type for libevent
The `libevent` package defaults to the "Release" build type, which
overrides our per-build-type optimization flags with `-O3`.

To prevent this behavior, set `CMAKE_BUILD_TYPE` to "None", consistent
with how other packages are handled.

Github-Pull: #31661
Rebased-From: d44626a9c2
2025-01-23 15:58:00 +00:00
Lőrinc
aa56eaaa78 coins: bump default LevelDB write batch size to 64 MiB
The UTXO set has grown significantly, and flushing it from memory to LevelDB often takes over 20 minutes after a successful IBD with large dbcache values.
The final UTXO set is written to disk in batches, which LevelDB sorts into SST files.
By increasing the default batch size, we can reduce overhead from repeated compaction cycles, minimize constant overhead per batch, and achieve more sequential writes.

Experiments with different batch sizes (loaded via assumeutxo at block 840k, then measuring final flush time) show that 64 MiB batches significantly reduce flush time without notably increasing memory usage:

| dbbatchsize | flush_sum (ms) |
|-------------|----------------|
| 8 MiB       | ~240,000       |
| 16 MiB      | ~220,000       |
| 32 MiB      | ~200,000       |
| *64 MiB*    | *~150,000*     |
| 128 MiB     | ~156,000       |
| 256 MiB     | ~166,000       |
| 512 MiB     | ~186,000       |
| 1 GiB       | ~186,000       |

Checking the impact of a `-reindex-chainstate` with `-stopatheight=878000` and `-dbcache=30000` gives:
16 << 20
```
2025-01-12T07:31:05Z Flushed fee estimates to fee_estimates.dat.
2025-01-12T07:31:05Z [warning] Flushing large (26 GiB) UTXO set to disk, it may take several minutes
2025-01-12T07:53:51Z Shutdown: done
```
Flush time: 22 minutes and 46 seconds

64 >> 20
```
2025-01-12T18:30:00Z Flushed fee estimates to fee_estimates.dat.
2025-01-12T18:30:00Z [warning] Flushing large (26 GiB) UTXO set to disk, it may take several minutes
2025-01-12T18:44:43Z Shutdown: done
```
Flush time: ~14 minutes 43 seconds.

Github-Pull: #31645
Rebased-From: d249a353be58868d41d2a7c57357038ffd779eba
2025-01-15 01:26:31 +00:00
Lőrinc
496dfda7a4 refactor: Fix remaining clang-tidy performance-unnecessary-copy-initialization errors
Github-Pull: #31364
Rebased-From: 3305972f7b
2025-01-15 01:13:30 +00:00
fanquake
5ffa1f9f80 depends: Qt 5.15.15
Github-Pull: #30774
Rebased-From: acf8b52a59565617d89cd9b0006ba54c0a1f448d
2025-01-15 00:31:58 +00:00
MarcoFalke
cdf2241a8e refactor: Avoid UB in SHA3_256::Write
It is UB to apply a distance to a pointer or iterator further than the
end itself, even if the distance is (partially) revoked later on.

Fix the issue by advancing the data pointer at most to the end.

Github-Pull: #31655
Rebased-From: fabeca3458
2025-01-14 23:40:17 +00:00