Commit Graph

39764 Commits

Author SHA1 Message Date
fanquake
7c248b972b
Merge bitcoin/bitcoin#29042: doc: Clarify C++20 comments
fa87f8feb7 doc: Clarify C++20 comments (MarcoFalke)

Pull request description:

  Turns out "class template argument deduction for aggregates" is one of the few things implemented only in recent compilers, see https://en.cppreference.com/w/cpp/compiler_support/20

  So clarify the comments.

ACKs for top commit:
  hebasto:
    ACK fa87f8feb7, I verified the code with clang-{16,17}.

Tree-SHA512: f6d20f946cb6f8e34db224e074ed8f9dfa598377c066d1b58a8feb9e64d007444f1e2c0399e91a3e282fd5d59f90e0d7df90aa3956824d96bc78070ee12f603c
2024-01-05 15:37:06 +00:00
fanquake
c80f57ba57
Merge bitcoin/bitcoin#29177: build: Fix check whether -latomic needed
f8ca1357c8 build: Fix check whether `-latomic` needed (Hennadii Stepanov)

Pull request description:

  Clang >=15 still might need linking against `libatomic`.

  We use `std::atomic<std::chrono::seconds>::compare_exchange_strong` in `net_processing.cpp`.

  Addresses the https://github.com/bitcoin/bitcoin/pull/29165#discussion_r1440293694.

ACKs for top commit:
  maflcko:
    lgtm ACK f8ca1357c8
  fanquake:
    ACK f8ca1357c8

Tree-SHA512: ba8b6a88fd3471a206d068e8a000a053c99cb46d26bd04624418ddb066b3b9664a569ec8a1569af67c96b3e27f13dccbd5e24f985290ac072b6d74c92524e35d
2024-01-05 10:52:17 +00:00
fanquake
143ace65db
Merge bitcoin/bitcoin#28890: rpc: Remove deprecated -rpcserialversion
fa46cc22bc Remove deprecated -rpcserialversion (MarcoFalke)

Pull request description:

  The flag is problematic for many reasons:

  * It is deprecated
  * It is a global flag, requiring a restart to change, as opposed to a flag that can be set on each RPC invocation
  * It may be hidden in config files by accident, hard to debug, causing LND crashes and bugs, see https://github.com/bitcoin/bitcoin/issues/28730#issuecomment-1780940868
  * It makes performance improvements harder to implement: https://github.com/bitcoin/bitcoin/pull/17529#issuecomment-556082818

  Fix all issues by removing it.

  If there is a use-case, likely a per-RPC flag can be added, if needed.

ACKs for top commit:
  ajtowns:
    crACK fa46cc22bc
  TheCharlatan:
    lgtm ACK fa46cc22bc

Tree-SHA512: 96ba1c60356ce93954fe5c2a59045771c6d1516ad0d9dc436ef1800a1f1b0153f0d5fb78ca99d53ad54ba25fbce36962bdf1d4325aceedfc8154a61347a6a915
2024-01-05 10:42:10 +00:00
MarcoFalke
fa87f8feb7
doc: Clarify C++20 comments 2024-01-05 11:22:31 +01:00
Ava Chow
d44554567f
Merge bitcoin/bitcoin#28832: fuzz: rule-out too deep derivation paths in descriptor parsing targets
a44808fb43 fuzz: rule-out too deep derivation paths in descriptor parsing targets (Antoine Poinsot)

Pull request description:

  This fixes the `mocked_descriptor_parse` timeout reported in #28812 and direct the targets more toward what they are intended to fuzz: the descriptor syntax.

ACKs for top commit:
  sipa:
    utACK a44808fb43
  achow101:
    ACK a44808fb43
  dergoegge:
    ACK a44808fb43 - Not running into timeouts anymore
  TheCharlatan:
    ACK a44808fb43

Tree-SHA512: a5dd1dbe9adf8f088bdc435addab88b56f435e6d7d2065bd6d5c6d80a32e3f1f97d3d2323131ab233618cd6dcc477c458abe3c4c865ab569449b8bc176231e93
2024-01-04 18:10:22 -05:00
glozow
737e5884cc
Merge bitcoin/bitcoin#29169: Update libsecp256k1 subtree to current master
29fde0223a Squashed 'src/secp256k1/' changes from 199d27cea3..efe85c70a2 (fanquake)

Pull request description:

  This includes changes from the 0.4.1 release: https://github.com/bitcoin-core/secp256k1/releases/tag/v0.4.1.

  > The point multiplication algorithm used for ECDH operations (module ecdh) was replaced with a slightly faster one.

  > Optional handwritten x86_64 assembly for field operations was removed because modern C compilers are able to output more efficient assembly. This change results in a significant speedup of some library functions when handwritten x86_64 assembly is enabled (--with-asm=x86_64 in GNU Autotools, -DSECP256K1_ASM=x86_64 in CMake), which is the default on x86_64. Benchmarks with GCC 10.5.0 show a 10% speedup for secp256k1_ecdsa_verify and secp256k1_schnorrsig_verify.

ACKs for top commit:
  hebasto:
    re-ACK e2cdeb5925
  jonasnick:
    reACK e2cdeb5925

