Commit graph

41283 commits

Author SHA1 Message Date
MarcoFalke
fa3e1151a2
doc: Correct pull request prefix for scripts and tools 2024-05-22 09:59:58 +02:00
fanquake
e8c25e8a35
guix: drop binutils from macOS env 2024-05-22 08:51:34 +01:00
fanquake
555fddf646
guix: use GUIX_LD_WRAPPER_DISABLE_RPATH for all HOSTS 2024-05-22 08:51:33 +01:00
fanquake
9ec238d0f3
guix: remove ZERO_AR_DATE export
LLD enables ZERO_AR_DATE by default, setting it to zero would enable
non-determinism, setting it to any other value is ignored.

See:
https://github.com/llvm/llvm-project/blob/main/lld/docs/MachO/ld64-vs-lld.rst.
2024-05-22 08:51:33 +01:00
fanquake
f836f7e9b3
depends: remove cctools & libtapi 2024-05-22 08:51:33 +01:00
fanquake
4a0536c5d9
build: switch to using lld for macOS builds
Adjust the security check for:
ld64.lld: warning: Option `-allow_stack_execute' is not yet implemented.
ld64.lld: error: -fixup_chains is incompatible with -no_pie
and to account for the embedding of LLVMs version number.
2024-05-22 08:51:33 +01:00
fanquake
c6a6b2d6fd
build: add lld into macOS build environment(s) 2024-05-22 08:51:33 +01:00
fanquake
437e908ebd
depends: swap cctools-x for llvm-x
Only build ld64 from cctools.
Disable adhoc codesigning, to avoid non-determinism.
2024-05-22 08:51:33 +01:00
fanquake
bab287d1ba
depends: don't use -no_warning_for_no_symbols in macOS qt build
Not supported by llvm-ar / llvm-ranlib.
2024-05-22 08:51:33 +01:00
merge-script
0388dd702b
Merge bitcoin/bitcoin#30120: Update libsecp256k1 subtree to current master
a057869aa3 build: pass --with-ecmult-gen-kb=86 to secp256k1 (fanquake)
ca3d945dc6 Squashed 'src/secp256k1/' changes from d8311688bd..06bff6dec8 (fanquake)

Pull request description:

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

  > New function secp256k1_ec_pubkey_sort that sorts public keys using lexicographic (of compressed serialization) order.

  > The implementation of the point multiplication algorithm used for signing and public key generation was changed, resulting in improved performance for those operations.
  >    The related configure option --ecmult-gen-precision was replaced with --ecmult-gen-kb (ECMULT_GEN_KB for CMake).
  >    This changes the supported precomputed table sizes for these operations. The new supported sizes are 2 KiB, 22 KiB, or 86 KiB (while the old supported sizes were 32 KiB, 64 KiB, or 512 KiB).

ACKs for top commit:
  hebasto:
    ACK a057869aa3, I've got a zero diff with my local branch, which reproduces the subtree update, and `ecmult gen table size   = 86 KiB` in the configure summary.
  jonasnick:
    utACK a057869aa3

Tree-SHA512: 907012b0d7e0a6bd68b245c238e968f2318d8ac5de5ec9070245de8391c996eb5ec6428184d028f6f0f54d3b2f5a8292ad7081177e1c331397879505436dc38e
2024-05-22 08:50:42 +01:00
Ava Chow
9f4ff1e965 windeploy: Renew certificate 2024-05-21 23:19:51 -04:00
merge-script
2ec0a28a37
Merge bitcoin/bitcoin#30137: build: Remove --enable-threadlocal
17fe948cce build: remove --enable-threadlocal (fanquake)
1e7c20bc19 doc: remove comment about using thread_local (fanquake)
5bba43312c build: Enable `thread_local` for MinGW-w64 builds (Hennadii Stepanov)

Pull request description:

  Includes a commit from #30099.
  Closes #29952.

ACKs for top commit:
  laanwj:
    Code review ACK 17fe948cce
  maflcko:
    utACK 17fe948cce
  hebasto:
    ACK 17fe948cce.
  theuni:
    utACK 17fe948cce

Tree-SHA512: 2aad6d19e79c4d6d7aefd0f41b215ac8d9320f5908808221d78e6ee1c77503832a02759bee2ad397e235b6739e22aca8dcf5c5ef8854deb8c697b18ac56a06da
2024-05-21 21:14:30 +01:00
Ava Chow
6c13b1375f
Merge bitcoin/bitcoin#29421: net: make the list of known message types a compile time constant
b3efb48673 protocol: make message types constexpr (Vasil Dimov)
2fa9de06c2 net: make the list of known message types a compile time constant (Vasil Dimov)

Pull request description:

  Turn the `std::vector` to `std::array` because it is cheaper and allows us to have the number of the messages as a compile time constant: `ALL_NET_MESSAGE_TYPES.size()` which can be used in future code to build other `std::array`s with that size.

  ---

  This change is part of https://github.com/bitcoin/bitcoin/pull/29418 but it makes sense on its own and would be good to have it, regardless of the fate of https://github.com/bitcoin/bitcoin/pull/29418. Also, if this is merged, that would reduce the size of https://github.com/bitcoin/bitcoin/pull/29418, thus the current standalone PR.

ACKs for top commit:
  achow101:
    ACK b3efb48673
  jonatack:
    ACK b3efb48673
  maflcko:
    utACK b3efb48673 🎊
  willcl-ark:
    ACK b3efb48673

Tree-SHA512: 6d3860c138c64514ebab13d97ea67893e2d346dfac30a48c3d9bc769a1970407375ea4170afdb522411ced306a14a9af4eede99e964d1fb1ea3efff5d5eb57af
2024-05-21 13:59:33 -04:00
Ava Chow
2289d45240 wallet, tests: Avoid stringop-overflow warning in PollutePubKey 2024-05-21 12:59:47 -04:00
glozow
154b2b2296 [fuzz] V3_MAX_VSIZE and effective ancestor/descendant size limits 2024-05-21 15:06:58 +01:00
glozow
a29f1df289 [policy] restrict all v3 transactions to 10kvB 2024-05-21 15:06:55 +01:00
glozow
d578e2e354 [policy] explicitly require non-v3 for CPFP carve out
This carve out is intended to allow a second child under restricted
circumstances, but this topology is not allowed for v3 transactions.

As CPFP carve out does not explicitly require a second child to actually
exist, it has the effect of granting a free +10KvB descendant size limit
when a single child is enough to bust the descendant limit.
2024-05-21 15:06:02 +01:00
furszy
6629d1d0f8
test: improve robustness of connect_nodes()
The 'connect_nodes' function in the test framework relies
on a stable number of peer connections to verify the new
connection between the nodes is successfully established.
This approach is fragile, as any of the peers involved in
the process can drop, lose, or create a connection at any
step, causing subsequent 'wait_until' checks to stall
indefinitely even when the peers in question are connected
successfully.

This commit improves the situation by using the nodes' subversion
and the connection direction (inbound/outbound) to identify the
exact peer connection and perform the checks exclusively on it.
2024-05-21 10:58:44 -03:00
Fabian Jahr
542e13b293
rpc: Enhance metadata of the dumptxoutset output
The following data is added:
- A newly introduced utxo set magic
- A version number
- The network magic
- The block height
2024-05-21 13:57:09 +02:00
Fabian Jahr
4d8e5edbaa
assumeutxo: Add documentation on dumptxoutset serialization format 2024-05-21 13:38:09 +02:00
Fabian Jahr
c14ed7f384
assumeutxo: Add test for changed coin size value 2024-05-21 13:38:09 +02:00
Fabian Jahr
de95953d87
rpc: Optimize serialization disk space of dumptxoutset
Co-authored-by: Aurèle Oulès <aurele@oules.com>
Co-authored-by: TheCharlatan <seb.kung@gmail.com>
2024-05-21 13:38:07 +02:00
fanquake
17fe948cce
build: remove --enable-threadlocal 2024-05-21 10:29:51 +01:00
fanquake
1e7c20bc19
doc: remove comment about using thread_local
Followup to https://github.com/bitcoin/bitcoin/pull/30095#discussion_r1605655974.
2024-05-21 10:29:51 +01:00
Hennadii Stepanov
5bba43312c
build: Enable thread_local for MinGW-w64 builds
The assumption in the commit 188ca75e5f
about the broken `thread_local` implementation in GCC was misguided
because the initial failure was not due to GCC, but a bug in the Wine
runtime, as evidenced, for example, here:
 - https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=917307
 - https://bugs.freedesktop.org/show_bug.cgi?id=108662

Consequently, it is safe to re-enable `thread_local` support for
MinGW-w64 builds.
2024-05-21 10:27:42 +01:00
merge-script
a786fd2041
Merge bitcoin/bitcoin#30143: doc: Update NetBSD Build Guide
85e480a41a doc: Update NetBSD Build Guide (Hennadii Stepanov)

Pull request description:

  This PR updates the NetBSD Build Guide to reflect:
  - the recent NetBSD Release
  - GCC minimum supported version update (https://github.com/bitcoin/bitcoin/pull/28348 and https://github.com/bitcoin/bitcoin/pull/29091)
  - Python minimum supported version update (https://github.com/bitcoin/bitcoin/pull/28211)

  Also a smaller package set has been suggested:
  - `boost-headers` instead of the full `boost`
  - `qt5-qtbase qt5-qttools` instead of the full `qt5` (similar to https://github.com/bitcoin/bitcoin/pull/29932 and https://github.com/bitcoin/bitcoin/pull/29947).

ACKs for top commit:
  maflcko:
    utACK 85e480a41a

Tree-SHA512: 0848b6f169a00f2da78eea452fd116193aece853680f4e615ba1df654246ec2a9d1600a4cfb238eb9305b72bbe4b2873519bf1e2987eaaf48aba900c64e85a48
2024-05-21 10:26:49 +01:00
merge-script
8804ec736a
Merge bitcoin/bitcoin#30095: util: avoid using thread_local variable that has a destructor
d35ba1b3f1 util: avoid using thread_local variable that has a destructor (Vasil Dimov)

Pull request description:

  Store the thread name in a `thread_local` variable of type `char[]` instead of `std::string`. This avoids calling the destructor when the thread exits. This is a workaround for
  https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=278701

  For type-safety, return `std::string` from
  `util::ThreadGetInternalName()` instead of `char[]`.

  As a side effect of this change, we no longer store a reference to a `thread_local` variable in `CLockLocation`. This was dangerous because if the thread quits while the reference still exists (in the global variable `lock_data`, see inside `GetLockData()`) then the reference will become dangling.

ACKs for top commit:
  laanwj:
    Code review ACK d35ba1b3f1
  hebasto:
    re-ACK d35ba1b3f1.
  theuni:
    utACK d35ba1b3f1

Tree-SHA512: a2a3bc4401654d6e99db5b9c46a7051855f5a26886142298662e681b78dd581ff4c6bebe42f649b8e1fb8a78d569c6117302db2cd6362e884a22f2a5839b7d43
2024-05-21 10:25:56 +01:00
merge-script
5acdc2b97d
Merge bitcoin/bitcoin#26606: wallet: Implement independent BDB parser
d51fbab4b3 wallet, test: Be able to always swap BDB endianness (Ava Chow)
0b753156ce test: Test bdb_ro dump of wallet without reset LSNs (Ava Chow)
c1984f1282 test: Test dumping dbs with overflow pages (Ava Chow)
fd7b16e391 test: Test dumps of other endian BDB files (Ava Chow)
6ace3e953f bdb: Be able to make byteswapped databases (Ava Chow)
d9878903fb Error if LSNs are not reset (Ava Chow)
4d7a3ae78e Berkeley RO Database fuzz test (TheCharlatan)
3568dce9e9 tests: Add BerkeleyRO to db prefix tests (Ava Chow)
70cfbfdadf wallettool: Optionally use BERKELEY_RO as format when dumping BDB wallets (Ava Chow)
dd57713f6e Add MakeBerkeleyRODatabase (Ava Chow)
6e50bee67d Implement handling of other endianness in BerkeleyRODatabase (Ava Chow)
cdd61c9cc1 wallet: implement independent BDB deserializer in BerkeleyRODatabase (Ava Chow)
ecba230979 wallet: implement BerkeleyRODatabase::Backup (Ava Chow)
0c8e728476 wallet: implement BerkeleyROBatch (Ava Chow)
756ff9b478 wallet: add dummy BerkeleyRODatabase and BerkeleyROBatch classes (Ava Chow)
ca18aea5c4 Add AutoFile::seek and tell (Ava Chow)

Pull request description:

  Split from #26596

  This PR adds `BerkeleyRODatabase` which is an independent implementation of a BDB file parser. It provides read only access to a BDB file, and can therefore be used as a read only database backend for wallets. This will be used for dumping legacy wallet records and migrating legacy wallets without the need for BDB itself.

  Wallettool's `dump` command is changed to use `BerkeleyRODatabase` instead of `BerkeleyDatabase` (and `CWallet` itself) to demonstrate that this parser works and to test it against the existing wallettool functional tests.

ACKs for top commit:
  josibake:
    reACK d51fbab4b3
  TheCharlatan:
    Re-ACK d51fbab4b3
  furszy:
    reACK d51fbab4b3
  laanwj:
    re-ACK d51fbab4b3
  theStack:
    ACK d51fbab4b3

Tree-SHA512: 1e7b97edf223b2974eed2e9eac1179fc82bb6359e0a66b7d2a0c8b9fa515eae9ea036f1edf7c76cdab2e75ad994962b134b41056ccfbc33b8d54f0859e86657b
2024-05-21 10:05:09 +01:00
Lőrinc
7f3f6c6dc8
refactor: replace hardcoded numbers
Replace ExpandHRP with a PreparePolynomialCoefficients function. Instead
of using a hardcoded value for the size of the array (90 in this case)
and a hardcoded value for the checksum, use the actual values vector and
define checksum size as a constexpr. Use the new CHECKSUM_SIZE
throughout instead 6.

Co-authored-by: Lőrinc <pap.lorinc@gmail.com>
2024-05-21 09:14:55 +02:00
MarcoFalke
fa73431dd4
ci: Add mising -Wno-error=maybe-uninitialized to armhf task 2024-05-21 06:48:40 +02:00
Cory Fields
d7707d9843 rpc: avoid copying into UniValue
These are simple (and hopefully obviously correct) copies that can be moves
instead.
2024-05-20 16:48:19 +00:00
Hennadii Stepanov
85e480a41a
doc: Update NetBSD Build Guide 2024-05-20 12:59:15 +01:00
glozow
ecd23656db
Merge bitcoin/bitcoin#30133: test: remove unneeded -maxorphantx=1000 settings
8950053636 test: remove unneeded `-maxorphantx=1000` settings (Sebastian Falbesoner)

Pull request description:

  It's unclear what the motivation for increasing the orphan pool is here, and it seems that this not needed at all. None of these tests involve orphan transactions explicitly, and if they would occur occasionally, there is no good reason to prefer a value of 1000 over the default of 100 (see DEFAULT_MAX_ORPHAN_TRANSACTIONS).

ACKs for top commit:
  maflcko:
    utACK 8950053636
  edilmedeiros:
    Tested ACK 8950053636
  AngusP:
    tACK 8950053636
  glozow:
    ACK 8950053636 From skimming the tests, it appears that none of these need a larger `-maxorphantx`.

Tree-SHA512: 81d4a4fb2ea92b97119f21cbc6c4b1240d863269932e6adf4982aead9726f20652523a4707add3ad38eb332d4452de41de6735265f22e62298f3b4b45de75a57
2024-05-20 09:47:31 +01:00
glozow
063bb2fbb5
Merge bitcoin/bitcoin#30066: test: add conflicting topology test case
9365baa489 test: add conflicting topology test case (Greg Sanders)

Pull request description:

  We want to ensure that even if topologies
  that are acceptable are relaxed, like
  removing package-not-child-with-unconfirmed-parents, that we don't end up accepting packages we shouldn't.

ACKs for top commit:
  glozow:
    reACK 9365baa489
  rkrux:
    reACK [9365baa](9365baa489)

Tree-SHA512: d58661064ca099ac0447c331a5020c74c0cdfe24259aa875592805bbd63de1bf23aa7ced9ff485fef90dc0602fcb997e631aaf1aa2e9805d2cf5f0e5c9b2f0e2
2024-05-20 09:27:37 +01:00
fanquake
a057869aa3
build: pass --with-ecmult-gen-kb=86 to secp256k1 2024-05-18 11:12:25 +08:00
TheCharlatan
09ef322acc
[[refactor]] Check CTxMemPool options in constructor
This ensures that the tests run the same checks on the mempool options
that the init code also applies.
2024-05-17 23:37:25 +02:00
Sebastian Falbesoner
8950053636 test: remove unneeded -maxorphantx=1000 settings
It's unclear what the motivation for increasing the orphan pool is, and
it seems that this not needed at all. None of these tests involve orphan
transactions explicitly, and if they would occur occasionally, there is
no good reason to prefer a value of 1000 over the default of 100 (see
DEFAULT_MAX_ORPHAN_TRANSACTIONS).
2024-05-17 22:38:59 +02:00
Ava Chow
058af75874
Merge bitcoin/bitcoin#29817: kernel: De-globalize fReindex
b47bd95920 kernel: De-globalize fReindex (TheCharlatan)

Pull request description:

  fReindex is one of the last remaining globals exposed by the kernel library, so move it into the blockstorage class to reduce the amount of global mutable state and make the kernel library a bit less awkward to use.

  ---

  This pull request is part of the [libbitcoinkernel project](https://github.com/bitcoin/bitcoin/issues/27587).

ACKs for top commit:
  achow101:
    ACK b47bd95920
  ryanofsky:
    Code review ACK b47bd95920. I rereviewed the whole PR, but the only change since last review was reverting the bugfix https://github.com/bitcoin/bitcoin/pull/29817#discussion_r1578327024 and make the change a pure refactoring.
  mzumsande:
    Code Review ACK b47bd95920
  stickies-v:
    ACK b47bd95920

Tree-SHA512: f7399d01f93bc0c0c7428fe95d19b9d29b4ed00a4f1deabca78fb0c4fecb434ec971e890feecb105938b5247c926850b1b7b4a4a9caa333a061e40777d0c8463
2024-05-17 15:50:56 -04:00
Ava Chow
4877fcdb42
Merge bitcoin/bitcoin#30048: crypto: add NUMS_H const
9408a04e42 tests, fuzz: use new NUMS_H const (josibake)
b946f8a4c5 crypto: add NUMS_H const (josibake)

Pull request description:

  Broken out from #28122

  ---

  [BIP341](https://github.com/bitcoin/bips/blob/master/bip-0341.mediawiki#constructing-and-spending-taproot-outputs) defines a NUMS point `H` as *H = lift_x(0x50929b74c1a04954b78b4b6035e97a5e078a5a0f28ec96d547bfee9ace803ac0)* which is [constructed](11af7015de/src/modules/rangeproof/main_impl.h (L16)) by taking the hash of the standard uncompressed encoding of the [secp256k1](https://www.secg.org/sec2-v2.pdf) base point G as X coordinate."

  Add this as a constant so it can be used in our codebase. My primary motivation is BIP352 specifies a special case for when taproot spends use `H` as the internal key, but outside of BIP352 it seems generally useful to have `H` in the codebase, for testing or other use cases.

ACKs for top commit:
  paplorinc:
    re-ACK 9408a04e42
  achow101:
    ACK 9408a04e42
  theStack:
    Code-review ACK 9408a04e42

Tree-SHA512: ad84492f5d635c0cb05bd82546079ded7e5138e95361f20d8285a9ad6e69c10ee2cc3fe46e16b46ef03c4253c8bee1051911c6b91264c90c3b1ad33a824bff4b
2024-05-17 14:10:51 -04:00
furszy
7c8abf3c20
bench: bugfix, properly release wallet before erasing directory
Since the wallet is appended to the global WalletContext during
creation, merely calling 'reset()' on the benchmark shared_pointer
is insufficient to destruct the wallet. This no destruction of the
wallet results in the db connection remaining open, which was the
cause of the 'fs::remove_all()' error in Windows.

Co-Authored-By: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com>
2024-05-17 12:49:59 -03:00
Ava Chow
d51fbab4b3 wallet, test: Be able to always swap BDB endianness 2024-05-16 15:03:13 -04:00
Ava Chow
0b753156ce test: Test bdb_ro dump of wallet without reset LSNs 2024-05-16 15:03:13 -04:00
Ava Chow
c1984f1282 test: Test dumping dbs with overflow pages 2024-05-16 15:03:13 -04:00
Ava Chow
fd7b16e391 test: Test dumps of other endian BDB files 2024-05-16 15:03:13 -04:00
Ava Chow
6ace3e953f bdb: Be able to make byteswapped databases
Byteswapped databases make it easier to test opening and deserializing
other endian databases.
2024-05-16 15:03:13 -04:00
Ava Chow
d9878903fb Error if LSNs are not reset 2024-05-16 15:03:13 -04:00
TheCharlatan
4d7a3ae78e Berkeley RO Database fuzz test 2024-05-16 15:03:13 -04:00
Ava Chow
3568dce9e9 tests: Add BerkeleyRO to db prefix tests 2024-05-16 15:03:13 -04:00
Ava Chow
70cfbfdadf wallettool: Optionally use BERKELEY_RO as format when dumping BDB wallets
In order to ease the transition to not having BDB, make the dump tool
use DatabaseFormmat::BERKELEY_RO when -withinternalbdb is set.
2024-05-16 15:03:13 -04:00
Ava Chow
dd57713f6e Add MakeBerkeleyRODatabase
Implements MakeBerkeleyRODatabase and adds DatabaseFormat::BERKELEY_RO
so that MakeDatabase can use BerkeleyRO as the backend database.
2024-05-16 15:03:13 -04:00