-
Notifications
You must be signed in to change notification settings - Fork 406
Bitcoin 0.32.2 upgrade #3239
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
Bitcoin 0.32.2 upgrade #3239
Conversation
2bf94c4
to
db61c59
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3239 +/- ##
==========================================
+ Coverage 89.75% 90.39% +0.63%
==========================================
Files 123 124 +1
Lines 102158 107249 +5091
Branches 102158 107249 +5091
==========================================
+ Hits 91695 96947 +5252
+ Misses 7773 7717 -56
+ Partials 2690 2585 -105 ☔ View full report in Codecov by Sentry. |
458d5cf
to
9d5a386
Compare
4c829f4
to
203803c
Compare
lightning/src/lib.rs
Outdated
@@ -144,7 +299,7 @@ pub mod io_extras { | |||
Ok(count) | |||
} | |||
|
|||
pub fn read_to_end<D: io::Read>(mut d: D) -> Result<alloc::vec::Vec<u8>, io::Error> { | |||
pub fn read_to_end<D: Read>(mut d: &mut D) -> Result<alloc::vec::Vec<u8>, io::Error> { |
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.
Can this be dropped in favor of read_to_limit
?
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.
It can be, but would probably be better in a followup because it does produce some errors.
We'll probably end up with a handful of followups to upstream stuff to |
48bb54e
to
07e0600
Compare
215b556
to
df9aa8f
Compare
c6a34da
to
b72b5e9
Compare
4b824f5
to
768c040
Compare
ebb80e6
to
7462995
Compare
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.
Did a first pass. Already looks pretty good.
AFAICT, you can (and should) drop most to almost all (?) changes related to lightning-transaction-sync
if you'd simply bump rust-esplora-client
and rust-electrum-client
to their latest versions which have already been upgraded to rust-bitcoin
0.32.
In anticipation of the rust-bitcoin upgrade, which incorporates its own `io::Read` implementation, we need to make our usage compatible with dropping `std::io` and `core2::io`. Notably, in version 0.32.2, `bitcoin::io`'s `Read` is no longer implemented for `&mut R where R: Read + ?Sized`, which results in errors anytime `&mut &mut Readable` is passed instead of `&mut Readable`. This commit fixes those instances.
In lieu of using `Seek` and `SeekFrom`, we will instead rely exclusively on the `io::Cursor` type.
The rust-bitcoin upgrade will introduce `bitcoin::io` module, which will be missing a necessary subset of traits. To accommodate those traits' future implementations, we move the `lightning::io` module to its own file, where we will be able to implement the missing trait subset in the next commit.
The `bitcoin::io` Cursor will miss a bunch of functionality that we were using that we will reimplement here, most critically `set_position`.
7462995
to
e07cccb
Compare
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.
Basically LGTM. Feel free to squash and I think we should just land this and then do fixups later.
impl<'a, R: Read> Read for BufReader<'a, R> { | ||
#[inline] | ||
fn read(&mut self, output: &mut [u8]) -> io::Result<usize> { | ||
let input = self.fill_buf()?; |
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.
Technically if we want to get fancy we can ignore the whole buffer nonsense here and actually just do a straight read, but I'm also hoping this code never makes it into a release at all (ie rust-bitcoin updates fast enough) so its not worth worrying about too much.
Taproot is not yet being actively used, and this commit suppresses the noisy warning generation.
Version 0.32.2 of `rust-bitcoin` deprecates a number of methods that are commonly used in this project, most visibly `txid()`, which is now called `compute_txid()`. This resulted in a lot of warnings, and this commit is part of a series that seeks to address that.
Version 0.32.2 of `rust-bitcoin` deprecates a number of methods that are commonly used in this project, most visibly `txid()`, which is now called `compute_txid()`. This resulted in a lot of warnings, and this commit is part of a series that seeks to address that.
Version 0.32.2 of `rust-bitcoin` deprecates a number of methods that are commonly used in this project, most visibly `txid()`, which is now called `compute_txid()`. This resulted in a lot of warnings, and this commit is part of a series that seeks to address that.
Version 0.32.2 of `rust-bitcoin` deprecates a number of methods that are commonly used in this project, most visibly `txid()`, which is now called `compute_txid()`. This resulted in a lot of warnings, and this commit is part of a series that seeks to address that.
Version 0.32.2 of `rust-bitcoin` deprecates a number of methods that are commonly used in this project, most visibly `txid()`, which is now called `compute_txid()`. This resulted in a lot of warnings, and this commit is part of a series that seeks to address that.
e07cccb
to
36b484a
Compare
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.
LGTM. There's probably a few things to clean up here and there but we should land this to get it out of the way and can clean up in a followup.
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.
Post-merge ACK
As the title suggests, but still unfortunately a work in progress.