Commit Graph

37986 Commits

Author SHA1 Message Date
Cory Fields
bea9fc2600 wallet: sqlite: force sqlite3.h to be included by the cpp files
This way sqlite usage is explicit.
2023-07-06 19:53:44 +00:00
fanquake
c325f0fbae
Merge bitcoin/bitcoin#28034: ci: Print full lscpu output
fa956d2048 ci: Print full lscpu output (MarcoFalke)

Pull request description:

  Seems odd to withhold the other output, given that it may be useful to debug issues?

ACKs for top commit:
  fanquake:
    ACK fa956d2048

Tree-SHA512: d93a79734a594c2ee180107e3ed1d1c07c1b6324b4b1e239d3f263e72490ca641f60a4e80793229523e2d52059958a896cb210014e3aa747a19871be62f5a961
2023-07-06 13:21:18 +01:00
glozow
ecf3baffc0
Merge bitcoin/bitcoin#27869: wallet: Give deprecation warning when loading a legacy wallet
8fbb6e99bf wallet: Give deprecation warning when loading a legacy wallet (Andrew Chow)

Pull request description:

  Next step in legacy wallet deprecation.

ACKs for top commit:
  S3RK:
    reACK 8fbb6e99bf
  jonatack:
    re-ACK 8fbb6e99bf

Tree-SHA512: 902984b09452926cf199f06e5fb56e4985325cdd5e0dcc829992158488f42d5fbc33e9a30a29303feac24c8315193e8d31712022e2a0503abd6b67169a0027f4
2023-07-06 10:47:41 +01:00
MarcoFalke
fa956d2048
ci: Print full lscpu output 2023-07-06 11:13:05 +02:00
fanquake
bc4f6b13fe
Merge bitcoin/bitcoin#28024: ci: Remove deprecated container.greedy
fac14c4e49 ci: Remove deprecated container.greedy (MarcoFalke)

Pull request description:

  The option is to be phased out, so remove it to avoid relying on it. Update container.cpu where needed.

ACKs for top commit:
  hebasto:
    ACK fac14c4e49.

Tree-SHA512: 0440b710e607aaa2f78f811f9d5ae786a59af4a44861d7905a25c742ff7f5b4558518b939539455309503266757182a1c8fce92c8d3430983b2103a613fe01d7
2023-07-04 17:43:48 +01:00
Hennadii Stepanov
c71a96c431
Merge bitcoin-core/gui#696: Switch RPCConsole wallet selection to the one most recently opened/restored/created
99c0eb9701 Fix RPCConsole wallet selection (John Moffett)

Pull request description:

  If a user opens multiple wallets in the GUI from the menu bar, the last one opened is the active one in the main window. However, For the RPC Console window, the  _first_ one opened is active. This can be confusing, as wallet RPC commands may be sent to a wallet the user didn't intend.

  This PR makes the RPC Console switch to the wallet just opened / restored / created from the menu bar, which is how the main GUI now works.

  Similar to https://github.com/bitcoin-core/gui/pull/665 and specifically requested [in a comment](https://github.com/bitcoin-core/gui/pull/665#issuecomment-1270003660).

ACKs for top commit:
  luke-jr:
    utACK 99c0eb9701
  hebasto:
    ACK 99c0eb9701, tested on Ubuntu 23.04.

Tree-SHA512: d5e5acdaa114130ad4d27fd3f25393bc8d02d92b5001cd39352601d04283cdad3bd62c4da6d369c69764e3b188e9cd3e83152c00b09bd42966082ad09037c328
2023-07-04 16:45:54 +01:00
Hennadii Stepanov
7446cb186c
Merge bitcoin-core/gui#719: Remove confusing "Dust" label from coincontrol / sendcoins dialog
a582b4141f gui: send, left alignment for "bytes" and "change" label (furszy)
210ef1e980 qt: remove confusing "Dust" label from coincontrol / sendcoins dialog (Sebastian Falbesoner)

