d07550d86d just: add just docsrs (Jose Storopoli)
Pull request description:
Adds `just docsrs` which takes [variadic arguments](https://just.systems/man/en/chapter_41.html?highlight=zero%20or#recipe-parameters) (zero or more after the command).
Kixunil this allows for `just docsrs` and `just docsrs --open`.
Closes#2965.
Using the command from `rust-bitcoin-maintainer-tools`: 3494ceec52/ci/run_task.sh (L277)
ACKs for top commit:
jamillambert:
ACK d07550d86d
Kixunil:
ACK d07550d86d
apoelstra:
ACK d07550d86d
Tree-SHA512: dfc8a91bf9d572cb0cb460102f051aabe026fde2852ef2c82e962f0c60d8532628aa15bb99590a6140871d5539cdd9e5c6f80d0684fc128031f1c930e66e99ff
dfce405007 Remove nonsense method (yancy)
Pull request description:
Weight type implicitly includes witness scale factor
closes https://github.com/rust-bitcoin/rust-bitcoin/issues/2963
ACKs for top commit:
Kixunil:
ACK dfce405007
apoelstra:
ACK dfce405007 agreed about CI, we are very close to removing it
Tree-SHA512: 1c30c61863dd9c2ce5b6524931a21f99825edfd7401b833581194792c622030a4aa6b9c0f9680f97a8ae901604314805efa77e6fe1e8c15b356ddfea99ffe90c
eeae225cfc ci: add cargo-semver-checks (Jose Storopoli)
d9567b097f ci: remove check-api (Jose Storopoli)
Pull request description:
- Removes `check-api` (`cargo-public-api`)
- Adds `cargo-semver-checks`
## Note to Reviewers
There is a new script `contrib/check-semver.sh` that checks for semver breaks against `master`.
If it detects a breaking change it will create the `.semver-break` file.
If this file exists then we will add an `API break` label and a big comment to the PR saying:
> 🚨 API BREAKING CHANGE DETECTED
It reproduces the current behavior of `cargo-public-api`:
- `bitcoin`:
- `all-features`
- `no-default-features`
- `base58ck`:
- `all-features`
- `no-default-features`
- `bitcoin_hashes`:
- `no-default-features`
- `features alloc`
- `bitcoin-units`:
- `no-default-features`
- `features alloc`
- `bitcoin-io`:
- `no-default-features`
- `features alloc`
Closes#1875.
Supersedes #2912.
## Context
Our current test to check API breaks using `cargo public-api` is not "automated" per se.
It needs contributors to keep tabs on text files with function signatures and other things and forces reviewers to be the _de facto_ API break detector tool.
The idea is to use the well-acclaimed and maintained `cargo semver-checks` that will do this automatically in CI.
ACKs for top commit:
Kixunil:
ACK eeae225cfc
tcharding:
ACK eeae225cfc
Tree-SHA512: a77d64b4ca6500b80e6f98f9735d17193f8eaa9998e38602f46418f4b9f3b391ffe9b06bfe8e0285fc4350e8214ebd203034693bac858bac31b7d722903933ae
The `bitcoin` crate documents its features in the crate level rustdocs,
currently they are stale.
Update and improve the feature docs section of crate level docs.
6d3137ed87 bip158: Hash data instead of copying first (Tobin C. Harding)
Pull request description:
Currently we copy data into a new buffer before passing it into the hasher, we can just hash the data directly.
Internal change only, no external change.
Fix: #2917
ACKs for top commit:
Kixunil:
ACK 6d3137ed87
apoelstra:
ACK 6d3137ed87
Tree-SHA512: ff5bd18feffe1e77494b0cd14713bc55f1111f026d05bfa58a679f609fdba70160ab9df7677f0790b5b269878226c2f16164be2c918e1ad8b77e2c23d72889dd
65e9ad2fea Introduce empty primitives crate (Tobin C. Harding)
Pull request description:
Introduce an empty `bitcoin-primitives` crate.
We were give the name on crates.io and previously a version `v0.1.16-alpha` was released so we use `v0.100.0`.
Does not include adding api files since that whole thing is in flux. This is an even smaller step than #2908 that does not include dependencies.
ACKs for top commit:
Kixunil:
ACK 65e9ad2fea
apoelstra:
ACK 65e9ad2fea
Tree-SHA512: e8664a5b697281b188345623783f3d92f625e7b42f497bd0c64e9117ac2eb42286071757b04ff92415fbb37ef53dbb7a395717785a941b69bee0f0e2a611c9c3
3196c271ac Deprecate `Amount::fmt_value_in` (Martin Habovstiak)
467546fc0c Round `Amount` when requested precision is too low (Martin Habovstiak)
7c95a777c1 Fix `Amount` decimals handling (Martin Habovstiak)
Pull request description:
Displaying with minimal number of zeros is the default in Rust and we want to follow it. This was originally implemented in #716 but #2604 reversed it claiming this is common, however it broke people who rely on minimal display (e.g. BIP21) without fixing the root cause of #2136.
This reverts commit d887423efc adds a test to prevent this change and also fixes the problem with `{:0.8}` not working.
Closes#2136Closes#2948
Can we backport this one too?
ACKs for top commit:
tcharding:
ACK 3196c271ac
apoelstra:
ACK 3196c271ac I also really like how this reduces the complexity of the module, basically passing everything through to `display_in`
Tree-SHA512: 3221f83086ac55af3d4caad03fe2b619be303533bba12096040419d119600c8597938809e171662f11b515d469156b083b2072b901d445e4fdfc7b1062cf7b6a
Currently we copy data into a new buffer before passing it into the
hasher, we can just hash the data directly.
Internal change only, no external change.
Fix: #2917
4576f4ba69 Remove fuzz rust version (yancy)
Pull request description:
Fuzz is not compatible with the workspace MSRV.
Closes https://github.com/rust-bitcoin/rust-bitcoin/issues/2923
ACKs for top commit:
tcharding:
ACK 4576f4ba69
apoelstra:
ACK 4576f4ba69
Kixunil:
ACK 4576f4ba69
Tree-SHA512: 3b350e1f22a585719eb272de41b6a2b7a83a8d7810df8d98c4ecc06cf391ec3c3582934abc05d53bbdbe4ae4165fead9df2abf6f5aa84a74c1c0a7a7569eac6c
60aa4acc5f Update README instructions for running MSRV (yancy)
Pull request description:
The file mentioned in the README for running MSRV no longer exists
closes https://github.com/rust-bitcoin/rust-bitcoin/issues/2934
ACKs for top commit:
tcharding:
ACK 60aa4acc5f
apoelstra:
ACK 60aa4acc5f Definite improvement. Unfortunately will not work for downstream users but currently we do not have a solution for them I think
Kixunil:
ACK 60aa4acc5f
Tree-SHA512: 554b1b4d6ea8a929fb168e48b8925e20e6ee717a603a4008793376393d1ae8ba18bc290fb69747be155cd75439499500056c54e845a6fa6dc097e523b76ea54f
`fmt_value_in` was added when `display_in` wasn't available. However
common usage patterns seem to favor `display_in`. It can be used within
format strings and supports formatting options.
Removing it will simplify the codebase, so this deprecates it.
Introduce an empty `bitcoin-primitives` crate.
We were give the name on crates.io and previously a version
`v0.1.16-alpha` was released so we use `v0.100.0`.
15f6bacec9 api: Run just check-api (Ryan Breen)
9684d496bb Add is_standard_op_return (Ryan Breen)
Pull request description:
This is the suggestion for #2292 to check OP_RETURN length
ACKs for top commit:
apoelstra:
ACK 15f6bacec9
Tree-SHA512: e346b5eff7cc40b98a08948c83cb5c064184541d819c37a977e432ec09df7f9e1a074f16a4df598142784bd875f1379e2b0848fe898923e4e12829f85b4c4520
Low precision was previously not considered because it was believed it
could lead to misleading data being displayed. However it's quite
possible that people using low precision know what they are doing and
it's sometimes useful to show rounded numbers.
To enable low precision we just compute what the rounded number would be
and display that one instead.
This actually fully closes#2136 since this issue was mentioned there
along with previously-fixed displaying of higher precisions.
Displaying with minimal number of zeros is the default in Rust and we
want to follow it. This was originally implemented in #716 but #2604
reversed it claiming this is common, however it broke people who rely on
minimal display (e.g. BIP21) without fixing the root cause of #2136.
This reverts commit d887423efc adds a test
to prevent this change and also fixes the problem with `{:0.8}` not
working.
Closes#2136Closes#2948
7f024c333e Revert "bug fix" (actually a bug) from #2655 (Martin Habovstiak)
Pull request description:
In a2b019f82 it was claimed that losing the input string without alloc is a bug. It is not, because allowing no-alloc is desired and there's no way to have the input string otherwise so we just accept it'll be missing and modify the messages accordingly. The commit that forced alloc was also horribly misleading since it kept the `alloc` feature but it makes this one easier.
Note that input string is still present by default in all configurations except for no-alloc.
I think we should also backport this and release fixed `units` because of the misleading `alloc` feature in them. Although it's not urgent. The only crate I know of that is kinda broken by it is `ln_types` which is already broken by depending on old `bitcoin`.
ACKs for top commit:
apoelstra:
ACK 7f024c333e
tcharding:
ACK 7f024c333e
Tree-SHA512: 014ed823f0daf2c47ca6cedf1aad0d94b702f2ca53b096556a76566baeadb209b9d4d710872c2b8308542fd7cfe6d815a206f1a84174458d251bf30882be7719
e8a30bfca7 taproot: Lowercase error messages (Jamil Lambert, PhD)
717da4bf69 Capitalize Huffman (Jamil Lambert, PhD)
175f69abeb Capitalize Merkle (Jamil Lambert, PhD)
be5b93ea4f Do not capitalize tree (Jamil Lambert, PhD)
b48ca050f9 Remove tap tree (Jamil Lambert, PhD)
c8e6c13608 Capitalize Taproot (Jamil Lambert, PhD)
Pull request description:
Taproot, Merkle and Huffman are proper nouns and should be capitalized in strings and docs.
These have been capitalized everywhere.
All cases of `taproot`/`taptree`/`tap tree` in docs and strings have been changed to be `Taproot tree` or ```[`TapTree`]``` as appropriate.
All cases of `tree` have been changed to lower cases, except where it is in title case.
Error messages in `Taproot` have been changed to start with a lowercase character, except when it is a proper noun, and not end with a period.
Close: #2913
ACKs for top commit:
tcharding:
ACK e8a30bfca7
apoelstra:
ACK e8a30bfca7
Tree-SHA512: 7d06b717072f7894093df8501752374637fc6673bd7b6f1b95297ab076725eb0d7f48caa45c321fd13a45d0e4387ab9eeb398261f7988d3c9f90cfa75aee17ca
de8a8ca077 Automated update to Github CI to rustc nightly-2024-06-30 (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 de8a8ca077
Tree-SHA512: 7d5918439152919c18875b717bff7a262436efac034f2a1fa3562da0621c3286f8a4bc38952bf41333fe7f851b759acc43e7036e3044872e277470907579c08b
0630457403 Create empty bitcoin-addresses crate (Tobin C. Harding)
Pull request description:
We intend on splitting the address types and logic out into a separate crate. In preparation for doing so, and so that we can grab the name on crates.io, add an empty crate `bitcoin-addresses`.
Tie it in to the CI infrastructure excluding the `check-api` infrastructure because that is in flux.
ACKs for top commit:
Kixunil:
ACK 0630457403
apoelstra:
ACK 0630457403 will try to tag and publish tonight, but may be tomorrow
Tree-SHA512: faf54f43954a799f1003dae67930edc7f306c35403ba05e511df6685c1068850c47fe1a46afdcabcb32c3f43398803181c7f53d6bcf64a4aec7123e9ce9306e8
865ba3fc39 Move serde string macros to internals (Tobin C. Harding)
4a2b13fcde internals: Feature gate whole serde module (Tobin C. Harding)
Pull request description:
The macros are internal things and can live in `internals`. This will help with future crate smashing.
ACKs for top commit:
apoelstra:
ACK 865ba3fc39
Kixunil:
ACK 865ba3fc39
Tree-SHA512: 7b3f029206c690ecf2894e0ad099d391312f7f8ec65ac9b5d4d9f25e6827f92075dcc851d0940a0faf1e27e7d0a305b575c8cc790939b3f222d7a2920d4d24fe
c717f7f424 Improve docs on private Witness fields (Tobin C. Harding)
Pull request description:
The `Witness` type is a reasonable complex data structure, make an effort to clarify its structure in the docs on the private fields.
Private docs only.
(Original idea pulled out of #2133.)
ACKs for top commit:
Kixunil:
ACK c717f7f424
apoelstra:
ACK c717f7f424 much clearer, thanks!
Tree-SHA512: 9d54b7eeefec97e584fb5f275049dbac0473c949fae8ab05c6961d6fc424c17a058af7037c2220ef1446af294d78c68bfee741cfeca1b18ecc402935d8069dab
In a2b019f82 it was claimed that losing the input string without alloc
is a bug. It is not, because allowing no-alloc is desired and there's
no way to have the input string otherwise so we just accept it'll be
missing and modify the messages accordingly. The commit that forced
alloc was also horribly misleading since it kept the `alloc` feature but
it makes this one easier.
Note that input string is still present by default in all configurations
except for no-alloc.
d099b9c195 Remove wildcard from prelude import (Jamil Lambert, PhD)
Pull request description:
This patch replaces `prelude::*` wildcard imports with the types actually used. In a couple of cases `DisplayHex` was previously imported by the wildcard but was only used in the test module, an additional import was added to the test module instead of at the top where it causes an unused import warning.
Close: #2875
ACKs for top commit:
Kixunil:
ACK d099b9c195
tcharding:
ACK d099b9c195
Tree-SHA512: d59dfac0961d2649d509039a11c1b5574d81d05fef567a624cf15be2f587de796ea960ba5a08bef788199331c2f790fb06f7b393182538c7d8b1891ded119efc
The `Witness` type is a reasonable complex data structure, make an
effort to clarify its structure in the docs on the private fields.
Private docs only.
010141ecc9 api: Run just check-api (Tobin C. Harding)
cf800a1b07 Remove bech32 dependency from blockdata (Tobin C. Harding)
Pull request description:
We have a single usage of the `bech32` crate inside the `blockdata` module, to convert a `WitnessVersion` to a `Fe32`. We then have a single call site where we use the conversion in the `address` module.
This code was written without thinking to hard about the introduced dependency on `bech32`, in hindsite it shouldn't have been added.
In preparation for splitting a bunch of code in `blockdata` out into the `primitives` crate remove the `bech32` stuff from the `witness_version` module.
ACKs for top commit:
Kixunil:
ACK 010141ecc9
apoelstra:
ACK 010141ecc9
Tree-SHA512: 2d368ebf64ab7197b421e0dec48623f3fb03243081a988ff9ed2070135c8741efe24520c2aab496d54c52595808f10ee39816eaab8e3e4a7e64955cd25285670
a7731b2f33 api: Run just check-api (Marko Bencun)
47cba7a655 bip32: add from_32_slice method to DerivationPath (Marko Bencun)
Pull request description:
ChildNumber already has a `From<u32>` impl, but converting `&[u32]` to a `DerivationPath` was still difficult.
ACKs for top commit:
Kixunil:
ACK a7731b2f33
tcharding:
ACK a7731b2f33
Tree-SHA512: 2db94ee035e686102b8201f637422bb96bd79858aeffdb007594d722902d31a20f27e61b88fae8c854c80f785d9e7837b0158a046639ff8cc2d20d8883391842
dc10a49876 api: Run just check-api (Tobin C. Harding)
5e8f204581 Pass sigs and associated types by value (Tobin C. Harding)
Pull request description:
We should pass `Copy` types by value not by reference.
Currently this is not done in secp, but lets do it here in bitcoin.
Pass by value:
- `SerializedSignature`
- bitcoin sigs
- secp sigs
- secp `Message`
This is a continuation of the work to split up #2404 into manageable PRs.
ACKs for top commit:
apoelstra:
ACK dc10a49876
Kixunil:
ACK dc10a49876
Tree-SHA512: 8736eba067c74edb951c92357f5b3d0fc99c4fa6dc3beea579c10b3150873b74e8ec46c2c01f18818b37fca6e77c6b6edddeb6340edde6a9d8c28a4e69164c8c
ebb862cbaf Automated update to Github CI to rustc nightly-2024-06-26 (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 ebb862cbaf
Tree-SHA512: ec7ba43d784ff6245abda82ab7c27b247d1bfc654335fe384cb0990a4b36d752467282990452f485c911f996a95f8a7c163fe44a177ef1bd4cdcffc6f0e5ed06
We intend on splitting the address types and logic out into a separate
crate. In preparation for doing so, and so that we can grab the name on
crates.io, add an empty crate `bitcoin-addresses`.
Tie it in to the CI infrastructure.