lightningdevkit / rust-lightning

A highly modular Bitcoin Lightning library written in Rust. It's rust-lightning, not Rusty's Lightning!
Other
1.16k stars 367 forks source link

Use `u64` for `required_unknown_bits_from` indexes, not `usize` #3279

Closed TheBlueMatt closed 2 months ago

TheBlueMatt commented 2 months ago

While usize should be fine, we're multiplying the index by 8 so if we have a jumbo feature bit fitting in a 32-bit size type may not quite work. More importantly, this would be the first use of a usize in the public API and dealing with it in bindings is annoying so we just replace with a u64.

codecov[bot] commented 2 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 89.80%. Comparing base (1122e82) to head (1d810a5). Report is 6 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #3279 +/- ## ========================================== - Coverage 89.81% 89.80% -0.02% ========================================== Files 126 126 Lines 103134 103134 Branches 103134 103134 ========================================== - Hits 92634 92622 -12 - Misses 7779 7785 +6 - Partials 2721 2727 +6 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

TheBlueMatt commented 2 months ago

Just landing, this is trivial.