Commit Graph

41699 Commits

Author SHA1 Message Date
Sjors Provoost
404b01c436
rpc: getblocktemplate getTipHash() via Miner interface 2024-06-18 18:47:51 +02:00
Sjors Provoost
d8a3496b5a
rpc: call TestBlockValidity via miner interface 2024-06-18 18:47:51 +02:00
Sjors Provoost
8ecb681678
Introduce Mining interface
Start out with a single method isTestChain() that's used by the getblocktemplate RPC.
2024-06-18 18:47:51 +02:00
Greg Sanders
4ccb3d6d0d fuzz: have package_rbf always make small txns
The fuzz target is generating a large amount of
transactions, but the core of the logic is
ConsumeTxMemPoolEntry making the mempool
entries for adding to the mempool. Since
ConsumeTxMemPoolEntry generates its own transaction
"vsize", we can improve efficiency of the target
by explicitly creating very small transactions,
reducing the hashing and memory burden.
2024-06-18 10:19:41 -04:00
Greg Sanders
ff4558d441 doc: reword package RBF documentation 2024-06-18 09:30:30 -04:00
Cory Fields
8acdf66540 upnp: add compatibility for miniupnpc 2.2.8
See: c0a50ce33e

The return value of 2 now indicates:
"A valid connected IGD has been found but its IP address is reserved (non routable)"

We continue to ignore any return value other than 1.
2024-06-18 12:24:48 +00:00
glozow
f543852a89 rename policy/v3_policy.* to policy/truc_policy.* 2024-06-18 13:06:36 +01:00
fanquake
81d4dc8e87
build: use -no_exported_symbols on macOS
This reduces the size of the binary by 2-3% when building with
`--enable-reduce-exports`.
2024-06-18 13:03:32 +01:00
merge-script
9c5cdf07f3
Merge bitcoin/bitcoin#30287: macOS: rewrite some docs & swap mmacosx-version-min for mmacos-version-min
7c298fe0df doc: rewrite some of the macdeploy docs (fanquake)
d042230f7a depends: swap mmacosx-version-min for mmacos-version-min (fanquake)

Pull request description:

  Whilst `-mmacosx-version-min` and `-mmacos-version-min` remain aliases for each other, the later is preferred,
  and I assume the former will be removed at some point in the future; see: https://github.com/llvm/llvm-project/pull/95374.

  Somewhat of a followup to #21778. Rewrite some of the mac deploy docs.

ACKs for top commit:
  theuni:
    utACK 7c298fe0df
  TheCharlatan:
    ACK 7c298fe0df
  hebasto:
    ACK 7c298fe0df.

Tree-SHA512: 6493f087fde93e0eec319af0e105d163b3f047d8a03f7d4b0d6cd7c64b58d0a978b7d67c6b8dba5c6ccf8b10e188aab5dc98eec400b0546dc9ee801a689b4332
2024-06-18 10:55:46 +01:00
merge-script
5fbdfe7104
Merge bitcoin/bitcoin#30299: ci: remove unused bcc variable from workflow
518b06c4b8 ci: remove unused bcc variable from workflow (Max Edwards)

Pull request description:

  Fixes https://github.com/bitcoin/bitcoin/pull/30193#discussion_r1636804002

ACKs for top commit:
  maflcko:
    lgtm ACK 518b06c4b8

Tree-SHA512: c87364670e26e15176ee21372a2cc100db0c275a5cffb37cc33ec4c2d85d6067b593bd4a6dea37bf478d2af197786df9dfac3cfb76db023c8db37184bb104458
2024-06-18 10:55:16 +01:00
merge-script
a1537ba1a3
Merge bitcoin/bitcoin#30282: Revert "contrib: macdeploy: monkey-patch gen-sdk to be deterministic"
b03a45b13e Revert "contrib: macdeploy: monkey-patch gen-sdk to be deterministic" (fanquake)

Pull request description:

  This reverts commit ba30a5407e.

  We no-longer support Python 3.8, so remove the monkey patching.

