Skip to content

chore: small-fix accoriding to the syncing up to the master branch #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 444 commits into from

Conversation

Sansh2356
Copy link

No description provided.

leopardracer and others added 30 commits April 26, 2025 12:47
afd4ec8 test: push minimality check for zero(empty) (ChrisCho-H)

Pull request description:

  Following rust-bitcoin#4368.
  I omitted to test OP_0(empty bytes) and can be covered by this PR.

ACKs for top commit:
  apoelstra:
    ACK afd4ec8; successfully ran local tests

Tree-SHA512: a3643227f9dfde71d5c5707bf11804e0e26eff43346c0443abdd805f0ffad284c3090e22a0bda34e54e1185a980adc7511724db401c04b55a8be79d67a3fce6d
…end test for P2A

8eeceed test: extend `valid_v1_witness_programs` test to include P2A (Luis Schwab)
647526d chore: fix docs for `impl WitnessProgram` and P2A (Luis Schwab)

Pull request description:

  Closes rust-bitcoin#4124.

  This PR fixes documentation on `impl WitnessProgram` by replacing instances of `address` to `[WitnessProgram]`, adds punctuation and capitalization where it was lacking and extends the `valid_v1_witness_programs` test to include the P2A output.

ACKs for top commit:
  Kixunil:
    ACK 8eeceed
  apoelstra:
    ACK 8eeceed; successfully ran local tests

Tree-SHA512: 6e62a8de7135da04d6330d2b5596a2cd19da8a849f8c8c892f53578a8690152b23facf58149d4139ae088f1ab297d3526094617c3549e688819e9b1f3688de8b
…ons" -> "operations"

d5f8a02 Update result.rs (leopardracer)

Pull request description:

  **Description:**
  This PR fixes a small typo in the documentation comment in units/src/result.rs where "operatons" was misspelled as "operations". This improves code documentation clarity and consistency.

  Changes:
  - Corrected spelling of "operatons" to "operations" in the documentation comment
  - No functional changes, documentation-only update

ACKs for top commit:
  apoelstra:
    ACK d5f8a02; successfully ran local tests

Tree-SHA512: b9d6ea4c8d36e6a9f8d397b4db31d99f0b9d0101a0bef922f0c3832c501fbc773f8871c350ae8add47ab1f1c4d15806e1b1d9f0b9d7dd707b38adcc2afad8b34
…CONTRIBUTING.md

ab9f2fc removed API documentation section (Maximilian Hubert)

Pull request description:

  Removed API documentation section due to dead link - couldn't locate the referenced api folder or README file. Happy to restore this with correct link info if someone can provide the proper reference path. Just let me know!

ACKs for top commit:
  apoelstra:
    ACK ab9f2fc; successfully ran local tests

Tree-SHA512: eb4887048f9d2e4bcb1b21947aac55c250fe369e5b9a3f07cc6f9ec7abd5716a4a45c6ac9e767808c5b1fa5f16f387e64a2ea3ccd997bf95fd3b19f669e1f249
6737c3a 2025-04-27 automated rustfmt nightly (Fmt Bot)

