Skip to content

Change ChannelManager deserialization to return an optional blockhash #810

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

Conversation

valentinewallace
Copy link
Contributor

If the ChannelManager never receives any blocks, it'll return a default blockhash
on deserialization. It's preferable for this to be an Option instead.

@valentinewallace valentinewallace force-pushed the optional-chanman-blockhash branch from 3f06730 to 43c3b01 Compare February 26, 2021 21:13
@valentinewallace valentinewallace marked this pull request as ready for review February 26, 2021 21:14
@valentinewallace valentinewallace added this to the 0.0.13 milestone Feb 26, 2021
@valentinewallace valentinewallace force-pushed the optional-chanman-blockhash branch from 43c3b01 to 35a311c Compare February 26, 2021 21:18
@codecov
Copy link

codecov bot commented Feb 26, 2021

Codecov Report

Merging #810 (c21b616) into main (59d2040) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #810   +/-   ##
=======================================
  Coverage   91.02%   91.02%           
=======================================
  Files          48       48           
  Lines       25495    25501    +6     
=======================================
+ Hits        23207    23213    +6     
  Misses       2288     2288           
Impacted Files Coverage Δ
lightning-block-sync/src/init.rs 93.56% <ø> (ø)
lightning-persister/src/lib.rs 92.52% <100.00%> (ø)
lightning/src/chain/channelmonitor.rs 95.77% <100.00%> (+<0.01%) ⬆️
lightning/src/ln/chanmon_update_fail_tests.rs 97.56% <100.00%> (ø)
lightning/src/ln/channelmanager.rs 85.28% <100.00%> (+0.02%) ⬆️
lightning/src/ln/functional_test_utils.rs 94.97% <100.00%> (ø)
lightning/src/ln/functional_tests.rs 96.96% <100.00%> (ø)
lightning/src/util/test_utils.rs 83.49% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 59d2040...c21b616. Read the comment docs.

Copy link
Collaborator

@TheBlueMatt TheBlueMatt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should probably be done in ChannelMonitors too, no?

If the ChannelManager never receives any blocks, it'll return a default blockhash
on deserialization. It's preferable for this to be an Option instead.
@valentinewallace valentinewallace force-pushed the optional-chanman-blockhash branch 2 times, most recently from 6eb2155 to 684e6f5 Compare March 2, 2021 00:56
@TheBlueMatt
Copy link
Collaborator

Needs rebase and the check_commits CI failed.

@valentinewallace valentinewallace force-pushed the optional-chanman-blockhash branch from 684e6f5 to c21b616 Compare March 2, 2021 17:33
@TheBlueMatt
Copy link
Collaborator

There is no fuzz issue that I can see (are you running cargo test in fuzz with the newly-required RUSTFLAGS="--cfg=fuzzing"?). I pushed a rebased version of this at https://git.bitcoin.ninja/?p=rust-lightning;a=shortlog;h=refs/heads/2021-03-810-rebased.

I also included a commit which updates the docs there, and I'm ACK on the version available there.

@TheBlueMatt
Copy link
Collaborator

See #819.

@TheBlueMatt TheBlueMatt closed this Mar 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants