Commit Graph

37921 Commits

Author SHA1 Message Date
Andrew Poelstra
eb78737ad4 codex32: add functional test for seed import
Github-Pull: #27351
Rebased-From: 91771366a3df22b9e8b4b7152d368d739bfeda94
2023-08-17 18:06:33 +00:00
Andrew Poelstra
6b585a09fa wallet: add ability for importdescriptors to import a seed
Github-Pull: #27351
Rebased-From: e29e656cbdd7e230cd5d04910e93c1cc562d593b
2023-08-17 18:06:28 +00:00
Andrew Poelstra
dba29e603a codex32: provide user-readable error types
Github-Pull: #27351
Rebased-From: 1fa04b11b2452a2f15906d97cf1370d43f0dc23e
2023-08-17 18:01:05 +00:00
Andrew Poelstra
203725def9 codex32: introduce Lagrange interpolation and derived shares
Github-Pull: #27351
Rebased-From: 7eced20085abbfa9412b726ae0f2f4e9013f1148
2023-08-17 18:01:04 +00:00
Andrew Poelstra
e94863bd27 codex32: implement encoding and decoding
Github-Pull: #27351
Rebased-From: fd6975d631f12ff7947db9abfdda4147ddc6cc24
2023-08-17 18:01:03 +00:00
Andrew Poelstra
a1adcf8b2a bech32: expose the character conversion functionality
In the next commit we will implement a new checksum, codex32, which uses
the same encoding and HRP rules as bech32 and bech32m, but has a
substantially different checksum verification procedure. To minimize
duplicated code, we expose the character conversion in a new
bech32::internals module.

Github-Pull: #27351
Rebased-From: 7a57cda8e4461b1ac075251c945eaeb18f1edfd4
2023-08-17 18:00:55 +00:00
Luke Dashjr
ca365ea1a8 Diff-minimise 2023-08-16 19:40:43 +00:00
Andrew Chow
9323152d3a RPC/Wallet: Convert walletprocesspsbt to use options parameter 2023-08-16 19:40:43 +00:00
Luke Dashjr
b11fc0541f Merge branch 'rpcarg_type_per_name' into rpc_walletprocesspsbt_options-25 2023-08-16 19:40:36 +00:00
Luke Dashjr
e400900433 QA: interface_rest: Check /mempool/info/with_fee_histogram matches RPC 2023-08-16 19:40:03 +00:00
Luke Dashjr
8ce5002322 Bugfix: RPC/blockchain: Actually round feerates down for getmempoolinfo fee histograms 2023-08-16 19:40:03 +00:00
Luke Dashjr
4ddc192c92 Bugfix: QA: Ensure mempool_fee_histogram expected feerates rounded down
As of #22949, fees are rounded up based on feerate, but going the opposite direction from fee to feerate still must round down.
2023-08-16 19:40:03 +00:00
Luke Dashjr
4fdce67505 RPC/mempool: Skip result type checks for fee_histogram in getmempoolinfo
fee_histogram contains both dynamic-named group objects as well as a numeric total_fees, which the check cannot handle
Long-term, the result is expected to change to avoid this, so just skip it for now
2023-08-16 19:40:03 +00:00
Luke Dashjr
b1982c627c Bugfix: RPC/blockchain: Correct type of "to_feerate" result in getmempoolinfo fee histogram 2023-08-16 19:40:03 +00:00
Luke Dashjr
211495e574 RPC/blockchain: getmempoolinfo: Return fee_histogram in older format (only) 2023-08-16 19:40:03 +00:00
Kiminuo
b4106f0654 RPC/mempool: Add "to" (end of range) field to fee histogram
Co-authored-by: Jonas Schnelli <dev@jonasschnelli.ch>
Co-authored-by: Jon Atack <jon@atack.com>

Github-Pull: #21422
Rebased-From: 0b87ba9bc3a2ada2839af0e1af868fcd5ddb9155
2023-08-16 19:40:03 +00:00
Luke Dashjr
b84bf8363a Add mempool/fee_histogram option to rest API 2023-08-16 19:40:03 +00:00
Luke Dashjr
24224c038b RPC/blockchain: getmempoolinfo: Enable specifying with_fee_histogram as a boolean to use a sensible default set of fee rate levels 2023-08-16 19:40:02 +00:00
Luke Dashjr
1d76f95b99 Bugfix: QA: Ensure mempool_fee_histogram can adapt to feerate rounding correctly
Caution: This implementation is for a post-#22949 codebase
2023-08-16 19:40:02 +00:00
Jonas Schnelli
f9cdc49f0a RPC/blockchain: Consider ancestor, descendant, and combined fee rates for histogram in getmempoolinfo
Test changes from: 0b6ba66238