Pull request description:

  Automated nightly `rustfmt` changes by [create-pull-request](https://github.com/peter-evans/create-pull-request) GitHub action

ACKs for top commit:
  apoelstra:
    ACK 6737c3a; successfully ran local tests

Tree-SHA512: d486efcc34aa7a3666ec421e8ae7d8f1d2f160a3ba8b086b70859f1da4fc03bb1399886370e09c26c57be98c20bdb865b86547f2f7dbcfcace2d34d486f842e0
…ks (to 0.41.0)

0edb0f5 Automated update to Github CI to cargo-semver-checks version-0.41.0 (Update cargo-semver-checks Bot)

Pull request description:

  Automated update to Github CI workflow `semver-checks.yml` by [create-pull-request](https://github.com/peter-evans/create-pull-request) GitHub action

ACKs for top commit:
  tcharding:
    ACK 0edb0f5

Tree-SHA512: 80ce15d4a0f568a2303d06f8c6c426cea75f90c5bff6270ff2b27b93f09260c3765666da51c1a0575a0ce8d526a0f1ac2cf7771a09f989cc147aa4d267799978
Our encoding/decoding support for scripts is currently a bit convoluted.
Add an example that shows how all the APIs go together.

Note this highlights a potential problem. `to_hex_string` is in
`bitcoin` and therefore has access to consensus encoding but does not
include the length prefix. This means that the output string from
`to_hex_string` cannot be parsed with
`consensus::encode::deserialize_hex` - which is surprising and has lead
to difficulty by at least one user trying to debug.
I'm not sure why we do not use consensus encoding currently for encoding
and decoding scripts to/from hex strings. Many tests include hard coded
hex which do not include the length prefix.

- Add a pair of encoding functions to encode/decode to/from hex without
the length prefix.
- Make `to_hex` and `from_hex` expect the length prefix i.e., use
consensus encoding.

This makes the API easier to use because the various encoding APIs can
be use together now eg `consensus::encode_hex` and `ScriptBuf::from_hex`.
Add the length prefix when formatting hex strings by way of `LowerHex`
and `UpperHex`.

This looses formatting options because I can't remember right now how
not to - again.
8b47068 feat(locktime): implement MtpAndHeight structure and validation logic (aagbotemi)

Pull request description:

  This PR fixes rust-bitcoin#4299

  - Computed MtpAndHeight structure
  - Checked if relative time and height is satisfied by MtpAndHeight
  - Compared the Ordering of MtpAndHeight with time and height
  - Checked MtpAndHeight satisfaction and comparison in Locktime
  - Added unit tests for all the implementation

  I've reviewed and adhered to the contribution guidelines

ACKs for top commit:
  apoelstra:
    ACK 8b47068; successfully ran local tests
  Kixunil:
    ACK 8b47068
  tcharding:
    ACK 8b47068

Tree-SHA512: b00d1384d5deaa038b486ca9d77ad33cfa6cd8c987e08407863f2be8d540014bdcc971cd9d46acb51a2d105341accc04ba151e5cccb276e8352a5d45b33097eb
a232783 docs: correction CHANGELOG.md (Fallengirl)

Pull request description:

  fix `funtions` - `functions`
  no impact on functionality, local tests passed
  thx

ACKs for top commit:
  tcharding:
    ACK a232783
  jamillambert:
    ACK a232783
  apoelstra:
    ACK a232783; successfully ran local tests

Tree-SHA512: e850ee8b642df49e1b8fb1cf50aac4f55c86cc4f955aa28bc0493449769d5239a491fab5df02c7ade21a40c1efb7f4194fded29a418ae070b3e20aceb9d6dae3
5d5a197 Run the formatter (Tobin C. Harding)
2b72f1f Make Lower/Upper hex print scripts with len prefix (Tobin C. Harding)
c27b95f Make script to/from hex use consensus encoding (Tobin C. Harding)
f4bc58d bitcoin: Add a script encoding example (Tobin C. Harding)

Pull request description:

  Done while investigating rust-bitcoin#3910 - this PR is quite invasive.

  - Patch 1 adds an example that shows the current behaviour of various API calls for converting scripts to/from hex.
  - Patch 2 adds a pair of functions that do not use the length prefix and makes script to/from_hex use the prefix.
  - Patch 3 makes `LowerHex` and `UpperHex` use the len prefix also
  - Patch 4 runs the formatter

  Explicitly keeps serde untouched - i.e., without the len prefix

ACKs for top commit:
  apoelstra:
    ACK 5d5a197; successfully ran local tests

Tree-SHA512: dbbec372ea7b01818fce68ffb807a4531f068e10147e8bedf37b77f66a068a628e380549c379c061b868973e97806ada59729248b03bbd1cf6809f6098170cb6
made a text look a little bit better
cargo-mutants 25.0.1  introduced a new mutation pattern that deletes an
arm of a match statement or replaces a match guard with true and false.
These are applied in sections that have been excluded from mutation
testing and cause false positives.
The match patterns are also now stricter causing previously excluded
`impl` to be included.

Exclude the new match arm and guard mutation patterns.

Add `impl fmt::` versions for Debug and Display.
f31b732 changed wording and punctuation (crStiv)

Pull request description:

  nothing fancy, just changed wording and improved punctuation

ACKs for top commit:
  apoelstra:
    ACK f31b732; successfully ran local tests
  tcharding:
    ACK f31b732

Tree-SHA512: 78daae62a7235dcf238687548f2b2778120aede3f5237e83a9015b87a112946b7ff4177cfbbab6206ea09f41cc9d08b3684f169beeba314f6afc1c917920f788
The bip32::Error enum is now exclusively used for errors related to
parsing and decoding. It is still a little messy (mainly: it contains a
base58 variant which is used when parsing a string but not when decoding
from bytes) but much cleaner than it was.
This restores the Result return from derive_xpriv which we had removed
in a previous PR, but such is life.

Fixes rust-bitcoin#4308
…um depth exceeded" error

b9a1204 bip32: return error when trying to derive a path too deep (Andrew Poelstra)
73781e0 bip32: rename Error to ParseError (Andrew Poelstra)
a66ad97 bip32: split InvalidChildNumber and InvalidChildNumberFormat out of error (Andrew Poelstra)
a891fb9 bip32: remove unused error variants (Andrew Poelstra)
f0a237c bip32: split out DerivationError from the main error enum (Andrew Poelstra)
32d96f6 bip32: make Xpriv::new_master be infallible (Andrew Poelstra)
0e5e021 bip32: change several cryptographically unreachable paths to expects (Andrew Poelstra)

Pull request description:

  This PR makes a first pass at splitting the `bip32::Error` type into multiple distinct types -- one for derivation (which can fail if you try to derive a hardened child of an xpub, or if you try to derive too many layers), one for parsing child numbers or derivation paths, and one for parsing xkeys. Along the way it cleans up a ton of weird things and typos, e.g. the psbt `GetKeyError` having an unused `Bip32` variant whose display text references "bip 23".

  Because all the error types get renamed, every part of this PR is an API break, but only the last commit is a "real" API break which uses the new `DerivationError::MaximumDepthExceeded` error variant to return an error when trying to derive a path of length 256 or longer. This means that `Xpriv::derive_xpriv` again returns an error result.

  I will make a simpler version of this last commit suitable for backporting to 0.32.x. (In 0.32.x `Xpriv::derive_priv` returns an error, so we can change it to error out on max-depth-exceeded without breaking the API. Sadly most users are likely to be unwrapping the error because in 0.32.x currently the error path is cryptographically unreachable...but at least this way the panic will be in their control rather than ours.)

  Fixes rust-bitcoin#4308

ACKs for top commit:
  tcharding:
    ACK b9a1204

Tree-SHA512: 688826126ff24066c6de9de3caa73db68c516ba8893d64d9226a498774a2fb9db7d7fd797375c6b3f820588c178632e1e6e8561022dfa7042a560582bf1509b4
…rm/guard mutants

3bcb5b0 Add exclusions for match arm/guard mutants (Jamil Lambert, PhD)

Pull request description:

  cargo-mutants 25.0.1 introduced a new mutation pattern that deletes an arm of a match statement or replaces a match guard with true and false. These are applied in sections that have been excluded from mutation testing and cause false positives.
  The match patterns are also now stricter causing previously excluded `impl` to be included.

  Exclude the new match arm and guard mutation patterns.

  Add `impl fmt::` versions for Debug and Display.

  Closes rust-bitcoin#4402

ACKs for top commit:
  apoelstra:
    ACK 3bcb5b0; successfully ran local tests
  tcharding:
    ACK 3bcb5b0

Tree-SHA512: d7a45bdd5bc844c273956922b5483c70f24ca8ea20da275fd6b1ff13e71ec86fcc487932365beb3084cc3894bbe1317ddb3df975f90584b639187ba278b0721e
The output of `Display` should not change in stable crates for types
that have well defined formatting and ones that implement `FromStr`.
Error types do not need to be tested.

Add missing tests for all implementations in `primitives` and round
trips for types that implement `FromStr`.
Existing display tests only test lock by block height.  New tests are
needed for lock by block time.

Change existing test names to make it clear which type of locktime is
being tested.
The existing display regression tests only tested height locktimes.
Denomination display regression and round trip were not tested.

Add tests for time locktimes and denomination.
The output of Display should not change in stable crates for types that
have well defined formatting and ones that implement FromStr.
Crates that are included in the mutation testing have been updated to
test all relevant Display implementations.

Remove the exclusion so that the Display implementations are included in
mutation testing.
The output of `Display` should not change in stable crates for types
that have well defined formatting and ones that implement `FromStr`.
Error types do not need to be tested.

Add missing tests for all implementations in `units`.
yancyribbens and others added 27 commits May 26, 2025 19:01
In order to add other types to CheckedSum, remove from the Amount
module.  In so doing, other types added to CheeckSum do not need to be
imported into Amount.
Expose `checked_sum` method to sum an iterator of Weights checked.
It is not immediately obvious what a zero value compact target is.
Because of this and the fact that we are trying to release minimal code
in `primitives 1.0` its best to remove the `Default` derive.

This is an API breaking change.
Recently we added a private `impl_u32_macro`. It included a bunch of
associated consts and a pair of u32 constructor/getter functions.

We overlooked the fact that the macro produces incorrect docs.

Move the offending code out of the macro and into the already existent
impl block for each type.

Docs only, no other logic change.
The `ServiceFlags` type is already tested within p2p/mod.rs with a
nearly identical test. This type also has nothing to do with `network`
In preparation to move `p2p` to its own crate, any `Vec<T>` that satisfies
`T: Encodable` will not trivially implement `Encodable` because of the
orphan rule. A type defined within p2p may implement `Encodable`,
however, and the simplest possible type is one that simply wraps the
vector. Three types that will implement `Encodable` within `p2p` are
added here.
All of the `Encodable` implementations are defined within `p2p` with the
exception of `p2p` types that are a `Vec`. To fully decouple `p2p` from
`encode` we can define these in `p2p` like the others. This is the final
step in removing anything `p2p` related from the rest of `bitcoin`.
9dac4d6 Implement CheckedSum for Weight iterator (yancy)
0dbcd09 Move CheckedSum trait to crate root (yancy)

Pull request description:

  * Move CheckedSum to the crate root so that other types can be added
  * Add Weight to CheckedSum

ACKs for top commit:
  tcharding:
    ACK 9dac4d6
  apoelstra:
    ACK 9dac4d6; successfully ran local tests

Tree-SHA512: 3e4b7f79074e23493ccd17a026542081f0d7a811f4f35edb7994ada95bf414a166531f142ad4986d27fcec448209b2ffa56813b495b5df6b6e8fcd589392e0c1
Peer to peer messages change on occasion, and we would like to add
messages as they are release from Bitcoin Core. Add an empty crate to
take the crate name.
9d956e8 test: remove redundant `ServiceFlags` test (rustaceanrob)

Pull request description:

  The `ServiceFlags` type is already tested within p2p/mod.rs with a nearly identical test. This type also has nothing to do with `network`

  ref: https://github.com/rust-bitcoin/rust-bitcoin/blob/master/bitcoin/src/p2p/mod.rs#L400

ACKs for top commit:
  tcharding:
    ACK 9d956e8
  apoelstra:
    ACK 9d956e8; successfully ran local tests

Tree-SHA512: d113609070e3df6d44b1ed57c40c1bce251d59fa22eb1abbf6c576fd84e21464553bee7fa97eba000ad9c1b8ef98e2ba04aec7077486273de9b7e54341ba894b
…nversions

6335c62 fix(p2p): remove `AddrV2` <> `SocketAddr` conversions (Luis Schwab)

Pull request description:

  This PR reverts rust-bitcoin#4521 due to loss/creation of port information during the conversion. Users should use the `AddrV2` <> `IpAddr` conversion instead.

  Closes rust-bitcoin#4566

ACKs for top commit:
  Kixunil:
    ACK 6335c62
  tcharding:
    ACK 6335c62

Tree-SHA512: f183756467ca17bb7e7078023a769ec33d3deb4146ab7ec63ef961107ab93ec975c9adffd9eeddc79250abfa1cee9eccbbcaef7466cf4c2c21205b69d8e9eb4f
2a3e606 units: Move some things out of impl_u32_macro (Tobin C. Harding)

Pull request description:

  Recently we added a private `impl_u32_macro`. It included a bunch of associated consts and a pair of u32 constructor/getter functions.

  We overlooked the fact that the macro produces incorrect docs.

  Move the offending code out of the macro and into the already existent impl block for each type.

  Docs only, no other logic change.

ACKs for top commit:
  apoelstra:
    ACK 2a3e606; successfully ran local tests

Tree-SHA512: ad4bdbb35bc674e9664e293841e14dc2374c8baddf3e795edb666c75860f02728e939ef5a93ede6f4c951e92c5dd5368d6a6b9662cf6d5b268f73ab5ac97e2cc
e47836f Do not derive Default on CompactTarget (Tobin C. Harding)

Pull request description:

  It is not immediately obvious what a zero value compact target is. Because of this and the fact that we are trying to release minimal code in `primitives 1.0` its best to remove the `Default` derive.

  This is an API breaking change.

ACKs for top commit:
  apoelstra:
    ACK e47836f; successfully ran local tests

Tree-SHA512: 7edb067a7ed66af8155b86b2391ee839b0a21b3d8d36b555123b14e93f1822b89c080328464b194e4ff47643440c56fa5afee929fe58b52d5f1cf84c9b96ca83
7b52b9c Fix typo (yancy)

Pull request description:

  Seems the comment has a stutter

ACKs for top commit:
  tcharding:
    ACK 7b52b9c
  apoelstra:
    ACK 7b52b9c; successfully ran local tests

Tree-SHA512: 1cb11c03bb3043c19936dbe4c2ccfa1e8fa43e90c118c969da536d010d95762966cc86e257e3365d18d96cc6dfe4a63d94c4d16b1b766dde3882286ce9bb4925
357ae40 fix typo Porallel to Parallel crypto.rs (Fallengirl)

Pull request description:

  Hi devs! Found and fixed one typo in `hashes/src/ripemd160/crypto.rs`

  `Porallel` - `Parallel`

ACKs for top commit:
  tcharding:
    ACK 357ae40

Tree-SHA512: 67b166f8f0262cc9f4fdd9d4cbe74977ca86e0256d0129f645559aa4e75fd30d978d8995d503932c90f000eee4d87b47cc4dd5eac8405d5cd02124346ad35b3a
4ccecf5 Fix stale Height type link (Tobin C. Harding)
caebb1b units: relative: Do minor rustdocs fixes (Tobin C. Harding)
40bb177 Put is_satisfied_by functions together (Tobin C. Harding)
480a2cd Favour new function `from_mtp` over deprecated (Tobin C. Harding)
f9d6453 Shorten locktime type term (Tobin C. Harding)
727047b Fix off-by-one-bug in absolute locktime (Tobin C. Harding)
3ffdc54 Fix off-by-one bug in relative locktime (Tobin C. Harding)
a2ff8dd Improve relative::LockTime is_satisfied_by_{height, time} (Tobin C. Harding)

Pull request description:

  Make the APIs uniform in relative and absolute locktimes in relation to the `is_satisfied_by` functions. In doing so improve the API and fix an off-by-one bug when checking satisfaction of locks by height.

  Done in three patches but maybe should be squashed? Probably easiest to review by looking at all the `is_satisfied_by*` functions and convincing yourself we got it right.

  EDIT: Now has 5 cleanup patches also (mostly docs cleanups).

ACKs for top commit:
  apoelstra:
    ACK 4ccecf5; successfully ran local tests

Tree-SHA512: 9206cb464a06647510a35a7d564062823117e75df60251969be458616f4f5d04acf0aada53dbf7d493a2a2a72d26b3a300417a6499e45413d5f2a011538b7826
…`p2p`

20779bd Move `p2p` encodings out of `encode` (rustaceanrob)
94bcff2 p2p: Add wrappers for messages that use `Vec` (rustaceanrob)

Pull request description:

  To move `p2p` into a crate:
  1. All `Encodable` implementations for `p2p` must be defined in `p2p`. To accomplish this, and anything else in the future related to encoding, I added a `deser` module with the necessary macro to implement `Encodable` for `Vec<T> where T: Encodable`.
  2. Because the orphan rule would apply for implementing `Encodable`for `Vec` within `p2p`, three types defined within `p2p` are used to wrap the `Vec` and snake around the orphan rule.

ACKs for top commit:
  tcharding:
    ACK 20779bd
  apoelstra:
    ACK 20779bd; successfully ran local tests

Tree-SHA512: 7abfe5b853e84bb465579309f80a0687c325217f6f342651278bedf540c4d17ae16683ab02dea5e3d98d90790deb12c6bc7d572a92cec8e19ff94e395bc0d29c
de32071 Introduce empty p2p messages crate (rustaceanrob)

Pull request description:

  Peer to peer messages change on occasion, and we would like to add messages as they are released from Bitcoin Core. Add an empty crate to take the crate name.

ACKs for top commit:
  tcharding:
    ACK de32071
  apoelstra:
    ACK de32071; successfully ran local tests

Tree-SHA512: 68c8080c524c30eb5ec0aca14e74c8196a7cfffabe32d47773d56b8a64850617094b3c2088dfce20b4abfca31c82b19369703722d0a98aee636c383318953da7
Copy link

github-actions bot commented Jun 2, 2025

🚨 API BREAKING CHANGE DETECTED

To see the changes click details on "Check semver breaks / PR Semver - stable toolchain" job then expand "Run semver checker script" and scroll to the end of the section.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.