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

Update/0.18.0 #129

Merged
merged 8 commits into from
Jun 10, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions configurator/src/lnd.conf.template
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,14 @@ protocol.option-scid-alias={protocol_option_scid_alias}
protocol.zero-conf={protocol_zero_conf}
protocol.simple-taproot-chans={protocol_simple_taproot_chans}

[sweeeper]
Dominion5254 marked this conversation as resolved.
Show resolved Hide resolved
sweeper.maxfeerate={sweeper_maxfeerate}
sweeper.nodeadlineconftarget={sweeper_nodeadlineconftarget}
sweeper.budget.tolocalratio={sweeper_budget_tolocalratio}
sweeper.budget.anchorcpfpratio={sweeper_budget_anchorcpfpratio}
sweeper.budget.deadlinehtlcratio={sweeper_budget_deadlinehtlcratio}
sweeper.budget.nodeadlinehtlcratio={sweeper_budget_nodeadlinehtlcratio}

[bolt]
db.bolt.nofreelistsync={db_bolt_no_freelist_sync}
db.bolt.auto-compact={db_bolt_auto_compact}
Expand Down
18 changes: 18 additions & 0 deletions configurator/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,17 @@ struct BitcoinChannelConfig {
time_lock_delta: usize,
}

#[derive(serde::Deserialize)]
#[serde(rename_all = "kebab-case")]
struct SweeperConfig {
sweeper_maxfeerate: u64,
sweeper_nodeadlineconftarget: usize,
sweeper_budget_tolocalratio: f64,
sweeper_budget_anchorcpfpratio: f64,
sweeper_budget_deadlinehtlcratio: f64,
sweeper_budget_nodeadlinehtlcratio: f64,
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think you also want to include Option<usize> values for the different fee caps


#[derive(serde::Deserialize, PartialEq, Eq)]
#[serde(tag = "type")]
#[serde(rename_all = "kebab-case")]
Expand Down Expand Up @@ -183,6 +194,7 @@ struct AdvancedConfig {
gc_canceled_invoices_on_startup: bool,
allow_circular_route: bool,
bitcoin: BitcoinChannelConfig,
sweeper: SweeperConfig,
}

#[derive(serde::Serialize, serde::Deserialize)]
Expand Down Expand Up @@ -440,6 +452,12 @@ fn main() -> Result<(), anyhow::Error> {
protocol_disable_script_enforced_lease =
config.advanced.protocol_disable_script_enforced_lease,
protocol_simple_taproot_chans = config.advanced.protocol_simple_taproot_chans,
sweeper_maxfeerate = config.advanced.sweeper.sweeper_maxfeerate,
sweeper_nodeadlineconftarget = config.advanced.sweeper.sweeper_nodeadlineconftarget,
sweeper_budget_tolocalratio = config.advanced.sweeper.sweeper_budget_tolocalratio,
sweeper_budget_anchorcpfpratio = config.advanced.sweeper.sweeper_budget_anchorcpfpratio,
sweeper_budget_deadlinehtlcratio = config.advanced.sweeper.sweeper_budget_deadlinehtlcratio,
sweeper_budget_nodeadlinehtlcratio = config.advanced.sweeper.sweeper_budget_nodeadlinehtlcratio,
db_bolt_no_freelist_sync = config.advanced.db_bolt_no_freelist_sync,
db_bolt_auto_compact = config.advanced.db_bolt_auto_compact,
db_bolt_auto_compact_min_age = config.advanced.db_bolt_auto_compact_min_age,
Expand Down
4 changes: 3 additions & 1 deletion manifest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@ version: 0.18.0
release-notes: |-
* Update to 0.18.0 [Release Notes](https://github.com/lightningnetwork/lnd/releases/tag/v0.18.0-beta)
* Add Umbrel 1.0 migration action
Dominion5254 marked this conversation as resolved.
Show resolved Hide resolved
* Add config options for zero-conf channels
* Add config options for zero-conf channels, taproot channels, and sweeper settings
* Minor fixes
* Notice! If LND gets stuck in "Stopping" status after the update, the solution is to restart your server. System -> Restart.

license: MIT
wrapper-repo: "https://github.com/Start9Labs/lnd-startos"
upstream-repo: "https://github.com/lightningnetwork/lnd"
Expand Down
10 changes: 10 additions & 0 deletions scripts/models/setConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,15 @@ export const matchBitcoin = shape({
"time-lock-delta": number,
});

export const matchSweeperOptions = shape({
"sweeper-maxfeerate": number,
"sweeper-nodeadlineconftarget": number,
"sweeper-budget-tolocalratio": number,
"sweeper-budget-anchorcpfpratio": number,
"sweeper-budget-deadlinehtlcratio": number,
"sweeper-budget-nodeadlinehtlcratio": number,
});

export const matchAdvanced2 = shape({
"debug-level": string,
"db-bolt-no-freelist-sync": boolean,
Expand All @@ -56,6 +65,7 @@ export const matchAdvanced2 = shape({
"protocol-simple-taproot-chans": boolean,
"gc-canceled-invoices-on-startup": boolean,
bitcoin: matchBitcoin,
"sweeper": matchSweeperOptions,
}, ["recovery-window"]);

export const matchRoot = shape({
Expand Down
70 changes: 70 additions & 0 deletions scripts/services/getConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -552,6 +552,76 @@ export const getConfig: T.ExpectedExports.getConfig = compat.getConfig({
},
},
},
"sweeper": {
"type": "object",
"name": "Sweeper Options",
"description":
"'Sweep' is a LND subservice that handles funds sent from dispute resolution contracts to the internal wallet.\nThese config values help inform the sweeper to make decisions regarding how much it burns in on-chain fees in order to recover possibly contested outputs (HTLCs and Breach outputs).\n<b>WARNING: These settings can result in loss of funds if poorly congifured. Refer to the LND documentation for more information: https://docs.lightning.engineering/lightning-network-tools/lnd/sweeper</b>",
"spec": {
"sweeper-maxfeerate": {
"type": "number",
"name": "Max Fee Rate",
"description":
"The max fee rate in sat/vb which can be used when sweeping funds. Setting this value too low can result in transactions not being confirmed in time, causing HTLCs to expire hence potentially losing funds.",
"nullable": false,
"range": "[1,*)",
"integral": true,
"default": 1000,
"units": "Sats/vb"
},
"sweeper-nodeadlineconftarget": {
"type": "number",
"name": "Non-time-sensitive Sweep Confirmation Target",
"description":
"The conf target to use when sweeping non-time-sensitive outputs. This is useful for sweeping outputs that are not time-sensitive, and can be swept at a lower fee rate.",
"nullable": false,
"range": "[1,*)",
"integral": true,
"default": 1008,
"units": "Confirmations"
},
"sweeper-budget-tolocalratio": {
"type": "number",
"name": "Budget to Local Ratio",
"description":
"The ratio (expressed as a decimal) of the value in to_local output to allocate as the budget to pay fees when sweeping it.",
"nullable": false,
"range": "[0,1)",
"integral": false,
"default": 0.5,
},
"sweeper-budget-anchorcpfpratio": {
"type": "number",
"name": "Anchor CPFP Ratio",
"description":
"The ratio of a special value to allocate as the budget to pay fees when CPFPing a force close tx using the anchor output. The special value is the sum of all time-sensitive HTLCs on this commitment subtracted by their budgets.",
"nullable": false,
"range": "[0,1)",
"integral": false,
"default": 0.5,
},
"sweeper-budget-deadlinehtlcratio": {
"type": "number",
"name": "Time-Sensitive HTLC Budget Ratio",
"description":
"The ratio of the value in a time-sensitive (first-level) HTLC to allocate as the budget to pay fees when sweeping it.",
"nullable": false,
"range": "[0,1)",
"integral": false,
"default": 0.5,
},
"sweeper-budget-nodeadlinehtlcratio": {
"type": "number",
"name": "Non-Time-Sensitive HTLC Budget Ratio",
"description":
"The ratio of the value in a non-time-sensitive (second-level) HTLC to allocate as the budget to pay fees when sweeping it.",
"nullable": false,
"range": "[0,1)",
"integral": false,
"default": 0.5,
},
}
},
},
},
});
10 changes: 10 additions & 0 deletions scripts/services/migrations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,14 @@ export const migration: T.ExpectedExports.migration = compat.migrations
config.advanced["protocol-zero-conf"] = false;
config.advanced["protocol-option-scid-alias"] = false;
config.advanced["protocol-simple-taproot-chans"] = false;
config.advanced.sweeper = {
"sweeper-maxfeerate": 1000,
"sweeper-nodeadlineconftarget": 1008,
"sweeper-budget-tolocalratio": 0.5,
"sweeper-budget-anchorcpfpratio": 0.5,
"sweeper-budget-deadlinehtlcratio": 0.5,
"sweeper-budget-nodeadlinehtlcratio": 0.5,
}
return config;
},
false,
Expand All @@ -228,11 +236,13 @@ export const migration: T.ExpectedExports.migration = compat.migrations
"protocol-zero-conf": matches.any,
"protocol-option-scid-alias": matches.any,
"protocol-simple-taproot-chans": matches.any,
sweeper: matches.any,
})
}).test(config)) {
delete config.advanced["protocol-zero-conf"];
delete config.advanced["protocol-option-scid-alias"];
delete config.advanced["protocol-simple-taproot-chans"];
delete config.advanced.sweeper;
}
return config;
},
Expand Down