-
Notifications
You must be signed in to change notification settings - Fork 358
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
Upgrade bech32 dependency (iterative) #3270
base: main
Are you sure you want to change the base?
Conversation
9372141
to
b677ddb
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3270 +/- ##
==========================================
- Coverage 89.64% 89.64% -0.01%
==========================================
Files 126 126
Lines 102676 102753 +77
Branches 102676 102753 +77
==========================================
+ Hits 92045 92109 +64
- Misses 7912 7932 +20
+ Partials 2719 2712 -7 ☔ View full report in Codecov by Sentry. |
8eb0c4b
to
1fa1e99
Compare
CI: A few misses in iterative-mutants on the |
55e4259
to
5fa337a
Compare
CI: All builds OK. Iterative mutants is satisfied now, but the build was interrupted (?) after the tests (verified the logs + locally). |
9abd92e
to
ca0e089
Compare
Added a minor cleanup: |
A note regarding bech32->bytes conversion with padding: I've raised an issue to I also realized padding can be done in an iterator adapter (counts the elements and and the end optionally outputs padding), so this padding can be applied nicely in the chained iterators approach (as discusses above). |
Awaiting (re)review, @TheBlueMatt . Thx. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is shaping up nicely. We took this opportunity to avoid allocations in the serialization pipeline (sadly with allocations to avoid GATs...) but there's also a ton of really useless allocations in the deserialization pipeline, some of which we can trivially remove. We certainly don't have to fix it all in one go, but it'd be nice to reduce them where its easy here.
In any case, please feel free to go ahead and rewrite the commit history to have a logical progression so its easy to review :)
440fd35
to
1a69ccc
Compare
Commits squashed |
1852781
to
89a6cec
Compare
We should get a second reviewer on this. |
89a6cec
to
7da1b51
Compare
Continuation of #3244 . Fixes #3176 .
Changes summary:
bech32
dependency to0.11.0
(from0.9
)bech32::u5
can be replaced bybech32::Fe32
, mostly as a drop-in replacement.u5::try_from_u8
is nowFe32::try_from
bech32::Error
is mostly replaced bybech32::primitives::decode::CheckedHrpstringError
ToBase32
(andBase32Len
) traits are discontinued inbech32
, they have been reimplemented in iterative style asBase32Iterable
. The implementations (Bolt11InvoiceFeatures/Payment*/...) have been moved tolightning-invoice
crate (as the trait is defined there)FromBase32
trait is discontinued inbech32
, it has been taken over tolighning-invoice
crate. The implementations have been moved tolightning-invoice
crate (as the trait is defined there)Here are some minor issues identified
Fe32
does not haveOrd
, so it had to be explicitly implemented forRawTaggedField
Fe32
does not haveDefault
, for which some workaround was needed. This will be added in nextbech32 0.12
release (see Add Ord trait to Fe32 (derived) rust-bitcoin/rust-bech32#186)bech32
error types are not always optimalbech32
crate)TODO:
fuzz
target