Pull request description:

  In contrast to to all other labels on the coin selection dialog, the displayed dust information has nothing to do with the selected coins. All that this label shows is whether at least one of the _outputs_ qualify as dust, but the outputs are set in a different dialog. (Even worse, the dust check is currently simply wrong because it only looks at an output's nValue and just assumes a P2PKH script size.)

  As the label clearly doesn't help the user and is, quite the contrary, rather increasing confusion/misguidance, it seems sensible to remove it. The label from the sendcoins dialog is also removed with the same rationale. Additionally, the "bytes" and "change" labels are aligned to the left (second commit).

  Closes https://github.com/bitcoin-core/gui/issues/699.

ACKs for top commit:
  furszy:
    ACK a582b41
  hebasto:
    Looks good. ACK a582b4141f.

Tree-SHA512: ebc00b68bdeab69f6ab643e4b89301a7e3d04a8a4027b50813314ddddb1387bc97a83313851e375dfbce97751c234686c82af7f4e55fa5ef29f4fed4e8fc11d9
2023-07-04 16:03:30 +01:00
MarcoFalke
fac14c4e49
ci: Remove deprecated container.greedy
The option is to be phased out, so remove it to avoid relying on it.
Update container.cpu and timeouts where needed.
2023-07-04 10:41:25 +02:00
Andrew Chow
f08d914a67
Merge bitcoin/bitcoin#27920: wallet: bugfix, always use apostrophe for spkm descriptor ID
5df988b534 test: add coverage for descriptor ID (furszy)
6a9510d2da wallet: bugfix, always use apostrophe for spkm descriptor ID (furszy)
97a965d98f refactor: extract descriptor ID calculation from spkm GetID() (furszy)
1d207e3931 wallet: do not allow loading descriptor with an invalid ID (furszy)

Pull request description:

  Aiming to fix #27915.

  As we re-write the descriptor's db record every time that
  the wallet is loaded (at `TopUp` time), if the spkm ID differs
  from the one in db, the wallet will enter in an unrecoverable
  corruption state (due to the storage of a descriptor with an ID
  that is not linked to any other descriptor record in DB), and
  no soft version will be able to open it anymore.

  Because we cannot change the past, to stay compatible between
  releases, we need to always use the apostrophe version for the
  spkm IDs.

ACKs for top commit:
  achow101:
    ACK 5df988b534
  Sjors:
    tACK 5df988b534

Tree-SHA512: f63fc4aac7d21a4e515657471758d28857575e751865bfa359298f8b89b2568970029ca487a873c1786a5716325f453f06cd417ed193f3366417f6e8c2987332
2023-07-03 21:42:01 -04:00
furszy
a582b4141f gui: send, left alignment for "bytes" and "change" label 2023-07-03 18:40:56 +02:00
John Moffett
99c0eb9701 Fix RPCConsole wallet selection
If a user opens multiple wallets in the GUI from the
menu bar, the last one opened is the active one in
the main window. However, For the RPC Console window,
the  _first_ one opened is active. This can be
confusing, as wallet RPC commands may be sent to a
wallet the user didn't intend.

This commit makes the RPC Console switch to the wallet
opened from the menu bar.
2023-07-03 12:07:30 -04:00
Sebastian Falbesoner
210ef1e980 qt: remove confusing "Dust" label from coincontrol / sendcoins dialog
In contrast to to all other labels on the coin selection dialog, the
displayed dust information has nothing to do with the selected coins.
All that this label shows is whether at least one of the _outputs_
qualify as dust, but the outputs are set in a different dialog.
(Even worse, the dust check is currently simply wrong because it only
looks at an output's nValue and just assumes a P2PKH script size.)

As the label clearly doesn't help the user and is, quite the contrary,
rather increasing confusion/misguidance, it seems sensible to remove it.

Also, remove the label from the sendcoins dialog with the same rationale.
2023-07-03 18:06:48 +02:00
fanquake
600c595b8d
Merge bitcoin/bitcoin#28021: docs: fixup honggfuzz fuzz patch
c1247c3746 docs: fixup honggfuzz patch (fanquake)

Pull request description:

  Closes #28019.

ACKs for top commit:
  brunoerg:
    ACK c1247c3746

Tree-SHA512: 3f2d146d3d0c24fd25458f6a41e2d20bf6024fc0ea9942ee6254a1b6d0e3c017c55fe79dfbf90652cad64a4d6f026f463b0011dfab065b3d9754ca7047018084
2023-07-03 11:44:55 +01:00
fanquake
c1247c3746
docs: fixup honggfuzz patch
Closes #28019.
2023-07-03 11:00:57 +01:00
fanquake
61d59fed74
Merge bitcoin/bitcoin#24005: test: add python implementation of Elligator swift
4f4d039a98 test: add ellswift test vectors from BIP324 (stratospher)
a31287718a test: Add ellswift unit tests (stratospher)
714fb2c02a test: Add python ellswift implementation to test framework (stratospher)

Pull request description:

  Built on top of https://github.com/bitcoin/bitcoin/pull/26222.

  This PR introduces Elligator swift encoding and decoding in the functional test framework. It's used in #24748 for writing p2p encryption tests.

ACKs for top commit:
  sipa:
    ACK 4f4d039a98
  theStack:
    ACK 4f4d039a98 🐊

Tree-SHA512: 32bc8e88f715f2cd67dc04cd38db92680872072cb3775478e2c30da89aa2da2742992779ea14da2f1faca09228942cfbd86d6957402b24bf560244b389e03540
2023-06-30 19:30:49 +01:00
Andrew Chow
6744d840df
Merge bitcoin/bitcoin#27745: addrman: select addresses by network follow-up
cd8ef5b3e6 test: ensure addrman test is finite (Amiti Uttarwar)
b9f1e86f12 addrman: change asserts to Assumes (Amiti Uttarwar)
768770771f doc: update `Select` function description (Amiti Uttarwar)
2b6bd12eea refactor: de-duplicate lookups (Amiti Uttarwar)

Pull request description:

  this PR addresses outstanding review comments from #27214

ACKs for top commit:
  achow101:
    ACK cd8ef5b3e6
  mzumsande:
    Code Review ACK cd8ef5b3e6
  brunoerg:
    crACK cd8ef5b3e6

Tree-SHA512: 669f67904263e3f51c39b175eabf5fa1b1e7b6841e889656afec33d0bd93fb446de9403f0a91b186ddeaf29498c8938484a0547b1188256c4e7c90db6f30bb55
2023-06-30 13:29:04 -04:00
fanquake
a8bd0fef25
Merge bitcoin/bitcoin#27999: contrib: add macOS test for fixup_chains usage
7f96638723 contrib: add macOS fixup_chains check to security-check (fanquake)
3dca683cb7 build: support -no_fixup_chains in ld64 (fanquake)

Pull request description:

  Followup to #27676, adding the check for chained fixups.

  Somewhat annoyingly, we have to patch support for `-no_fixup_chains` into ld64. As it doesn't seem to have been added [until a later version](59a99ab603/src/ld/Options.cpp (L4172)).

  Guix Build:
  ```bash
  0e17d462808f86aa7157e27a957da88fd1adeb491ad6c01138aca93e5ad1d018  guix-build-7f96638723a0/output/arm64-apple-darwin/SHA256SUMS.part
  ceb208e6374f5d7367b73128e90ca6eaeea15d50c69e49c8cf75b47212525ad7  guix-build-7f96638723a0/output/arm64-apple-darwin/bitcoin-7f96638723a0-arm64-apple-darwin-unsigned.dmg
  e31663554cfde8a37a9f3438c9c895dde94b90ff87e28f12f78be71ef6421d93  guix-build-7f96638723a0/output/arm64-apple-darwin/bitcoin-7f96638723a0-arm64-apple-darwin-unsigned.tar.gz
  68a7bbc42418641eab391a85725b5c2f3c46d38a7acc07e7a8cef98909be07ec  guix-build-7f96638723a0/output/arm64-apple-darwin/bitcoin-7f96638723a0-arm64-apple-darwin.tar.gz
  38d966ad93e7384f4f1ce16faded003a675ecce7be1987e6c4eee8e4b82c0432  guix-build-7f96638723a0/output/dist-archive/bitcoin-7f96638723a0.tar.gz
  9d314f595d897a715a321a9fba0d552220fbd4bf69aff84eb8c0001cdb48234f  guix-build-7f96638723a0/output/x86_64-apple-darwin/SHA256SUMS.part
  c218ebfd0e96348c4912e6d522492b621bb043ef45b75105ff1fde979d1004d0  guix-build-7f96638723a0/output/x86_64-apple-darwin/bitcoin-7f96638723a0-x86_64-apple-darwin-unsigned.dmg
  1c5ff7fa82f5c76d7d8b9582ad5202f4a82a917102ecafdc3c1fb7b783f6bc3e  guix-build-7f96638723a0/output/x86_64-apple-darwin/bitcoin-7f96638723a0-x86_64-apple-darwin-unsigned.tar.gz
  15fb01e5afcc842db6a3e793b42c70c05ce07bec79e0d2d605e241901ff9f639  guix-build-7f96638723a0/output/x86_64-apple-darwin/bitcoin-7f96638723a0-x86_64-apple-darwin.tar.gz
  ```

ACKs for top commit:
  theuni:
    utACK 7f96638723.
  hebasto:
    ACK 7f96638723, I have reviewed the code and the patch, and they look OK.
  TheCharlatan:
    ACK 7f96638723

Tree-SHA512: 7f94710460f54b2afe3c9f5d57107b71436c59b799b15f78e5e3011c3c4f6b23a3acc1008eccea9c22226a200774c82900bad6c6236ab6c5c48a17dec3f2d5a2
2023-06-30 16:35:09 +01:00
fanquake
3367e1c850
Merge bitcoin/bitcoin#28009: script, test: python typing and linter updates
6c97757a48 script: appease spelling linter (Jon Atack)
1316119ce7 script: update ignored-words.txt (Jon Atack)
146c861da2 script: update linter dependencies (Jon Atack)
92408224a4 test: fix PEP484 no implicit optional argument types errors (Jon Atack)
f86a301433 script, test: add missing python type annotations (Jon Atack)

Pull request description:

  With these updates, `./test/lint/lint-python.py` and `./test/lint/lint-spelling.py` should be green again for developers using relatively recent Python dependencies, in particular mypy 0.991 (released 11/2022) and later. Please see the commit messages for details.

ACKs for top commit:
  fanquake:
    ACK 6c97757a48

Tree-SHA512: 8a46a4d36d5978affdcecf4f2ace20ca1b52d483e098304911a2169afe60ccb9b042fa90c04b762d94f3ce53d2cafe6f24476ae839867a770c7f31e7e7242d99
2023-06-30 16:20:37 +01:00
fanquake
f8a71f3fc0
Merge bitcoin/bitcoin#28014: ci: re-enable gui tests for s390x
9be4565c2d ci: re-enable gui tests for s390x (fanquake)

Pull request description:

  These work for me now. If they still don't work in other setups, maybe we can better document the issues.

  ```bash
  time FILE_ENV="./ci/test/00_setup_env_s390x.sh" ./ci/test_run_all.sh
  ...
  Running tests: coins_tests from test/coins_tests.cpp
  PASS: qt/test/test_bitcoin-qt
  Running tests: coinstatsindex_tests from test/coinstatsindex_tests.cpp
  ...
  Stop and remove CI container by ID
  + docker container kill 617bef8accb87530e5fbb03ff07b3b9f0aa9e3030d4da424c9612d153ab98dbf
  617bef8accb87530e5fbb03ff07b3b9f0aa9e3030d4da424c9612d153ab98dbf

  real51m37.809s
  ```

ACKs for top commit:
  MarcoFalke:
    lgtm ACK 9be4565c2d , didn't test
  hebasto:
    ACK 9be4565c2d, tested on Ubuntu 23.04.

Tree-SHA512: 2ab708013fab7f9bf06cfc106cdffd3b7733cc7b2fe5b2122e915895735452c9b4a70ccc5a8435b28655369d54820fcf62ecb89791d5ee2e349724857e944796
2023-06-30 15:09:40 +01:00
fanquake
76240ce55d
Merge bitcoin/bitcoin#28011: test: Rename EncodeDecimal to serialization_fallback
fabd34873c test: Rename EncodeDecimal to serialization_fallback (MarcoFalke)

Pull request description:

  The new name better explains that the function handles fallbacks, without listing all in the function name.

ACKs for top commit:
  theStack:
    ACK fabd34873c

Tree-SHA512: a0405aab2bfb2fd10c61b51b4eb767053b25b0d914d2dac006dd3eaf360fbc6f3a444bc7b580ab8469ec492fe4358cfad5943adde4a7c8f783032ceef5cc5383
2023-06-30 12:12:40 +01:00
fanquake
ca8bfbd980
Merge bitcoin/bitcoin#28013: doc: Fix verify-binaries link in contrib README
ab8f673357 doc: Fix verify-binaries link in contrib README (TheCharlatan)

Pull request description:

ACKs for top commit:
  Zero-1729:
    crACK ab8f673357
  theStack:
    ACK ab8f673357

Tree-SHA512: 901d99b897d0b4b1af612e5650e84530252d96b5b49bc4f87c512af993abe32e6494e7248bb7ce3eb7c5ff7377a949980f143007446e3720450146367e346519
2023-06-30 11:57:08 +01:00
fanquake
9be4565c2d
ci: re-enable gui tests for s390x
These work for me now. If they still don't work in other setups,
maybe we can better document the issues.

```bash
time FILE_ENV="./ci/test/00_setup_env_s390x.sh" ./ci/test_run_all.sh
...
Running tests: coins_tests from test/coins_tests.cpp
PASS: qt/test/test_bitcoin-qt
Running tests: coinstatsindex_tests from test/coinstatsindex_tests.cpp
...
Stop and remove CI container by ID
+ docker container kill 617bef8accb87530e5fbb03ff07b3b9f0aa9e3030d4da424c9612d153ab98dbf
617bef8accb87530e5fbb03ff07b3b9f0aa9e3030d4da424c9612d153ab98dbf

real	51m37.809s
```
2023-06-30 11:15:57 +01:00
TheCharlatan
ab8f673357
doc: Fix verify-binaries link in contrib README 2023-06-30 12:12:24 +02:00
fanquake
2cd71d3a13
Merge bitcoin/bitcoin#27937: doc: i2p documentation updates
11900e5a8a doc: simplify the router options in doc/i2p.md (Jon Atack)
b505d59326 doc: clarify when and how to launch the SAM bridge in doc/i2p.md (Jon Atack)

Pull request description:

  1. Clarify when and how to launch the SAM application bridge to address user questions and https://github.com/bitcoin/bitcoin/issues/22759#issuecomment-1599449753. The bridge is not enabled by default in the Java I2P Router, and the relevant info is somewhat difficult to find in its documentation.

  2. Remove a duplicate sentence and link (the preceding paragraph begins with the same sentence and link).

  3. Simplify the router options:

      - the Java I2P router and i2pd are the two routers have been heavily tested with Bitcoin Core and are what node operators and node software packages are using

      - [i2p-zero](https://github.com/i2p-zero/i2p-zero) hasn't been updated since July 2021 and its last release was in December 2020

      - the other routers in the wikipedia page are niche and I haven't heard anyone report using them

ACKs for top commit:
  fanquake:
    ACK 11900e5a8a

Tree-SHA512: add5f40004feddc7829d658a5de30422f144ab8fa09ff1396d5d263ee86e39803595a2c50e2aa601d0df6da5eff4358c3f7f17e039dcd4952cb306596c6c0397
2023-06-30 10:08:31 +01:00
fanquake
47ab00666e
Merge bitcoin/bitcoin#27988: test: Use same timeout for all index sync
fa086248e5 test: Use same timeout for all index sync (MarcoFalke)

Pull request description:

  Seems odd to use different timeouts.

  Fix this by using the same timeout for all syncs.

  May also fix https://github.com/bitcoin/bitcoin/issues/27355 or at least make it less frequent?

ACKs for top commit:
  mzumsande:
    code review ACK fa086248e5

Tree-SHA512: a61619247c97f3a88dd19eb3f200adedd120e6da8c4e4f2cf83621545b8c289dbad77e16f13cf7973a090f7b2c3391cb0297f09b0cc95fe4f55de21ae247670f
2023-06-30 10:06:58 +01:00
fanquake
b5ebeb376d
Merge bitcoin/bitcoin#28002: refactor: remove in-code warning suppression
3210f224db refactor: remove in-code warning suppression (fanquake)

Pull request description:

  Should no-longer be needed post #27872. If it is, then suppress-external-warnings should be fixed.

ACKs for top commit:
  hebasto:
    ACK 3210f224db

Tree-SHA512: 2405250b7308779d576f13ce9144944abd5b2293499a0c0fe940398dae951cb871246a55c0e644a038ee238f9510b5845c3e39f9658d9f10225a076d8122f078
2023-06-30 09:45:42 +01:00
Andrew Chow
54ba330f79
Merge bitcoin/bitcoin#27863: net: do not break when addr is not from a distinct network group
5fa4055452 net: do not `break` when `addr` is not from a distinct network group (brunoerg)

Pull request description:

  When the address is from a network group we already caught,
  do a `continue` and try to find another address until conditions
  are met or we reach the limit (`nTries`).

ACKs for top commit:
  amitiuttarwar:
    utACK 5fa4055452
  achow101:
    ACK 5fa4055452
  mzumsande:
    utACK 5fa4055452

Tree-SHA512: 225bb6df450b46960db934983c583e862d1a17bacfc46d3657a0eb25a0204e106e8cd18de36764e210e0a92489ab4b5773437e4a641c9b455bde74ff8a041787
2023-06-29 19:42:47 -04:00
Jon Atack
6c97757a48 script: appease spelling linter 2023-06-29 16:14:07 -06:00
Jon Atack
1316119ce7 script: update ignored-words.txt 2023-06-29 16:14:07 -06:00
Jon Atack
146c861da2 script: update linter dependencies 2023-06-29 16:14:07 -06:00
Jon Atack
92408224a4 test: fix PEP484 no implicit optional argument types errors
Fix warnings for these files when ./test/lint/lint-python.py is run using
mypy 0.991 (released 11/2022) and later:

$ test/lint/lint-python.py
test/functional/test_framework/coverage.py:23: error: Incompatible default for argument "coverage_logfile" (default has type "None", argument has type "str")  [assignment]
test/functional/test_framework/coverage.py:23: note: PEP 484 prohibits implicit Optional. Accordingly, mypy has changed its default to no_implicit_optional=True
test/functional/test_framework/util.py:318: error: Incompatible default for argument "timeout" (default has type "None", argument has type "int")  [assignment]
test/functional/test_framework/util.py:318: note: PEP 484 prohibits implicit Optional. Accordingly, mypy has changed its default to no_implicit_optional=True
test/functional/test_framework/util.py:318: error: Incompatible default for argument "coveragedir" (default has type "None", argument has type "str")  [assignment]
test/functional/interface_rest.py:67: error: Incompatible default for argument "query_params" (default has type "None", argument has type "dict[str, Any]")  [assignment]
test/functional/interface_rest.py:67: note: PEP 484 prohibits implicit Optional. Accordingly, mypy has changed its default to no_implicit_optional=True

Verified using https://github.com/hauntsaninja/no_implicit_optional

For details, see:

https://mypy-lang.blogspot.com/2022/11/mypy-0990-released.html
2023-06-29 16:14:07 -06:00
Jon Atack
f86a301433 script, test: add missing python type annotations
Fix warnings for these files when ./test/lint/lint-python.py is run using
mypy 0.991 (released 11/2022) and later:

"By default the bodies of untyped functions are not checked, consider using
--check-untyped-defs [annotation-unchecked]"

For details, see:

https://mypy-lang.blogspot.com/2022/11/mypy-0990-released.html
2023-06-29 16:13:51 -06:00
Andrew Chow
561915f35f
Merge bitcoin/bitcoin#27978: refactor: Drop unsafe AsBytePtr function
7c853619ee refactor: Drop unsafe AsBytePtr function (Ryan Ofsky)

Pull request description:

  Replace calls to `AsBytePtr` with calls to `AsBytes` or `reinterpret_cast`. `AsBytePtr` is just a wrapper around `reinterpret_cast`. It accepts any type of pointer as an argument and uses `reinterpret_cast` to cast the argument to a `std::byte` pointer.

  Despite taking any type of pointer as an argument, it is not useful to call `AsBytePtr` on most types of pointers, because byte representations of most types will be platform specific or undefined. Also, because it is named similarly to the `AsBytes` function, `AsBytePtr` looks safer than it actually is. Both `AsBytes` and `AsBytePtr` call reinterpret_cast internally and may be unsafe to use with certain types, but AsBytes at least has some type checking and can only be called on `Span` objects, while `AsBytePtr` can be called on any pointer argument.

  The change was motivated by discussion on #27973 and #27927 and is compatible with those PRs

ACKs for top commit:
  jonatack:
    re-ACK 7c853619ee
  sipa:
    utACK 7c853619ee
  achow101:
    ACK 7c853619ee

Tree-SHA512: 200d858b1d4d579f081a7f9a14d488a99713b4918b4564ac3dd5c18578d927dbd6426e62e02f49f04a3fa73ca02ff7109c495cb0b92bec43c27d9b74e2f95757
2023-06-29 17:29:40 -04:00
stratospher
4f4d039a98 test: add ellswift test vectors from BIP324
The test vector input file is taken from:
1. https://github.com/bitcoin/bips/blob/master/bip-0324/xswiftec_inv_test_vectors.csv
2. https://github.com/bitcoin/bips/blob/master/bip-0324/ellswift_decode_test_vectors.csv

Co-authored-by: theStack <sebastian.falbesoner@gmail.com>
2023-06-29 23:32:56 +05:30
stratospher
a31287718a test: Add ellswift unit tests
remove util also since unit tests there were removed in #27538

Co-authored-by: theStack <sebastian.falbesoner@gmail.com>
2023-06-29 23:32:56 +05:30
stratospher
714fb2c02a test: Add python ellswift implementation to test framework
Co-authored-by: Pieter Wuille <pieter.wuille@gmail.com>
2023-06-29 23:32:54 +05:30
MarcoFalke
fabd34873c
test: Rename EncodeDecimal to serialization_fallback
The new name better explains that the function handles fallbacks,
without listing all in the function name.
2023-06-29 19:51:43 +02:00
fanquake
3210f224db
refactor: remove in-code warning suppression
Should no-longer be needed post #27872. If it is, then
suppress-external-warnings should be fixed.
2023-06-29 14:41:33 +01:00
fanquake
c6287faae4
Merge bitcoin/bitcoin#27996: ci: filter all subtrees from tidy output
62633b5046 ci: filter all subtrees from tidy output (fanquake)

Pull request description:

  We are currently dumping output for some. i.e:
  ```bash
  diff --git a/src/minisketch/src/fields/clmul_1byte.cpp b/src/minisketch/src/fields/clmul_1byte.cpp
  index 8826af9..7fd6f2a 100644
  --- a/src/minisketch/src/fields/clmul_1byte.cpp
  +++ b/src/minisketch/src/fields/clmul_1byte.cpp
  @@ -4,21 +4,16 @@
    * file LICENSE or http://www.opensource.org/licenses/mit-license.php.*
    **********************************************************************/

  -/* This file was substantially auto-generated by doc/gen_params.sage. */
  -#include "../fielddefines.h"
  -
  +class Sketch;
   #if defined(ENABLE_FIELD_BYTES_INT_1)
  ```

ACKs for top commit:
  hebasto:
    re-ACK 62633b5046

Tree-SHA512: fd0a17af6b37fc7641547dab329c2d14ec784941c4d100db1e80d232aff39e45ad9c588982810a2cfc54b4fe820bfe0d50638b53209fec6774fd556b9b0ae180
2023-06-29 13:35:47 +01:00
fanquake
3d51f7c9a8
Merge bitcoin/bitcoin#27932: test: Fuzz on macOS
fae7c50d20 test: Run fuzz tests on macOS (MarcoFalke)

Pull request description:

  Any reason not to?

ACKs for top commit:
  jamesob:
    Github ACK fae7c50d20
  dergoegge:
    utACK fae7c50d20

Tree-SHA512: e45122d73fafb17cea312258314b826cb0745e08daadd28465f687ec02d4c127d2f8cbe20179a9fff5712038850c02c968abb4838fa088b7555e28709317d3a3
2023-06-29 13:08:58 +01:00
fanquake
7f96638723
contrib: add macOS fixup_chains check to security-check
Followup to #27676.
2023-06-29 12:08:08 +01:00
fanquake
62633b5046
ci: filter all subtrees from tidy output
We are currently dumping output for some. i.e:
```bash
diff --git a/src/minisketch/src/fields/clmul_1byte.cpp b/src/minisketch/src/fields/clmul_1byte.cpp
index 8826af9..7fd6f2a 100644
--- a/src/minisketch/src/fields/clmul_1byte.cpp
+++ b/src/minisketch/src/fields/clmul_1byte.cpp
@@ -4,21 +4,16 @@
  * file LICENSE or http://www.opensource.org/licenses/mit-license.php.*
  **********************************************************************/

-/* This file was substantially auto-generated by doc/gen_params.sage. */
-#include "../fielddefines.h"
-
+class Sketch;
 #if defined(ENABLE_FIELD_BYTES_INT_1)
```
2023-06-29 11:59:31 +01:00
fanquake
3dca683cb7
build: support -no_fixup_chains in ld64
Patch in suport for using -no_fixup_chains, with ld64. This option just
seems to be missing from our version, as it exists in later releases.

This is needed so we can disable fixup_chains in our security checks.
2023-06-29 11:55:40 +01:00
fanquake
d4018f0b6c
Merge bitcoin/bitcoin#27811: guix: Clean up manifest
a51d7abf1e guix: Specify symbols in modules explicitly (Hennadii Stepanov)
47d51fb048 guix: Drop unneeded modules (Hennadii Stepanov)
57fdedd0e9 guix: Unify fetch methods (Hennadii Stepanov)

Pull request description:

  This PR cleans up the `contrib/guix/manifest.scm` in the following way:
  - Unneeded for a successful build modules have be dropped.
  - Some modules have been enhanced with `#:select` clauses, which improves maintainability (see the commit message for details).

ACKs for top commit:
  TheCharlatan:
    ACK a51d7abf1e

Tree-SHA512: 380a36d03ec303ff8700893cfaad75ca09d84a77fd08d6c6a1679ac96409014b36f0698eb071e09af25ad36f1bc62aec0eec1092146d879251c6a8cce586169b
2023-06-29 10:43:33 +01:00
fanquake
e0cd7458e6
Merge bitcoin/bitcoin#27530: Remove now-unnecessary poll, fcntl includes from net(base).cpp
8d9b90a61e Remove now-unnecessary poll, fcntl includes from net(base).cpp (Ben Woosley)

Pull request description:

  As far as I can tell, the code calling for these includes was removed in:
  6e68ccbefe #24356
  82d360b5a8 #21387

ACKs for top commit:
  fanquake:
    ACK 8d9b90a61e

Tree-SHA512: e536d60f4cf204a10a5b461eca20c8329aa6b0fd3b27651ac9490ed42d3e22e31d652cd991ddc84c96e4758df15aefa7e7f84c710f2feb6d2e0fcfbda9ad4356
2023-06-29 10:32:48 +01:00
fanquake
e8543629ae
Merge bitcoin/bitcoin#27884: test: Use TestNode datadir_path or chain_path where possible
aaaa3aefbd test: Use TestNode *_path properties where possible (MarcoFalke)
dddd89962b test: Allow pathlib.Path as RPC argument via authproxy (MarcoFalke)
fa41614a0a scripted-diff: Use wallets_path and chain_path where possible (MarcoFalke)
fa493fadfb test: Use wallet_dir lambda in wallet_multiwallet test where possible (MarcoFalke)

Pull request description:

  It seems inconsistent, fragile and verbose to:

  * Call `get_datadir_path` to recreate the path that already exists as field in TestNode
  * Call `os.path.join` with the hardcoded chain name or `self.chain` to recreate the TestNode `chain_path` property
  * Sometimes even use the hardcoded node dir name (`"node0"`)

  Fix all issues by using the TestNode properties.

ACKs for top commit:
  willcl-ark:
    re-ACK aaaa3aefbd
  theStack:
    Code-review ACK aaaa3aefbd 🌊

Tree-SHA512: e4720278085beb8164e1fe6c1aa18f601558a9263494ce69a83764c1487007de63ebb51d1b1151862dc4d5b49ded6162a5c1553cd30ea1c28627d447db4d8e72
2023-06-29 09:51:53 +01:00
Ben Woosley
8d9b90a61e
Remove now-unnecessary poll, fcntl includes from net(base).cpp
As far as I can tell, the code calling for these includes was removed in:
6e68ccbefe #24356
82d360b5a8 #21387
2023-06-28 16:35:45 -05:00
Andrew Chow
626d346469
Merge bitcoin/bitcoin#26222: Introduce secp256k1 module with field and group classes to test framework
d4fb58ae8a test: EC: optimize scalar multiplication of G by using lookup table (Sebastian Falbesoner)
1830dd8820 test: add secp256k1 module with FE (field element) and GE (group element) classes (Pieter Wuille)

Pull request description:

  This PR rewrites a portion of `test_framework/key.py`, in a compatible way, by introducing classes that encapsulate field element and group element logic, in an attempt to be more readable and reusable.

  To maximize readability, the group element logic does not use Jacobian coordinates. Instead, group elements just store (affine) X and Y coordinates directly. To compensate for the performance loss this causes, field elements are represented as fractions. This undoes most, but not all, of the performance loss, and there is a few % slowdown (as measured in `feature_taproot.py`, which heavily uses this).

  The upside is that the implementation for group laws (point doubling, addition, subtraction, ...) is very close to the mathematical description of elliptic curves, and this extends to potential future extensions (e.g. ElligatorSwift as needed by #27479).

ACKs for top commit:
  achow101:
    ACK d4fb58ae8a
  theStack:
    re-ACK d4fb58ae8a
  stratospher:
    tested ACK d4fb58a. really liked how this PR makes the secp256k1 code in the tests more intuitive and easier to follow!

Tree-SHA512: 9e0d65d7de0d4fb35ad19a1c19da7f41e5e1db33631df898c6d18ea227258a8ba80c893dab862b0fa9b0fb2efd0406ad4a72229ee26d7d8d733dee1d56947f18
2023-06-28 16:27:55 -04:00
Ryan Ofsky
7c853619ee refactor: Drop unsafe AsBytePtr function
Replace calls to AsBytePtr with direct calls to AsBytes or reinterpret_cast.
AsBytePtr is just a wrapper around reinterpret_cast. It accepts any type of
pointer as an argument and uses reinterpret_cast to cast the argument to a
std::byte pointer.

Despite taking any type of pointer as an argument, it is not useful to call
AsBytePtr on most types of pointers, because byte representations of most types
will be implmentation-specific. Also, because it is named similarly to the
AsBytes function, AsBytePtr looks safer than it actually is. Both AsBytes and
AsBytePtr call reinterpret_cast internally and may be unsafe to use with
certain types, but AsBytes at least has some type checking and can only be
called on Span objects, while AsBytePtr can be called on any pointer argument.

Co-authored-by: Pieter Wuille <pieter@wuille.net>
2023-06-28 15:14:45 -04:00
Andrew Chow
7952a5934a
Merge bitcoin/bitcoin#27927: util: Allow std::byte and char Span serialization
fa38d86235 Use only Span{} constructor for byte-like types where possible (MarcoFalke)
fa257bc831 util: Allow std::byte and char Span serialization (MarcoFalke)

Pull request description:

  Seems odd to require developers to cast all byte-like spans passed to serialization to `unsigned char`-spans. Fix that by passing and accepting byte-like spans as-is. Finally, add tests and update the code to use just `Span` where possible.

ACKs for top commit:
  sipa:
    utACK fa38d86235
  achow101:
    ACK fa38d86235
  ryanofsky:
    Code review ACK fa38d86235. This looks great. The second commit really removes a lot of boilerplate and shows why the first commit is useful.

Tree-SHA512: 788592d9ff515c3ebe73d48f9ecbb8d239f5b985af86f09974e508cafb0ca6d73a959350295246b4dfb496149bc56330a0b5d659fc434ba6723dbaba0b7a49e5
2023-06-28 15:12:12 -04:00