Commit graph

38657 commits

Author SHA1 Message Date
MarcoFalke
fa70cbd969
ci: Remove unused TEST_RUNNER_ENV="LC_ALL=C" from s390x task 2023-08-27 22:50:42 +02:00
MarcoFalke
fa33354dcb
ci: Remove /ro_base bind mount
Just set the bind mount to BASE_READ_ONLY_DIR, which allows to drop one
line of code and makes the code easier to understand.
2023-08-27 22:50:07 +02:00
MarcoFalke
fa0df9d4c4
doc: Remove sudo from command that is already run as root 2023-08-27 22:49:59 +02:00
MarcoFalke
faf7e69862
test: Support powerpc64le in get_previous_releases.py 2023-08-27 22:28:57 +02:00
Fabian Jahr
df60de770d
log: Print error message when coindb is in inconsistent state 2023-08-27 20:16:43 +02:00
fanquake
8371914604
Merge bitcoin/bitcoin#28337: build: use Clang 15 for macOS cross-compilation
ff42d81383 guix: use clang-toolchain-15 for macOS compilation (fanquake)
94955b4b1d depends: use LLVM/Clang 15.0.6 for macOS cross-compile (fanquake)

Pull request description:

  This will end up being a blocker for #28210, and is already part of #21778, even though an even newer LLVM/Clang combination is required (and still missing from upstream Guix). Seems straight-forward enough to just bump the macOS compiler to a more modern Clang.

ACKs for top commit:
  TheCharlatan:
    re-ACK ff42d81383

Tree-SHA512: 8af4b54c3a56abb3825c6470444a28e14e9c69820c09ec4a33acebb8ae434df9ae18163c088a582130cc68755293a7e2bde5d065763919d94064ff9b3f83730f
2023-08-27 14:54:48 +01:00
fanquake
ff42d81383
guix: use clang-toolchain-15 for macOS compilation 2023-08-27 10:03:00 +01:00
fanquake
94955b4b1d
depends: use LLVM/Clang 15.0.6 for macOS cross-compile
There is no x86_64 binaries for 15.0.7.
2023-08-27 10:02:55 +01:00
Jon Atack
6c008a2006 script: replace deprecated pkg_resources with importlib.metadata
in our python linter:

```
./test/lint/lint-python.py:12: DeprecationWarning: pkg_resources is deprecated as an API.
  See https://setuptools.pypa.io/en/latest/pkg_resources.html
  import pkg_resources
```

The importlib.metadata library was added in Python 3.8, which is currently our
minimum-supported Python version.

For more details about importlib.metadata, see https://docs.python.org/3/library/importlib.metadata.html
2023-08-26 16:42:02 -06:00
fanquake
03675b2ba3
Merge bitcoin/bitcoin#28328: guix: update time-machine
6cbedc3d9b guix: drop Windows broken-longjmp.patch (fanquake)
a1d4a42993 guix: drop NSIS patch now that we use 3.09 (fanquake)
1f6c75e82b guix: use cross-* keyword arguments (fanquake)
ea4387e1d0 guix: update time-machine to 160f78a4d92205df986ed9efcce7d3aac188cb24 (fanquake)
f1a4afb26f guix: update python-oscrypto to 1.3.0 (fanquake)
a8a7b75a01 guix: backport glibc patch to fix powerpc build (fanquake)