Tree-SHA512: eaa82721b63e84b9d8dae82956d5e75dbcee50c58c9049b7901055d79aef938bd268e18ce4ff85feb73aae7ee1cf58018b93067692f8f69f80216d336bd6f10a
2024-01-04 16:55:02 +00:00
Ava Chow
d84f736ba1
Merge bitcoin/bitcoin#29176: wallet: Fix use-after-free in WalletBatch::EraseRecords
faebf1df2a wallet: Fix use-after-free in WalletBatch::EraseRecords (MarcoFalke)

Pull request description:

  Creating a copy of the pointer to the underlying data of the stream is not enough to copy the data.

  Currently this happens to work sometimes, because the stream may not immediately free unused memory. However, there is no guarantee by the stream interface to always behave this way. Also, if `vector::clear` is called on the underlying memory, any pointers to it are invalid.

  Fix this, by creating a full copy of all bytes.

ACKs for top commit:
  achow101:
    ACK faebf1df2a

Tree-SHA512: 79ede9bc16cf257609545597bc6d9623ceead4531780ea6037cc5684aa3a7c7d80601354d315358defe47193f978a8ce40c5dc4637e32936c76157679b549ac5
2024-01-04 10:19:48 -05:00
fanquake
e2cdeb5925
Update secp256k1 subtree to latest master 2024-01-04 14:40:28 +00:00
fanquake
29fde0223a Squashed 'src/secp256k1/' changes from 199d27cea3..efe85c70a2
efe85c70a2 Merge bitcoin-core/secp256k1#1466: release cleanup: bump version after 0.4.1
4b2e06f460 release cleanup: bump version after 0.4.1
1ad5185cd4 Merge bitcoin-core/secp256k1#1465: release: prepare for 0.4.1
672053d801 release: prepare for 0.4.1
1a81df826e Merge bitcoin-core/secp256k1#1380: Add ABI checking tool for release process
74a4d974d5 doc: Add ABI checking with `check-abi.sh` to the Release Process
e7f830e32c Add `tools/check-abi.sh`
77af1da9f6 Merge bitcoin-core/secp256k1#1455: doc: improve secp256k1_fe_set_b32_mod doc
3928b7c383 doc: improve secp256k1_fe_set_b32_mod doc
5e9a4d7aec Merge bitcoin-core/secp256k1#990: Add comment on length checks when parsing ECDSA sigs
4197d667ec Merge bitcoin-core/secp256k1#1431: Add CONTRIBUTING.md
0e5ea62207 CONTRIBUTING: add some coding and style conventions
e2c9888eee Merge bitcoin-core/secp256k1#1451: changelog: add entry for "field: Remove x86_64 asm"
d2e36a2b81 changelog: add entry for "field: Remove x86_64 asm"
1a432cb982 README: update first sentence
0922a047fb docs: move coverage report instructions to CONTRIBUTING
76880e4015 Add CONTRIBUTING.md including scope and guidelines for new code
d3e29db8bb Merge bitcoin-core/secp256k1#1450: Add group.h ge/gej equality functions
04af0ba162 Replace ge_equals_ge[,j] calls with group.h equality calls
60525f6c14 Add unit tests for group.h equality functions
a47cd97d51 Add group.h ge/gej equality functions
10e6d29b60 Merge bitcoin-core/secp256k1#1446: field: Remove x86_64 asm
07687e811d Merge bitcoin-core/secp256k1#1393: Implement new policy for VERIFY_CHECK and #ifdef VERIFY (issue #1381)
bb4672342e remove VERIFY_SETUP define
a3a3e11acd remove unneeded VERIFY_SETUP uses in ECMULT_CONST_TABLE_GET_GE macro
a0fb68a2e7 introduce and use SECP256K1_SCALAR_VERIFY macro
cf25c86d05 introduce and use SECP256K1_{FE,GE,GEJ}_VERIFY macros
5d89bc031b remove superfluous `#ifdef VERIFY`/`#endif` preprocessor conditions
c2688f8de9 redefine VERIFY_CHECK to empty in production (non-VERIFY) mode
5814d8485c Merge bitcoin-core/secp256k1#1438: correct assertion for secp256k1_fe_mul_inner
c1b4966410 Merge bitcoin-core/secp256k1#1445: bench: add --help option to bench_internal
f07cead0ca build: Don't call assembly an optimization
2f0762fa8f field: Remove x86_64 asm
1ddd76af0a bench: add --help option to bench_internal
e72103932d Merge bitcoin-core/secp256k1#1441: asm: add .note.GNU-stack section for non-exec stack
ea47c82e01 Merge bitcoin-core/secp256k1#1442: Return temporaries to being unsigned in secp256k1_fe_sqr_inner
dcdda31f2c Tighten secp256k1_fe_mul_inner's VERIFY_BITS checks
10271356c8 Return temporaries to being unsigned in secp256k1_fe_sqr_inner
33dc7e4d3e asm: add .note.GNU-stack section for non-exec stack
c891c5c2f4 Merge bitcoin-core/secp256k1#1437: ci: Ignore internal errors of snapshot compilers
8185e72d29 ci: Ignore internal errors in snapshot compilers
40f50d0fbd Merge bitcoin-core/secp256k1#1184: Signed-digit based ecmult_const algorithm
8e2a5fe908 correct assertion for secp256k1_fe_mul_inner
355bbdf38a Add changelog entry for signed-digit ecmult_const algorithm
21f49d9bec Remove unused secp256k1_scalar_shr_int
115fdc7232 Remove unused secp256k1_wnaf_const
aa9f3a3c00 ecmult_const: add/improve tests
4d16e90111 Signed-digit based ecmult_const algorithm
ba523be067 make SECP256K1_SCALAR_CONST reduce modulo exhaustive group order
2140da9cd5 Add secp256k1_scalar_half for halving scalars (+ tests/benchmarks).
1f1bb78b7f Merge bitcoin-core/secp256k1#1430: README: remove CI badge
5dab0baa80 README: remove CI badge
b314cf2833 Merge bitcoin-core/secp256k1#1426: ci/cirrus: Add native ARM64 jobs
fa4d6c76b6 ci/cirrus: Add native ARM64 persistent workers
ee7aaf213e Merge bitcoin-core/secp256k1#1395: tests: simplify `random_fe_non_zero` (remove loop limit and unneeded normalize)
ba9cb6f378 Merge bitcoin-core/secp256k1#1424: ci: Bump major versions for docker actions
d9d80fd155 ci: Bump major versions for docker actions
4fd00f4bfe Merge bitcoin-core/secp256k1#1422: cmake: Install `libsecp256k1.pc` file
421d84855a ci: Align Autotools/CMake `CI_INSTALL` directory names
9f005c60d6 cmake: Install `libsecp256k1.pc` file
2262d0eaab ci/cirrus: Bring back skeleton .cirrus.yml without jobs
b10ddd2bd2 Merge bitcoin-core/secp256k1#1416: doc: Align documented scripts with CI ones
49be5be9e8 Merge bitcoin-core/secp256k1#1390: tests: Replace counting_illegal_callbacks with CHECK_ILLEGAL_VOID
cbf3053ff1 Merge bitcoin-core/secp256k1#1417: release cleanup: bump version after 0.4.0
9b118bc7fb release cleanup: bump version after 0.4.0
70303643cf tests: add CHECK_ERROR_VOID and use it in scratch tests
f8d7ea68df tests: Replace counting_illegal_callbacks with CHECK_ILLEGAL_VOID
b0f7bfedc9 doc: Do not mention soname in CHANGELOG.md "ABI Compatibility" section
bd9d98d353 doc: Align documented scripts with CI ones
a1d52e3e12 tests: remove unnecessary test in run_ec_pubkey_parse_test
875b0ada25 tests: remove unnecessary set_illegal_callback
c45b7c4fbb refactor: introduce testutil.h (deduplicate `random_fe_`, `ge_equals_` helpers)
dc5514144f tests: simplify `random_fe_non_zero` (remove loop limit and unneeded normalize)
e02f313b1f Add comment on length checks when parsing ECDSA sigs

