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
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`.
ee30eaa81b fuzz: add more coverage for `deserialize_block` (Bruno Garcia)
Pull request description:
This PR adds more coverage for the `deserialize_block` target. First, it serializes the block and compares with the data provided and then call some block functions to ensure they run without any issue.
ACKs for top commit:
apoelstra:
ACK ee30eaa81b Thanks!
Tree-SHA512: db6c7befa7b429267e9b28fb7910d2b9e8d462e22c791b544b1aa528c7ba4f8e1cd32e1276c67d3da1f97ce484e7ed19ec20b10d2030f2977fd8f855cf510ffe
5cff6b4765 Automated update to Github CI to rustc nightly-2024-06-02 (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 5cff6b4765
Tree-SHA512: 02513ed90221b2a31a3cc839dde89eb0239d3537ce19bd32bbc4541f58469a9d88de57e921fea3d653b0f52405b94677ea4470d469ae5f7ace463611be7cd9cd
d6ef16af30 update api (Divyansh Gupta)
a336ec0dda refactor(script): move `read_scriptint` to `PushBytes` & create `read_int` function (Divyansh Gupta)
Pull request description:
* Moved `read_scriptint` method to `Push_Bytes` struct
* Created `Instruction::read_int` method which acts as a wrappper around this function.
Done as part of #1547
ACKs for top commit:
apoelstra:
ACK d6ef16af30
tcharding:
ACK d6ef16af30
Tree-SHA512: e33df8adcb1c23351da303f6bad1ea4a8eae30e65943d230ae886183a01f970aecd0c8c8fd3a6c337cfe6dde1b7590778d88c308415e393f137065ef7da4b29c
0ae5be3e42 docs: Add more info to the update api files section (Tobin C. Harding)
Pull request description:
Done to try to further help new contributors and save maintainer time.
Add an example of using `just check-api` and an example `git` command for devs to create the api patch now required for all changes to the public API.
ACKs for top commit:
apoelstra:
ACK 0ae5be3e42
Tree-SHA512: 042dad94c1887fcfad535b1eb51cb38a450f3928742d0887c8470888ba53cf79687b65cf7040bdcbe4ce4d49a843f66f198139c22d4f3c4d2689b94b946e6929
c9d1ff7037 Update hashes API changes (Nick Johnson)
878ab924d1 Add HMAC Extract-and-Expand Key Derivation Function (Nick Johnson)
Pull request description:
rustaceanrob and I have been working on a Rust-based BIP324 implementation over at https://github.com/rustaceanrob/bip324. We have been attempting to keep the code pretty clean in hopes of a future "soft landing" in rust-bitcoin. I figured the HKDF implementation is a small, self-contained chunk that might allow us to learn the ropes here first.
There was a mention in the [discussion thread on BIP324](https://github.com/rust-bitcoin/rust-bitcoin/discussions/1691) that the hashes interface may be changing in the near future. I am not sure the effect that would have on this implementation, but happy to work through any issues.
Closes#2551
ACKs for top commit:
tcharding:
ACK c9d1ff7037
apoelstra:
ACK c9d1ff7037
Tree-SHA512: 404d51ca055db4366ec57f1503fcf350aebcd181f36a20a17763ea8c47ade851213fc882acd2785313953a3e768d588c230f737ff93f88121b97c34b37c65127
Done to try to further help new contributors and save maintainer time.
Add an example of using `just check-api` and an example `git` command
for devs to create the api patch now required for all changes to the
public API.
60ab3d26e5 CI: Remove shebang from non-executable scripts (Tobin C. Harding)
Pull request description:
Some of our CI shell scripts are meant only to be sourced and not run directly however they include an initial shebang line, implying that they should be run.
Remove the shebang line from `crates.sh` and the various `test_vars.sh` scripts. Add a `shellcheck` directive to inhibit the no-shebang warning.
Please note, the issue mentions the following in the discussion thread and it is _not_ implemented here.
> It would be good also to find a way to detect whether the script is being run directly, and to print an error message. I'm sure this is a common thing and we can find a stackexchange post telling us how to do it.
I don't see an immediate way to do this because CI is run using `run_task.sh` which is not in this repo. And since one can still run a script without the shebang (by doing eg, `bash script.sh`) the lack of shebang is only an indicator of how we are using the script.
Fix: #2764
ACKs for top commit:
apoelstra:
ACK 60ab3d26e5
Tree-SHA512: fe829226fb50e88bb84a2bbe324fbf977b7d5abc3637e9b7f8148e74a45a995b526bbe8c7263d903fd03f4563cdf95887433daa76f81faa7cd88d830bf6e0205
Some of our CI shell scripts are meant only to be sourced and not
run directly however they include an initial shebang line, implying that
they should be run.
Remove the shebang line from `crates.sh` and the various `test_vars.sh`
scripts. Add a `shellcheck` directive to inhibit the no-shebang warning.
Fix: #2764
BIP324's peer to peer encryption protocol requires an HMAC-based extract
and expand key derivation function (HKDF). HKDFs were not part of many
bitcoin protocols before BIP324, but the hope is that the encrypted
protocol becomes the dominant standard justifying this implementation.
4137c5c7a2 Automated update to Github CI to rustc nightly-2024-05-29 (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 4137c5c7a2
Tree-SHA512: 022339e41f69f1d8518cd8902fbe3fab329df8564366d2ea8d4fe47337693ca7a344d1d799aa8db1235bc45e87c6f70f172efbd75b80a7a3ad79293b8e0fe4e5
eb723740f1 api: Run just check-api (Tobin C. Harding)
853026071f bitcoin: Use new BlockHeight and BlockInterval types (Tobin C. Harding)
1173f3fbff units: Add BlockHeight and BlockInterval types (Tobin C. Harding)
Pull request description:
Add two simple integer wrapper types for abstracting over block height (from genesis block) and block interval.
This does not include hex because block height is typically written in decimal.
These types are very thin wrappers, their usecase is to assist in code readability instead of enforcing any logic.
Based on discussion in #2533Close: #2532
ACKs for top commit:
apoelstra:
ACK eb723740f1
Tree-SHA512: e6ae637461a813022e5236622143c658ac731730cb568c14c90cb358ed40452609d0e815ea99619ad7a2ea36f8dd053094b55f09b267e9a7cf5bab73cd3f81c8
We just added to now types that are thin wrappers around `u32`s for
block heights and intervals.
Add `Encodable` and `Decodable` impls and use the new types. While we
are at it re-export the types from the crate root so users don't have to
dig into the `units` crate.
Add two simple integer wrapper types for abstracting over block
height (from genesis block) and block interval.
This does not include hex because block height is typically written in
decimal.
These types are very thin wrappers, their usecase is to assist in code
readability instead of enforcing any logic.
18d298ab4f api: Run just check-api (Tobin C. Harding)
Pull request description:
During a bunch of merges the api/ files have gotten out of sync.
Run just check-api, no other changes.
ACKs for top commit:
apoelstra:
ACK 18d298ab4f
Tree-SHA512: 44d8f691e0ef919b851c43e19ffa28c48598163be056ef95498b5b868a57f83a274e6b69b5172417ac8ef61d56b4d16ed99a91b4e9b5bb9261750afeda301cfa