Skip to content
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

Move forwarding_fee_proportional_millionths, forwarding_fee_base_msat to ChannelHandshakeConfig #1247

Closed

Conversation

matchacactus
Copy link

@matchacactus matchacactus commented Jan 18, 2022

First step for #216

@matchacactus
Copy link
Author

The second commit broke test_priv_forwarding_rejection randomly. I have tried and failed to find out why, another 👀 for debug help?

@codecov-commenter
Copy link

codecov-commenter commented Jan 18, 2022

Codecov Report

Merging #1247 (6bccdaa) into main (34cdca9) will increase coverage by 0.01%.
The diff coverage is 92.00%.

❗ Current head 6bccdaa differs from pull request most recent head c49c086. Consider uploading reports for the commit c49c086 to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1247      +/-   ##
==========================================
+ Coverage   90.40%   90.42%   +0.01%     
==========================================
  Files          70       70              
  Lines       38087    38098      +11     
==========================================
+ Hits        34434    34449      +15     
+ Misses       3653     3649       -4     
Impacted Files Coverage Δ
lightning/src/ln/functional_test_utils.rs 95.28% <ø> (ø)
lightning/src/util/config.rs 47.82% <0.00%> (+2.17%) ⬆️
lightning/src/ln/channel.rs 89.44% <100.00%> (+0.06%) ⬆️
lightning/src/ln/functional_tests.rs 97.28% <100.00%> (+0.01%) ⬆️
lightning/src/ln/onion_route_tests.rs 96.69% <100.00%> (ø)
lightning/src/ln/payment_tests.rs 99.14% <100.00%> (ø)
lightning/src/util/events.rs 32.73% <0.00%> (+0.35%) ⬆️

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 34cdca9...c49c086. Read the comment docs.

@TheBlueMatt
Copy link
Collaborator

I'm somewhat confused as to the motivation for this PR - ChannelHandshakeConfig is all configuration options which are set at the beginning of a channel and then can not be changed afterwards - its all stuff in the "handshake". Instead, I think we should move things from ChannelConfig which cannot be updated after the handshake, specifically announced_channel (cannot be updated per lightning spec), commit_upfront_shutdown_pubkey (its literally about whether we include the pubkey in the handshake or not).

@@ -264,13 +264,10 @@ impl Default for ChannelConfig {
}

impl_writeable_tlv_based!(ChannelConfig, {
(0, forwarding_fee_proportional_millionths, required),
Copy link
Collaborator

@TheBlueMatt TheBlueMatt Jan 18, 2022

Choose a reason for hiding this comment

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

Note that we cannot remove required elements, as old clients will refuse to load data serialized by new clients (which we guarantee won't happen at least across a few releases). We instead need to write the default value with something like (0, Some(DEFAULT_VALUE as u64), option)

@matchacactus
Copy link
Author

I'm somewhat confused as to the motivation for this PR - ChannelHandshakeConfig is all configuration options which are set at the beginning of a channel and then can not be changed afterwards - its all stuff in the "handshake". Instead, I think we should move things from ChannelConfig which cannot be updated after the handshake, specifically announced_channel (cannot be updated per lightning spec), commit_upfront_shutdown_pubkey (its literally about whether we include the pubkey in the handshake or not).

I misunderstood the issue - am I on the right track with #1270? Closing this PR in favor of #1270

@TheBlueMatt
Copy link
Collaborator

Eventually landed rebased as #1529.

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.

3 participants