Commit graph

43076 commits

Author SHA1 Message Date
Byron Hambly
c66623d5d0
Merge 295f617988 into merged_master (Bitcoin PR bitcoin/bitcoin#26505) 2025-03-03 12:10:21 +02:00
Byron Hambly
da8b6f2f7f
Merge d0b1f613c2 into merged_master (Bitcoin PR bitcoin/bitcoin#17786) 2025-03-03 11:12:31 +02:00
Byron Hambly
e7850e19b3
Merge aeb395dcdb into merged_master (Bitcoin PR bitcoin/bitcoin#25315) 2025-03-03 09:50:21 +02:00
Byron Hambly
b1c4442e53
Merge 256120d2da into merged_master (Bitcoin PR bitcoin/bitcoin#26519) 2025-03-03 09:49:24 +02:00
Byron Hambly
fd4160ae71
Merge b3c76ab757 into merged_master (Bitcoin PR bitcoin/bitcoin#26524) 2025-03-03 09:49:16 +02:00
Byron Hambly
8c3a9aea6f
Merge cfee93f68a into merged_master (Bitcoin PR bitcoin/bitcoin#26487) 2025-03-03 09:49:14 +02:00
Byron Hambly
71535c907e
Merge fb01af6c77 into merged_master (Bitcoin PR bitcoin-core/gui#680) 2025-03-03 09:49:10 +02:00
Byron Hambly
28e384494e
Merge 82fe672ea0 into merged_master (Bitcoin PR bitcoin-core/gui#681) 2025-03-03 09:49:07 +02:00
Byron Hambly
89cb20a432
Merge 6863ad79a6 into merged_master (Bitcoin PR bitcoin/bitcoin#25112) 2025-03-03 09:48:51 +02:00
Byron Hambly
349f4d2778
Merge f0c646f026 into merged_master (Bitcoin PR bitcoin/bitcoin#25730)
This merge was already done and resolved, but then I had to fix a
previous commit. I then cherry-picked this resolved merge, did the
outstanding PRs from the Elements side, confusing the merge ancestors
and having to "redo" this merge - which just means this one is empty.
2025-03-03 09:40:12 +02:00
Byron Hambly
6b82cfa0aa
Merge df4e99dca3 into merged_master (Elements PR #1423) 2025-02-28 15:25:43 +02:00
Byron Hambly
5c10c048e6
Merge 7ed2768dca into merged_master (Elements PR #1421) 2025-02-28 15:02:20 +02:00
Byron Hambly
c9bfabff20
Merge 1ded38874e into merged_master (Elements PR #1420) 2025-02-28 14:34:34 +02:00
Byron Hambly
d97db2851f
Merge f0c646f026 into merged_master (Bitcoin PR bitcoin/bitcoin#25730) 2025-02-28 14:25:06 +02:00
Byron Hambly
014fe79a37
Merge 5602cc7ccf into merged_master (Bitcoin PR bitcoin/bitcoin#16981) 2025-02-28 14:24:51 +02:00
Byron Hambly
f92dc0ec3c
Merge 547a963628 into merged_master (Bitcoin PR bitcoin/bitcoin#26489) 2025-02-27 15:22:57 +02:00
Byron Hambly
7ea69ff0d8
Merge UP TO 48174c0f28 into merged_master (UP TO Bitcoin PR bitcoin/bitcoin#26240)
FIXME in wallet_taproot.py functional test

1668424146 2022-11-14T12:09:06+01:00 48174c0f28 Bitcoin Merge bitcoin/bitcoin#26240: rpc: Adjust RPCTypeCheckObj error string
1668417474 2022-11-14T10:17:54+01:00 59e00c7e03 Bitcoin Merge bitcoin/bitcoin#25714: univalue: Avoid std::string copies
1668111238 2022-11-10T15:13:58-05:00 7ef730ca84 Bitcoin Merge bitcoin/bitcoin#26483: test: Don't pass add_to_wallet option to walletcreatefundedpsbt
1668004459 2022-11-09T15:34:19+01:00 9dce30194b Bitcoin Merge bitcoin/bitcoin#26472: test: add missing bech32m / BIP86 test-cases to wallet_descriptor.py
1667992471 2022-11-09T12:14:31+01:00 44ca5d5e87 Bitcoin Merge bitcoin/bitcoin#26473: test: Avoid collision with valid path names in `getarg_tests/logargs`
1667640759 2022-11-05T10:32:39+01:00 50422b770a Bitcoin Merge bitcoin/bitcoin#26419: log: mempool: log removal reason in validation interface
1667636699 2022-11-05T09:24:59+01:00 ce57dbac90 Bitcoin Merge bitcoin/bitcoin#26449: rpc: doc: add missing option "bech32m" for `change_type` parameters
1667577253 2022-11-04T15:54:13+00:00 ae6bb6e71e Bitcoin Merge bitcoin/bitcoin#26418: Fix signing of multi_a and rawtr scripts with wallets that only have corresponding keys
2025-02-27 15:15:49 +02:00
Byron Hambly
b83abdf89a
Merge UP TO e42ba134f4 into merged_master (UP TO Bitcoin PR bitcoin/bitcoin#26448)
1667577042 2022-11-04T16:50:42+01:00 e42ba134f4 Bitcoin Merge bitcoin/bitcoin#26448: test: fix intermittent failure in p2p_sendtxrcncl.py
1667576919 2022-11-04T15:48:39+00:00 83cf055bef Bitcoin Merge bitcoin/bitcoin#26443: doc: mention BIP86 in doc/bips.md
1667478613 2022-11-03T13:30:13+01:00 28653a596a Bitcoin Merge bitcoin/bitcoin#26445: .python-version: bump patch version to 3.6.15
1667471345 2022-11-03T10:29:05+00:00 2a7c9984db Bitcoin Merge bitcoin/bitcoin#25248: refactor: Add LIFETIMEBOUND / -Wdangling-gsl to Assert()
1667397640 2022-11-02T15:00:40+01:00 5274f32437 Bitcoin Merge bitcoin/bitcoin#26417: test: fix intermittent failure in feature_index_prune.py
1667372848 2022-11-02T08:07:28+01:00 39f026b1ec Bitcoin Merge bitcoin/bitcoin#26396: net: Avoid SetTxRelay for feeler connections
1667316369 2022-11-01T16:26:09+01:00 bf0cb43990 Bitcoin Merge bitcoin/bitcoin#26437: test: remove unused `CHANGE_{XPRV,XPUB}` constants
1667300957 2022-11-01T11:09:17+00:00 5668ccec1d Bitcoin Merge bitcoin/bitcoin#25548: gui: Check for readlink buffer overflow and handle gracefully
1667297563 2022-11-01T10:12:43+00:00 c041d8f2c9 Bitcoin Merge bitcoin/bitcoin#26360: build: remove threadinterrupt from libbitcoinkernel
1667297149 2022-11-01T10:05:49+00:00 27e76afe24 Bitcoin Merge bitcoin/bitcoin#26294: build: move util/url to common/url
1667291397 2022-11-01T08:29:57+00:00 d08b63baa0 Bitcoin Merge bitcoin/bitcoin#26373: Update minisketch subtree to latest upstream
1667230521 2022-10-31T15:35:21+00:00 43e813cab2 Bitcoin Merge bitcoin/bitcoin#26387: p2p: TryLowWorkHeadersSync follow-ups
1667217075 2022-10-31T11:51:15+00:00 4766cd1981 Bitcoin Merge bitcoin/bitcoin#24051: Bugfix: configure: bitcoin-{cli,tx,util} don't need UPnP, NAT-PMP, or ZMQ
1667213203 2022-10-31T11:46:43+01:00 2856dee808 Bitcoin Merge bitcoin/bitcoin#26402: doc: Fix typos
1667202170 2022-10-31T08:42:50+01:00 c75c0d8e11 Bitcoin Merge bitcoin/bitcoin#26424: doc: correct deriveaddresses RPC name
1667034850 2022-10-29T11:14:10+02:00 4f270d2b63 Bitcoin Merge bitcoin/bitcoin#26404: test: fix intermittent failure in rpc_getblockfrompeer.py
1667030363 2022-10-29T09:59:23+02:00 984a01589b Bitcoin Merge bitcoin/bitcoin#26408: test: Remove spam from debug log
1666985837 2022-10-28T15:37:17-04:00 8b050762b1 Bitcoin Merge bitcoin/bitcoin#26409: refactor: Silence GCC Wmissing-field-initializers in ChainstateManagerOpts
1666949533 2022-10-28T11:32:13+02:00 1bad29fe02 Bitcoin Merge bitcoin/bitcoin#26377: test: Make `system_tests/run_command` test locale and platform agnostic
2025-02-27 13:40:17 +02:00
Byron Hambly
7c5f4914fb
Merge f37bd15d47 into merged_master (Bitcoin PR bitcoin/bitcoin#25685)
FIXME introduces a new regression test to reproduce the issue commented
out in the confidential transaction functional test
2025-02-27 09:55:45 +02:00
Byron Hambly
df4e99dca3
Merge pull request #1423 from psgreco/master-win64-fixassert
Fix Assert crash in win64 native builds
2025-02-26 14:50:20 +02:00
Pablo Greco
59c30c0779 Blinding: update change_position after calling fillBlindDetails 2025-02-25 14:57:10 -08:00
Pablo Greco
4058bd114b Remove extra ; in confidential.h 2025-02-25 14:57:10 -08:00
Byron Hambly
7ed2768dca
Merge pull request #1421 from psgreco/master-fixlock
Fix tests and build warnings
2025-02-24 15:58:18 +02:00
Pablo Greco
b92a3ceda2 TSAN: Avoid unlocked access to pindexBestHeader 2025-02-23 14:34:19 -08:00
Pablo Greco
38065e1159 Fix warning about mixing enum and int 2025-02-23 14:34:19 -08:00
Pablo Greco
d973e36ffa Win64 Native: Fix PACKAGE_NAME and bug report url 2025-02-23 14:34:19 -08:00
Pablo Greco
73c542ea58 Fix error reading cookie file on windows when path contains UTF-8 2025-02-23 14:34:19 -08:00
Pablo Greco
fe04483875 Avoid concatenating default path when mainchainrpccookiefile is an absolute path 2025-02-23 14:34:19 -08:00
Pablo Greco
258d9d3c87 feature_fedpeg: Use os.join instead of hardcoded separator 2025-02-23 10:19:51 -08:00
Pablo Greco
305de6d265 feature_confidential_transactions: Use system temp dir instead of hardcoded /tmp 2025-02-23 09:24:05 -08:00
Pablo Greco
cd67236c12 feature_discount_ct: some txs can return 2 different weights, adapt the test to it 2025-02-22 09:05:56 -08:00
Byron Hambly
1ded38874e
Merge pull request #1420 from ElementsProject/simplicity
Simplicity
2025-02-19 10:01:05 +02:00
Russell O'Connor
c211d1a4d9 Merge commit '37adf7d72d' into simplicity 2025-02-18 13:11:04 -05:00
Russell O'Connor
37adf7d72d Squashed 'src/simplicity/' changes from 4858b89526..b549192109
b549192109 codespell: fix typos

git-subtree-dir: src/simplicity
git-subtree-split: b5491921095b28bc554c325a7d05274690483a6f
2025-02-18 13:11:04 -05:00
Byron Hambly
c49d1e5211
Merge 12c586a3bf into merged_master (Elements PR #1417) 2025-02-18 16:51:52 +02:00
Byron Hambly
a5ed028a9a
Merge c9c21cf7df into merged_master (Elements PR #1416) 2025-02-18 16:51:48 +02:00
Byron Hambly
ed487fc096
Merge e343610b99 into merged_master (Elements PR #1414) 2025-02-18 16:51:36 +02:00
Byron Hambly
12c586a3bf
Merge pull request #1417 from psgreco/master-fix-win64native
Fix Win64 native unit test
2025-02-18 16:05:44 +02:00
Byron Hambly
c9c21cf7df
Merge pull request #1416 from apoelstra/2025-02--psbt-fix
pset: fix NULL pointer dereference when deserializing malformed PSETs over RPC
2025-02-18 15:06:38 +02:00
Byron Hambly
13c2a2b766
chainstatemanager: fix warnings of missing fields in initialization 2025-02-17 15:27:34 +02:00
Byron Hambly
ff888d5a2b
tidy: use nullptr in simplicity targets 2025-02-17 10:52:31 +02:00
Byron Hambly
25c864583a
libbitcoinkernel: include simplicity 2025-02-17 10:47:28 +02:00
Jon Atack
7f56623441 Put lock logging behind DEBUG_LOCKCONTENTION preprocessor directive 2025-02-15 00:22:57 -08:00
Andrew Poelstra
0bff9b06f7
psbt: guard against empty PSBT transaction
There is a crashing bug in psbt.h which works as follows. This occurs in
the psbt_deserialize_input fuzz test, which deserializes an input and
then tries to reserialize it. Here a PSET input may contain a mainchain
transaction, which is where our trouble is.

The process is as follows:

1. On line 901, we create a CTransactionRef, which is a newtype around
   std::shared_ptr<CTransaction> which defaults to being null.
2. On line 903 we then call `UnserializeFromVector` to populate this,
   where this is a helper function which attempts to read some number of
   objects from a byte vector, i.e. a length-prefixed blob.
3. HOWEVER, `UnserializeFromVector` when given an empty vector, decides
   that it has successfully deserialized zero elements, and returns.
4. Then, on line 904 we assign the CTransactionRef, which is a valid
   std::shared_ptr whose internal pointer is NULL, to `m_peg_in_tx`,
   which is a variant of monostate, Bitcoin::CTransactionRef, and
   CTransactionRef. Its variant changes from the default monostate
   to CTransactionRef.
5. Then, on line 419, we call `std::get_if<CTransactionRef>` on this
   object, which returns a std::optional<CTransactionRef>. Because
   `m_peg_in_tx` is in the `CTransactionRef` variant, this succeeds,
   returning a true std::optional containing a valid std::shared_ptr
   which contains a NULL pointer.
6. Then, on line 420, we call `if (peg_in_tx)`, which is true, because
   we have a true std::optional. We then dereference it on line 423,
   which is perfectly legal, to get our std::shared_ptr, and pass this
   shared pointer to SerializeToVector.
7. SerializeToVector passes through like 6 layers of serialize.h
   obfuscation and eventually dereferences the shared pointer, but
   because it's NULL, this is a NULL pointer dereference, and we get a
   crash.

There are two lessons here:

1. Don't use C++. As I say in acf709b3ab,
   where I introduced some of the offending code here (but only by
   replacing boost stuff with their STL equivalents; the bug existed
   before I did this), "what a trainwreck of a language".
2. Don't use `UnserializeFromVector` and expect it to throw if the data
   you're deserializing is malformed. If it's malformed in the sense of
   being empty, it will "succeed" and silently do nothing.

I glanced at every other instance of UnserializeFromVector to check what
will happen when it's passed an empty string. I believe there are no
other cases where it will fail to initialize a NULL pointer, so I
believe that this will not cause other crashes. But I also believe that
the behavior in this case is almost always wrong and that we parse
malformed PSETs in crazy and incorrect ways all over the place.

If anybody has a problem with this, I encourage you to go review the
Bitcoin PSBT2 PRs, which this stuff is based on, which have been
languishing in rebase hell for the better part of a decade. Don't blame
the author for not writing perfect code in a hostile language with no
support.

After this PR I ran the fuzzer for 16 hours on a 192-thread machine (so
3072 CPU-hours) and didn't see any more crashes.
2025-02-14 18:08:45 +00:00
Andrew Poelstra
f7826f9199
psbt: avoid assigning non-boolean values to bool (ubsan)
ubsan doesn't like assigning arbitrary uint8_t values to bool. It's easy
to avoid doing, so do it. (We do this specifically in PSET since that's
Elements-specific code, but the same issue is present in Bitcoin in the
Unserialize impl for bool in serialize.h. Upstream this is only used in
the wallet database, where it may be that non 0/1 values are impossible
(absent a corrupt wallet).
2025-02-14 18:07:48 +00:00
Byron Hambly
e343610b99
Merge pull request #1414 from apoelstra/2025-02--fuzz-update
fuzz: minor updates to the Simplicity fuzz tests
2025-02-14 16:23:16 +02:00
Byron Hambly
07aebbf505
lint: fixes 2025-02-14 15:54:27 +02:00
Byron Hambly
b20ab1c24e
Merge 0397d22941 into merged_master (Elements PR #1409) 2025-02-14 14:14:59 +02:00
Byron Hambly
a12e099e07
Merge 24b43eaa66 into merged_master (Elements PR #1413) 2025-02-14 14:14:34 +02:00
Andrew Poelstra
a2d24eff9e
fuzz: remove dead code from simplicity_tx.cpp 2025-02-13 23:09:51 +00:00