git-subtree-dir: src/secp256k1
git-subtree-split: efe85c70a2e357e3605a8901a9662295bae1001f
2024-01-04 14:40:28 +00:00
Hennadii Stepanov
f8ca1357c8
build: Fix check whether -latomic needed 2024-01-04 11:47:47 +00:00
MarcoFalke
faebf1df2a
wallet: Fix use-after-free in WalletBatch::EraseRecords 2024-01-04 12:16:36 +01:00
Gloria Zhao
65c05db660
Merge bitcoin/bitcoin#29013: test: doc: follow-up #28368
b1318dcc56 test: change `m_submitted_in_package` input to fuzz data provider boolean (ismaelsadeeq)
5615e16b70 tx fees: update `m_from_disconnected_block` to `m_mempool_limit_bypassed` (ismaelsadeeq)
fcd4296648 doc: fix typo and update incorrect comment (ismaelsadeeq)
562664d263 test: wait for fee estimator to catch up before estimating fees (ismaelsadeeq)

Pull request description:

  This is a simple PR that does two things
  1.   Fixes #29000 by waiting for the fee estimator to catch up after `removeForBlock` calls before calling `estimateFee` in the `BlockPolicyEstimates` unit test.

  2. Addressed some outstanding review comments from #28368
  - Updated `NewMempoolTransactionInfo::m_from_disconnected_block` to `NewMempoolTransactionInfo::m_mempool_limit_bypassed` which now correctly indicates what the boolean does.
  - Changed  input of `processTransaction`'s tx_info  `m_submitted_in_package` input from false to fuzz data provider boolean.
  - Fixed some typos, and update incorrect comment

ACKs for top commit:
  martinus:
    re-ACK b1318dcc56
  glozow:
    utACK b1318dcc56

Tree-SHA512: 45268729bc044da4748fe004524e0df696d2ec92c5bd053db9aad6e15675f3838429b2a7b9061a6b694be4dc319d1782a876b44df506ddd439d62ad07252d0e1
2024-01-03 11:23:27 +00:00
Ava Chow
c3038bf95a
Merge bitcoin/bitcoin#29076: fuzz: set m_fallback_fee and m_fee_mode in wallet_fees target
e03d6f7ed5 fuzz: set `m_fallback_fee`/`m_fee_mode` in `wallet_fees` target (brunoerg)

