Commit graph

41576 commits

Author SHA1 Message Date
stratospher
ad1482d5a2 test: Check that disconnection happens when wrong garbage terminator is sent
This test type is represented using WRONG_GARBAGE_TERMINATOR.
since the wrong garbage terminator is sent to TestNode, TestNode
will interpret all of the gabage bytes, wrong garbage terminator,
decoy messages and version packet it receives as garbage bytes.

If the length of all these is more than 4095 + 16, it will result
in a missing garbage terminator error. otherwise, it will result
in a V2 handshake timeout error.

Send only MAX_GARBAGE_LEN//2 bytes of garbage data to TestNode
so that the total length received by the TestNode is at max
= (MAX_GARBAGE_LEN//2) + 16 + 10*120 + 20 = 3283 bytes
(which is less than 4095 + 16 bytes) and we get a consistent
V2 handshake timeout error message.

If we do not limit the garbage length sent, we will intermittently
get both missing garbage terminator error and V2 handshake
timeout error based on the garbage length and decoy packets length
which are chosen at random.
2024-06-21 19:38:51 +05:30
stratospher
e351576862 test: Check that disconnection happens when >4095 garbage bytes is sent
This test type is represented using EXCESS_GARBAGE.
2024-06-21 19:37:13 +05:30
Fabian Jahr
96b4facc91
refactor, blockstorage: Generalize GetFirstStoredBlock
GetFirstStoredBlock is generalized to check for any data status with a
status mask that needs to be passed as a parameter. To reflect this the
function is also renamed to GetFirstBlock.

Co-authored-by: stickies-v <stickies-v@protonmail.com>
2024-06-21 15:00:16 +02:00
merge-script
538363738e
Merge bitcoin/bitcoin#30314: doc: clarify Cirrus self-hosted workers setup
c67f215ea5 ci: clarify Cirrus self-hosted workers setup (Sjors Provoost)

Pull request description:

  Taken from #29274 (except for two paragraphs that require the other commits in that PR).

ACKs for top commit:
  maflcko:
    ACK c67f215ea5
  tdb3:
    ACK c67f215ea5

Tree-SHA512: 321cc327bfbf0b8e55eb84cb259cf55a66d480c99abe6824248f8b5fdb9a31a079f7ce2c5a6c27afa809aa343d1efb0744a19dd379c17162b21fdf24b6b8836b
2024-06-21 13:54:53 +01:00
merge-script
a19563ac86
Merge bitcoin/bitcoin#30316: refactor: remove extraneous lock annotations from function definitions
5729dbbb74 refactor: remove extraneous lock annotations from function definitions (Cory Fields)

Pull request description:

  These annotations belong in the declarations rather than the definitions. While harmless now, future versions of clang may warn about these.

  Discovered these using the upstream WIP: https://github.com/llvm/llvm-project/pull/67520

ACKs for top commit:
  instagibbs:
    ACK 5729dbbb74
  maflcko:
    ACK 5729dbbb74 🦋

Tree-SHA512: c82c6b269dd353b140cbb36b5519ab2637e54034f159d6ad3eb78c6f4019aa053a5973c626395f0ed3366b9f4117ecc4fe7926b83e9714b1e21c97d5e4bed8d7
2024-06-21 11:20:46 +01:00
fanquake
e3dc64f499
build: add -Wundef
"Warn if an undefined identifier is evaluated in an #if directive. Such
identifiers are replaced with zero."
2024-06-21 09:43:48 +01:00
fanquake
82b43955f7
refactor: use #ifdef HAVE_SOCKADDR_UN
```bash
init.cpp:526:5: error: "HAVE_SOCKADDR_UN" is not defined, evaluates to 0 [-Werror=undef]
  526 | #if HAVE_SOCKADDR_UN
      |     ^~~~~~~~~~~~~~~~
init.cpp:541:5: error: "HAVE_SOCKADDR_UN" is not defined, evaluates to 0 [-Werror=undef]
  541 | #if HAVE_SOCKADDR_UN
      |     ^~~~~~~~~~~~~~~~
init.cpp:1318:5: error: "HAVE_SOCKADDR_UN" is not defined, evaluates to 0 [-Werror=undef]
 1318 | #if HAVE_SOCKADDR_UN
```
```
netbase.cpp:26:5: error: "HAVE_SOCKADDR_UN" is not defined, evaluates to 0 [-Werror=undef]
   26 | #if HAVE_SOCKADDR_UN
      |     ^~~~~~~~~~~~~~~~
netbase.cpp:221:5: error: "HAVE_SOCKADDR_UN" is not defined, evaluates to 0 [-Werror=undef]
  221 | #if HAVE_SOCKADDR_UN
      |     ^~~~~~~~~~~~~~~~
netbase.cpp:496:5: error: "HAVE_SOCKADDR_UN" is not defined, evaluates to 0 [-Werror=undef]
  496 | #if HAVE_SOCKADDR_UN
      |     ^~~~~~~~~~~~~~~~
netbase.cpp:531:5: error: "HAVE_SOCKADDR_UN" is not defined, evaluates to 0 [-Werror=undef]
  531 | #if HAVE_SOCKADDR_UN
      |     ^~~~~~~~~~~~~~~~
netbase.cpp:639:5: error: "HAVE_SOCKADDR_UN" is not defined, evaluates to 0 [-Werror=undef]
  639 | #if HAVE_SOCKADDR_UN
```
2024-06-21 09:43:46 +01:00
fanquake
40cd7585a0
randomenv: use ifdef over if
randomenv.cpp:48:5: warning: 'HAVE_VM_VM_PARAM_H' is not defined, evaluates to 0 [-Wundef]

randomenv.cpp:51:5: warning: 'HAVE_SYS_RESOURCES_H' is not defined, evaluates to 0 [-Wundef]

randomenv.cpp:424:5: error: 'HAVE_SYSCTL' is not defined, evaluates to 0 [-Werror,-Wundef]
2024-06-21 09:42:32 +01:00
fanquake
7839503b30
zmq: use #ifdef ENABLE_ZMQ 2024-06-21 09:42:32 +01:00
Ryan Ofsky
79e197b175
build: Suppress warnings from boost and capnproto in multiprocess code
Without this change there are errors from boost like:

/ci_container_base/depends/i686-pc-linux-gnu/include/boost/signals2/expired_slot.hpp:23:28: error: 'what' overrides a member function but is not marked 'override' [-Werror,-Wsuggest-override]
/ci_container_base/depends/i686-pc-linux-gnu/include/boost/signals2/detail/signal_template.hpp:750:32: error: 'lock_pimpl' overrides a member function but is not marked 'override' [-Werror,-Wsuggest-override]
/ci_container_base/depends/i686-pc-linux-gnu/include/boost/signals2/connection.hpp:150:22: error: 'connected' overrides a member function but is not marked 'override' [-Werror,-Wsuggest-override]

There do not seem to be errors from capnproto currently, but add a suppression
for it, too, to be consistent with other libraries.
2024-06-21 09:42:32 +01:00
Fabian Jahr
2f9bde69f4
test: Remove unnecessary restart in assumeutxo test 2024-06-21 10:39:39 +02:00
Fabian Jahr
19ce3d407e
assumeutxo: Check snapshot base block is not marked invalid
Co-authored-by: Alfonso Roman Zubeldia <alfonsoromanz24@gmail.com>
2024-06-21 10:39:35 +02:00
Sjors Provoost
c67f215ea5
ci: clarify Cirrus self-hosted workers setup 2024-06-21 08:58:59 +02:00
Cory Fields
5729dbbb74 refactor: remove extraneous lock annotations from function definitions
These annotations belong in the declarations rather than the definitions.
While harmless now, future versions of clang may warn about these.
2024-06-20 18:45:32 +00:00
Ava Chow
a961ad1beb
Merge bitcoin/bitcoin#30202: netbase: extend CreateSock() to support creating arbitrary sockets
1245d1388b netbase: extend CreateSock() to support creating arbitrary sockets (Vasil Dimov)

Pull request description:

  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. In addition to extending arguments, some extra safety checks were put in place.

  The need for this came up during the discussion in https://github.com/bitcoin/bitcoin/pull/30043#discussion_r1618837102

ACKs for top commit:
  achow101:
    ACK 1245d1388b
  tdb3:
    re ACK 1245d1388b
  theStack:
    re-ACK 1245d1388b

Tree-SHA512: cc86b56121293ac98959aed0ed77812d20702ed7029b5a043586f46e74295779c5354bb0d5f9e80be6c29e535df980d34c1dbf609064fb7ea3e5ca0f0ed54d6b
2024-06-20 13:44:56 -04:00
Ava Chow
21656e99b5
Merge bitcoin/bitcoin#29862: test: Validate oversized transactions or without inputs
969e047cfb Replace hard-coded constant in test (Lőrinc)
327a31d1a4 Validate oversized transaction (Lőrinc)
1984187840 Validate transaction without inputs (Lőrinc)
c3a8843189 Use SCRIPT_VERIFY_NONE instead of hard-coded 0 in transaction_tests (Lőrinc)

Pull request description:

  Based on https://maflcko.github.io/b-c-cov/test_bitcoin.coverage/src/consensus/tx_check.cpp.gcov.html empty inputs and oversized transactions weren't covered by Boost unit tests (though they're covered by [python](https://github.com/bitcoin/bitcoin/blob/master/test/functional/mempool_accept.py#L231) [tests](https://github.com/bitcoin/bitcoin/blob/master/test/functional/data/invalid_txs.py#L102)).
  <img alt="image" src="https://github.com/bitcoin/bitcoin/assets/1841944/57a74ff5-5466-401f-a4fe-d79e36964adf">

  I have tried including the empty transaction into [tx_invalid.json](https://github.com/bitcoin/bitcoin/blob/master/src/test/data/tx_invalid.json#L34-L36), but it failed for another reason, so I added a separate test case for it in the end.

  The oversized tx data is on the failure threshold now (lower threshold fails for a different reason, but I guess that's fine, we're testing the boundary here).

ACKs for top commit:
  achow101:
    ACK 969e047cfb
  tdb3:
    ACK 969e047cfb pending `MSan, depends` CI failure.
  glozow:
    utACK 969e047cfb

Tree-SHA512: 2a472690eabfdacc276b7e0414d3a4ebc75c227405b202c9fe3c8befad875f6e4d9b40c056fb05971ad3ae479c8f53edebb2eeeb700088856caf5cf58bfca0c1
2024-06-20 13:36:55 -04:00
Ava Chow
a52837b9e9
Merge bitcoin/bitcoin#29575: net_processing: make any misbehavior trigger immediate discouragement
6eecba475e net_processing: make MaybePunishNodeFor{Block,Tx} return void (Pieter Wuille)
ae60d485da net_processing: remove Misbehavior score and increments (Pieter Wuille)
6457c31197 net_processing: make all Misbehaving increments = 100 (Pieter Wuille)
5120ab1478 net_processing: drop 8 headers threshold for incoming BIP130 (Pieter Wuille)
944c54290d net_processing: drop Misbehavior for unconnecting headers (Pieter Wuille)
9f66ac7cf1 net_processing: do not treat non-connecting headers as response (Pieter Wuille)

Pull request description:

  So far, discouragement of peers triggers when their misbehavior score exceeds 100 points. Most types of misbehavior increment the score by 100, triggering immediate discouragement, but some types do not. This PR makes all increments equal to either 100 (meaning any misbehavior will immediately cause disconnection and discouragement) or 0 (making the behavior effectively unconditionally allowed), and then removes the logic for score accumulation.

  This simplifies the code a bit, but also makes protocol expectations clearer: if a peer misbehaves, they get disconnected. There is no good reason why certain types of protocol violations should be permitted 4 times (howmuch=20) or 9 times (howmuch=10), while many others are never allowed. Furthermore, the distinction between these looks arbitrary.

  The specific types of misbehavior that are changed to 100 are:
  * Sending us a `block` which does not connect to our header tree (which necessarily must have been unsollicited). [used to be score 10]
  * Sending us a `headers` with a non-continuous headers sequence. [used to be score 20]
  * Sending us more than 1000 addresses in a single `addr` or `addrv2` message [used to be score 20]
  * Sending us more than 50000 invs in a single `inv` message [used to be score 20]
  * Sending us more than 2000 headers in a single `headers` message [used to be score 20]

  The specific types of misbehavior that are changed to 0 are:
  * Sending us 10 (*) separate BIP130 headers announcements that do not connect to our block tree [used to be score 20]
  * Sending us more than 8 headers in a single `headers` message (which thus does not get treated as a BIP130 announcement) that does not connect to our block tree. [used to be score 10]

  I believe that none of these behaviors are unavoidable, except for the one marked (*) which can in theory happen still due to interaction between BIP130 and variations in system clocks (the max 2 hour in the future rule). This one has been removed entirely. In order to remove the impact of the bug it was designed to deal with, without relying on misbehavior, a separate improvement is included that makes `getheaders`-tracking more accurate.

  In another unrelated improvement, this also gets rid of the 8 header limit heuristic to determine whether an incoming non-connecting `headers` is a potential BIP130 announcement, as this rule is no longer needed to prevent spurious Misbehavior. Instead, any non-connecting `headers` is now treated as a potential announcement.

ACKs for top commit:
  sr-gi:
    ACK [6eecba4](6eecba475e)
  achow101:
    ACK 6eecba475e
  mzumsande:
    Code Review ACK 6eecba475e
  glozow:
    light code review / concept ACK 6eecba475e

Tree-SHA512: e11e8a652c4ec048d8961086110a3594feefbb821e13f45c14ef81016377be0db44b5311751ef635d6e026def1960aff33f644e78ece11cfb54f2b7daa96f946
2024-06-20 13:28:38 -04:00
Max Edwards
4ecbbd9b7f ci: add option for running tests without volume
DANGER_CI_ON_HOST_CACHE_FOLDERS if set will mount caches in directories on the host rather than in docker volumes. Supports saving and restoring caches on Github Actions.
2024-06-20 17:42:28 +01:00
fanquake
4289dd02cc
contrib: add R(UN)PATH check to ELF symbol-check
Our binaries shouldn't contains any rpaths, or runpaths, so check that
at release time.
2024-06-20 12:32:07 +01:00
merge-script
aa2ce2d646
Merge bitcoin/bitcoin#30307: fuzz: Fix wallet_bdb_parser 32-bit unhandled fseek error
fa7bc9bbca fuzz: Fix wallet_bdb_parser 32-bit unhandled fseek error (MarcoFalke)

Pull request description:

  `std::fseek` on 64-bit past the end of the file may work fine (the following read would fail). However, on 32-bit it may fail early.

  Fix it, by ignoring the error, treating it similar to a read error.

  This was found by OSS-Fuzz.

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

ACKs for top commit:
  TheCharlatan:
    ACK fa7bc9bbca
  brunoerg:
    utACK fa7bc9bbca

Tree-SHA512: 7a752a005837bae6846ce315a7b3b1a5fe1f440c7797c750f2c0bbb20b1ef1537cd390c425747c0c85d012655e2f908bd300ea084f82e5ada19badbf826e1ec9
2024-06-20 09:52:57 +01:00
merge-script
c6de072a21
Merge bitcoin/bitcoin#30248: refactor: Add explicit cast to expected_last_page to silence fuzz ISan
fa9cb101cf refactor: Add explicit cast to expected_last_page to silence fuzz ISan (MarcoFalke)

Pull request description:

  Fixes #30247

  I don't think this implicit cast can lead to any bugs, so make it explicit to silence the fuzz integer sanitizer.

  Can be tested with:

  ```
  FUZZ=wallet_bdb_parser UBSAN_OPTIONS="suppressions=$(pwd)/test/sanitizer_suppressions/ubsan:print_stacktrace=1:halt_on_error=1:report_error_type=1" ./src/test/fuzz/fuzz /tmp/1376869be72eebcc87fe737020add634b1a29533
  ```

  After downloading the raw fuzz input from 1376869be7

ACKs for top commit:
  dergoegge:
    utACK fa9cb101cf

Tree-SHA512: 226dcc58be8d70b4eec1657f232c9c6648b5dac5eb2706e7390e65ce0a031fbaf8afce97d71a535c8294467dca4757c96f294d8cc03d5e6a1c0a036b0e070325
2024-06-20 09:43:26 +01:00
AngusP
55eea003af
test: Make blockencodings_tests deterministic
refactor: CBlockHeaderAndShortTxIDs constructor now always takes an explicit nonce.
test: Make blockencodings_tests deterministic using fixed seed providing deterministic
CBlockHeaderAndShortTxID nonces and dummy transaction IDs.

Fixes very rare flaky test failures, where the ShortIDs of test transactions collide, leading to
`READ_STATUS_FAILED` from PartiallyDownloadedBlock::InitData and/or `IsTxAvailable` giving `false`
when the transaction should actually be available.

 * Use a new `FastRandomContext` with a fixed seed in each test, to ensure 'random' uint256s
   used as fake prevouts are deterministic, so in-turn test txids and short IDs are deterministic
   and don't collide causing very rare but flaky test failures.
 * Add new test-only/internal initializer for `CBlockHeaderAndShortTxIDs` that takes a specified
   nonce to further ensure determinism and avoid rare but undesireable short ID collisions.
   In a test context this nonce is set to a fixed known-good value. Normally it is random, as
   previously.

Flaky test failures can be reproduced with:

```patch
diff --git a/src/blockencodings.cpp b/src/blockencodings.cpp
index 695e8d806a..64d635a97a 100644
--- a/src/blockencodings.cpp
+++ b/src/blockencodings.cpp
@@ -44,7 +44,8 @@ void CBlockHeaderAndShortTxIDs::FillShortTxIDSelector() const {

 uint64_t CBlockHeaderAndShortTxIDs::GetShortID(const Wtxid& wtxid) const {
     static_assert(SHORTTXIDS_LENGTH == 6, "shorttxids calculation assumes 6-byte shorttxids");
-    return SipHashUint256(shorttxidk0, shorttxidk1, wtxid) & 0xffffffffffffL;
+    // return SipHashUint256(shorttxidk0, shorttxidk1, wtxid) & 0xffffffffffffL;
+    return SipHashUint256(shorttxidk0, shorttxidk1, wtxid) & 0x0f;
 }

```

to increase the likelihood of a short ID collision; and running

```shell
set -e;
n=0;
while (( n++ < 5000 )); do
    src/test/test_bitcoin --run_test=blockencodings_tests;
done
```
2024-06-19 22:56:30 +01:00
Fabian Jahr
80315c0118
refactor: Move early loadtxoutset checks into ActiveSnapshot
Also changes the return type of ActiveSnapshot to allow returning the
error message to the user of the loadtxoutset RPC.
2024-06-19 22:32:33 +02:00
Luke Dashjr
197b5404b0 QA: Expect PACKAGE_NAME rather than constant "Bitcoin Core" 2024-06-19 14:59:31 +00:00
glozow
2d21060af8
Merge bitcoin/bitcoin#30300: fuzz: have package_rbf always make small txns
4ccb3d6d0d fuzz: have package_rbf always make small txns (Greg Sanders)

Pull request description:

  hopefully resolves https://github.com/bitcoin/bitcoin/issues/30241

  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.

ACKs for top commit:
  maflcko:
    lgtm ACK 4ccb3d6d0d
  hodlinator:
    ACK 4ccb3d6d0d
  glozow:
    ACK 4ccb3d6d0d

Tree-SHA512: 5d2e7e98460c6144dfe7deac554865e2e8e0e5f934dbdf5857dc4b4f471a64dc933297dc0dcf516f748a4348be6bd184808b7ece17ce073fdcc77f81b74c64de
2024-06-19 12:40:46 +01:00
MarcoFalke
fa7bc9bbca
fuzz: Fix wallet_bdb_parser 32-bit unhandled fseek error 2024-06-19 13:39:43 +02:00
dergoegge
e009bf681c Don't use iterator addresses in IteratorComparator
The addresses of the iterator values are non-deterministic (i.e. they
depend on where the values were allocated). This causes stability issues
when fuzzing (e.g. in the `txorphan` and `mini_miner` harnesses), due
the orders (derived from IteratorComparator) not being deterministic.

Improve stability by comparing the first element in the iterator value
pair instead of using the the value addresses.
2024-06-19 10:14:31 +01:00
merge-script
ac4ea782af
Merge bitcoin/bitcoin#30283: upnp: fix build with miniupnpc 2.2.8
8acdf66540 upnp: add compatibility for miniupnpc 2.2.8 (Cory Fields)

Pull request description:

  Fixes https://github.com/bitcoin/bitcoin/issues/30266

  Miniupnpc 2.2.8 [changed the function signature of `UPNP_GetValidIGD`](c0a50ce33e (diff-5a0d7cff00628c2c64a617edb347c0f283e3a75e7df910e7e8438fc6db23f610R122)) without taking much care with the abi :(

  ~This is the minimal change to cope with that. Also included in this PR is a temporary bump to 2.2.8 to verify that it builds correctly. I'm happy to revert that and discuss the bump separately, as miniupnpc bumps require some scrutiny.~

  I believe that this is problematic if we build against one version and encounter a different one at runtime. This is not a problem for depends because we build statically. But for users who are self-building against shared system libs, care must be taken to run against the same version used for linking.

  Some quick digging shows that at least Ubuntu/Arch make the distinction between soversions:
  `libminiupnpc.so.17` -> `libminiupnpc.so.18`. So in practice, I suppose this shouldn't be much of a problem.

  Boooo for the upstream loose abi policy.

ACKs for top commit:
  edilmedeiros:
    reACK 8acdf66540
  fanquake:
    ACK 8acdf66540

Tree-SHA512: d2236ec8aef57a5c879065fbbe20080a14e4bf7b44c0bf506707eb946f72aa5837aba2fb2426d6853d21a9b77db5d72561d29d7ea645714d90309e11fe11d354
2024-06-19 10:06:59 +01:00
Sjors Provoost
a9716c53f0
rpc: call IsInitialBlockDownload via miner interface 2024-06-18 21:07:51 +02:00
Lőrinc
969e047cfb Replace hard-coded constant in test 2024-06-18 19:43:33 +02:00
Lőrinc
327a31d1a4 Validate oversized transaction 2024-06-18 19:43:33 +02:00
Lőrinc
1984187840 Validate transaction without inputs 2024-06-18 19:43:33 +02:00
Lőrinc
c3a8843189 Use SCRIPT_VERIFY_NONE instead of hard-coded 0 in transaction_tests 2024-06-18 19:43:33 +02:00
Sjors Provoost
dda0b0834f
rpc: minize getTipHash() calls in gbt
Set tip at the start of the function and only update it for a long poll.

Additionally have getTipHash return an optional, so the
caller can explicitly check that a tip exists.
2024-06-18 18:47:52 +02:00
Sjors Provoost
7b4d3249ce
rpc: call processNewBlock via miner interface 2024-06-18 18:47:52 +02:00
Sjors Provoost
9e228351e7
rpc: getTransactionsUpdated via miner interface 2024-06-18 18:47:52 +02:00
Sjors Provoost
64ebb0f971
Always pass options to BlockAssembler constructor
This makes the options argument for BlockAssembler constructor mandatory,
dropping implicit use of ArgsManager. The caller i.e. the Mining
interface implementation now handles this.

In a future Stratum v2 change the Options object needs to be
mofified after arguments have been processed. Specifically
the pool communicates how many extra bytes it needs for
its own outputs (payouts, extra commitments, etc). This will need
to be substracted from what the user set as -blockmaxweight.

Such a change can be implemented in createNewBlock, after
ApplyArgsManOptions.
2024-06-18 18:47:51 +02:00
Sjors Provoost
4bf2e361da
rpc: call CreateNewBlock via miner interface 2024-06-18 18:47:51 +02:00
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
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
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
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