Commit graph

5277 commits

Author SHA1 Message Date
merge-script
0cb5c660bb Merge bitcoin/bitcoin#33105: validation: detect witness stripping without re-running Script checks
27aefac42505e9c083fa131d3d7edbec7803f3c0 validation: detect witness stripping without re-running Script checks (Antoine Poinsot)
2907b58834ab011f7dd0c42d323e440abd227c25 policy: introduce a helper to detect whether a transaction spends Segwit outputs (Antoine Poinsot)
eb073209db9efdbc2c94bc1f535a27ec6b20d954 qa: test witness stripping in p2p_segwit (Antoine Poinsot)

Pull request description:

  Since it was introduced in 4eb515574e (#18044), the detection of a stripped witness relies on running the Script checks 3 times. In the worst case, this consists in running Script validation for every single input 3 times.

  Detection of a stripped witness is necessary because in this case wtxid==txid, and the transaction's wtxid must not be added to the reject filter or it could allow a malicious peer to interfere with txid-based orphan resolution as used in 1p1c package relay.

  However it is not necessary to run Script validation to detect a stripped witness (much less so doing it 3 times in a row). There are 3 types of witness program: defined program types (Taproot, P2WPKH and P2WSH), undefined types, and the Pay-to-anchor carve-out.

  For defined program types, Script validation with an empty witness will always fail (by consensus). For undefined program types, Script validation is always going to fail regardless of the witness (by standardness). For P2A, an empty witness is never going to lead to a failure.

  Therefore it holds that we can always detect a stripped witness without re-running Script validation. However this might lead to more "false positives" (cases where we return witness stripping for an otherwise invalid transaction) than the existing implementation. For instance a transaction with one P2PKH input with an invalid signature and one P2WPKH input with its witness stripped. The existing implementation would treat it as consensus invalid while the implementation in this PR would always consider it witness stripped.

  h/t AJ: this essentially implements a variant of https://github.com/bitcoin/bitcoin/pull/33066#issuecomment-3135258539.

ACKs for top commit:
  sipa:
    re-ACK 27aefac42505e9c083fa131d3d7edbec7803f3c0
  Crypt-iQ:
    re-ACK 27aefac42505e9c083fa131d3d7edbec7803f3c0
  glozow:
    reACK 27aefac42505e9c083fa131d3d7edbec7803f3c0

Tree-SHA512: 70cf76b655b52bc8fa2759133315a3f11140844b6b80d9de3c95f592050978cc01a87bd2446e3a9c25cc872efea7659d6da3337b1a709511771fece206e9f149
2025-11-21 00:13:00 +00:00
Pablo Greco
752b11dae7
Merge branch 'master' into elem-23.3.1rc3 2025-11-11 00:10:38 -08:00
Tom Trevethan
a700d7f2b8 add reissuance token moneyrange check 2025-11-11 00:24:23 +00:00
Tom Trevethan
1484272806 fixed payload limit for elements 2025-10-15 16:06:22 +01:00
Pablo Greco
afb63a43a6 Merge branch 'master' into elem-23.3.1-rc2 2025-10-07 07:53:22 -07:00
Tom Trevethan
a937d53a23 moved acceptunlimitedissuances to chainparams and set defaults 2025-09-26 14:15:46 +01:00
Byron Hambly
93c84a97f9
fix: unblinded re/issuance for non-policy asset greater than 21 million (#1445)
* test: add test for unblinded re/issuance greater than 21 million

Co-authored-by: Mihailo Milenkovic <mihailo.milenkovic84@gmail.com>

* fix: unblinded re/issuance for greater than 21 million

Co-authored-by: Mihailo Milenkovic <mihailo.milenkovic84@gmail.com>

* enable with param config

* change range check to policy with config option

* refactoring, additional error messages and test extension

---------

Co-authored-by: Mihailo Milenkovic <mihailo.milenkovic84@gmail.com>
Co-authored-by: Tom Trevethan <ttrevethan@blockstream.com>
2025-09-23 13:17:02 +02:00
Tom Trevethan
9f1cc945b6
Fix: address error messages and test (#1486)
* fix address error messages and test

* newline

---------

Co-authored-by: Tom Trevethan <ttrevethan@blockstream.com>
2025-08-25 15:05:57 +02:00
Tom Trevethan
7532092cbc fix intermittent functional test failures 2025-08-08 14:54:54 +01:00
Tom Trevethan
da9d7c16ce fix feature_pak test 2025-08-05 13:51:27 +01:00
Byron Hambly
6e2d87990e
Merge pull request #1333 from delta1/mintxfee
wallet: allow mintxfee=0
2025-07-31 10:07:07 +02:00
Tom Trevethan
2eb5b084bc
Enable sending of different assets to the same address (#1479)
* enable rawtransaction send multiple assets to same address

* fix whitespace

* Update test/functional/feature_issuance.py

Co-authored-by: Byron Hambly <byron@hambly.dev>

* Update test/functional/feature_issuance.py

Co-authored-by: Byron Hambly <byron@hambly.dev>

---------

Co-authored-by: Tom Trevethan <ttrevethan@blockstream.com>
Co-authored-by: Byron Hambly <byron@hambly.dev>
2025-07-30 12:41:37 +01:00
Tom Trevethan
c1a47134ff prevent reused utxo 2025-07-28 14:30:09 +01:00
Byron Hambly
ab5777ee73
test: minor improvements for send_zero_fee 2025-07-25 15:03:22 +02:00
Tom Trevethan
cd1b94e64b Merge remote-tracking branch 'origin/master' into mintxfee 2025-07-22 11:57:05 +01:00
Tom Trevethan
e8e19528b0 Zero fee transactions without fee output 2025-07-22 11:37:30 +01:00
Pablo Greco
38cbe9282d Merge branch 'master' into elem-23.3.1-rc1 2025-07-14 16:35:03 -07:00
Tom Trevethan
c4bc9fd5b4
Fix position of version argument in walletcreatefundedpsbt (#1474)
* fix position of version argument and add test

* add test for version number

---------

Co-authored-by: Tom Trevethan <ttrevethan@blockstream.com>
2025-07-11 12:27:43 +02:00
Byron Hambly
67cd78dbc2
Merge pull request #1451 from tomt1664/v25+_cherry_pick
Selected Bitcoin v25 and onwards patches
2025-07-08 14:17:15 +02:00
Tom Trevethan
a9da179304 remove unused variable 2025-07-07 15:55:11 +01:00
Tom Trevethan
2f9eab6379 add solved_data to options for functional test 2025-07-07 15:55:11 +01:00
merge-script
8614ff46c9 Merge bitcoin/bitcoin#30435: init: change shutdown order of load block thread and scheduler
5fd4836019 init: change shutdown order of load block thread and scheduler (Martin Zumsande)

Pull request description:

  This avoids situations during a reindex, in which the shutdown doesn't finish since `LimitValidationInterfaceQueue()` is called by the load block thread when the scheduler is already stopped, in which case it would block indefinitely. This can lead to intermittent failures in `feature_reindex.py` (#30424), which I could locally reproduce with
  ```diff
  diff --git a/src/validation.cpp b/src/validation.cpp
  index 74f0e4975c..be1706fdaf 100644
  --- a/src/validation.cpp
  +++ b/src/validation.cpp
  @@ -3446,6 +3446,7 @@ static void LimitValidationInterfaceQueue(ValidationSignals& signals) LOCKS_EXCL
       AssertLockNotHeld(cs_main);

       if (signals.CallbacksPending() > 10) {
  +        std::this_thread::sleep_for(std::chrono::milliseconds(50));
           signals.SyncWithValidationInterfaceQueue();
       }
   }
  ```
  It has also been reported by users running `reindex-chainstate` (#23234).

  I thought for a bit about potential downsides of changing this order, but couldn't find any.

  Fixes #30424
  Fixes #23234

ACKs for top commit:
  maflcko:
    review ACK 5fd4836019
  hebasto:
    re-ACK 5fd4836019.
  tdb3:
    ACK 5fd4836019
  BrandonOdiwuor:
    Code Review ACK 5fd4836019

Tree-SHA512: 3b8894e99551c5d4392b55eaa718eee05841a7287aeef2978699e1d633d5234399fa2f5a3e71eac1508d97845906bd33e0e63e5351855139e7be04c421359b36
2025-06-24 10:25:22 +01:00
Andrew Chow
cb5c59e8a5 Merge bitcoin/bitcoin#28784: rpc: keep .cookie file if it was not generated
7cb9367157 rpc: keep .cookie if it was not generated (Roman Zeyde)

Pull request description:

  Otherwise, starting bitcoind twice may cause the `.cookie` file generated by the first instance to be deleted by the second instance shutdown (after failing to obtain a lock).

ACKs for top commit:
  willcl-ark:
    re-ACK 7cb9367157
  achow101:
    ACK 7cb9367157
  kristapsk:
    re-ACK 7cb9367157
  stickies-v:
    ACK 7cb9367157

Tree-SHA512: 0960dbc457975b0e0535f3d814824a879d7f85c9f1191537415b3fc253429a316a8e4badde56c8bc139778f132392983cec5fbe03891fb15ff61d3bc3f6e681b
2025-06-24 10:25:22 +01:00
Byron Hambly
10a8e36813
Merge pull request #1428 from psgreco/master-showpak
wallet: Show full pak entry in getwalletpakinfo
2025-06-10 19:30:06 +02:00
Pablo Greco
4a51d82d4b Merge branch 'master' into elem-23.3.0rc6 2025-03-26 05:17:41 -07:00
Pablo Greco
811d835960
Merge pull request #1439 from tomt1664/fix/check-missing-proofs
Add missing proof checks and tests
2025-03-26 05:11:02 -07:00
Thomas Trevethan
51f81f3286 add missing proof checks and tests 2025-03-26 11:35:22 +00:00
Pablo Greco
3c1782e3ce
Merge pull request #1438 from delta1/simplicity-activation-dynafed
fix: simplicity activation when dynafed is active
2025-03-26 04:17:30 -07:00
Byron Hambly
1bb6c424c2
simplicity: change deployment to version bit 21 2025-03-25 09:29:04 +02:00
Byron Hambly
4b5c6e578b
test: failing test for simplicity activation when dynafed is active 2025-03-25 09:25:17 +02:00
Byron Hambly
8cde3cd308
test: add dust relay output value test 2025-03-19 14:48:27 +02:00
Pablo Greco
b63f7ab9b5
Merge pull request #1433 from kilrau/reduce-default-dust-relay-fee
feat: reduce default dust relay fee
2025-03-13 08:00:07 -07:00
Byron Hambly
32390d1552
test: use bitcoin default dustrelayfee in mempool_accept.py 2025-03-13 09:38:10 +02:00
Pablo Greco
6fded6f927 Merge branch 'master' into elements-23.x-test 2025-03-12 08:47:53 -07:00
Thomas Trevethan
d74af31c9e use elements regtest address for derive test 2025-03-10 23:02:16 +00:00
muxator
0cb8f113df rpc: add non-regression test about deriveaddresses crash when index is 2147483647
This test would cause a crash in bitcoind (see #26274) if the fix given in the
previous commit was not applied.

Github-Pull: #26275
Rebased-From: 9153ff3e27
2025-03-10 17:56:03 +00:00
brunoerg
2f9042a967 test: ensure createmultisig and addmultisigaddress are not returning any warning for expected cases
Github-Pull: #25220
Rebased-From: 3a9b9bb38e
2025-03-10 16:21:52 +00:00
Andrew Chow
fb888905f5 tests: Calculate input weight more accurately
The external input test with specifying input weight would make a
pessimistic estimate of the input weight. However this would result in a
test failure as it is sometimes too pessimistic when an ECDSA signature
ends up being smaller than usual. To correct this, we can calculate the
input weight more accurately.

Github-Pull: #24454
Rebased-From: 8a04a386f7
2025-03-10 15:15:58 +00:00
Thomas Trevethan
45fdd42927 fixed tests 2025-03-10 13:03:15 +00:00
Jon Atack
608381c1e8 rpc: rename getdeploymentinfo status-next to status_next
Github-Pull: bitcoin#24528
Rebased-From: 5d7c69b
2025-03-10 11:51:55 +00:00
Pablo Greco
54fa255b85 Merge branch 'master' into elem-23.3.0rc5 2025-03-04 08:53:38 -08:00
Pablo Greco
c878b2587b wallet: Show full pak entry in getwalletpakinfo 2025-03-04 07:16:05 -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
Pablo Greco
69b18d4bef Merge branch 'master' into elem-23.3.0rc4 2025-02-18 06:42:25 -08:00
Jon Atack
7f56623441 Put lock logging behind DEBUG_LOCKCONTENTION preprocessor directive 2025-02-15 00:22:57 -08:00
Byron Hambly
5cb3acef29
Merge pull request #1310 from GoodDaisy/master
Fix typos
2025-02-13 09:47:55 +02:00
Byron Hambly
2c9c6cd7a0 test: add discountvsize test vectors 2025-02-11 11:21:18 -08:00
Byron Hambly
22089ac8f6
Merge pull request #1372 from delta1/issues-1371
decodepsbt: add asset/assetcommitment to input.witness_utxo
2025-02-11 08:47:17 +02:00