Co-authored-by: João Barbosa <joao.paulo.barbosa@gmail.com>
Co-authored-by: Jon Atack <jon@atack.com>
2023-08-16 19:40:02 +00:00
Luke Dashjr
ac6286af7b Merge branch 'rpcarg_type_per_name' into fee_histogram+pr15836_api 2023-08-16 19:39:54 +00:00
Luke Dashjr
183d89ff42 RPC: Support specifying different types for param aliases 2023-08-16 19:35:37 +00:00
Luke Dashjr
636b3aee43 ZMQ: Fallback to ReadBlockFromDisk if cached CBlock is missing in UpdatedBlockTip event 2023-08-02 00:51:32 +00:00
Luke Dashjr
973cdab768 Only include full CBlock in UpdatedBlockTip when it will be used
Avoid keeping it around (increasing memory usage) when nothing will use it
2023-08-02 00:51:32 +00:00
Ryan Ofsky
60ff4ea1d3 wallet: Add tracing for sqlite statements
I found sqlite tracing was useful for debugging a test in #27790, and thought
it might be helpful in other contexts too, so this PR adds an option to enable
it. Tracing is still disabled by default and only shown with `-debug=walletdb
-loglevel=walletdb:trace` options.
2023-07-27 22:32:41 +00:00
furszy
9497ecff9e test: rpc_getblockfrompeer.py, remove magic numbers usage
Instead of hardcoding the `pruneblockchain(<height>)` heights,
use 'getblockfileinfo' to obtain the highest block number of
each of the block files.

Making the test more robust and readable by stating which file
is being pruned at every point of time (the goal is to mimic
how the automatic pruning process work).

Github-Pull: #27770
Rebased-From: 5110139d397486bca7be0cf4c2ec31e304c22d45
2023-07-27 22:31:09 +00:00
furszy
4a1e08b4c2 RPC: introduce 'getblockfileinfo' RPC command
Simple command to retrieve information about a certain block file

Github-Pull: #27770
Rebased-From: f6fb9cdd6e56d46949dff933498f9ac5c65c0b8a
2023-07-27 22:31:08 +00:00
Luke Dashjr
2beadbed30 Merge branch 'rpc_getblocklocations' into rpc_getblockfileinfo-25+knots 2023-07-27 22:30:55 +00:00
Martin Zumsande
adbdff5443 p2p: Log addresses of stalling peers
This allows node operators that have the -logips option enabled
to better identify potentially misbehaving peers and maybe
ban them.

Github-Pull: #27761
Rebased-From: fb02a3cd1a
2023-07-27 22:25:25 +00:00
Hennadii Stepanov
61a6e0ba5f test: Treat bitcoin-wallet binary in the same way as others
This change makes the `bitcoin-wallet` binary path customizable in the
same way how it can be done now with other ones, including `bitcoind`,
`bitcoin-cli` and `bitcoin-util`.

Github-Pull: #27554
Rebased-From: f6d7636be4
2023-07-27 22:14:34 +00:00
glozow
47559b7737 [mempool] clear mapDeltas entry if prioritisetransaction sets delta to 0
It's unnecessary to keep the data around, as it doesn't do anything. If
prioritisetransaction is called again, we'll make a new entry in
mapDeltas.

These entries are only deleted when the transaction is mined or conflicted
from a block (i.e. not in replacement or eviction), are persisted in
mempool.dat, and never expire. If node operators use the RPC to
regularly prioritise/de-prioritise transactions, these (meaningless)
map entries may hang around forever and take up valuable mempool memory.