Pull request description:

  `m_fallback_fee` and `m_fee_mode` are used in `GetMinimumFeeRate` but we're not setting any value for them in `wallet_fees` target. That's the reason fuzzing is never reaching the following code:

  ![Screenshot 2023-12-13 at 15 04 30](https://github.com/bitcoin/bitcoin/assets/19480819/454ddcaa-75ca-452f-ad13-5f142de0bdce)

  This PR fixes it.

ACKs for top commit:
  maflcko:
    review ACK e03d6f7ed5
  achow101:
    ACK e03d6f7ed5
  murchandamus:
    ACK e03d6f7ed5

Tree-SHA512: 5d364f5351d65762a3ddf88e3abb7bda401b7e4955285e083031d216fb50082b1ea98e2c065aff75a5a8a3d1bc4c2e5e3ca9f9478d902ee8f8d4347b6cbe53af
2024-01-02 11:33:29 -05:00
Ava Chow
00bf4a1711
Merge bitcoin/bitcoin#26684: bench: add readblock benchmark
1c4b9cbe90 bench: add readblock benchmark (Andrew Toth)

Pull request description:

  Requested in https://github.com/bitcoin/bitcoin/pull/13151#issuecomment-385962450.
  See https://github.com/bitcoin/bitcoin/pull/26415 and https://github.com/bitcoin/bitcoin/pull/21319.

  Benchmarking shows a >50x increase in speed on both nvme and spinning disk.

  Benchmark results:
  |               ns/op |                op/s |    err% |          ins/op |          cyc/op |    IPC |         bra/op |   miss% |     total | benchmark
  |--------------------:|--------------------:|--------:|----------------:|----------------:|-------:|---------------:|--------:|----------:|:----------
  |        5,377,375.00 |              185.96 |    0.2% |   60,125,513.00 |   11,633,676.00 |  5.168 |   3,588,800.00 |    0.4% |      0.09 | `ReadBlockFromDiskTest`

  |               ns/op |                op/s |    err% |          ins/op |          cyc/op |    IPC |         bra/op |   miss% |     total | benchmark
  |--------------------:|--------------------:|--------:|----------------:|----------------:|-------:|---------------:|--------:|----------:|:----------
  |           89,945.58 |           11,117.83 |    0.7% |       12,743.90 |       64,530.33 |  0.197 |       2,595.20 |    0.2% |      0.01 | `ReadRawBlockFromDiskTest`

ACKs for top commit:
  maflcko:
    lgtm ACK 1c4b9cbe90
  achow101:
    ACK 1c4b9cbe90
  TheCharlatan:
    ACK 1c4b9cbe90

Tree-SHA512: 71dbcd6c7e2be97eb3001e35d0a95ef8e0c9b10dc9193025c7f8e11a09017fa2fbf89489b686353cd88fb409fb729fe2c4a25c567d2988f64c9c164ab09fba9f
2024-01-02 11:12:32 -05:00
Ava Chow
265250687b
Merge bitcoin/bitcoin#28455: refactor: share and use GenerateRandomKey helper
fa1d49542e refactor: share and use `GenerateRandomKey` helper (Sebastian Falbesoner)

Pull request description:

  Making the `GeneratingRandomKey` helper (recently introduced in PR #28433, commit b6934fd03f) available to other modules via key.{h.cpp} allows us to create random private keys directly at CKey instantiation, in contrast to the currently needed two-step process of creating an (invalid) CKey instance first and then having to call `MakeNewKey(...)`.

  This is mostly used in unit tests and a few instances in the wallet.

ACKs for top commit:
  Sjors:
    re-ACK fa1d49542e
  achow101:
    ACK fa1d49542e
  sipa:
    utACK fa1d49542e
  kristapsk:
    cr utACK fa1d49542e
  stratospher:
    ACK fa1d495.

Tree-SHA512: 6fec73f33efe5bd77ca7d3c2fc06725d96f789f229294c39377e682ff222cfc7990b77c92e0bfd4cb6cf891d007ab1f86d395907511f06e87044bae37652a2fd
2024-01-02 10:56:43 -05:00
Ava Chow
d036a86815
Merge bitcoin/bitcoin#28978: doc: Add multiprocess design doc
91dc48c148 doc: Add multiprocess design doc (Ryan Ofsky)

Pull request description:

  Add multiprocess design doc and existing multiprocess documentation into design and usage sections.

  Links to rendered markdown:

  https://github.com/ryanofsky/bitcoin/blob/pr/ipcdoc/doc/design/multiprocess.md
  https://github.com/ryanofsky/bitcoin/blob/pr/ipcdoc/doc/multiprocess.md

  ---

  This PR is part of the [process separation project](https://github.com/bitcoin/bitcoin/issues/28722).

ACKs for top commit:
  fjahr:
    ACK 91dc48c148
  achow101:
    ACK 91dc48c148
  TheCharlatan:
    ACK 91dc48c148
  stickies-v:
    ACK 91dc48c148 - left a couple of improvements but agreed that iterating in future PRs is better.

Tree-SHA512: 8890abd85555eb3a64e75e3393f867839771a83aaba7667c19eccac2e959fb37b13c3bc1906ff06ff3d66609e2c72835b4b9a22d31e997af4489092418eeb001
2024-01-02 10:45:11 -05:00
ismaelsadeeq
b1318dcc56 test: change m_submitted_in_package input to fuzz data provider boolean
In reality some mempool transaction might be submitted in a package,
so change m_submitted_in_package to fuzz data provider boolean just like
m_has_no_mempool_parents.
2024-01-02 12:41:01 +01:00
ismaelsadeeq
5615e16b70 tx fees: update m_from_disconnected_block to m_mempool_limit_bypassed
The boolean indicates whether the transaction was added without enforcing mempool
fee limits. m_mempool_limit_bypassed is the correct variable name.

Also changes NewMempoolTransactionInfo booleans descriptions to the format that
is consistent with the codebase.
2024-01-02 12:41:01 +01:00
ismaelsadeeq
fcd4296648 doc: fix typo and update incorrect comment 2024-01-02 12:40:11 +01:00
Antoine Poinsot
a44808fb43
fuzz: rule-out too deep derivation paths in descriptor parsing targets
This fixes the reported timeouts and direct the target cycles toward what it's intended to fuzz: the descriptor syntax.
2023-12-31 16:19:56 +01:00
Sebastian Falbesoner
fa1d49542e refactor: share and use GenerateRandomKey helper
Making the `GenerateRandomKey` helper available to other modules via
key.{h.cpp} allows us to create random private keys directly at
instantiation of CKey, in contrast to the two-step process of creating
the instance and then having to call `MakeNewKey(...)`.
2023-12-23 13:26:00 +01:00
Ryan Ofsky
91dc48c148 doc: Add multiprocess design doc
Also split up existing multiprocess documentation into design and usage
sections
2023-12-22 16:23:33 -05:00
fanquake
4b1196a985
Merge bitcoin/bitcoin#28880: build: switch to using LLVM 17.x for macOS builds
b335710782 depends: patch around non-determinism in qt (fanquake)
e8ecec4575 build: rename native_clang to native_llvm (fanquake)
b0c290340c Revert "build: Patch Qt to handle minimum macOS version properly" (fanquake)
558250dec1 guix: use clang-toolchain-17 for macOS build (fanquake)
5ddd7c65b4 build: Bump `native_clang` up to 17.0.6 (Hennadii Stepanov)

Pull request description:

  This is the last step before #21778. We need LLVM 17.x so that lld has `-fixup_chains`.

ACKs for top commit:
  theuni:
    ACK b335710782.
  TheCharlatan:
    ACK b335710782

Tree-SHA512: 8142956196a481178f360258c2e4d924178d552966b713323f29f2deba7e5ec73a3da1c9d79d97c9e7f6aa18ed7429cd6660826aa633e6dde1ac56000b9ad57f
2023-12-22 10:35:06 +00:00
Ava Chow
dca0f231fa
Merge bitcoin/bitcoin#29056: refactor: Print verbose serialize compiler error messages
fae526345d Allow std::byte C-style array serialization (MarcoFalke)
fa898e6836 refactor: Print verbose serialize compiler error messages (MarcoFalke)

Pull request description:

  Currently, trying to serialize an object that can't be serialized will fail with a short error message. For example, the diff and the error message:

  ```diff
  diff --git a/src/test/serialize_tests.cpp b/src/test/serialize_tests.cpp
  index d75eb499b4..773f49845b 100644
  --- a/src/test/serialize_tests.cpp
  +++ b/src/test/serialize_tests.cpp
  @@ -62,6 +62,8 @@ public:

   BOOST_AUTO_TEST_CASE(sizes)
   {
  +    int b[4];
  +    DataStream{} << b << Span{b};
       BOOST_CHECK_EQUAL(sizeof(unsigned char), GetSerializeSize((unsigned char)0));
       BOOST_CHECK_EQUAL(sizeof(int8_t), GetSerializeSize(int8_t(0)));
       BOOST_CHECK_EQUAL(sizeof(uint8_t), GetSerializeSize(uint8_t(0)));
  ```

  ```
  ./serialize.h:765:6: error: member reference base type 'const int[4]' is not a structure or union
    765 |     a.Serialize(os);
        |     ~^~~~~~~~~~
  ```
  ```
  ./serialize.h:277:109: error: no matching function for call to 'UCharCast'
    277 | template <typename Stream, typename B> void Serialize(Stream& s, Span<B> span) { (void)/* force byte-type */UCharCast(span.data()); s.write(AsBytes(span)); }
        |                                                                                                             ^~~~~~~~~
  ```

  This is fine. However, it would be more helpful for developers and more accurate by the compiler to explain why each function is not selected.

  Fix this by using C++20 concepts where appropriate.

ACKs for top commit:
  ajtowns:
    reACK fae526345d
  achow101:
    ACK fae526345d
  TheCharlatan:
    Re-ACK fae526345d

Tree-SHA512: e03a684ccfcc5fbcad7f8a4899945a05989b555175fdcaebdb113aff46b52b4ee7b467192748edf99c5c348a620f8e52ab98bed3f3fca88280a64dbca458fe8a
2023-12-21 12:27:21 -05:00
Ava Chow
eefe4bacdd
Merge bitcoin/bitcoin#29027: wallet: fix key parsing check for miniscript expressions
e1281f1bbd wallet: fix key parsing check for miniscript expressions in `ParseScript` (brunoerg)

Pull request description:

  In `ParseScript`, when processing miniscript expressions, the way we check for key parsing error is wrong, the actual code is unreachable because we're checking it into `if (node)` (successful parsing) statement.

ACKs for top commit:
  sipa:
    utACK e1281f1bbd
  RandyMcMillan:
    utACK e1281f1bbd
  achow101:
    ACK e1281f1bbd

Tree-SHA512: c4b3765d32673928a1f6d84ecbaa311870da9a9625753ed15ea57c802a9f16ddafa48c1dc66c0e4be284c5862e7821ed94135498ed9b9f3d7342a080035da289
2023-12-21 12:06:35 -05:00
fanquake
b335710782
depends: patch around non-determinism in qt 2023-12-21 09:37:33 +00:00
fanquake
e8ecec4575
build: rename native_clang to native_llvm
This is more correct, as this is downloading LLVM, and already unpacking
and using more than just clang.
2023-12-21 09:37:33 +00:00
fanquake
b0c290340c
Revert "build: Patch Qt to handle minimum macOS version properly"
This reverts commit 05aca09381.
2023-12-21 09:37:33 +00:00
fanquake
558250dec1
guix: use clang-toolchain-17 for macOS build
Version is 17.0.6.
2023-12-21 09:37:33 +00:00
Hennadii Stepanov
5ddd7c65b4
build: Bump native_clang up to 17.0.6 2023-12-21 09:37:32 +00:00
Ava Chow
7524fcff86
Merge bitcoin/bitcoin#28372: fuzz: coinselection, improve min_viable_change/change_output_size
cd810075ed fuzz: coinselection, improve `min_viable_change`/`change_output_size` (brunoerg)

Pull request description:

  Instead of "randomly" fuzzing `min_viable_change` and `change_output_size`, and since they're correlated, this PR changes the approach to fuzz them according to the logic in `CreateTransactionInternal`.

ACKs for top commit:
  murchandamus:
    ACK cd810075ed
  achow101:
    ACK cd810075ed
  furszy:
    Code ACK cd810075ed

Tree-SHA512: 4539b469f00cdf666078d80c07ed062726f804e390400348148cd3092db9cdc178c6d00ead39aef19acf97badfb6576ce23546d8967387e81c5398d52d7f4404
2023-12-20 19:45:41 -05:00
glozow
3a0f54dd24
Merge bitcoin/bitcoin#29115: [doc]: add doxygen comment describing what CheckPackageLimits returns
19bb65bf25 [doc]: add doxygen return comment for CheckPackageLimits (ismaelsadeeq)

Pull request description:

  This PR adds a  doxygen comment on `CheckPackageLimits` describing what the method returns.

  Fixes https://github.com/bitcoin/bitcoin/pull/28863#discussion_r1429805433

ACKs for top commit:
  Sjors:
    utACK 19bb65bf25
  Zero-1729:
    utACK 19bb65bf25

Tree-SHA512: ccf1cc00a44d3fff60f28ad6766019a9f61b349729eab3cb02bc76b13c2e55441348a1602d806e60e4b2eabeb1f5d1ddacddf86c0bcdb78b078bb3a863b650c2
2023-12-20 10:48:41 +00:00
Ava Chow
e3847f7ac4
Merge bitcoin/bitcoin#29037: Add multiplication operator to CFeeRate
1757452cc5 test: Add tests for CFeeRate multiplication operator (Kashif Smith)
1553c80786 Add multiplication operator to CFeeRate (Murch)

Pull request description:

  Allows us to use
  `coin_selection_params.m_long_term_feerate * 3`
  or
  `3 * coin_selection_params.m_long_term_feerate`
  instead of
  `CFeeRate{coin_selection_params.m_long_term_feerate.GetFee(3000)}`

  inspired by https://github.com/bitcoin/bitcoin/pull/27877#discussion_r1414455724

ACKs for top commit:
  kevkevinpal:
    reACK [1757452](1757452cc5)
  achow101:
    ACK 1757452cc5
  ajtowns:
    ACK 1757452cc5 ; lgtm
  ismaelsadeeq:
    ACK 1757452cc5

Tree-SHA512: a86faac1efd1b7688630cd811246533d184d56b62064a7fd9007de95dbf81fa668aa2252253d102fba67517b6a4ca2dc367c5388b8ab936215734d7d370740cf
2023-12-19 19:36:06 -05:00
ismaelsadeeq
19bb65bf25 [doc]: add doxygen return comment for CheckPackageLimits 2023-12-19 17:12:45 +01:00
glozow
dd391944dc
Merge bitcoin/bitcoin#28863: wallet, mempool: propagete checkChainLimits error message to wallet
8dec9c560b wallet, mempool: propagete `checkChainLimits` error message to wallet (ismaelsadeeq)

Pull request description:

  * Requested in [#28391 comment](https://github.com/bitcoin/bitcoin/pull/28391#discussion_r1382997719)

  * The error message is static when a new transaction is created and package limit is reached.
  `Transaction has too long of a mempool chain`
  While the [`CTxMempool::CheckPackageLimits`](5800c558eb/src/txmempool.cpp (L199)) provide explicit information about the error message.
  * This PR updates [`CTxMempool::CheckPackageLimits`](5800c558eb/src/txmempool.cpp (L199)) return type to `util::Result<void>`, `CheckPackageLimits` now returns void when package limit is not hit, and returns the error string whenever package limit is hit instead of using out parameter `errString`.
  * The PR updates [`checkChainLimits`](5800c558eb/src/node/interfaces.cpp (L703)) return type to `util::Result<void>`.

  * Now the wallet `CreateTransactionInternal` will have access to the package limit error string whenever its hit.
  * Also Updated functional test to reflect the error message from `CTxMempool::CheckPackageLimits` output.

ACKs for top commit:
  glozow:
    utACK 8dec9c560b
  Sjors:
    utACK 8dec9c560b
  TheCharlatan:
    Re-ACK 8dec9c560b

Tree-SHA512: ddeac18aeba6f8e3be0e3fe76bf3db655352e3b415169f1f83ea1e8976a2f3e3de021c8da6880eb8382ab52d545e418e3f4d57adcc68ecb4f390339710ee6f30
2023-12-18 15:35:11 +00:00
fanquake
eef19c4ce2
Merge bitcoin/bitcoin#29064: fuzz: Improve fuzzing stability for minisketch harness
b2fc7a2eda [fuzz] Improve fuzzing stability for minisketch harness (dergoegge)

Pull request description:

  The `minisketch` harness has low stability due to:
  * Rng internal to minisketch
  * Benchmarkning for the best minisketch impl

  Fix this by seeding the rng and letting the fuzzer choose the impl.

  Also see #29018.

ACKs for top commit:
  maflcko:
    review ACK b2fc7a2eda

Tree-SHA512: 3d81414299c6803c34e928a53bcf843722fa8c38e1d3676cde7fa80923f9058b1ad4b9a2941f718303a6641b17eeb28b4a22eda09678102e9fb7c4e31d06f8f2
2023-12-18 13:54:00 +00:00
fanquake
c840dea27e
Merge bitcoin/bitcoin#29078: build: Bump guix time-machine to unlock riscv64 metal
fa87a2072b build: Bump guix time-machine to unlock riscv64 metal (MarcoFalke)

Pull request description:

  Closes https://github.com/bitcoin/bitcoin/issues/29020

ACKs for top commit:
  fanquake:
    ACK fa87a2072b

Tree-SHA512: a4681f560ebab2f74c2dc8e5a9851d23c1f3fd7235b19343950afdc126d4bc77fc733fa852f55d18656ba592f37a9fff487d8af776f6b952eb4f52c1affa8ba4
2023-12-18 12:54:31 +00:00
fanquake
4b94578fd8
Merge bitcoin/bitcoin#29079: fuzz: Limit p2p fuzz targets to MAX_PROTOCOL_MESSAGE_LENGTH
fa769d3e41 fuzz: Limit p2p fuzz targets to MAX_PROTOCOL_MESSAGE_LENGTH (MarcoFalke)

Pull request description:

  Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=65039

ACKs for top commit:
  dergoegge:
    utACK fa769d3e41
  brunoerg:
    crACK fa769d3e41

Tree-SHA512: 46f70d1acf4e2f95055c70162909010c6322f8504a810906e1ab4db470dc2525f9a494b8427b254279bc68b1c8b87338c943787fd5249df7113556740701a51a
2023-12-18 12:52:59 +00:00
fanquake
925a750d99
Merge bitcoin/bitcoin#28844: contrib: drop GCC MAX_VERSION to 4.3.0 in symbol-check
ff896d2581 contrib: drop GCC MAX_VERSION to 4.3.0 in symbol-check (fanquake)

Pull request description:

  Reflect the actual symbols used, i.e:

  ```bash
  bitcoind: symbol __bswapsi2 from unsupported version GCC_4.3.0(7)
  ```

ACKs for top commit:
  TheCharlatan:
    ACK ff896d2581

Tree-SHA512: b38ff8f4dd78d2d1c9063c53544dc4f240c3043f142e1581f7ba42f088a509293f6f17cc402c60ac82bff3b36668866b87e0e9e4d10d929484bb4c7a3e654f25
2023-12-18 12:48:14 +00:00
ismaelsadeeq
8dec9c560b wallet, mempool: propagete checkChainLimits error message to wallet
Update CheckPackageLimits to use util::Result to pass the error message
instead of out parameter.

Also update test to reflect the error message from `CTxMempool`
`CheckPackageLimits` output.
2023-12-17 21:13:44 +01:00
Ava Chow
3695ecbf68
Merge bitcoin/bitcoin#29088: tests: Don't depend on value of DEFAULT_PERMIT_BAREMULTISIG
7b45744df3 tests: ensure functional tests set permitbaremultisig=1 when needed (Anthony Towns)
7dfabdcf86 tests: test both settings for permitbaremultisig in p2sh tests (Anthony Towns)

Pull request description:

  Update unit and functional tests so that they continue to work if the default for `-permitbaremultisig` is changed.

ACKs for top commit:
  maflcko:
    lgtm ACK 7b45744df3
  instagibbs:
    crACK 7b45744df3
  ajtowns:
    > crACK [7b45744](7b45744df3)
  achow101:
    ACK 7b45744df3
  glozow:
    ACK 7b45744df3, changed default locally and all tests passed

Tree-SHA512: f89f9e2bb11f07662cfd57390196df9e531064e1bd662e1db7dcfc97694394ae5e8014e9d209b9405aa09195bf46fc331b7fba10378065cdb270cbd0669ae904
2023-12-15 16:22:54 -05:00
MarcoFalke
fae526345d
Allow std::byte C-style array serialization 2023-12-15 15:21:22 +01:00
MarcoFalke
fa898e6836
refactor: Print verbose serialize compiler error messages 2023-12-15 15:20:54 +01:00
fanquake
9776186e9f
Merge bitcoin/bitcoin#29087: Update security.md contact for achow101
e7d66509dc Update security.md contact for achow101 (Ava Chow)

Pull request description:

ACKs for top commit:
  maflcko:
    lgtm ACK e7d66509dc
  0xB10C:
    ACK e7d66509dc

Tree-SHA512: 73247b612d1c2c99973de90edede0153de4cacbf9c66b87c07cb1429cb80a1b23fb497c7263494f05869605a0a5cd9b2173bc1c64c8beacb5990f69d39101168
2023-12-15 10:13:47 +00:00
brunoerg
cd810075ed fuzz: coinselection, improve min_viable_change/change_output_size
Change it to use same approach from
`CreateTransactionInternal`.
2023-12-15 06:28:42 -03:00
Anthony Towns
7b45744df3 tests: ensure functional tests set permitbaremultisig=1 when needed
The mempool_dust and mempool_sigoplimits functional tests both use bare
multisig txs, so ensure they're allowed by policy.
2023-12-15 18:37:29 +10:00
Anthony Towns
7dfabdcf86 tests: test both settings for permitbaremultisig in p2sh tests 2023-12-15 18:37:24 +10:00
Ava Chow
e7d66509dc Update security.md contact for achow101 2023-12-14 18:14:54 -05:00
Ava Chow
1b2dedbf5c
Merge bitcoin/bitcoin#29040: refactor: Remove pre-C++20 code, fs::path cleanup
6666713041 refactor: Rename fs::path::u8string() to fs::path::utf8string() (MarcoFalke)
856c88776f ArgsManager: return path by value from GetBlocksDirPath() (Vasil Dimov)
fa3d9304e8 refactor: Remove pre-C++20 fs code (MarcoFalke)
fa00098e1a Add tests for C++20 std::u8string (MarcoFalke)
fa2bac08c2 refactor: Avoid copy/move in fs.h (MarcoFalke)
faea30227b refactor: Use C++20 std::chrono::days (MarcoFalke)

Pull request description:

  This:

  * Removes dead code.
  * Avoids unused copies in some places.
  * Adds copies in other places for safety.

ACKs for top commit:
  achow101:
    ACK 6666713041
  ryanofsky:
    Code review ACK 6666713041. Just documentation change since last review.
  stickies-v:
    re-ACK 6666713041

Tree-SHA512: 6176e44f30b310d51632ec2d3827c3819905d0ddc6a4b57acfcb6cfa1f9735176da75ee8ed4a4abd1296cb0b83bee9374cc6f91ffac87c19b63c435eeadf3f46
2023-12-14 16:46:54 -05:00
Ava Chow
08e6aaabef
Merge bitcoin/bitcoin#28920: wallet: birth time update during tx scanning
1ce45baed7 rpc: getwalletinfo, return wallet 'birthtime' (furszy)
83c66444d0 test: coverage for wallet birth time interaction with -reindex (furszy)
6f497377aa wallet: fix legacy spkm default birth time (furszy)
75fbf444c1 wallet: birth time update during tx scanning (furszy)
b4306e3c8d refactor: rename FirstKeyTimeChanged to MaybeUpdateBirthTime (furszy)

Pull request description:

  Fixing #28897.

  As the user may have imported a descriptor with a timestamp newer
  than the actual birth time of the first key (by setting 'timestamp=now'),
  the wallet needs to update the birth time when it detects a transaction
  older than the oldest descriptor timestamp.

  Testing Notes:
  Can cherry-pick the test commit on top of master. It will fail there.

ACKs for top commit:
  Sjors:
    re-utACK 1ce45baed7
  achow101:
    ACK 1ce45baed7

Tree-SHA512: 10c2382f87356ae9ea3fcb637d7edc5ed0e51e13cc2729c314c9ffb57c684b9ac3c4b757b85810c0a674020b7287c43d3be8273bcf75e2aff0cc1c037f1159f9
2023-12-14 16:27:40 -05:00