ACKs for top commit:
  hebasto:
    ACK b03a45b13e, I have reviewed the code and it looks OK.

Tree-SHA512: 5bf68c2b332f18a620a8a6f77812ed93afa988016847bec1d3b7355670301dc957442ac47191a0cb7c3fe607d902914fb00c96345c8170f2a64429638c00b3c4
2024-06-18 10:26:11 +01:00
Max Edwards
518b06c4b8 ci: remove unused bcc variable from workflow 2024-06-18 10:16:30 +01:00
Greg Sanders
de669a883b doc: replace mention of V3 with TRUC 2024-06-17 17:26:23 -04:00
Ava Chow
41544b8f96
Merge bitcoin/bitcoin#28984: Cluster size 2 package rbf
94ed4fbf8e Add release note for size 2 package rbf (Greg Sanders)
afd52d8e63 doc: update package RBF comment (Greg Sanders)
6e3c4394cf mempool: Improve logging of replaced transactions (Greg Sanders)
d3466e4cc5 CheckPackageMempoolAcceptResult: Check package rbf invariants (Greg Sanders)
316d7b63c9 Fuzz: pass mempool to CheckPackageMempoolAcceptResult (Greg Sanders)
4d15bcf448 [test] package rbf (glozow)
dc21f61c72 [policy] package rbf (Suhas Daftuar)
5da3967815 PackageV3Checks: Relax assumptions (Greg Sanders)

Pull request description:

  Allows any 2 transaction package with no in-mempool ancestors to do package RBF when directly conflicting with other mempool clusters of size two or less.

  Proposed validation steps:
  1) If the transaction package is of size 1, legacy rbf rules apply.
  2) Otherwise the transaction package consists of a (parent, child) pair with no other in-mempool ancestors (or descendants, obviously), so it is also going to create a cluster of size 2. If larger, fail.
  3) The package rbf may not evict more than 100 transactions from the mempool(bip125 rule 5)
  4) The package is a single chunk
  5) Every directly conflicted mempool transaction is connected to at most 1 other in-mempool transaction (ie the cluster size of the conflict is at most 2).
  6) Diagram check: We ensure that the replacement is strictly superior, improving the mempool
  7) The total fee of the package, minus the total fee of what is being evicted, is at least the minrelayfee * size of the package (equivalent to bip125 rule 3 and 4)

  Post-cluster mempool this will likely be expanded to general package rbf, but this is what we can safely support today.

ACKs for top commit:
  achow101:
    ACK 94ed4fbf8e
  glozow:
    reACK 94ed4fbf8e via range-diff
  ismaelsadeeq:
    re-ACK 94ed4fbf8e
  theStack:
    Code-review ACK 94ed4fbf8e
  murchandamus:
    utACK 94ed4fbf8e

Tree-SHA512: 9bd383e695964f362f147482bbf73b1e77c4d792bda2e91d7f30d74b3540a09146a5528baf86854a113005581e8c75f04737302517b7d5124296bd7a151e3992
2024-06-17 17:22:43 -04:00
Ava Chow
ddf2ebd465
Merge bitcoin/bitcoin#30058: Encapsulate warnings in generalized node::Warnings and remove globals
260f8da71a refactor: remove warnings globals (stickies-v)
9c4b0b7ce4 node: update uiInterface whenever warnings updated (stickies-v)
b071ad9770 introduce and use the generalized `node::Warnings` interface (stickies-v)
20e616f864 move-only: move warnings from common to node (stickies-v)
bed29c481a refactor: remove unnecessary AppendWarning helper function (stickies-v)

