Commit Graph

37921 Commits

Author SHA1 Message Date
Luke Dashjr
6ebba87d0c Enable acceptstalefeeestimates by default 2023-10-02 21:26:18 +00:00
Luke Dashjr
daa32813b8 Allow acceptstalefeeestimates on all networks 2023-10-02 21:26:12 +00:00
Luke Dashjr
09b8cf5894 Merge commit '910c36253e4' into fee_est_stalecheck-25+knots 2023-10-02 21:25:47 +00:00
Andrew Chow
b3517cb1b5
test: Test loading wallets with conflicts without a chain
Loading a wallet with conflicts without a chain (e.g. wallet tool and
migration) would previously result in an assertion due to -1 being both
a valid number of conflict confirmations, and the indicator that that
member has not been set yet.

Github-Pull: #28542
Rebased-From: 782701ce7d
2023-10-02 13:39:34 +01:00
Andrew Chow
d63478cb50
wallet: Check last block and conflict height are valid in MarkConflicted
MarkConflicted calculates conflict confirmations incorrectly when both
the last block processed height and the conflicting height are negative
(i.e. uninitialized). If either are negative, we should not be marking
conflicts and should exit early.

Github-Pull: #28542
Rebased-From: 4660fc82a1
2023-10-02 13:29:04 +01:00
ismaelsadeeq
910c36253e
test: ensure old fee_estimate.dat not read on restart and flushed
This commit adds tests to ensure that old fee_estimates.dat files
are not read and that fee_estimates are periodically flushed to the
fee_estimates.dat file.

Additionaly it tests the -regtestonly option -acceptstalefeeestimates.

Github-Pull: #27622
Rebased-From: d2b39e09bc
2023-10-02 13:09:01 +01:00
MarcoFalke
5e51a9cc72
ci: Nuke Android APK task, Use credits for tsan
Github-Pull: #27834
Rebased-From: fa22538e48
2023-10-02 13:09:01 +01:00
ismaelsadeeq
37764d3300
tx fees, policy: read stale fee estimates with a regtest-only option
If -acceptstalefeeestimates option is passed stale fee estimates can now
be read when operating in regtest environments.

Additionally, this commit updates all declarations of the CBlockPolicyEstimator
class to include a the second constructor variable.

Github-Pull: #27622
Rebased-From: cf219f29f3
2023-10-02 13:09:01 +01:00
ismaelsadeeq
16bb9161fa
tx fees, policy: do not read estimates of old fee_estimates.dat
Old fee estimates could cause transactions to become stuck in the
mempool. This commit prevents the node from using stale estimates
from an old file.

Github-Pull: #27622
Rebased-From: 3eb241a141
2023-10-02 13:09:01 +01:00
ismaelsadeeq
c4dd5989b3
tx fees, policy: periodically flush fee estimates to fee_estimates.dat
This reduces chances of having old estimates in fee_estimates.dat.

Github-Pull: #27622
Rebased-From: 5b886f2b43
2023-10-02 13:09:01 +01:00
furszy
c36770cefd
test: wallet, verify migration doesn't crash for an invalid script
The migration process must skip any invalid script inside the legacy
spkm and all the addressbook records linked to them.

These scripts are not being watched by the current wallet, nor should
be watched by the migrated one.

IsMine() returns ISMINE_NO for them.

Github-Pull: #28125
Rebased-From: 8e7e3e6149
2023-10-02 13:09:01 +01:00
furszy
0d2a33e05c
wallet: disallow migration of invalid or not-watched scripts
The legacy wallet allowed to import any raw script, without checking if
it was valid or not. Appending it to the watch-only set.

This causes a crash in the migration process because we are only
expecting to find valid scripts inside the legacy spkm.

