In #2521 I removed the link from `std::error::Error` with the claim that
it broke no-std builds. However there are a ton of other places where we
link to `std::` types.
I have no idea where the breakage was, I assume it existed and I was
sane at the time, CI on this patch will tell us.
Close: #2571
We have a mechanism to run additional custom tests by way of the
`extra_tests.sh` script in each crate.
Remove the CI job and run the schemars test using `extra_tests.sh`. This
patch changes the test coverage because currently the schemars test is
only run with a stable toolchain but with this patch applied it runs
with stable, MSRV, and nightly.
Fix: #2787
024d1fa53b Automated update to Github CI to rustc nightly-2024-06-12 (Update Nightly Rustc Bot)
Pull request description:
Automated update to Github CI workflow `rust.yml` by [create-pull-request](https://github.com/peter-evans/create-pull-request) GitHub action
ACKs for top commit:
tcharding:
ACK 024d1fa53b
Tree-SHA512: e075c3aca81ab3cddbac470f17d48acf39483e664341894203f042a01cec12534efd013c070c6985c864687ef8575f2df31d2eb8af33dea952bb6676f667640a
Currently we have a trait `Hash` that is required for `Hmac`, `Hkdf`,
and other use cases. However, it is unegonomic for users who just want
to do a simple hash to have to import the trait.
Add inherent functions to all hash types including those created with
the new wrapper type macros.
This patch introduces some duplicate code but we are trying to make
progress in the hashes API re-write. We can come back and de-dublicate
later.
Includes making `to_byte_array`,`from_byte_array`, `as_byte_array`, and
`all_zeros` const where easily possible.
8d256b4e79 Moved doctest to unit test (Jamil Lambert, PhD)
Pull request description:
Moved the doctest from the private module to a unit test to fix: #2840
ACKs for top commit:
apoelstra:
ACK 8d256b4e79
tcharding:
ACK 8d256b4e79
Tree-SHA512: 233961288579381cb5c51235331c78c9980046f0317a2062cb108a2e604adde322e2dd834e724d1fe05f54f92721fe6c9f5344dcf930f99aa3756a698ddf9732
fcf27a62a2 update api (Divyansh Gupta)
531aba0cf1 make `difficulty_float` general to all network (Divyansh Gupta)
Pull request description:
Fix#2783
ACKs for top commit:
tcharding:
ACK fcf27a62a2
apoelstra:
ACK fcf27a62a2
Tree-SHA512: aec9648b057677b89f4f397e1fa703ed6496436bd6e1e8052d5b7f52ef52c95b286babd425d97fe7d4f903cd0a3d68ae589d8fb255fc68f423714918cd485873
091d614aad bitcoin: Remove "std" feature from examples (Tobin C. Harding)
Pull request description:
The "rand-std" feature enables "std" but we use it in examples still. FTR I added this a while ago thinking the explicitness was clearer but in hindsight I think that was wrong and that it makes usage of our features _less_ clear.
No logic changes.
(Pulled out of #2756.)
ACKs for top commit:
storopoli:
ACK 091d614aad
apoelstra:
ACK 091d614aad
Tree-SHA512: d72eec37e3a434a1f850cb4257529fc18540cb5075bc7d3bd494cba59b08404c6c86223361a3c3a3de8d50a1168b656ff1123d28f7d2dcdf05c404caff716b1a
2db88a62fd Update bitcoinconsensus version (Jamil Lambert, PhD)
Pull request description:
Updated bitcoinconsensus version to 0.106.0+26.0 in bitcoin/Cargo.toml
The new version supports taproot and has a new parameter for `spent_outputs` in the `verify()` and `verify_with_flags()` functions.
The validation module was changed to keep the existing functionality by adding `None` as the `spent_outputs` and the flag `VERIFY_ALL_PRE_TAPROOT`.
This method does not add taproot features to the verify functions.
ACKs for top commit:
tcharding:
ACK 2db88a62fd
apoelstra:
ACK 2db88a62fd agreed, this is a good step forward
Tree-SHA512: b6cef395e065cfe859a7896ee2deb2f2d255051566751c10d06092064f6523338ca912aad81b789d6ca94e6f6164f2eef874ad6086c6ebe1384ce520d6eba366
8aa893ebd0 Remove repetition from sha256t_hash_newtype macro (Tobin C. Harding)
Pull request description:
The `sha256t_hash_newtype` macro is hard to reason about because we allow repetition so which tag goes with which type is slightly obscure.
Remove repetition and call the macro three times.
Internal change in `bitcoin`, API change in `hashes`.
Fix#2811
ACKs for top commit:
apoelstra:
ACK 8aa893ebd0 nice, small diff
Tree-SHA512: b38e7c307ac7288b4a5c1c3170ad6aa54c62bd3198922ec8bb091867b230bb9149f7dc996766fc8fa20a1af18b318c475b3e83e2689d322b7f4af0d5cb588e50
ce1db3ea26 hashes: Move non-trait functions (Tobin C. Harding)
Pull request description:
The `hash_trait_impls` macro currently adds an impl block for `Hash` - this is not what the docs say since and `impl Hash` block is nothing to do with traits.
Move the impl block and add a duplicate of the functions to the `sha256t::Hash` type.
This is a refactor, no API or logic changes. Note that wrapper types currently do net get these functions - that will be discussed/implemented separately.
ACKs for top commit:
apoelstra:
ACK ce1db3ea26 Ok, this one is easy :)
Tree-SHA512: c25bc2bcfdae8130bbcb9d212701504e15a8429630ae4ce924dcf1c54bb10e122aa67d1abed8bb338e4844de715816dc49ca4de7bf16033f293817c398717756
Updated bitcoinconsensus version to 0.106.0+26.0.
The new version supports taproot and has a new parameter for spent outputs in the `verify()` and `verify_with_flags()` functions.
The validation module was changed to keep the existing functionality by adding `None` as the `spent_outputs` and the flag `VERIFY_ALL_PRE_TAPROOT`.
ce585dc529 api: Run just check-api (Liu-Cheng Xu)
61565957ad Add API for extracting the inner payload of RawNetworkMessage (Liu-Cheng Xu)
Pull request description:
I'd like to take out the `payload` of `RawNetworkMessage` and then send it to the actual network message processor, but find there is no way to do it. This commit adds such an API to expose all the inner parts (UPD: so that I don't have to do an unnecessary clone to obtain the owned value of `payload`).
ACKs for top commit:
apoelstra:
ACK ce585dc529
tcharding:
ACK ce585dc529
Tree-SHA512: 89c5f1361a8c2d0ecf928325e9a37b26d39cf32c3a023b78742555a5a1e59e1579522e942ff6f48b07b2d3b81b48c5e8182fa6e88b57fc9c33ce13e313ba2982
The `sha256t_hash_newtype` macro is hard to reason about because we
allow repetition so which tag goes with which type is slightly obscure.
Remove repetition and call the macro three times.
Internal change in `bitcoin`, API change in `hashes`.
The "rand-std" feature enables "std" but we use it in examples still.
FTR I added this a while ago thinking the explicitness was clearer but
in hindsight I think that was wrong and that it makes usage of our
features _less_ clear.
No logic changes.
The `hash_trait_impls` macro currently adds an impl block for `Hash` -
this is not what the docs say since and `impl Hash` block is nothing
to do with traits.
Move the impl block and add a duplicate of the functions to the
`sha256t::Hash` type.
This is a refactor, no API or logic changes. Note that wrapper types
currently do net get these functions - that will be
discussed/implemented separately.
d89b7bd770 Automated update to Github CI to rustc nightly-2024-06-09 (Update Nightly Rustc Bot)
Pull request description:
Automated update to Github CI workflow `rust.yml` by [create-pull-request](https://github.com/peter-evans/create-pull-request) GitHub action
ACKs for top commit:
tcharding:
ACK d89b7bd770
Tree-SHA512: 96f2fd63c511683f23d345b6bfc655614003f59e99624653247d73b541dda5f62cf44fc4c4737e0a8aaf1cbfcc8d7374f0cdd23ab268944029f0cc2e39fa16fa
76826313a1 generate Network <-> Magic From and TryFrom with a macro (Antoni Spaanderman)
Pull request description:
Removes possible errors when a network is added to the enum (expressed with the comment `// Note: new network entries must explicitly be matched in 'try_from' below.`)
ACKs for top commit:
Kixunil:
ACK 76826313a1
apoelstra:
ACK 76826313a1
Tree-SHA512: 37aaf4b9021204c24e3dc405e666f3dea8c4f8e478b26892dd962a49c988904ba02c3dee7cec1ad78d4e4bb9ba9565ec4574d0e169dd215d26b010f1c4dd3d0b
0949be931a fix ServiceFlags::remove (Antoni Spaanderman)
Pull request description:
Contrary to the documentation and the method name, this function does an XOR operation, if there are no flags in `self`, flags from `other` are added.
What should happen to the core::ops::BitXor{,Assign} implementations? I did not touch them because it would break current API usage and would require a minor version bump (on 0.x.y versions).
ACKs for top commit:
Kixunil:
ACK 0949be931a
apoelstra:
ACK 0949be931a looks good. I think it is fine to retain a BitXor impl on a flag type, even if it is questionably useful
Tree-SHA512: d73853e5fe5e3776ef5cfb54c1ae2f9151c17c51861759b096eae339d4c9a544a9a32f5cc23e76f79827a40425a8a0823e2b989ed9ab98b8373d2b8d94418e8e
a09c3c5225 Check API: remove false positives on rustdoc (Jose Storopoli)
Pull request description:
Fixes the rustdocs build warnings.
This PR is composed by two commits:
- Updates `contrib/check-for-api-changes.sh` to ignore
`rustdoc::broken_intra_doc_links` due to the features being turned on and off
(see rationale below); and
- Adds a `just doc` quick check that will check for all missing rustdoc broken links
to counterbalance the allow flag above.
As jyap808 has pointed out in #2800,
we might not have a simple fix for these rustdoc build warnings inside the `just check-api`.
This can be mitigated by adding a simple allow flag to `RUSTDOCFLAGS` in `contrib/check-for-api-changes.sh`.
> Took a quick look at this. Not sure if there's anything obvious to fix.
>
> A few warnings mentioning [`ordered::ArbitraryOrd`] which is only enabled when the "--features ordered" flag is used. No warning when the flag is enabled. Generated docs look OK.
>
> jyap808 in #2800Closes#2800.
I don't know if this is the intended solution, or if we want to add more CI checks for the docs.
Note that these docs checks are already covered in `rust-bitcoin/rust-bitcoin-maintainer-tools`: 3494ceec52/ci/run_task.sh (L275-L278)
Any feedback will be appreciated.
ACKs for top commit:
apoelstra:
ACK a09c3c5225
tcharding:
ACK a09c3c5225
Tree-SHA512: d8a4a14a220d907a072fb283075c168e8264d01e73bf6b600f9c562337836ff6ea47cd0ab326bebd997522d5fdf32ae5a9b82c6951741595ec41c13ad49bc2ce
5e7a638b4d fix crypto rustdocs (Jamil Lambert, PhD)
bac30d3e6e fix rustdocs in bip152 (Jamil Lambert, PhD)
4a9f74b55c fix missing fullstops in bitcoin rustdoc (Jamil Lambert, PhD)
Pull request description:
Updated some of the rustdocs to make the style consistent. There is still more to do which I can work on if it is useful?
ACKs for top commit:
tcharding:
ACK 5e7a638b4d
apoelstra:
ACK 5e7a638b4d
Tree-SHA512: 3813900d4f15e95a290286a4d9efd8010625150a09dd4f601ab6279e3e0bd5cfa8b2f1628543d7279b4b26f1e7e85d10338d3401a7b6e9794684d02fa0e8fda1
55cbae9c2f fuzz: add more coverage for `deserialize_psbt` (Bruno Garcia)
Pull request description:
This PR adds more coverage for `deserialize_psbt` harness. It uses the `data` to create more than one psbt and then combine them.
ACKs for top commit:
apoelstra:
ACK 55cbae9c2f yeah, I like this
Tree-SHA512: 568899be8a82595c07e7b47c3011c093ce4ce49962e14781ea0c2eb9608fbba9920bbc81a296ec49d6ca124b813715bc0b8eb0cf887d44bbf8190f9a10c18845
I'd like to take out the `payload` of RawNetworkMessage and
then send it to the actual network message processor, but
finds there is no way to do it. This commit adds such an API
to expose the owned value of inner `payload`.
3298c0c4b5 pow: Unit test from_hex_internal (Tobin C. Harding)
47e4bff0ee pow: Fix off-by-one error (Tobin C. Harding)
Pull request description:
Patch 1 adds the fix, patch 2 is a unit test that fails if move to the front.
ACKs for top commit:
apoelstra:
ACK 3298c0c4b5 nice find! and lucky this just returns an error rather than panicking. may be worth backporting nonetheless
brunoerg:
ACK 3298c0c4b5
Tree-SHA512: 15bbd5aa4ac62c91492f5394444d179d95770bae822422bf00bb62896dcaf6c92d32f7d2e3380c352ff7242422ec6af6ff637ff78d14406cd047ef4ad5f22649
Add a unit test that fails if put before the "pow: Fix off-by-one error"
patch. Tests that we can correctly parse a 32 character long hex string
into a `U256`.