While I believe the original commit used 80 bytes for the entire script as the limit,
Bitcoin Core as of [this commit](7a172c76d2/src/policy/policy.h)
will relay OP_RETURN outputs as long as the data itself is not above 80 bytes, meaning a script of maximum size 83 bytes should be standard.
Bitcoin Core's consensus rules allow this timespan interval to be
negative. This commit also updates Params::pow_target_timespan to be a
u32. This field is almost compared to u64 and i64s, so changing this to
a u32 will allow users to use `.into()` for converstions
This function calls helper function predict_weight_internal and that
function was refactored. The refactor changed the interface to accept
the input_weight instead of partial input_weight, however this function
was not updated with the refactor and was still passing a partial input
weight. This commit is a followup that fixes the internal calculation
error by pass input_weight instead of partial_weight to the helper
function predict_weight_internal.
261c8d8ae6 Add total_weight to Input Weight Prediction (yancy)
cc4c36e8ac Deprecate weight (yancy)
Pull request description:
Closes https://github.com/rust-bitcoin/rust-bitcoin/issues/3645
I'm not sure if `total_weight` is the most accurate. Please advise if there's a different name that is better.
ACKs for top commit:
apoelstra:
ACK 261c8d8ae659d98fd3f63228f16d8f2eb4010b7e; successfully ran local tests
Tree-SHA512: f7fbcc587d3b72edf4add8a7bfecf99ee8133f679bd905c2ab6eeb959db455905c7e32ae91c95571599f09df605454f1e9953f1a47d1f1ee6d66270784c77793
d9ccb60a2f Fix typo in hash tag type (Tobin C. Harding)
Pull request description:
In commit: `39f7dcb Reduce API surface of tagged wrapped hash types` I introduced a typo in the tagged hash tag type. Fortunately it has no effect because the tag type controls how an engine is created (when the tag is input into the engine) and has no effect on the call to `from_engine`. However the typo makes the code confusing.
This bug is currently unreleased.
Fix: #3649
ACKs for top commit:
apoelstra:
ACK d9ccb60a2f9e89c8bb1979f032e8a222ab9b025a; successfully ran local tests
Tree-SHA512: 54cc78fb74ea119beaf4500d49a4d3954ffc3c52494b3ebc1539a3eec35078cb9388e72b42c59f371b53cced89b7b6303a0e3d3b02e59d72da182dd7bbfe2a55
f9ab3aea8a Re-export bech32 crate (Tobin C. Harding)
Pull request description:
`rust-bitcoin` is a lot further from 1.0 than `bech32` is. We previously removed the re-export of `bech32` because we thought it might hold us up releasing `rust-bitcoin 1.0` but in hindsite this was incorrect.
Having a public re-export of dependencies helps users keep their deps in sync with those in `rust-bitcoin` and is thus useful.
Close: #3650
ACKs for top commit:
apoelstra:
ACK f9ab3aea8abb0bf17d0a03be29d510049a85d0a9; successfully ran local tests; Yeah, let's backport
Tree-SHA512: 62b240bcf7a7f9dd8d4620a44e06a28f07d96eb555ec14500750190f2f6248c915b38d6e0eeab953973c6233d4782d27ec3f7939370e3474ea944d40b9aa8ebb
7b8369f381 units: Add integration test of API surface (Tobin C. Harding)
Pull request description:
In an effort to check off items in the Rust API guidelines checklist (#3632) add an integration test file that tests:
- The location of re-exports for various typical usage styles.
- Regressions in the API surface (things being accidentally moved).
- All public types implement Debug (C-DEBUG).
- For all non-error types:
- `Debug` representation is never empty (C-DEBUG-NONEMPTY)
- For all error types:
- Derive standard traits as defined by `rust-bitcoin` policy.
- All data structures implement `serde` traits (C-SERDE).
I used the `cargo check-api` script we have laying around from ages ago (#2986) to parse `units` and get a list of the public types.
ACKs for top commit:
apoelstra:
ACK 7b8369f381c3f3fc15ed536d5316e86e02914b4e; successfully ran local tests
Tree-SHA512: 6fa2a61f6b67a6b5a56950b87e6df68b761b69bd2a49e7aac48aa238cb84441ce04acd85097d28ae4055058052a7491eccda3da218812149a896e548b4018aaa
`rust-bitcoin` is a lot further from 1.0 than `bech32` is. We previously
removed the re-export of `bech32` because we thought it might hold us up
releasing `rust-bitcoin 1.0` but in hindsite this was incorrect.
Having a public re-export of dependencies helps users keep their deps in
sync with those in `rust-bitcoin` and is thus useful.
Close: #3650
In commit: `39f7dcb Reduce API surface of tagged wrapped hash types` I
introduced a typo in the tagged hash tag type. Fortunately it has no
effect because the tag type controls how an engine is created (when the
tag is input into the engine) and has no effect on the call to
`from_engine`. However the typo makes the code confusing.
This bug is currently unreleased.
Fix: #3649
17ca5018eb units: Comment alloc feature (Tobin C. Harding)
Pull request description:
Add a comment to the `serde` module about why we have all the `alloc` feature gating.
Done as part of #3556 - auditing the whole crate for use of `alloc` feature.
ACKs for top commit:
apoelstra:
ACK 17ca5018ebb28d5d392d61aee62170fb3e4f2a5b; successfully ran local tests
Tree-SHA512: 6d13129903a9c530db811e9f64ae4fa653dbcc952a42502c53c6c622a80c1e58b3037edd0638de78867823ca370b3a4595a08a9ec07b84c71afb6200454f5d6d
073ff81536 address: Simplify `Address::assume_checked` impl (Max Fang)
e4cf8ebc20 address: Add `Address::into_unchecked` (Max Fang)
Pull request description:
## Commits
### address: Add `Address::into_unchecked`
Adds an ergonomic way to convert any `Address` (network can be checked
or unchecked) into an `Address<NetworkUnchecked>` without cloning, which
I've found useful in several contexts.
### address: Simplify `Address::assume_checked` impl
Removes an unnecessary `match` which I noticed while implementing `Address::into_unchecked`.
## Small note on use of `Self`
The style guide in `CONTRIBUTING.md` notes to return `Self` when possible, but that doesn't apply here as the `Address` being returned is different from the `Address` type referred to by `Self`, due to the changed `NetworkValidation` type.
ACKs for top commit:
tcharding:
ACK 073ff81536
apoelstra:
ACK 073ff81536e7a24883d6470ecf3054f4b7263186; successfully ran local tests; nice!
Tree-SHA512: dd6749cffad75d88568106169032d8af023ed56df4b1b38fa613ae7b140d1eb22933e7b0ffc1b17681a5db4b11b28d9db4efb62868755ca3c0f7cac20de0be4b
In an effort to check off items in the Rust API guidelines
checklist (#3632) add an integration test file that tests:
- The location of re-exports for various typical usage styles.
- Regressions in the API surface (things being accidentally moved).
- All public types implement Debug (C-DEBUG).
- For all non-error types:
- `Debug` representation is never empty (C-DEBUG-NONEMPTY)
- For all error types:
- Derive standard traits as defined by `rust-bitcoin` policy.
I used the `cargo check-api` script we have laying around from ages
ago (#2986) to parse `units` and get a list of the public types.
a0c79735c7 README: Fix Kani badge and update `no-std` details (S \times 3 🗿)
Pull request description:
The Kani badge was not displayed due to using `imp` rather than `img` and link was broken. Also the `no-std` details need to be updated.
ACKs for top commit:
tcharding:
ACK a0c79735c7
apoelstra:
ACK a0c79735c79ab067f2518ecae1c533e75d194ab0; successfully ran local tests
Tree-SHA512: a4da661f14044ff3b5fac611849a14b80ca97f7125902712caa5910873686ff4f669ddf68fe4478b55b7d31d2443cba1260dae2729d50173d66df2641005607c
a8379bf005 Mark `checked_` functions const in bitcoin. (Jamil Lambert, PhD)
fe10ff2eb7 Mark functions `const` in `units` (Jamil Lambert, PhD)
Pull request description:
Following on #3608, #3627 and #1174 the rest of the `checked_` functions in all `rust-bitcoin` have been marked as const. Except for tests and traits.
ACKs for top commit:
apoelstra:
ACK a8379bf0053e66cf5984ce449d19e54e529b6b70; successfully ran local tests; thanks! I find this much easier to read
tcharding:
ACK a8379bf005
Tree-SHA512: b8d97b7a3d9fc33b57349f418ccc5aac2f3e8c4145a73bf0e24e85547217d41214696e9a80b1fb5a1bae7e766aad1c2b5df6044564772fe76cec9b3628bcd8e5
Add a comment to the `serde` module about why we have all the `alloc`
feature gating.
Done as part of #3556 - auditing the whole crate for use of `alloc`
feature.
571ba0c77c Automated update to Github CI to rustc nightly-2024-11-20 (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 571ba0c77c
Tree-SHA512: d926de595a816dddbe809717bb3eb2cf5445a1777354cc5a2eb8825e1d123d3bd56a5ec8845c58b634dd7b0d60ce4fdb748e331170d9b171e16e359061f223b1
Adds an ergonomic way to convert any `Address` (network can be checked
or unchecked) into an `Address<NetworkUnchecked>` without cloning, which
I've found useful in several contexts.
500cd10802 2024-11-17 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 500cd10802acc00df3664d7e7a03de7ad0bfe36e; successfully ran local tests; much less offensive this week
tcharding:
ACK 500cd10802
Tree-SHA512: 5dbd91260684f257277c5d2706ce8a95a4bf7d8d1e285e8e71261df35425cc7f512688c11643c4ea585905b05cbdfa221fb99731429d46eb5e33c12ab1088307
Mark `checked_` functions const. Replace `map()` and `?` operators,
which are not allowed in const context, with match statements.
Use descriptive variable names in ceiling division to make
it easier to follow.
7876a0d5ee Automated update to Github CI to rustc nightly-2024-11-17 (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 7876a0d5ee
Tree-SHA512: 80f238cd5a8b5ddf7c71bc8d80cf6cbf930b3db615fbca2a52d59c8f57b38b0ef106d5480a6c18c37821fe58f85dfa8c950a238933376d82d831a08cc78dc46e
68aac98753 Mark functions `const` (Jamil Lambert, PhD)
Pull request description:
Following on from #3608 and #1174 more functions have been marked as const.
Mark `checked_` functions in `units/src/fee_rate.rs` as const.
Replace `map()` and `?` operators, which are not allowed in const context, with match statements.
ACKs for top commit:
apoelstra:
ACK 68aac98753dba77bccc6572c65d441108dc53a17; successfully ran local tests; nice
tcharding:
ACK 68aac98753
Tree-SHA512: 2165f0fdb2bbbd68223646c7f788ec3b637cf2bec06a9faee8b252900fac0517985047d5e88ec074b6d9121fcb3a3774a62f326e53e1ceaa041d65a4e2e35fb6
ad82ed7179 Fix spelling typo (yancy)
8fe5ffde4c Rename tests that have _test suffix (yancy)
Pull request description:
Convention is to not include test as a suffix
Used `git grep -n _test` and renamed all the tests that made sense to rename. There are a number of fn `do_test(data: &[u8]) {` that I felt it would be better not to touch. Everything else that was a testname I renamed if it had a _test suffix.
ACKs for top commit:
apoelstra:
ACK ad82ed71796c79399cd8a81814b1af61c4ca3582; successfully ran local tests
tcharding:
ACK ad82ed7179
Tree-SHA512: 9c4ee71974e39814a8a63d269e3dcf6e761312dd0903ac1e6268dc421b9ef89a63f27cade3d5a51436660bb01457ac1a2f23a628a4d11622cd4a33fa6c483934
ec06028f63 hashes: Make hex dependency optional (Tobin C. Harding)
9dce0b4b8c Remove hex string trait bounds from GeneralHash (Tobin C. Harding)
766f498b33 Pull serde stuff out of impl_bytelike_traits macro (Tobin C. Harding)
Pull request description:
This is done in 3 parts:
1. Pull the `serde` stuff out of `impl_bytelike_traits` to fix the bug described here: https://github.com/rust-bitcoin/rust-bitcoin/issues/2654#issuecomment-2470716693
2. Prepare the `hashes` trait by removing string/hex trait bounds from `GeneralHash` and also pull the hex/string stuff out of `impl_bytelike_traits`
3. Make hex optional, including adding custom debug logic when `hex` feature is not enabled
Patch 3 is tested in `hashes/embedded`, by the new `debug` unit test, and there is a `Midstate` unit test as well that covers the `Debug` impl.
Close: #2654 - BOOM!
ACKs for top commit:
apoelstra:
ACK ec06028f63ba591a14c3a15cdfd410bb5ff1c09b; successfully ran local tests; nice!
Tree-SHA512: 85eb10d36a4581af6cd700f7ff876585bcc114c60e9864906e65659f3b3ee550fe6d9f40ca4230d870a9e23f0720723e11443ec329f16e40259a259b9be57466
53d3ab18b9 Bump version of bitcoin-primitives to 0.101.0 (Tobin C. Harding)
175171d339 Make primitives re-exports uniform (Tobin C. Harding)
3e9267071f primitives: Update crate level docs re allocator (Tobin C. Harding)
Pull request description:
Its 00:02 on the 15th UTC now, I'm hoping this merges within 24 hours - then the date is correct.
ACKs for top commit:
apoelstra:
ACK 53d3ab18b9d3385c8c72fe422a36235c825f44c3; successfully ran local tests
Tree-SHA512: c2a806867e1d50ba7512d4f1c91cd758688f587f985177a8dc3c12f495e81aa71bf1ec527611ddda0b09f271e9d652e58750ef2fa4756f447bd9be660985baab
4223655829 Add test case (yancy)
Pull request description:
Since there are test cases for other functions here, add test case as follow up for https://github.com/rust-bitcoin/rust-bitcoin/pull/3604. I forgot to request this during review.
ACKs for top commit:
apoelstra:
ACK 422365582964cf405529de3a1cf63d766b0d0e2e; successfully ran local tests
tcharding:
ACK 4223655829
Tree-SHA512: 8629cfff3e3eb800aa4d4625627e0a777c389566f4125bc63e67fe4c5a597ca63b9fb92da42f6c9dab12e6c63839eef35a13957f98606a37ed687eb96d896c2e
In preparation for releasing `primitives v0.101.0` bump the version
number, add a changelog entry, update the lock files, and depend on the
new version in all crates that depend on `primitives`.
7819e50055 Move Block to primitives (Tobin C. Harding)
55200924e4 Move Sealed to bottom of file (Tobin C. Harding)
d5b148d400 Make block_size free standing and rename (Tobin C. Harding)
5016a73207 Manually implement consensus traits for Block (Tobin C. Harding)
Pull request description:
Re-design the `Block` API and move the type to `primitives`.
ACKs for top commit:
apoelstra:
ACK 7819e50055c1be1d09b7d08734955f43229e6ed5; successfully ran local tests; let's go
Tree-SHA512: 13dc27508348966392aab4a80a3009bd53dd604d98ef392b9655bb97d669e01c4399901043ca3558b9b339cec5a1521ed0abfe7d666a66c6cc84ee4a97772de1
0348801ef3 Remove Amount::fmt_value_in (Shing Him Ng)
Pull request description:
Saw this mentioned in #3556Fixes#2952
ACKs for top commit:
apoelstra:
ACK 0348801ef30d1cdfdc40cd2316671532d4c06141; successfully ran local tests
tcharding:
ACK 0348801ef3
Tree-SHA512: 29a1d230672a22d059d2ef0870e68dec0fe6d6ae9d3fed51275d9b6779d097578a38a514544df11bdf23908c2d8e3c5fd5c6de2e460aab9792770d6b9e396fc6
On the way re-design the API by doing:
- Introduce `Checked` and `Unchecked` tags
- Rename the `txdata` field to `transactions`
- Make the `Block` fields private
- Add getters for `header` and `transactions` fields
- Move the various `compute_` methods to be free standing functions
- Make the `check_` functions private
- Introduce extension traits
In preparation for adding a block extension trait move the only private
method off the `Block` type and make it free standing.
While we are at it just take a slice of transactions since we don't need
the block itself - rename appropriately.
Internal change only.