Pull request description:

  This PR:
  - moves warnings from common to the node library and into the node namespace (as suggested in https://github.com/bitcoin/bitcoin/pull/29845#discussion_r1570069541)
  - generalizes the warnings interface to `Warnings::Set()` and `Warnings::Unset()` methods, instead of having a separate function and globals for each warning. As a result, this simplifies the `kernel::Notifications` interface.
  - removes warnings.cpp from the kernel library
  - removes warning globals
  - adds testing for the warning logic

  Behaviour change introduced:
  - the `-alertnotify` command is executed for all `KernelNotifications::warningSet` calls, which now also covers the `LARGE_WORK_INVALID_CHAIN` warning
  - the GUI is updated automatically whenever a warning is (un)set, covering some code paths where it previously wouldn't be, e.g. when `node::AbortNode()` is called, or for the `LARGE_WORK_INVALID_CHAIN` warning

  Some discussion points:
  - ~is `const std::string& id` the best way to refer to warnings? Enums are an obvious alternative, but since we need to define warnings across libraries, strings seem like a straightforward solution.~ _edit: updated approach to use `node::Warning` and `kernel::Warning` enums._

ACKs for top commit:
  achow101:
    ACK 260f8da71a
  ryanofsky:
    Code review ACK 260f8da71a. Only change since last review was rebasing
  TheCharlatan:
    Re-ACK 260f8da71a

Tree-SHA512: a3fcedaee0d3ad64e9c111aeb30665162f98e0e72acd6a70b76ff2ddf4f0a34da4f97ce353c322a1668ca6ee4d8a81cc6e6d170c5bbeb7a43cffdaf66646b588
2024-06-17 17:09:18 -04:00
Ava Chow
d97ddbe797
Merge bitcoin/bitcoin#30193: ci: move ASan job to GitHub Actions from Cirrus CI
9eea51d905 ci: move Asan / LSan / USDT job to Github Actions (Max Edwards)
4b527fa93b ci: add IPV6 network to ci container (Max Edwards)

Pull request description:

  PR for moving the ASAN + LSAN + USDT + friends job to github actions from Cirrus.

  The motivation for this PR is that this task needs a full VM (or bare metal) to function, because of the tracepoints. It can not run in a container on an arbitrary Linux, because the outside machine must exactly match the specification of the distro used in the CI task config. This requires more maintenance for the persistent worker, and I think moving to GHA will reduce the maintenance burden, or at least make it possible for anyone to work on.

  Also, it makes it easier to run the task on forks (bitcoin-inquisition, bitcoin-knots, devel forks, ...) without having to set-up a real machine.

ACKs for top commit:
  maflcko:
    review ACK 9eea51d905
  achow101:
    ACK 9eea51d905
  hebasto:
    ACK 9eea51d905.

Tree-SHA512: 1111c1c9e3a11e725dff1344643fff3c91fb9b4d7c1cc9a7d507a8f146f5223316a00272030b41ae37ecb59d044f2e90e1cd907450049b25f094f0b60643d4c7
2024-06-17 15:49:43 -04:00
Ava Chow
f011022d53
Merge bitcoin/bitcoin#30195: test: Added test coverage to listsinceblock rpc
881724d443 test: Added test coverage to listsinceblock rpc (kevkevinpal)

Pull request description:

  This change is meant to add test coverage to this rpc error https://github.com/bitcoin/bitcoin/blob/master/src/wallet/rpc/transactions.cpp#L666C53-L666C79

  This is done by renaming the first block in the blocks folder

  ---

  Doing a quick grep for the error code in our functional tests leads to zero results
  `grep -nri "Can't read block from disk" ./test/functional/`

ACKs for top commit:
  achow101:
    ACK 881724d443
  tdb3:
    re ACK for 881724d443
  rkrux:
    tACK [881724](881724d443)

Tree-SHA512: c5dff20cf014d0181f49d6b161f1364e1c6b79e8661047f77f07e21e59f4d1f2fd6f745538c8fc5bd6d4244650a840dd64d184634366f7c21fa67141a60af44a
2024-06-17 15:35:49 -04:00
Ava Chow
4bcef32a93
Merge bitcoin/bitcoin#28312: test: fix keys_to_multisig_script (P2MS) helper for n/k > 16
5cf0a1f230 test: add `createmultisig` P2MS encoding test for all n (1..20) (Sebastian Falbesoner)
0570d2c204 test: add unit test for `keys_to_multisig_script` (Sebastian Falbesoner)
0c41fc3fa5 test: fix `keys_to_multisig_script` (P2MS) helper for n/k > 16 (Sebastian Falbesoner)

Pull request description:

  While reviewing #28307, I noticed that the test framework's `key_to_multisig_script` helper (introduced in #23305) is broken for pubkey count (n) and threshold (k) values larger than 16. This is due to the implementation currently enforcing a direct single-byte data push (using `CScriptOp.encode_op_n`), which obviously fails for values 17+. Fix that by passing the numbers directly to the CScript list, where it's automatically converted to minimally-encoded pushes (see class method `CScript.__coerce_instance`, branch `isinstance(other, int)`).

  The second commit adds a unit test to ensure that the encoding  is correct.

ACKs for top commit:
  achow101:
    ACK 5cf0a1f230
  tdb3:
    ACK 5cf0a1f230
  rkrux:
    reACK [5cf0a1f](5cf0a1f230)

Tree-SHA512: 4168a165c3f483ec8e37a27dba1628a7ea0063545a2b7e74d9e20d753fddd7e33d37e1a190434fa6dca39adf9eef5d0211f7a0c1c7b44979f0a3bb350e267562
2024-06-17 15:18:08 -04:00
Ava Chow
808898fddf
Merge bitcoin/bitcoin#30291: test: write functional test results to csv
ad06e68399 test: write functional test results to csv (tdb3)

Pull request description:

  Adds argument `--resultsfile` to test_runner.py.
  Enables functional test results to be written to a (csv) file for processing by other applications (or for historical archiving).
  Test name, status, and duration are written to the file provided with the argument.

  Since `test_runner.py` is being touched, also fixes a misspelling (linter warning).   Can split into its own commit if desired.

  #### Notes
   - Total runtime of functional tests has seemed to have increased on my development machines over the past few months (more tests added, individual test runtime increase, etc.).  Was interested in recording test runtime data over time to detect trends.  Initially searched `doc/benchmarking.md`, existing PRs, and Issues, but didn't immediately see this type of capability or alternate solutions (please chime in if you know of one!).  Thought it would be beneficial to add this capability to `test_runner` to facilitate this type of data analysis (and potentially other use cases)
   - Saw https://github.com/bitcoin/bitcoin/blob/master/test/functional/README.md#benchmarking-with-perf, and this PR's higher level data seems complimentary.
   - Was on the fence as to whether to expand `print_results()` (i.e. take advantage of the same loop over `test_results`) or implement in a separate `write_results()` function.  Decided on the latter for now, but interested in reviewers' thoughts.

  #### Example 1: all tests pass
  ```
  $ test/functional/test_runner.py --resultsfile functional_test_results.csv --cachedir=/mnt/tmp/cache --tmpdir=/mnt/tmp feature_blocksdir wallet_startup feature_config_args mempool_accept
  Temporary test directory at /mnt/tmp/test_runner_₿_🏃_20240614_201625
  Test results will be written to functional_test_results.csv
  ...

  $ cat functional_test_results.csv
  test,status,duration(seconds)
  feature_blocksdir.py,Passed,1
  feature_config_args.py,Passed,29
  mempool_accept.py,Passed,9
  wallet_startup.py,Passed,2
  ALL,Passed,29
  ```

  #### Example 2: one test failure
  ```
  $ cat functional_test_results.csv
  test,status,duration(seconds)
  feature_blocksdir.py,Passed,1
  feature_config_args.py,Passed,28
  wallet_startup.py,Passed,2
  mempool_accept.py,Failed,1
  ALL,Failed,28
  ```

ACKs for top commit:
  maflcko:
    re-ACK ad06e68399
  kevkevinpal:
    tACK [ad06e68](ad06e68399)
  achow101:
    ACK ad06e68399
  rkrux:
    tACK [ad06e68](ad06e68399)
  brunoerg:
    ACK ad06e68399
  marcofleon:
    Good idea, tested ACK ad06e68399

Tree-SHA512: 561194406cc744905518aa5ac6850c07c4aaecdaf5d4d8b250671b6e90093d4fc458f050e8a85374e66359cc0e0eaceba5eb24092c55f0d8f349d744a32ef76c
2024-06-17 14:54:08 -04:00
josibake
a9c7300135
move-only: refactor CreateTransactionInternal
Move the output serialization size and dust calculation into the loop where the
outputs are iterated over to calculate the total sum.

Move the code for adding the the txoutputs to the transaction to after
coin selection.

While this code structure generally follows a more logical flow,
the primary motivation for moving the code for adding outputs to the
transaction sets us up nicely for silent payments (in a future PR):
we need to know the input set before generating the final output scriptPubKeys.
2024-06-17 20:25:27 +02:00
josibake
adc6ab25bb
wallet: use CRecipient instead of CTxOut
Now that a CRecipient holds a CTxDestination, we can get the serialized
size and determine if the output is dust using the CRecipient directly.
This does not change any current behavior, but provides a nice generalization
that can be used to apply special logic to a CTxDestination serialization
and dust calculations in the future.

Specifically, in a later PR when support for `V0SilentPayment` destinations is
added, we need to use `WitnessV1Taproot` as the scriptPubKey for serialized
size calcuations whenever the `CRecipient` destination is a `V0SilentPayment`
destination.
2024-06-17 20:25:03 +02:00
stratospher
e075fd131d test: Introduce test types and modify v2 handshake function accordingly
Prior to this commit, TestEncryptedP2PState would always
send initial_v2_handshake bytes in 2 parts (as required
by early key response test).

For generalising this test and having different v2 handshake
behaviour based on the test type, special behaviours like
sending initial_v2_handshake bytes in 2 parts are executed
only if test_type is set to EARLY_KEY_RESPONSE.
2024-06-17 09:59:54 +05:30
tdb3
ad06e68399
test: write functional test results to csv
Adds argument --resultsfile to test_runner.py.
Writes comma-separated functional test name, status,
and duration to the file provided with the argument.
Also fixes minor typo in test_runner.py
2024-06-16 22:51:12 -04:00
kevkevinpal
881724d443
test: Added test coverage to listsinceblock rpc
This change adds a test to add coverage to the rpc error that emmits the message "Can't
read block from disk"
2024-06-16 13:30:56 -04:00
Ava Chow
2c79abc7ad
Merge bitcoin/bitcoin#27969: bumpfee: ignore WALLET_INCREMENTAL_RELAY_FEE when user specifies fee_rate
f58beabe75 test: bumpfee with user specified fee_rate ignores walletIncrementalRelayFee (ismaelsadeeq)
436e88f433 bumpfee: ignore WALLET_INCREMENTAL_RELAY_FEE when user specifies fee rate (ismaelsadeeq)

Pull request description:

  Fixes #26973

  When using the `bumpfee` RPC and manually specifying `fee_rate`, there should be no requirement that the new fee must be at least the sum of the original fee and `incrementalFee` (maximum of `relayIncrementalFee` and `WALLET_INCREMENTAL_RELAY_FEE`).

  This restriction should only apply when user did not specify `fee_rate`.
  > because the GUI doesn't let the user specify the new fee rate yet (https://github.com/bitcoin-core/gui/issues/647), it would be very annoying to have to bump 20 times to increment by 20 sat/vbyte.

  The restriction should instead be the new fee must be at least the sum of the original fee and `incrementalFee` (`relayIncrementalFee`)

ACKs for top commit:
  achow101:
    ACK f58beabe75
  murchandamus:
    ACK f58beabe75

Tree-SHA512: 193259f87173b7d5a8e68e0e29f2ca7e75c550e3cf0dee3d6d822b5b1e07c2e6dec0bfc8fb435855736ebced97a10dbdbfef72e8c5abde06fdefcba122f2e7f1
2024-06-14 14:46:04 -04:00
Ava Chow
538497ba27
Merge bitcoin/bitcoin#30255: log: use error level for critical log messages
fae3a1f006 log: use error level for critical log messages (MarcoFalke)

Pull request description:

  This picks up the first commit from https://github.com/bitcoin/bitcoin/pull/29231, but extends it to also cover cases that were missed in it.

  As per https://github.com/bitcoin/bitcoin/blob/master/doc/developer-notes.md#logging, LogError should be used for severe problems that require the node to shut down.

ACKs for top commit:
  stickies-v:
    re-ACK fae3a1f006, I'm ~0 on the latest force push as `user_error` was already logged at the right level through `GetNotifications().fatalError(user_error);` so I'd be in favour of deduplicating/cleaning up this logging logic but can be done in follow-up.
  kevkevinpal:
    ACK [fae3a1f](fae3a1f006)
  achow101:
    ACK fae3a1f006

Tree-SHA512: 3f99fd25d5a204d570a42d8fb2b450439aad7685692f9594cc813d97253c4df172a6ff3cf818959bfcf25dfcf8ee9a9c9ccc6028fcfcecdb47591e18c77ef246
2024-06-14 14:34:48 -04:00
Vasil Dimov
4d81b4de33
fuzz: FuzzedSock::Recv() don't lose bytes from MSG_PEEK read
Problem:

If `FuzzedSock::Recv(N, MSG_PEEK)` is called then `N` bytes would be
retrieved from the fuzz provider, saved in `m_peek_data` and returned
to the caller (ok).

If after this `FuzzedSock::Recv(M, 0)` is called where `M < N`
then the first `M` bytes from `m_peek_data` would be returned
to the caller (ok), but the remaining `N - M` bytes in `m_peek_data`
would be discarded/lost (not ok). They must be returned by a subsequent
`Recv()`.

To resolve this, only remove the head `N` bytes from `m_peek_data`.
2024-06-14 14:56:17 +02:00
Vasil Dimov
b51d75ea97
fuzz: simplify FuzzedSock::m_peek_data
`FuzzedSock::m_peek_data` need not be an optional of a vector.
It can be just a vector whereas an empty vector denotes "no peek data".
2024-06-14 14:44:26 +02:00
Vasil Dimov
1245d1388b
netbase: extend CreateSock() to support creating arbitrary sockets
Allow the callers of `CreateSock()` to pass all 3 arguments to the
`socket(2)` syscall. This makes it possible to create sockets of
any domain/type/protocol.
2024-06-14 14:23:50 +02:00
Cory Fields
26a7f70b5d ci: enable self-assignment clang-tidy check 2024-06-14 10:27:03 +00:00
Cory Fields
32b1d13792 refactor: add self-assign checks to classes which violate the clang-tidy check
Both of these cases appear to be harmless, but adding the tests allows us to
turn on the aggressive clang-tidy checks.
2024-06-14 10:27:03 +00:00
merge-script
0b94fb8720
Merge bitcoin/bitcoin#30281: Update leveldb subtree to latest upstream
a37778d4d3 Squashed 'src/leveldb/' changes from e2f10b4e47..688561cba8 (fanquake)

Pull request description:

  Includes https://github.com/bitcoin-core/leveldb-subtree/pull/41 which is used in #30234.

ACKs for top commit:
  theuni:
    utACK 95812d912b

Tree-SHA512: 3d943695a3d33816cf5558b183f5629aa92a500a1544eecedf84952e93c8592a8cf0d554b88281fc0bad3c9e920ebcff1ed8edc12f8e73f36ed5335482beb829
2024-06-14 11:26:02 +01:00
merge-script
54c5f67c38
Merge bitcoin/bitcoin#30276: doc: archive release notes for v27.1
e71a21b641 doc: archive release notes for v27.1 (fanquake)

Pull request description:

ACKs for top commit:
  benalleng:
    ACK for e71a21b

Tree-SHA512: a89231d09b442e5e1755135a475030648a81bb0c331eec8d9c7a27a633f64fd0449dcfe8939c0d43cc5133ad0ab85acda7de757594986f9c93fe6f90efc11a02
2024-06-14 11:17:12 +01:00
fanquake
7c298fe0df
doc: rewrite some of the macdeploy docs
Somewhat of a followup to #21778.
2024-06-14 09:43:36 +01:00
fanquake
d042230f7a
depends: swap mmacosx-version-min for mmacos-version-min
Whilst these remain aliases for each other, the later is preferred,
and I assume the former will be removed at some point in the future;
see: https://github.com/llvm/llvm-project/pull/95374.
2024-06-14 09:43:36 +01:00
merge-script
8efc346e3b
Merge bitcoin/bitcoin#30278: test: cover more errors for signrawtransactionwithkey RPC
e2779ce98b test: cover more errors for `signrawtransactionwithkey` RPC (brunoerg)

Pull request description:

  This PR adds test coverage for the following errors for the `signrawtransactionwithkey` RPC:

  - Invalid private key
  - TX decode failed

  For reference: https://maflcko.github.io/b-c-cov/total.coverage/src/rpc/rawtransaction.cpp.gcov.html

ACKs for top commit:
  maflcko:
    ACK e2779ce98b
  kevkevinpal:
    ACK [e2779ce](e2779ce98b)
  tdb3:
    ACK e2779ce98b
  BrandonOdiwuor:
    Code Review ACK e2779ce98b

Tree-SHA512: 41c7e990684b60645cf4ccec8aad5ebbe61da221871eb3c1685b2bb1eebda58b29358502cb1525b7c7a2b612e2bebf449ed0bae14ab663b4641c528a9c013b5b
2024-06-14 09:42:20 +01:00
Ava Chow
fcc3b653dc
Merge bitcoin/bitcoin#29607: refactor: Reduce memory copying operations in bech32 encoding
07f64177a4 Reduce memory copying operations in bech32 encode (Lőrinc)
d5ece3c4b5 Reserve hrp memory in Decode and LocateErrors (Lőrinc)

Pull request description:

  Started optimizing the base conversions in [TryParseHex](https://github.com/bitcoin/bitcoin/pull/29458), [Base58](https://github.com/bitcoin/bitcoin/pull/29473) and [IsSpace](https://github.com/bitcoin/bitcoin/pull/29602) - this is the next step.

  Part of this change was already merged in https://github.com/bitcoin/bitcoin/pull/30047, which made decoding `~26%` faster.

  Here I've reduced the memory reallocations and copying operations in bech32 encode, making it `~15%` faster.

  >  make && ./src/bench/bench_bitcoin --filter='Bech32Encode' --min-time=1000

  Before:
  ```
  |             ns/byte |              byte/s |    err% |     total | benchmark
  |--------------------:|--------------------:|--------:|----------:|:----------
  |               19.97 |       50,074,562.72 |    0.1% |      1.06 | `Bech32Encode`
  ```

  After:
  ```
  |             ns/byte |              byte/s |    err% |     total | benchmark
  |--------------------:|--------------------:|--------:|----------:|:----------
  |               17.33 |       57,687,668.20 |    0.1% |      1.10 | `Bech32Encode`
  ```

ACKs for top commit:
  josibake:
    ACK 07f64177a4
  sipa:
    utACK 07f64177a4
  achow101:
    ACK 07f64177a4

Tree-SHA512: 511885217d044ad7ef2bdf9203b8e0b94eec8b279bc193bb7e63e29ab868df6d21e9e4c7a24390358e1f9c131447ee42039df72edcf1e2b11e1856eb2b3e10dd
2024-06-13 12:18:49 -04:00
Greg Sanders
94ed4fbf8e Add release note for size 2 package rbf 2024-06-13 09:52:59 -04:00
Greg Sanders
afd52d8e63 doc: update package RBF comment 2024-06-13 09:52:59 -04:00
Greg Sanders
6e3c4394cf mempool: Improve logging of replaced transactions 2024-06-13 09:52:59 -04:00
Greg Sanders
d3466e4cc5 CheckPackageMempoolAcceptResult: Check package rbf invariants 2024-06-13 09:52:59 -04:00
Greg Sanders
316d7b63c9 Fuzz: pass mempool to CheckPackageMempoolAcceptResult 2024-06-13 09:52:59 -04:00
glozow
4d15bcf448 [test] package rbf 2024-06-13 09:52:59 -04:00
Suhas Daftuar
dc21f61c72 [policy] package rbf
Support package RBF where the conflicting package would result
in a mempool cluster of size two, and each of its direct
conflicts are also part of an up-to-size-2 mempool cluster.

This restricted topology allows for exact calculation
of miner scores for each side of the equation, reducing
the surface area for new pins, or incentive-incompatible
replacements.

This allows wallets to create simple CPFP packages
that can fee bump other simple CPFP packages. This,
leveraged with other restrictions such as V3 transactions,
can create pin-resistant applications.

Future package RBF relaxations can be considered when appropriate.

Co-authored-by: glozow <gloriajzhao@gmail.com>
Co-authored-by: Greg Sanders <gsanders87@gmail.com>
2024-06-13 09:52:59 -04:00
fanquake
b03a45b13e
Revert "contrib: macdeploy: monkey-patch gen-sdk to be deterministic"
This reverts commit ba30a5407e.
2024-06-13 13:48:26 +01:00
fanquake
95812d912b
Update leveldb-subtree subtree to latest upstream 2024-06-13 13:17:57 +01:00
fanquake
a37778d4d3 Squashed 'src/leveldb/' changes from e2f10b4e47..688561cba8
688561cba8 Merge bitcoin-core/leveldb-subtree#41: Ignore clang's self-assignment check
7045a90ed7 Ignore clang's self-assignment check

git-subtree-dir: src/leveldb
git-subtree-split: 688561cba8746482893f835c4829e4eb4a5b7615
2024-06-13 13:17:57 +01:00
merge-script
080a47cb8a
Merge bitcoin/bitcoin#30270: Update minisketch subtree to eb37a9b8e79f9e49d73b96a49bf97a96d9eb676c
cb59af38e7 Squashed 'src/minisketch/' changes from 3472e2f5ec..eb37a9b8e7 (fanquake)

Pull request description:

  Includes https://github.com/sipa/minisketch/pull/87 which is used in https://github.com/bitcoin/bitcoin/pull/30234.
  Includes https://github.com/sipa/minisketch/pull/88 which is used in https://github.com/bitcoin/bitcoin/pull/29876.

ACKs for top commit:
  sipa:
    utACK 89464ad59c
  theuni:
    utACK 89464ad59c

Tree-SHA512: 838a8c60856bfdf714da7d5d97e31d458290849ba5007d5c5bb7abb83d413ada6b4c16e45b0e060ff892b5785e6b664be9b6a666d04f0a414b0e359d64d3ad44
2024-06-13 12:30:38 +01:00
stickies-v
260f8da71a
refactor: remove warnings globals 2024-06-13 11:20:49 +01:00
stickies-v
9c4b0b7ce4
node: update uiInterface whenever warnings updated
This commit introduces slight behaviour change. Previously, the
GUI status bar would be updated for most warnings, namely
UNKNOWN_NEW_RULES_ACTIVATED, CLOCK_OUT_OF_SYNC and
PRE_RELEASE_TEST_BUILD, but not for LARGE_WORK_INVALID_CHAIN
(and not for FATAL_INTERNAL_ERROR, but that is not really
meaningful).

Fix this by always updating the status bar when the warnings are
changed.
2024-06-13 11:20:48 +01:00