Github-Pull: #27501
Rebased-From: 67b7fecacd
2023-07-27 21:54:28 +00:00
glozow
c3c5f53c64 [functional test] prioritisation is not removed during replacement and expiry
Github-Pull: #27501
Rebased-From: c1061acb9d
2023-07-27 21:54:28 +00:00
glozow
525933197b [functional test] getprioritisedtransactions RPC
Github-Pull: #27501
Rebased-From: 0e5874f0b0
2023-07-27 21:54:28 +00:00
glozow
c045c80812 [rpc] add getprioritisedtransactions
This allows the user to see prioritisation for not-in-mempool
transactions.

Github-Pull: #27501
Rebased-From: 99f8046829
2023-07-27 21:54:28 +00:00
glozow
a0772a06dc [mempool] add GetPrioritisedTransactions
Github-Pull: #27501
Rebased-From: 9e9ca36c80
2023-07-27 21:54:28 +00:00
Hernan Marino
f87947e5aa qt: show own outputs on PSBT signing window 2023-07-27 21:49:13 +00:00
Luke Dashjr
ee39a9889d Merge branch 'fix_nonstring_onelinedesc-25' into codex32-25+knots 2023-07-27 20:47:07 +00:00
Luke Dashjr
d53acdb6dd Merge branch 'importfromcoldcard' into codex32-25+knots 2023-07-27 20:46:09 +00:00
Luke Dashjr
003f1122b5 Merge branch 'rpc_importaddr_for_descwallet-25+k' into codex32-25+knots 2023-07-27 20:45:26 +00:00
Matthew Zipkin
3f78578fe7 test: cover "ismine" and "isactive" field in rpc getaddressinfo
Github-Pull: #27216
Rebased-From: 67650211e36003ca3adddef34118ea45023c283f
2023-07-27 19:58:17 +00:00
Matthew Zipkin
964ed4b9da test: cover ScriptPubKeyMan::IsKeyActive() and Wallet::IsDestinationActive()
Github-Pull: #27216
Rebased-From: ba65d93a4c4ae1e06fbd5e06ab0b344e77b2c3b0
2023-07-27 19:58:16 +00:00
Matthew Zipkin
a7333dc919 wallet: implement IsDestinationActive() and add to rpc getaddressinfo
This connects SPKM.IsKeyActive() up to the wallet level.

Github-Pull: #27216
Rebased-From: d33f3bdb84f1823aebe3fd88c4b2ec4df1c1fe3d
2023-07-27 19:58:16 +00:00
Matthew Zipkin
9c1936ac89 wallet: implement IsKeyActive() in scriptpubkeyman
This new method returns true if the given CScript key is derived
from the SPKM. For Legacy that means checking the hd_seed_id in the
key's metadata.

Also patches PKDescriptor to return associated public keys in
MakeScripts()

Github-Pull: #27216
Rebased-From: f39957f5deec87d141e995a3bc90cc54e2d0ccbf
2023-07-27 19:58:16 +00:00
Luke Dashjr
631d7eabcc Keep ProcessDescriptorImport exported for bitcoin-wallet importfromcoldcard 2023-07-27 18:57:38 +00:00
Luke Dashjr
0f103d762c Diff-minimise 2023-07-27 18:42:04 +00:00
furszy
c090b420e0 rpc: make importaddress compatible with descriptors wallet
so it's simpler to watch for certain address/hex.

Github-Pull: #27034
Rebased-From: be3ae51ece
2023-07-27 18:42:04 +00:00
Luke Dashjr
2d1a78db3e Bugfix: RPC/Blockchain: Correct getblocklocations return type
(array of objects, not array with named keys)
2023-07-27 00:48:03 +00:00
Luke Dashjr
5baca4d30d RPC/Blockchain: Bugfix: Correct getblocklocations example RPC method name 2023-07-27 00:48:03 +00:00
Luke Dashjr
1df160d36a Bugfix: RPC/blockchain: Hold cs_main for CBlockIndex access as needed to avoid races in getblocklocations 2023-07-27 00:48:03 +00:00
Roman Zeyde
5bbefce63c RPC: Add getblocklocations call
This RPC allows the client to retrieve the file system locations
of the confirmed blocks and their undo data, to allow building
efficient indexes outside of Bitcoin Core.

An example usage is described here:
https://github.com/romanz/electrs/issues/308

By using the new RPC, it is possible to build an address-based
index taking ~24GB and a txindex taking ~6GB (as of Dec. 2020).
2023-07-27 00:48:03 +00:00