These stored scripts internally map to `ISMINE_NO` (same as if they
weren't stored at all..).

So we need to check for these special case, and take into account that
the legacy spkm could be storing invalid not watched scripts.

Which, in code words, means IsMineInner() returning IsMineResult::INVALID
for them.

Github-Pull: #28125
Rebased-From: 1de8a2372a
2023-10-02 13:09:01 +01:00
Pieter Wuille
2c51a07c08
Do not use std::vector = {} to release memory
Github-Pull: #28452
Rebased-From: 3fcd7fc7ff
2023-10-02 13:09:00 +01:00
fanquake
887cbfcc93
Merge bitcoin/bitcoin#28534: [25.x] qt: 25.1rc1 translations update
88b525f93a qt: 25.1rc1 translations update (Hennadii Stepanov)

Pull request description:

  This PR pulls the recent translations from the [Transifex.com](https://www.transifex.com/bitcoin/bitcoin) using the [`bitcoin-maintainer-tools/update-translations.py`](https://github.com/bitcoin-core/bitcoin-maintainer-tools/blob/main/update-translations.py) tool.

  According to our [Release Process docs](https://github.com/bitcoin/bitcoin/blob/master/doc/release-process.md#before-every-release-candidate), it is supposed to be merged before `v25.1rc1` tagging.

  Changes in "Chinese (China) (zh_CN)" translation were manually discarded as they have too many removals (it looks like a vandalism).

ACKs for top commit:
  stickies-v:
    re-ACK 88b525f93a
  jarolrod:
    ACK 88b525f93a

Tree-SHA512: 007d3e00f92d2450f99d1a84b53dc929fd80b7ebb7939271b67969bf99bb3b0ae7426428f6c63f1dbdfa88b90cb237e7614f7b2239f9773b84424b544bf106af
2023-10-02 10:47:32 +02:00
Luke Dashjr
029d5d8e77 Bugfix: QA/wallet_fundrawtransaction: Ensure segwit_inputs_only gets tested correctly
Co-authored-by: Aurèle Oulès <aurele@oules.com>
2023-10-02 01:12:08 +00:00
Sebastian Falbesoner
428578c481 test: avoid sporadic MINIMALDATA failure in feature_taproot.py (fixes #27595)
The functional test feature_taproot.py fails in some rare cases on the
execution of the `"branched_codesep"` spending script. The problem
occurs if the first data-push (having random content with a random
length in the range [0, 510]) has a length of 1 and the single byte has
value of [1...16] or [-1]; in this case, the data-push is not minimally
encoded by test framework's CScript class (i.e. doesn't use the special
op-codes OP_1...OP_16 or OP_1NEGATE) and the script interpreter throws
an SCRIPT_ERR_MINIMALDATA error:

```
test_framework.authproxy.JSONRPCException: non-mandatory-script-verify-flag (Data push larger than necessary) (-26)
```

Background:
The functional test framework's CScript class translates passed
bytes/bytearrays always to data pushes using OP_PUSHx/OP_PUSHDATA{1,2,4}
op-codes. E.g. the expression `CScript(bytes([1]))` yields
`bytes([OP_PUSH1, 1])` instead of the minimal-encoded `bytes([OP_1])`.

Fix this by adapting the random-size range to [2,...], i.e. never pass
byte-arrays below length two to be pushed.

Closes #27595.

Github-Pull: #27631
Rebased-From: 54877253c8
2023-09-29 02:21:26 +00:00
Hennadii Stepanov
88b525f93a
qt: 25.1rc1 translations update 2023-09-28 15:50:04 +01:00
Luke Dashjr
a28118c5c4 RPC/Blockchain: Optimise getblock for simple disk->hex case 2023-09-27 02:46:52 +00:00
Luke Dashjr
1bfbc750dd Diff-minimise 2023-09-22 20:40:16 +00:00
Luke Dashjr
c10f1326aa Bugfix: GUI/PSBTOperationsDialog: Pass feerate limit as a CFeeRate instead of assuming 1kvB
Github-Pull: #28345
Rebased-From: 6cd57e509c2f72ce4cd3abd71f18527c0a839695
2023-09-22 20:40:16 +00:00
Luke Dashjr
b152fb564a Bugfix: RPC/Mempool: Pass CFeeRate to BroadcastTransaction to correctly account for non-weight vsize
Github-Pull: #28345
Rebased-From: ae232c72384c4b2b0cacb85eaeedd79fa78a9f73
2023-09-22 20:40:16 +00:00
Luke Dashjr
14c2af07ae node: Refactor BroadcastTransaction to accept a CFeeRate maximum
Github-Pull: #28345
Rebased-From: 46e993c57e212725418aa3a6d8495a454b56b344
2023-09-22 20:40:11 +00:00
Luke Dashjr
9cb2925be9 Merge branch 'fix_pkg_eval_sigops_pr28471-25+knots' into fix_bytespersigop_checks-25 2023-09-22 18:06:02 +00:00
Greg Sanders
c6dfebd149 Add functional test to catch too large vsize packages
Github-Pull: #28471
Rebased-From: eb8f58f5e4
2023-09-22 18:05:33 +00:00
Greg Sanders
8f0bc19767 Handle over-sized (in virtual bytes) packages with no in-mempool ancestors
Github-Pull: #28471
Rebased-From: 1a579f9d01
2023-09-22 18:05:33 +00:00
Luke Dashjr
1d8b2d966c Bugfix: Pass correct virtual size to CheckPackageLimits
Github-Pull: #28471
Rebased-From: bc013fe8e3
2023-09-22 18:05:33 +00:00
Greg Sanders
189f0bff22 Replace MAX_PACKAGE_SIZE with MAX_PACKAGE_WEIGHT to avoid vbyte confusion
While allowing submitted packages to be slightly larger than what
may be allowed in the mempool to allow simpler reasoning
about contextual-less checks vs chain limits.

Github-Pull: #28471
Rebased-From: 533660c58a
2023-09-22 18:05:33 +00:00
Luke Dashjr
9d58bf6a27 Merge branch 'qa_tfw_generate_keypair-21' into fix_pkg_eval_sigops_pr28471-25+knots 2023-09-22 17:53:46 +00:00
Sebastian Falbesoner
d2548cd38a test: introduce generate_keypair helper with WIF support
In functional tests it is a quite common scenario to generate fresh
elliptic curve keypairs, which is currently a bit cumbersome as it
involves multiple steps, e.g.:

    privkey = ECKey()
    privkey.generate()
    privkey_wif = bytes_to_wif(privkey.get_bytes())
    pubkey = privkey.get_pubkey().get_bytes()

Simplify this by providing a new `generate_keypair` helper function that
returns the private key either as `ECKey` object or as WIF-string
(depending on the boolean `wif` parameter) and the public key as
byte-string; these formats are what we mostly need (currently we don't
use `ECPubKey` objects from generated keypairs anywhere).

With this, most of the affected code blocks following the pattern above
can be replaced by one-liners, e.g.:

    privkey, pubkey = generate_keypair(wif=True)

Github-Pull: #27733
Rebased-From: 1a572ce7d6 [partial]
2023-09-22 17:21:14 +00:00
stratospher
f3a5a77b16 test: add functional test for getaddrmaninfo
Github-Pull: #27511
Rebased-From: 28bac81a34
2023-09-22 04:36:00 +00:00
stratospher
5726951f23 rpc: Introduce getaddrmaninfo for count of addresses stored in new/tried table
Github-Pull: #27511
Rebased-From: c8eb8dae51
2023-09-22 04:34:54 +00:00
kevkevin
2a3756d2ef doc, refactor: Changing -torcontrol help to specify that a default port is used
Right now when we get the help for -torcontrol it says that there is a
default ip and port we dont specify if there is a specified ip that we
would also use port 9051 as default

Github-Pull: #28101
Rebased-From: 9a84200cfc
2023-09-15 21:05:05 +00:00
Kratos
c8ed62aa4d fix: unnecessary continuation after finding mutation
Github-Pull: #28430
Rebased-From: 42b25bbd93
2023-09-13 17:14:29 +00:00
Luke Dashjr
8570175428 GUI: Include optional URI in command line help
Inspired-by: b45658ad093b61e92e9b2edbfb7003bf544e52ab (gui#752)
2023-09-13 17:11:32 +00:00
furszy
ddf30ef3f9 index: coinstats reorg, fail when block cannot be reversed
During a reorg, continuing execution when a block cannot be
reversed leaves the coinstats index in an inconsistent state,
which was surely overlooked when 'CustomRewind' was implemented.

Github-Pull: #28427
Rebased-From: eef595560e
2023-09-12 01:44:40 +00:00
fanquake
ecc74cd4f3
Merge bitcoin/bitcoin#28047: [25.x] Further backports for 25.1
494f1afa5a depends: xcb-proto 1.15.2 (fanquake)
513ca0a711 test: wallet, add coverage for watch-only raw sh script migration (furszy)
6d5a510dcd descriptor: InferScript, do not return top-level only func as sub descriptor (furszy)
37d9cc657c test: wallet, add coverage for addressbook migration (furszy)
4b16650c10 wallet: migration bugfix, persist empty labels (furszy)
59b06b696a wallet: migration bugfix, clone 'send' record label to all wallets (furszy)

Pull request description:

  Currently backports:
  * #28038
  * #28067 2nd & 3rd commits.
  * #28097

ACKs for top commit:
  stickies-v:
    ACK 494f1afa5a

Tree-SHA512: cea134cfa72950d8428191adce79c0881302ca54488f64d3d4a5f9070bb2445d8074e58fa31a482481c4eabb74c852a025f53597540fc646dc20f33b21cf0a06
2023-09-06 15:55:51 +01:00
Luke Dashjr
956479b630 Diff-minimise 2023-09-06 11:58:49 +00:00
Yusuf Sahin HAMZA
49a61ba7f0 rpc, docs: Add note for commands that supports only legacy wallets
Note is added for following rpc commands:

importprivkey, importpubkey, importwallet, dumpprivkey,
dumpwallet, importmulti, addmultisigaddress, sethdseed

Github-Pull: #25680
Rebased-From: 9141e4395a
2023-09-06 11:52:30 +00:00
Sebastian Falbesoner
16cbff2829 test: fix feature_addrman.py on big-endian systems
The test `feature_addrman.py` currently serializes the addrdb without
specifying endianness for `int`s, so the machine's native byte order is used (see
https://docs.python.org/3/library/struct.html#byte-order-size-and-alignment)
and the generated `peers.dat` would be invalid on big-endian systems.
Fix this by explicitly specifying little-endian serialization via the
`<` character in `struct.pack(...)`.

Github-Pull: #27529
Rebased-From: 53c990ad34
2023-09-06 03:26:14 +00:00
Matthew Zipkin
bbd7021a0e wallet rpc: return final tx hex from walletprocesspsbt if complete
Github-Pull: #28414
Rebased-From: e3d484b603
2023-09-05 22:29:41 +00:00
Luke Dashjr
6fc7e56161 Merge branch 'rpc_walletprocesspsbt_options-25' into HEAD 2023-09-05 22:23:29 +00:00
Luke Dashjr
04c6ba58e0 txdb: Increase max dbcache size to 1 TB 2023-09-05 22:05:43 +00:00
Luke Dashjr
8009cc1263 Merge branch 'neutrino_whitelist-mini' into whitelist_outgoing-mini-25+knots 2023-08-28 17:26:08 +00:00
Luke Dashjr
fdf53a874d Diff-minimise 2023-08-24 19:07:26 +00:00
Luke Dashjr
21a7f5ad0c Refactor to avoid conflicts in new p2p permissions 2023-08-24 19:07:26 +00:00
Luke Dashjr
e529e00643 Include "blockfilters" in NetPermissions::ToStrings as appropriate 2023-08-24 19:07:26 +00:00
Luke Dashjr
76f055d909 net: Add blockfilters white{bind,list} permission flag 2023-08-24 19:07:26 +00:00
Luke Dashjr
0d26160765 Diff-minimise 2023-08-19 20:47:27 +00:00
furszy
44377d2c69 gui: make '-min' minimize wallet loading dialog
When '-min' is enabled, no loading dialog should
be presented on screen during startup.

Github-Pull: gui#749
Rebased-From: 32db15450a
2023-08-19 20:47:27 +00:00
Pieter Wuille
cd5476aa0f Rework receive buffer pushback
Co-authored-by: Anthony Towns <aj@erisian.com.au>

Github-Pull: #27981
Rebased-From: 3388e523a1
2023-08-19 20:34:21 +00:00