Pull request description:

  Bumps our Guix time-machine to [160f78a4d92205df986ed9efcce7d3aac188cb24](https://git.savannah.gnu.org/cgit/guix.git/commit/?id=160f78a4d92205df986ed9efcce7d3aac188cb24), which includes:

  GCC 10.3.0 -> 10.4.0
  Binutils 2.37 -> 2.38
  Automake 1.16.3 -> 1.16.5
  Coreutils 8.32 -> 9.1
  Findutils 4.8.2 -> 4.9.0
  Libtool 2.4.6 -> 2.4.7
  Linux Libre Headers 5.15.37 -> 5.15.127
  Git 2.36.0 -> 2.41.0
  Mingw-w64 8.0.0 -> 11.0.1
  NSIS 3.05 -> 3.09
  Xorriso 1.5.2 -> 1.5.6.pl02
  Python 3.9 -> 3.10.7
  Python-asn1crypto 1.4.0 -> 1.5.1

  GCC 12.3.0 becomes available. See #27897.
  LLVM 15.0.7 becomes available. Sadly not quite new enough for #21778.

  Split from #27897 for easier review, and to make it clear which changes are part of the time-machine bump vs changing to GCC 12.

  Guix Build:
  ```bash
  1e4aab93de36b47cbbfc5882d3d2a598e54a9c3604b3be1891ddac70cdc46547  guix-build-6cbedc3d9b67/output/aarch64-linux-gnu/SHA256SUMS.part
  278206bddf166ce507ab2ae4742ffbe6ec4256dbc6beee7e42ea040ec3d5b679  guix-build-6cbedc3d9b67/output/aarch64-linux-gnu/bitcoin-6cbedc3d9b67-aarch64-linux-gnu-debug.tar.gz
  261974753869297a480db24733f057aa58e33a0ce08754bea74984a00f8c376f  guix-build-6cbedc3d9b67/output/aarch64-linux-gnu/bitcoin-6cbedc3d9b67-aarch64-linux-gnu.tar.gz
  13bde7d903665f7699e2aa42a23ddc5ece9fab450437ae641d8ebfe6f6b084e1  guix-build-6cbedc3d9b67/output/arm-linux-gnueabihf/SHA256SUMS.part
  df951e4b23db34d1248f7ee9837594645acea8e2de1ed03b23ee002579a4c653  guix-build-6cbedc3d9b67/output/arm-linux-gnueabihf/bitcoin-6cbedc3d9b67-arm-linux-gnueabihf-debug.tar.gz
  5839bb71cca6aafa662f3c7e1c09393dce1c3fd13241726796bf3e681a0a34f0  guix-build-6cbedc3d9b67/output/arm-linux-gnueabihf/bitcoin-6cbedc3d9b67-arm-linux-gnueabihf.tar.gz
  637b1aa49db0cab1bc35064d068f1a5fdee5ab2ceba30b7f6d2c80bbf174c107  guix-build-6cbedc3d9b67/output/arm64-apple-darwin/SHA256SUMS.part
  be87c1ad41f06bcaa8c940fc8d881eca41c531d250ce114325b0e042e603c257  guix-build-6cbedc3d9b67/output/arm64-apple-darwin/bitcoin-6cbedc3d9b67-arm64-apple-darwin-unsigned.dmg
  632956e64d2baf9329ee086781b9268786f37b7c3c5f5232e2394ef2839d6d40  guix-build-6cbedc3d9b67/output/arm64-apple-darwin/bitcoin-6cbedc3d9b67-arm64-apple-darwin-unsigned.tar.gz
  1b23548a94aee5e03a8aec1e63938d9c8505005b87fa832ed112af60861c42a6  guix-build-6cbedc3d9b67/output/arm64-apple-darwin/bitcoin-6cbedc3d9b67-arm64-apple-darwin.tar.gz
  e4056df68bac0bdc0a54899af8f8178e78bfb7d170750f2296fd512d0c6c20db  guix-build-6cbedc3d9b67/output/dist-archive/bitcoin-6cbedc3d9b67.tar.gz
  9f149c82f30eed35e2c217dc57cab37745db27f0a3205e66b4535c247dffc500  guix-build-6cbedc3d9b67/output/powerpc64-linux-gnu/SHA256SUMS.part
  ef91dce0a735ce0633fd273d9e1d6599d74c18280a866c1d6b71c2c3434af9c3  guix-build-6cbedc3d9b67/output/powerpc64-linux-gnu/bitcoin-6cbedc3d9b67-powerpc64-linux-gnu-debug.tar.gz
  dfb60f13b9a7435f608f6d09585de37f789b055c77a0ee729e5723b0ef0550fe  guix-build-6cbedc3d9b67/output/powerpc64-linux-gnu/bitcoin-6cbedc3d9b67-powerpc64-linux-gnu.tar.gz
  0ae916b95617042330166e20a27399c14abbc20638ae3e5e5f9f812146d4a07e  guix-build-6cbedc3d9b67/output/powerpc64le-linux-gnu/SHA256SUMS.part
  180d9c29da1efd21fba6be8a670b6ed01d71a5e90991da3c543f6720273831a2  guix-build-6cbedc3d9b67/output/powerpc64le-linux-gnu/bitcoin-6cbedc3d9b67-powerpc64le-linux-gnu-debug.tar.gz
  9753408e3b4c10b19dba30ecb12ee2ae065c08e7c88be25599e1fdffe81bddbe  guix-build-6cbedc3d9b67/output/powerpc64le-linux-gnu/bitcoin-6cbedc3d9b67-powerpc64le-linux-gnu.tar.gz
  b1f09baec636a3bbaff1be629c95e75767c4ae3d96f0ebe63dcefb6fdb4953fb  guix-build-6cbedc3d9b67/output/riscv64-linux-gnu/SHA256SUMS.part
  09149283880c39c76f73ce83848f266f93777f6d9d389c2448ef0a9af9339b30  guix-build-6cbedc3d9b67/output/riscv64-linux-gnu/bitcoin-6cbedc3d9b67-riscv64-linux-gnu-debug.tar.gz
  788ce14925fec9861c78e16a57a1fd25d0f2ddf3f4e10f3c795bac534d339197  guix-build-6cbedc3d9b67/output/riscv64-linux-gnu/bitcoin-6cbedc3d9b67-riscv64-linux-gnu.tar.gz
  f357a0522c779d1953f37f4cab0160622cbf89ed3fe49cb5abea2509dba1d76f  guix-build-6cbedc3d9b67/output/x86_64-apple-darwin/SHA256SUMS.part
  be5c797a3e4dc969fd9116dede0cb27bda5180e653bb63d1ef3dbcc3de983bf0  guix-build-6cbedc3d9b67/output/x86_64-apple-darwin/bitcoin-6cbedc3d9b67-x86_64-apple-darwin-unsigned.dmg
  7364b2d0223b39debd386b521a5c5d1b26a446331f347b4d4e8fc58bf5b4439e  guix-build-6cbedc3d9b67/output/x86_64-apple-darwin/bitcoin-6cbedc3d9b67-x86_64-apple-darwin-unsigned.tar.gz
  7e873165d4ed785381b6e461a81a947814d14fdd41ae65bc82134c03b3ac0471  guix-build-6cbedc3d9b67/output/x86_64-apple-darwin/bitcoin-6cbedc3d9b67-x86_64-apple-darwin.tar.gz
  bf03ca15a885330ed0c91b3137dcc4ec1102570898360cc3f1073f03b792d729  guix-build-6cbedc3d9b67/output/x86_64-linux-gnu/SHA256SUMS.part
  0707b0e4d8529fc5f7567d1ff029b4b6fdf0bb46f1eb227d70c3aaa2018d65e5  guix-build-6cbedc3d9b67/output/x86_64-linux-gnu/bitcoin-6cbedc3d9b67-x86_64-linux-gnu-debug.tar.gz
  5f1e3713cf856f884d305ad12f43254be3871d9020cc514194fc0a6efd0867b1  guix-build-6cbedc3d9b67/output/x86_64-linux-gnu/bitcoin-6cbedc3d9b67-x86_64-linux-gnu.tar.gz
  c0d5e284903dbb55e4ad3d43db9b1e5d211c5259c3fae43bf4cddedea2e02c01  guix-build-6cbedc3d9b67/output/x86_64-w64-mingw32/SHA256SUMS.part
  d16f61c78b784b664d558a9a537e15da432ef9c18de0754dd7fd19682ab0569f  guix-build-6cbedc3d9b67/output/x86_64-w64-mingw32/bitcoin-6cbedc3d9b67-win64-debug.zip
  617010c1ac295bc692e0a4074acc19ebbc9561a01c8e5365428cfe61dc50fe3c  guix-build-6cbedc3d9b67/output/x86_64-w64-mingw32/bitcoin-6cbedc3d9b67-win64-setup-unsigned.exe
  a48961c49edf9f8988b902d874f47918f6716053be6c3bc263932834cb896510  guix-build-6cbedc3d9b67/output/x86_64-w64-mingw32/bitcoin-6cbedc3d9b67-win64-unsigned.tar.gz
  0cd95e8f919ac694dfd88a14fda37c57f0534cb890acc73f70aff71937fa1a8e  guix-build-6cbedc3d9b67/output/x86_64-w64-mingw32/bitcoin-6cbedc3d9b67-win64.zip
  ```

ACKs for top commit:
  TheCharlatan:
    ACK 6cbedc3d9b

Tree-SHA512: 48950535febab3865a8899b0ce590a7da6dbd0a89d2d2987a467da457e9ff0687d5afc65f952386fa562aa2a3fc6d8c85b1c221c73998d522076486a9fd845c4
2023-08-26 08:49:34 +01:00
MarcoFalke
99995cfe8d
refactor: Use HashWriter over legacy CHashWriter (via SerializeHash) 2023-08-25 17:09:32 +02:00
MarcoFalke
5555aa2d0d
refactor: Use HashWriter over legacy CHashWriter 2023-08-25 17:09:13 +02:00
Hennadii Stepanov
6a43372980
ci: Run "Win64 native" job on GitHub Actions 2023-08-25 13:50:04 +01:00
Antoine Poinsot
10546a569c
wallet: accurately account for the size of the witness stack
When estimating the maximum size of an input, we were assuming the
number of elements on the witness stack could be encode in a single
byte. This is a valid approximation for all the descriptors we support
(including P2WSH Miniscript ones), but may not hold anymore once we
support Miniscript within Taproot descriptors (since the max standard
witness stack size of 100 gets lifted).

It's a low-hanging fruit to account for it correctly, so just do it now.
2023-08-25 12:40:12 +02:00
Antoine Poinsot
9b7ec393b8
wallet: use descriptor satisfaction size to estimate inputs size
Instead of using the dummysigner to compute a placeholder satisfaction,
infer a descriptor on the scriptPubKey of the coin being spent and use
the estimation of the satisfaction size given by the descriptor
directly.

Note this (almost, see next paragraph) exactly conserves the previous
behaviour. For instance CalculateMaximumSignedInputSize was previously
assuming the input to be spent in a transaction that spends at least one
Segwit coin, since it was always accounting for the serialization of the
number of witness elements.

In this commit we use a placeholder for the size of the serialization of
the witness stack size (1 byte). Since the logic in this commit is
already tricky enough to review, and that it is only a very tiny
approximation not observable through the existing tests, it is addressed
in the next commit.
2023-08-25 12:40:12 +02:00
Antoine Poinsot
8d870a9873
script/signingprovider: introduce a MultiSigningProvider
It is sometimes useful to interface with multiple signing providers at
once. For instance when inferring a descriptor with solving information
being provided from multiple sources (see next commit).

Instead of inneficiently copying the information from one provider into
the other, introduce a new signing provider that takes a list of
pointers to existing providers.
2023-08-25 12:40:11 +02:00
Antoine Poinsot
fa7c46b503
descriptor: introduce a method to get the satisfaction size
In the wallet code, we are currently estimating the size of a signed
input by doing a dry run of the signing logic. This is unnecessary as
all outputs we are able to sign for can be represented by a descriptor,
and we can derive the size of a satisfaction ("signature") from the
descriptor itself directly.
In addition, this approach does not scale: getting the size of a
satisfaction through a dry run of the signing logic is only possible for
the most basic scripts.

This commit introduces the computation of the size of satisfaction per
descriptor. It's a bit intricate for 2 main reasons:
- We want to conserve the behaviour of the current dry-run logic used by
  the wallet that sometimes assumes ECDSA signatures will be low-r,
  sometimes not (when we don't create them).
- We need to account for the witness discount. A single descriptor may
  sometimes benefit of it, sometimes not (for instance `pk()` if used as
  top-level versus if used inside `wsh()`).
2023-08-25 12:40:11 +02:00
Antoine Poinsot
bdba7667d2
miniscript: introduce a helper to get the maximum witness size
Similarly to how we compute the maximum stack size.

Also note how it would be quite expensive to recompute it recursively
by accounting for different ECDSA signature sizes. So we just assume
high-R everywhere. It's only a trivial difference anyways.
2023-08-25 11:56:10 +02:00
Antoine Poinsot
4ab382c2cd
miniscript: make GetStackSize independent of P2WSH context
It was taking into account the P2WSH script push in the number of stack
elements.
2023-08-25 11:56:09 +02:00
Andrew Chow
c9273f68f6
Merge bitcoin/bitcoin#28287: rpc, test: add sendmsgtopeer rpc and a test for net-level deadlock situation
b3a93b409e test: add functional test for deadlock situation (Martin Zumsande)
3557aa4d0a test: add basic tests for sendmsgtopeer to rpc_net.py (Martin Zumsande)
a9a1d69391 rpc: add test-only sendmsgtopeer rpc (Martin Zumsande)

Pull request description:

  This adds a `sendmsgtopeer` rpc (for testing only) that allows a node to send a message (provided in hex) to a peer.
  While we would usually use a `p2p` object instead of a node for this in the test framework, that isn't possible in situations where this message needs to trigger an actual interaction of multiple nodes.

  Use this rpc to add test coverage for the bug fixed in #27981 (that just got merged):
  The test lets two nodes (almost) simultaneously send a single large (4MB) p2p message to each other, which would have caused a deadlock previously (making this test fail), but succeeds now.

  As can be seen from the discussion in #27981, it was not easy to reproduce this bug without `sendmsgtopeer`. I would imagine that `sendmsgtopeer` could also be helpful in various other test constellations.

ACKs for top commit:
  ajtowns:
    ACK b3a93b409e
  sipa:
    ACK b3a93b409e
  achow101:
    ACK b3a93b409e

Tree-SHA512: 6e22e72402f3c4dd70cddb9e96ea988444720f7a164031df159fbdd48056c8ac77ac53def045d9208a3ca07437c7c8e34f8b4ebc7066c0a84d81cd53f2f4fa5f
2023-08-24 17:34:57 -04:00
Andrew Chow
5ce200dda2
Merge bitcoin/bitcoin#27480: doc: Improve documentation of rpcallowip
c8e066461b doc: Improve documentation of rpcallowip rpchelp (willcl-ark)

Pull request description:

  Closes #21070

  v21.0 introduced a behaviour changed noted in #21070 where using a config value `rpcallowip=::0` no longer also permitted ipv4 ip addresses.

  The rpc_bind.py functional test covers this new behaviour already by checking that the list of bind addresses exactly matches what is expected so this commit only updates the documentation.

ACKs for top commit:
  achow101:
    ACK c8e066461b
  pinheadmz:
    ACK c8e066461b
  jonatack:
    ACK c8e066461b

Tree-SHA512: 332060cf0df0427c6637a9fd1e0783ce0b0940abdb41b0df13f03bfbdc28af067cec8f0b1bbc4e47b3d54fa1b2f110418442b05b39d5e7c7e0b96744ddd7c003
2023-08-24 16:31:38 -04:00
Andrew Chow
74d66359da
Merge bitcoin/bitcoin#27585: fuzz: improve coinselection
bf26f978ff fuzz: coinselection, fix `m_cost_of_change` (brunoerg)
6d9b26d56a fuzz: coinselection, BnB should never produce change (brunoerg)
b2eb558407 fuzz: coinselection, compare `GetSelectedValue` with target (brunoerg)
0df0438c60 fuzz: coinselection, improve `ComputeAndSetWaste` (brunoerg)
1e351e5db1 fuzz: coinselection, add coverage for `Merge` (brunoerg)
f0244a8614 fuzz: coinselection, add coverage for `GetShuffledInputVector`/`GetInputSet` (brunoerg)
808618b8a2 fuzz: coinselection, add coverage for `AddInputs` (brunoerg)
90c4e6a241 fuzz: coinselection, add coverage for `EligibleForSpending` (brunoerg)
2a031cb2c2 fuzz: coinselection, add `CreateCoins` (brunoerg)

Pull request description:

  This PR:

  - Moves coin creation to its own function called `CreateCoins`.
  - Add coverage for `EligibleForSpending`
  - Add coverage for `AddInputs`: get result of each algorithm (srd, knapsack and bnb), call `CreateCoins` and add into them.
  - Add coverage for `GetShuffledInputVector` and `GetInputSet` using the result of each algorithm (srd, knapsack and bnb).
  - Add coverage for `Merge`: Call SRD with the new utxos and, if successful, try to merge with the previous SRD result.

ACKs for top commit:
  murchandamus:
    reACK with some minimal fuzzing bf26f978ff
  achow101:
    ACK bf26f978ff
  furszy:
    re-ACK bf26f97

Tree-SHA512: bdd2b0a39de37be0a9b21a7c51260b6b8abe538cc0ea74312eb658b90a121a1ae07306c09fb0e75e93b531ce9ea2402feb041b0d852902d07739257f792e64ab
2023-08-24 16:11:20 -04:00
fanquake
1fa6411dde
Merge bitcoin/bitcoin#28165: net: transport abstraction
8a3b6f3387 refactor: make Transport::ReceivedBytes just return success/fail (Pieter Wuille)
bb4aab90fd net: move message conversion to wire bytes from PushMessage to SocketSendData (Pieter Wuille)
a1a1060fd6 net: measure send buffer fullness based on memory usage (Pieter Wuille)
009ff8d650 fuzz: add bidirectional fragmented transport test (Pieter Wuille)
fb2c5edb79 net: make V1Transport implicitly use current chainparams (Pieter Wuille)
0de48fe858 net: abstract sending side of transport serialization further (Pieter Wuille)
649a83c7f7 refactor: rename Transport class receive functions (Pieter Wuille)
27f9ba23ef net: add V1Transport lock protecting receive state (Pieter Wuille)
93594e42c3 refactor: merge transport serializer and deserializer into Transport class (Pieter Wuille)

Pull request description:

  This PR furthers the P2P message serialization/deserialization abstraction introduced in #16202 and #16562, in preparation for introducing the BIP324 v2 transport (making this part of #27634). However, nothing in this PR is BIP324-specific, and it contains a number of independently useful improvements.

  The overall idea is to have a single object in every `CNode` (called `m_transport`) that is responsible for converting sent messages to wire bytes, and for converting received wire bytes back to messages, while having as little as possible knowledge about this conversion process in higher-level net code. To accomplish that, there is an abstract `Transport` class with (currently) a single `V1Transport` implementation.

  Structurally, the above is accomplished by:
  * Merging the `TransportDeserializer` and `TransportSerializer` classes into a single `Transport` class, which encompasses both the sending and receiving side. For `V1Transport` these two sides are entirely separate, but this assumption doesn't hold for the BIP324 transport where e.g. the sending encryption key depends on the DH key negotiation data received from the other side. Merging the two means a future `V2Transport` can handle all this interaction without callers needing to be aware.
  * Removing the assumption that each message is sent using a computed header followed by (unmodified) data bytes. To achieve that, the sending side of `Transport` mirrors what the receiver side does: callers can set a message to be sent, then ask what bytes must be sent out, and then allowing them to transition to the next message.
  * Adding internal locks to protect the sending and receiving state of the `V1Transport` implementation. I believe these aren't strictly needed (opinions welcome) as there is no real way to use `Transport` objects in a multi-threaded fashion without some form of external synchronization (e.g. "get next bytes to send" isn't meaningful to call from multiple threads at the same time without mechanism to control the order they'll actually get sent). Still, I feel it's cleaner to make the object responsible for its own consistency (as we definitely do not want the entire object to be under a single external GUARDED_BY, as that'd prevent simultaneous sending and receiving).
  * Moving the conversion of messages to bytes on the sending side from `PushMessage` to `SocketSendData`, which is needed to deal with the fact that a transport may not immediately be able to send messages.

  This PR is not a refactor, though some commits are. Among the semantic changes are:
  * Changing the send buffer pushback mechanism to trigger based on the memory usage of the buffer rather than the amount of bytes to be sent. This is both closer to the desired behavior, and makes the buffering independent from transport details (which is why it's included here).
  * When optimistic send is not applicable, the V1 message checksum calculation now runs in the net thread rather than the message handling thread. I believe that's generally an improvement, as the message handling thread is far more computationally bottlenecked already.
  * The checksum calculation now runs under the `CNode::cs_vSend` lock, which does mean no two checksum calculations for messages sent to the same node can run in parallel, even if running in separate threads. Despite that limitation, having the checksum for non-optimistic sends moved in the net thread is still an improvement, I believe.
  * Statistics for per-message-type sent bytes are now updated when the bytes are actually handed to the OS rather than in `PushMessage`. This is because the actual serialized sizes aren't known until they've gone through the transport object.

  A fuzz test of the entire `V1Transport` is included. More elaborate rationale for each of the changes can be found in the commit messages.

ACKs for top commit:
  theStack:
    re-ACK 8a3b6f3387
  vasild:
    ACK 8a3b6f3387
  dergoegge:
    Code review ACK 8a3b6f3387

Tree-SHA512: 26e9a6df47f1dd3e3f3edb4874edf365728e5a8bbc9d0d4d71fb6000cb2dfde5574902c47ffcf825af6743922f2ff9d31a5a38942a196f4ca6669122e15e42e4
2023-08-24 13:55:41 +01:00
fanquake
083316c4fe
Merge bitcoin/bitcoin#28230: rpc: Add MaybeArg() and Arg() default helper
c00000df16 rpc: Add MaybeArg() and Arg() default helper (MarcoFalke)

Pull request description:

  Currently the RPC method implementations have many issues:

  * Default RPC argument values (and their optionality state) are duplicated in the documentation and the C++ code, with no checks to prevent them from going out of sync.
  * Getting an optional RPC argument is verbose, using a ternary operator, or worse, a multi-line `if`.

  Fix all issues by adding default helper that can be called via `self.Arg<int>(0)`. The helper needs a few lines of code in the `src/rpc/util.h` header file. Everything else will be implemented in the cpp file once and if an RPC method needs it.

  There is also an `self.MaybeArg<int>(0)` helper that works on any arg to return the argument, the default, or a falsy value.

ACKs for top commit:
  ajtowns:
    reACK c00000df16
  stickies-v:
    re-ACK c00000df16
  TheCharlatan:
    re-ACK c00000df16

Tree-SHA512: e7ddcab3faa319bc53edbdf3f89ce83389d2c4e571d5db42401620ff105e522a4a0669dad08e08cde5fd05c790aec3b806f63261a9100c2778865a489e57381e
2023-08-24 11:57:12 +01:00
fanquake
27101d0f0c
Merge bitcoin/bitcoin#28330: ci: Add missing docker.io prefix for native tasks to CI_IMAGE_NAME_TAG
fab7f5c01d ci: Add missing docker.io prefix to CI_IMAGE_NAME_TAG (MarcoFalke)

Pull request description:

  Currently, the CI system may pick the wrong (non-native) architecture due to the missing prefix.

  For example, assuming the CI_IMAGE_NAME_TAG is `debian:bookworm` and the user has previously pulled an s390x image:

  ```
  $ podman run --rm 'docker.io/s390x/debian:bookworm' dpkg --print-architecture
  exec /usr/bin/dpkg: exec format error
  ```

  Now, `debian:bookworm` will refer to the same image:

  ```
  $ podman run --rm 'debian:bookworm' dpkg --print-architecture
  exec /usr/bin/dpkg: exec format error
  ```

  However, `docker.io/debian:bookworm` works fine:

  ```
   $ podman run --rm 'docker.io/debian:bookworm' dpkg --print-architecture
  arm64

ACKs for top commit:
  hebasto:
    ACK fab7f5c01d.

Tree-SHA512: c423c5cd454a95fa3e67081411ca08d316b8c680a5bba49196c514b91df65d9cc46a47700cc00d9579327842615f98146d0ac50abb016616a9b17d042598dab6
2023-08-24 10:56:03 +01:00
fanquake
7ee7c6d2c3
Merge bitcoin/bitcoin#28332: test: previous releases: speed up fetching sources with shallow clone
360ac64b90 test: previous releases: speed up fetching sources with shallow clone (Sebastian Falbesoner)

Pull request description:

  For the sake of building previous releases, fetching the whole history of the repository for each version seems to be overkill as it takes much more time, bandwidth and disk space than necessary. Create a shallow clone instead with history truncated to the one commit of the version tag, which is directly checked out in the same command. This has the nice side-effect that we can remove the extra `git checkout` step after as it's not needed anymore.

  Note that it might look confusing to pass a _tag_ to a parameter named `--branch`, but the git-clone manpage explicitly states that this is supported.

ACKs for top commit:
  MarcoFalke:
    lgtm ACK 360ac64b90

Tree-SHA512: c885a695c1ea90895cf7a785540c24e8ef8d1d9ea78db28143837240586beb6dfb985b8b0b542d2f64e2f0ffdca7c65fc3d55f44b5e1b22cc5535bc044566f86
2023-08-24 10:37:41 +01:00
fanquake
e8989f295d
Merge bitcoin/bitcoin#28325: test: wallet_backup.py, fix intermittent failure in "restore using dumped wallet"
c4929cfa50 test: wallet_backup.py, fix intermittent failure in "restore using dumped wallet" (furszy)

Pull request description:

  Aiming to fix #25652.

  The failure arises because the test expects `init_wallet()` (the test framework function) to create a wallet with no keys. However, the function also imports the deterministic private key used to receive the coinbase coins.

  This causes a race within the "restore using dumped wallet" case, where we intend to have a new wallet (with no existing keys) to test the 'importwallet()' RPC result.
  The reason why this failure is intermittent is that it depends on other peers delivering the chain right after node2 startup and prior to the test 'node2.getbalance()' call and also the synchronization of the validation queue.

ACKs for top commit:
  MarcoFalke:
    lgtm ACK c4929cfa50

Tree-SHA512: 80faa590439305576086a7d6e328f2550c97b218771fc5eba0567feff78732a2605d028a30a368d50944ae3d25fdbd6d321fb97321791a356416f2b790999613
2023-08-24 10:30:58 +01:00
fanquake
94af164e5e
Merge bitcoin/bitcoin#28322: ci: Use concurrency for pull requests only
e7d67efd13 ci: Use concurrency for pull requests only (Hennadii Stepanov)

Pull request description:

  This PR is an amendment for https://github.com/bitcoin/bitcoin/pull/28282.

  It avoids skipping builds when some pushes were done consequentially:

  ![image](https://github.com/bitcoin/bitcoin/assets/32963518/977e9ead-1856-4020-82eb-d16dbead5753)

  From GitHub Actions [docs](https://docs.github.com/en/actions/using-jobs/using-concurrency):

  > When a concurrent ... workflow is queued, if another ... workflow using the same concurrency group in the repository is in progress, the queued ... workflow will be pending. **Any previously pending ... workflow in the concurrency group will be canceled.**

  No behavior change for pull requests:

  ![image](https://github.com/bitcoin/bitcoin/assets/32963518/4865ae04-fc42-4028-b91e-500c0b36bce6)

ACKs for top commit:
  MarcoFalke:
    review only ACK e7d67efd13
  dergoegge:
    lgtm ACK e7d67efd13

Tree-SHA512: 360be9dbb46354d988935643e8793ea630c3416609c45aab4c39075a00a427487446a34a4fb93b490ece43cabe43640fcc6fb2ac97760e2c6ee54b95241da826
2023-08-24 10:17:14 +01:00
fanquake
e0ad847073
Merge bitcoin/bitcoin#28321: test: Fix intermittent issue in mempool_reorg
fa5cc3ccfb test: Fix intermittent issue in mempool_reorg (MarcoFalke)

Pull request description:

  Currently the test case may fail intermittently, see https://github.com/bitcoin/bitcoin/issues/28313

  Fix this by changing a number and reducing the failure rate a bit.

ACKs for top commit:
  glozow:
    ACK fa5cc3ccfb

Tree-SHA512: ff552111b434ca712c7dbdc5ba32a986a6fa4512cba5a756234eae69428063bf6ecfdc8f350ee84226ed4d3e4262b4639dbe49162a722e8da85f0d61e5690c51
2023-08-24 10:16:13 +01:00
MarcoFalke
c00000df16
rpc: Add MaybeArg() and Arg() default helper 2023-08-24 10:44:45 +02:00
fanquake
cd5d2f5f09
Merge bitcoin/bitcoin#27976: ci: Start with clean env
fa15f7e082 ci: Remove no longer applicable section (MarcoFalke)
fa378bed56 ci: Start with clean env (MarcoFalke)
fa8c250c2f ci: Limit scope of some env vars (MarcoFalke)

Pull request description:

  Starting with a clean `env` should help to avoid non-determinism, such as the one fixed in https://github.com/bitcoin/bitcoin/pull/27739#issuecomment-1564529747

ACKs for top commit:
  dergoegge:
    utACK fa15f7e082

Tree-SHA512: 716b264217557b6524dab92d5a2a8d61ecb982dff475bd0cf5a763070b4c5916cd5995e764eb5d67d9cf2428c29d5fc2f42b32941b54c7c3053123ce448171e5
2023-08-24 09:28:49 +01:00
fanquake
6cbedc3d9b
guix: drop Windows broken-longjmp.patch
This is no-longer required, now that we are building using GCC 10.4.0.
2023-08-24 09:21:50 +01:00
fanquake
a1d4a42993
guix: drop NSIS patch now that we use 3.09
See https://sourceforge.net/p/nsis/bugs/1283/.
2023-08-24 09:21:49 +01:00
fanquake
1f6c75e82b
guix: use cross-* keyword arguments
Using the new time-machine results in warnings about consistently using
keyword arguments:
```bash
guix environment: warning: 'cross-kernel-headers' must be used with keyword arguments
guix environment: warning: 'cross-libc' must be used with keyword arguments
```
2023-08-24 09:21:49 +01:00
fanquake
ea4387e1d0
guix: update time-machine to 160f78a4d92205df986ed9efcce7d3aac188cb24
In our time-machine environment this changes the following:

GCC 10.3.0 -> 10.4.0
Binutils 2.37 -> 2.38
Linux Libre Headers 5.15.37 -> 5.15.127
git 2.36.0 -> 2.41.0
mingw-w64 8.0.0 -> 11.0.1
NSIS 3.05 -> 3.09
xorriso 1.5.2 -> 1.5.6.pl02
Python 3.9 -> 3.10.7
Python-asn1crypto 1.4.0 -> 1.5.1

GCC 12.3.0 becomes available.
LLVM 15.0.7 becomes available.
2023-08-24 09:21:49 +01:00
fanquake
f1a4afb26f
guix: update python-oscrypto to 1.3.0
This is required for bumping the time-machine, for compatibility with
OpenSSL:

oscrypto: openssl backend, 1.2.1, /tmp/guix-build-python-oscrypto-1.2.1.drv-0/source/oscrypto
Traceback (most recent call last):
  File "/tmp/guix-build-python-oscrypto-1.2.1.drv-0/source/oscrypto/_openssl/_libcrypto_ctypes.py", line 304, in <module>
    libcrypto.EVP_PKEY_size.argtypes = [
  File "/gnu/store/9dkl9fnidcdpw19ncw5pk0p7dljx7ijb-python-3.10.7/lib/python3.10/ctypes/__init__.py", line 387, in __getattr__
    func = self.__getitem__(name)
  File "/gnu/store/9dkl9fnidcdpw19ncw5pk0p7dljx7ijb-python-3.10.7/lib/python3.10/ctypes/__init__.py", line 392, in __getitem__
    func = self._FuncPtr((name_or_ordinal, self))
AttributeError: /gnu/store/2hr7w64zhr6jjznidyc2xi40d5ynhj9c-openssl-3.0.8/lib/libcrypto.so.3: undefined symbol: EVP_PKEY_size. Did you mean: 'EVP_PKEY_free'?
2023-08-24 09:20:31 +01:00
fanquake
a8a7b75a01
guix: backport glibc patch to fix powerpc build
Do this prior to bumping the time-machine, to avoid the following build
failure:
```bash
 /tmp/guix-build-glibc-cross-powerpc64le-linux-gnu-2.27.drv-0/build/string/memset-power8.o.dt -MT /tmp/guix-build-glibc-cross-powerpc64le-linux-gnu-2.27.drv-0/build/string/memset-power8.o
../sysdeps/powerpc/powerpc64/power4/memcmp.S: Assembler messages:
../sysdeps/powerpc/powerpc64/power4/memcmp.S:87: Error: unrecognized opcode: `ldbrx'
../sysdeps/powerpc/powerpc64/power4/memcmp.S:88: Error: unrecognized opcode: `ldbrx'
../sysdeps/powerpc/powerpc64/power4/memcmp.S:112: Error: unrecognized opcode: `ldbrx'
```

See:
https://sourceware.org/git/?p=glibc.git;a=commit;h=9250e6610fdb0f3a6f238d2813e319a41fb7a810.
e154242724.
2023-08-24 09:20:31 +01:00
fanquake
f3cc29fc5f
Merge bitcoin/bitcoin#28324: guix: pre time-machine bump changes (Linux)
806b75b213 guix: consolidate Linux GCC package (fanquake)
4415275f96 guix: consolidate glibc 2.27 package (fanquake)

Pull request description:

  This is some refactoring to the Linux Guix build that facilitates bumping our Guix time-machine. Namely, avoiding `package-with-extra-configure-variable`, which is non-functional in the newer time-machine, see https://issues.guix.gnu.org/64436.

  At the same time, consolidate our Linux GCC build into `linux-base-gcc`. Now that we only use `building-on`, remove `explicit-cross-configure`.

  Split out of https://github.com/bitcoin/bitcoin/pull/27897. Most of the [[WIP] Linux commit](8335fc4775), minus anything GCC 12 related.

  I'll also be splitting out the other changes we can do pre-timemachine bump, for easier review.

  Similar/followup to #28294. Requirement for #28328.

  Guix Build:
  ```bash
  17463110d4b4721a7c188e71b1fc00c9b5b82227aa8342471390c17678e04a9a  guix-build-806b75b21340/output/aarch64-linux-gnu/SHA256SUMS.part
  0ca919ce568e7d4ffe44dda871d48963ca2988516068e75b1f30ca342d853d20  guix-build-806b75b21340/output/aarch64-linux-gnu/bitcoin-806b75b21340-aarch64-linux-gnu-debug.tar.gz
  134afa263e4da6c8d7df79a7dd8e59911c1e643b53b7c285de9418d97fb06d5f  guix-build-806b75b21340/output/aarch64-linux-gnu/bitcoin-806b75b21340-aarch64-linux-gnu.tar.gz
  22ce318241084829e57f064bf47de57752151863aac545e643eea5dd8eee96fe  guix-build-806b75b21340/output/arm-linux-gnueabihf/SHA256SUMS.part
  a26fecfeb821040704ca70ea056bff796789ed9500d9575d8fa13a85b32143f6  guix-build-806b75b21340/output/arm-linux-gnueabihf/bitcoin-806b75b21340-arm-linux-gnueabihf-debug.tar.gz
  213c84494835c81a40ebc5d38a62bb19cbee5b214b2a8aaed6d28746b245108e  guix-build-806b75b21340/output/arm-linux-gnueabihf/bitcoin-806b75b21340-arm-linux-gnueabihf.tar.gz
  ce1efcf6d3ca0e7422c5ce35f5e45e0770a3ae48173e061137daa7dc551e9d48  guix-build-806b75b21340/output/arm64-apple-darwin/SHA256SUMS.part
  fc01aaeb4e4722d21fd60c78f1b5322c9875ec6fb4d244f4547a354e91a33ed7  guix-build-806b75b21340/output/arm64-apple-darwin/bitcoin-806b75b21340-arm64-apple-darwin-unsigned.dmg
  632e4a243d3e4144313f53047499f91b7c9380a1a50f5846e1635d0a00fd202a  guix-build-806b75b21340/output/arm64-apple-darwin/bitcoin-806b75b21340-arm64-apple-darwin-unsigned.tar.gz
  8e694e4cd1bf45e6a586a0d8c19b675014f168f342f881a9ae0c4fbbda796914  guix-build-806b75b21340/output/arm64-apple-darwin/bitcoin-806b75b21340-arm64-apple-darwin.tar.gz
  dad6e8475f13dac6c4f0b182f53dc330997e9e1e5cf4d46413655f319dcd9bff  guix-build-806b75b21340/output/dist-archive/bitcoin-806b75b21340.tar.gz
  32e8b6c7e7a7561e132c5f15e2151a51aad1c5004ab90a36a7e80f92c200ef6f  guix-build-806b75b21340/output/powerpc64-linux-gnu/SHA256SUMS.part
  9033e85e03bd12a3a19599735cfd44fcfdfb1bf1b632733341cec6a4f75ff86f  guix-build-806b75b21340/output/powerpc64-linux-gnu/bitcoin-806b75b21340-powerpc64-linux-gnu-debug.tar.gz
  72698691b27ec0ac17f21dce8551de0ca683dd00b5b9442ea7616fb56cca8c6b  guix-build-806b75b21340/output/powerpc64-linux-gnu/bitcoin-806b75b21340-powerpc64-linux-gnu.tar.gz
  ef7c6d7184249eb59fa67d6df91d1a567570b9fb026dbb8682763029decaacca  guix-build-806b75b21340/output/powerpc64le-linux-gnu/SHA256SUMS.part
  fc6bb5619ee76899a88c1dd62640b429ad8957bbdf821238038b41fc87d18eca  guix-build-806b75b21340/output/powerpc64le-linux-gnu/bitcoin-806b75b21340-powerpc64le-linux-gnu-debug.tar.gz
  0eceb969f41f6b8dba88f641e268590de7edf0008318c8051d9cb208fb15e7f7  guix-build-806b75b21340/output/powerpc64le-linux-gnu/bitcoin-806b75b21340-powerpc64le-linux-gnu.tar.gz
  6f51a4791d87a610abd81cee83efa7f469e905829797bc2edac4fb95a2e0f3e4  guix-build-806b75b21340/output/riscv64-linux-gnu/SHA256SUMS.part
  c978706988f31e65a7991ff7582d79b3d1df44249c14d9807d93c01bf3f5080d  guix-build-806b75b21340/output/riscv64-linux-gnu/bitcoin-806b75b21340-riscv64-linux-gnu-debug.tar.gz
  93aefe058025067550692adae59ead14228ac252a9e7cf8b55c8fb4189ece545  guix-build-806b75b21340/output/riscv64-linux-gnu/bitcoin-806b75b21340-riscv64-linux-gnu.tar.gz
  862a53f6023bd1ca98a078ea540bba8ca9bfa335a9560f3d8d62ac873c2d5848  guix-build-806b75b21340/output/x86_64-apple-darwin/SHA256SUMS.part
  8f632b42c94d061fa30364087e75bb8b04eb2ac5a0a988eacc37c5983669f01b  guix-build-806b75b21340/output/x86_64-apple-darwin/bitcoin-806b75b21340-x86_64-apple-darwin-unsigned.dmg
  ce62e76ca446a6316b31490e12463c0a641e15beef9bdae7acc8e5db057b433a  guix-build-806b75b21340/output/x86_64-apple-darwin/bitcoin-806b75b21340-x86_64-apple-darwin-unsigned.tar.gz
  f57b014818e3b1ec07d27c8224ec4ac0e5786dacd00639513b599c6138790ece  guix-build-806b75b21340/output/x86_64-apple-darwin/bitcoin-806b75b21340-x86_64-apple-darwin.tar.gz
  70e75f6f13795f968f91719d221673b687bf747f90d77912cbcb2c1ee45ec623  guix-build-806b75b21340/output/x86_64-linux-gnu/SHA256SUMS.part
  30dec525364bb21a26cfe8bfff061d013c4ce849165aa67b06eb154019444862  guix-build-806b75b21340/output/x86_64-linux-gnu/bitcoin-806b75b21340-x86_64-linux-gnu-debug.tar.gz
  d8b3a996f25fb948b3555d5750852aaf82f7051848586b9ba0f4d0d223226e4b  guix-build-806b75b21340/output/x86_64-linux-gnu/bitcoin-806b75b21340-x86_64-linux-gnu.tar.gz
  4259adec77912bab6494f71a2a95d98093b116c05fc9ad03069e92de4ce0248c  guix-build-806b75b21340/output/x86_64-w64-mingw32/SHA256SUMS.part
  0a2d5cab3fe94a86def0cc1b6efe9ac871839cbcdc05ad92686df1d2bdd154ea  guix-build-806b75b21340/output/x86_64-w64-mingw32/bitcoin-806b75b21340-win64-debug.zip
  d2a1876333bdb1cd5b8b1d4a52bccd756ea2e992c291dac233e65beeb0c905fd  guix-build-806b75b21340/output/x86_64-w64-mingw32/bitcoin-806b75b21340-win64-setup-unsigned.exe
  192ea38d70e12c23327ff811ea930b50ac31c9fb2bc8dcc9391ad585112322ff  guix-build-806b75b21340/output/x86_64-w64-mingw32/bitcoin-806b75b21340-win64-unsigned.tar.gz
  474f88a1f4cc8900a7d8967909336d4122e449ce98cacaf2cacec340780ede0b  guix-build-806b75b21340/output/x86_64-w64-mingw32/bitcoin-806b75b21340-win64.zip
  ```

ACKs for top commit:
  TheCharlatan:
    Nice cleanups, ACK 806b75b213

Tree-SHA512: cede797c3b9b88cc1588d0ff7ff9b2908316a8ba384d9087b16466aceeb2e0c194aa56e3023f6b6ce7ca8896a1b87ef56b966db198cc1712cb6ddc37fe684567
2023-08-24 09:19:57 +01:00
Sebastian Falbesoner
360ac64b90 test: previous releases: speed up fetching sources with shallow clone
For the sake of building previous releases, fetching the whole history
of the repository for each version seems to be overkill as it takes much
more time, bandwidth and disk space than necessary. Create a shallow
clone instead with history truncated to the one commit of the version
tag, which is directly checked out in the same command. This has the
nice side-effect that we can remove the extra `git checkout` step after
as it's not needed anymore.

Note that it might look confusing to pass a _tag_ to a parameter named
`--branch`, but the git-clone manpage explicitly states that this is
supported.
2023-08-24 02:37:36 +02:00
Pieter Wuille
8a3b6f3387 refactor: make Transport::ReceivedBytes just return success/fail 2023-08-23 20:13:49 -04:00
Pieter Wuille
bb4aab90fd net: move message conversion to wire bytes from PushMessage to SocketSendData
This furthers transport abstraction by removing the assumption that a message
can always immediately be converted to wire bytes. This assumption does not hold
for the v2 transport proposed by BIP324, as no messages can be sent before the
handshake completes.

This is done by only keeping (complete) CSerializedNetMsg objects in vSendMsg,
rather than the resulting bytes (for header and payload) that need to be sent.
In SocketSendData, these objects are handed to the transport as permitted by it,
and sending out the bytes the transport tells us to send. This also removes the
nSendOffset member variable in CNode, as keeping track of how much has been sent
is now a responsability of the transport.

This is not a pure refactor, and has the following effects even for the current
v1 transport:

* Checksum calculation now happens in SocketSendData rather than PushMessage.
  For non-optimistic-send messages, that means this computation now happens in
  the network thread rather than the message handler thread (generally a good
  thing, as the message handler thread is more of a computational bottleneck).
* Checksum calculation now happens while holding the cs_vSend lock. This is
  technically unnecessary for the v1 transport, as messages are encoded
  independent from one another, but is untenable for the v2 transport anyway.
* Statistics updates about per-message sent bytes now happen when those bytes
  are actually handed to the OS, rather than at PushMessage time.
2023-08-23 20:13:49 -04:00
Pieter Wuille
a1a1060fd6 net: measure send buffer fullness based on memory usage
This more accurately captures the intent of limiting send buffer size, as
many small messages can have a larger overhead that is not counted with the
current approach.

It also means removing the dependency on the header size (which will become
a function of the transport choice) from the send buffer calculations.
2023-08-23 20:13:49 -04:00
Pieter Wuille
009ff8d650 fuzz: add bidirectional fragmented transport test
This adds a simulation test, with two V1Transport objects, which send messages
to each other, with sending and receiving fragmented into multiple pieces that
may be interleaved. It primarily verifies that the sending and receiving side
are compatible with each other, plus a few sanity checks.
2023-08-23 20:13:45 -04:00
Pieter Wuille
fb2c5edb79 net: make V1Transport implicitly use current chainparams
The rest of net.cpp already uses Params() to determine chainparams in many
places (and even V1Transport itself does so in some places).

Since the only chainparams dependency is through the message start characters,
just store those directly in the transport.
2023-08-23 19:56:24 -04:00
Pieter Wuille
0de48fe858 net: abstract sending side of transport serialization further
This makes the sending side of P2P transports mirror the receiver side: caller provides
message (consisting of type and payload) to be sent, and then asks what bytes must be
sent. Once the message has been fully sent, a new message can be provided.

This removes the assumption that P2P serialization of messages follows a strict structure
of header (a function of type and payload), followed by (unmodified) payload, and instead
lets transports decide the structure themselves.

It also removes the assumption that a message must always be sent at once, or that no
bytes are even sent on the wire when there is no message. This opens the door for
supporting traffic shaping mechanisms in the future.
2023-08-23 19:56:24 -04:00
Pieter Wuille
649a83c7f7 refactor: rename Transport class receive functions
Now that the Transport class deals with both the sending and receiving side
of things, make the receive side have function names that clearly indicate
they're about receiving.

* Transport::Read() -> Transport::ReceivedBytes()
* Transport::Complete() -> Transport::ReceivedMessageComplete()
* Transport::GetMessage() -> Transport::GetReceivedMessage()
* Transport::SetVersion() -> Transport::SetReceiveVersion()

Further, also update the comments on these functions to (among others) remove
the "deserialization" terminology. That term is better reserved for just the
serialization/deserialization between objects and bytes (see serialize.h), and
not the conversion from/to wire bytes as performed by the Transport.
2023-08-23 19:56:24 -04:00
Pieter Wuille
27f9ba23ef net: add V1Transport lock protecting receive state
Rather than relying on the caller to prevent concurrent calls to the
various receive-side functions of Transport, introduce a private m_cs_recv
inside the implementation to protect the lock state.

Of course, this does not remove the need for callers to synchronize calls
entirely, as it is a stateful object, and e.g. the order in which Receive(),
Complete(), and GetMessage() are called matters. It seems impossible to use
a Transport object in a meaningful way in a multi-threaded way without some
form of external synchronization, but it still feels safer to make the
transport object itself responsible for protecting its internal state.
2023-08-23 19:56:24 -04:00
Pieter Wuille
93594e42c3 refactor: merge transport serializer and deserializer into Transport class
This allows state that is shared between both directions to be encapsulated
into a single object. Specifically the v2 transport protocol introduced by
BIP324 has sending state (the encryption keys) that depends on received
messages (the DH key exchange). Having a single object for both means it can
hide logic from callers related to that key exchange and other interactions.
2023-08-23 19:56:24 -04:00
Andrew Chow
23f3f402fc
Merge bitcoin/bitcoin#27829: rpc: fix data optionality for RPC calls.
27b168b81f Update help text for spend and rawtransaction rpcs (Michael Tidwell)

Pull request description:

  The "data" field without outputs was marked as "required" in the help docs when using bitcoin-cli. This field when left off worked as an intended optional OP_RETURN. closes #27828.

  Motivation: It is hard to understand that "data" is actually optional for commands like `createpsbt` and `walletcreatefundedpsbt`.

ACKs for top commit:
  achow101:
    ACK 27b168b81f
  Sjors:
    tACK 27b168b81f

Tree-SHA512: 235e7ed4af69880880c04015b3f7de72c8f31ae035485c4c64c483e282948f3ea3f1eef16f15e260a1aaf21114150713516ba6a99967ccad9ecd91ff67cb0450
2023-08-23 16:37:28 -04:00
MarcoFalke
fab7f5c01d
ci: Add missing docker.io prefix to CI_IMAGE_NAME_TAG 2023-08-23 22:33:02 +02:00