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

Wumbo! #1425

Merged
merged 5 commits into from
Apr 28, 2022
Merged

Wumbo! #1425

merged 5 commits into from
Apr 28, 2022

Conversation

valentinewallace
Copy link
Contributor

Wumbo channels! 🥳

I'm not sure if we care about the TOTAL_BITCOIN_SUPPLY check, so I haven't tested it yet. Let me know if we want it and I'll add testing.

@valentinewallace valentinewallace added this to the 0.0.107 milestone Apr 15, 2022
@valentinewallace valentinewallace force-pushed the 2021-04-wumbo branch 2 times, most recently from e4c156c to 3445214 Compare April 15, 2022 22:11
@codecov-commenter
Copy link

codecov-commenter commented Apr 15, 2022

Codecov Report

Merging #1425 (5cfe19e) into main (83595db) will increase coverage by 1.12%.
The diff coverage is 92.85%.

@@            Coverage Diff             @@
##             main    #1425      +/-   ##
==========================================
+ Coverage   90.84%   91.96%   +1.12%     
==========================================
  Files          74       75       +1     
  Lines       41288    49132    +7844     
  Branches    41288    49132    +7844     
==========================================
+ Hits        37507    45184    +7677     
- Misses       3781     3948     +167     
Impacted Files Coverage Δ
lightning/src/ln/channelmanager.rs 87.49% <ø> (+2.83%) ⬆️
lightning/src/util/config.rs 44.89% <0.00%> (-0.94%) ⬇️
lightning/src/ln/channel.rs 92.40% <93.33%> (+4.03%) ⬆️
lightning/src/ln/functional_tests.rs 98.23% <94.11%> (+1.08%) ⬆️
lightning/src/ln/features.rs 99.45% <100.00%> (+0.01%) ⬆️
lightning/src/chain/mod.rs 59.25% <0.00%> (-1.86%) ⬇️
lightning/src/routing/scoring.rs 94.00% <0.00%> (-0.36%) ⬇️
lightning-persister/src/lib.rs 93.71% <0.00%> (-0.22%) ⬇️
lightning/src/util/persist.rs 93.75% <0.00%> (ø)
lightning-invoice/src/utils.rs 97.12% <0.00%> (+0.44%) ⬆️
... and 14 more

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 83595db...5cfe19e. Read the comment docs.

pub const MAX_FUNDING_SATOSHIS_NO_WUMBO: u64 = 1 << 24;

/// Total bitcoin supply in satoshis.
pub const TOTAL_BITCOIN_SUPPLY_SATOSHIS: u64 = 21_000_000 * 1_0000_0000;
Copy link
Contributor

Choose a reason for hiding this comment

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

Just a tiny nitpick on naming (not blocking): I feel like "total" can be misinterpreted in various ways such as representing the total supply so far and not necessarily year 2140. If the intention is to communicate the maximum number of sats possible in any one channel, then maybe a name like MAX_SATOSHI_LIMIT would be more accurate?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

"Total bitcoin supply" is referred to quite a few times in the codebase as 21 million bitcoin, so I like that it's consistent with that

TheBlueMatt
TheBlueMatt previously approved these changes Apr 18, 2022
Copy link
Contributor

@vincenzopalazzo vincenzopalazzo left a comment

Choose a reason for hiding this comment

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

🎇

dunxen
dunxen previously approved these changes Apr 19, 2022
Copy link
Contributor

@dunxen dunxen left a comment

Choose a reason for hiding this comment

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

ACK 451e096
Compared to spec and everything looks good!

@@ -58,9 +58,12 @@ use ln::chan_utils::CommitmentTransaction;
#[test]
fn test_insane_channel_opens() {
// Stand up a network of 2 nodes
use ln::channel::TOTAL_BITCOIN_SUPPLY_SATOSHIS;
let mut cfg = UserConfig::default();
cfg.peer_channel_config_limits.max_funding_satoshis = TOTAL_BITCOIN_SUPPLY_SATOSHIS + 1;
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there any need to use TOTAL_BITCOIN_SUPPLY_SATOSHIS here? Seems strange to use an invalid value when any valid value would suffice.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It allows us to cover both the cases of config.max_funding_satoshis and the TOTAL_BITCOIN_SUPPLY check without recreating the channels with a new config. If it were lower, we'd never get to the TOTAL_BITCOIN_SUPPLY check I think

/// Default value: 2^24.
// Note that this default was chosen because it was the maximum funding amount prior to wumbo
// channels being introduced.
pub max_funding_satoshis: u64,
Copy link
Contributor

Choose a reason for hiding this comment

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

Why have a config parameter? If we advertise support for wumbo, wouldn't it be surprising to a peer if they couldn't open a channel >= 2^24?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Users are likely to implement it anyway via the accept_channel hooks, plus its a really important security parameter - what level of risk are you willing to tolerate if the channel funds somehow get lost because you went offline too long?

MAX_FUNDING_SATOSHIS will no longer be accurately named once wumbo is merged.
Also, we'll want to check that wumbo channels don't exceed the total bitcoin supply
TheBlueMatt
TheBlueMatt previously approved these changes Apr 26, 2022
dunxen
dunxen previously approved these changes Apr 26, 2022
Copy link
Contributor

@jkczyz jkczyz left a comment

Choose a reason for hiding this comment

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

Just some comments all related to the non-wumbo constant.

@valentinewallace valentinewallace force-pushed the 2021-04-wumbo branch 2 times, most recently from 99b06ea to 3af4165 Compare April 28, 2022 17:53
jkczyz
jkczyz previously approved these changes Apr 28, 2022
Also redefine MAX_FUNDING_SATOSHIS_NO_WUMBO to no longer be off-by-one.
@valentinewallace
Copy link
Contributor Author

Squashed!

@TheBlueMatt TheBlueMatt merged commit f53d13b into lightningdevkit:main Apr 28, 2022
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.

8 participants