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 all commits
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
10 changes: 3 additions & 7 deletions .github/workflows/buildService.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,6 @@ jobs:
- name: Checkout services repository
uses: actions/checkout@v4

- name: Debug
run: |
pwd
ls -alR


Dominion5254 marked this conversation as resolved.
Show resolved Hide resolved
- name: Build the service package
id: build
run: |
Expand All @@ -33,9 +27,11 @@ jobs:
make
PACKAGE_ID=$(yq -oy ".id" manifest.*)
echo "package_id=$PACKAGE_ID" >> $GITHUB_ENV
printf "\n SHA256SUM: $(sha256sum ${PACKAGE_ID}.s9pk) \n"
shell: bash

- name: Upload .s9pk
uses: actions/upload-artifact@v4
with:
name: ${{ env.package_id }}.s9pk
path: ./${{ env.package_id }}.s9pk
path: ./${{ env.package_id }}.s9pk
Dominion5254 marked this conversation as resolved.
Show resolved Hide resolved
3 changes: 2 additions & 1 deletion .github/workflows/releaseService.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ jobs:
- name: Generate sha256 checksum
run: |
PACKAGE_ID=${{ env.package_id }}
printf "\n SHA256SUM: $(sha256sum ${PACKAGE_ID}.s9pk) \n"
sha256sum ${PACKAGE_ID}.s9pk > ${PACKAGE_ID}.s9pk.sha256
shell: bash

Expand Down Expand Up @@ -68,4 +69,4 @@ jobs:
echo "Publish skipped: missing registry credentials."
else
start-sdk publish https://$S9USER:$S9PASS@$S9REGISTRY ${{ env.package_id }}.s9pk
fi
fi
Dominion5254 marked this conversation as resolved.
Show resolved Hide resolved
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM lightninglabs/lnd:v0.17.5-beta
FROM lightninglabs/lnd:v0.18.0-beta

ARG ARCH
RUN apk add --no-cache \
Expand Down
18 changes: 9 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -49,27 +49,27 @@ docker-images/aarch64.tar: Dockerfile docker_entrypoint.sh configurator/target/a
configurator/target/aarch64-unknown-linux-musl/release/configurator: $(CONFIGURATOR_SRC)
docker run --user $(UID):$(GID) --rm -v ~/.cargo/registry:/root/.cargo/registry -v "$(shell pwd)"/configurator:/home/rust/src messense/rust-musl-cross:aarch64-musl cargo build --release
docker run --user $(UID):$(GID) --rm -v ~/.cargo/registry:/root/.cargo/registry -v "$(shell pwd)"/configurator:/home/rust/src messense/rust-musl-cross:aarch64-musl musl-strip target/aarch64-unknown-linux-musl/release/configurator
# Docker 26 + buildkit 0.13.2 seem to have issues with building a context that contains multiple hardlinked files, work-around that by breaking the hardlink
cp --remove-destination configurator/target/aarch64-unknown-linux-musl/release/configurator configurator/target/aarch64-unknown-linux-musl/release/configurator.tmp
mv --force configurator/target/aarch64-unknown-linux-musl/release/configurator.tmp configurator/target/aarch64-unknown-linux-musl/release/configurator
# Docker 26 + buildkit 0.13.2 seem to have issues with building a context that contains multiple hardlinked files, work-around that by breaking the hardlink
cp configurator/target/aarch64-unknown-linux-musl/release/configurator configurator/target/aarch64-unknown-linux-musl/release/configurator.tmp
mv configurator/target/aarch64-unknown-linux-musl/release/configurator.tmp configurator/target/aarch64-unknown-linux-musl/release/configurator

health-check/target/aarch64-unknown-linux-musl/release/health-check: $(HEALTH_CHECK_SRC)
docker run --user $(UID):$(GID) --rm -v ~/.cargo/registry:/root/.cargo/registry -v "$(shell pwd)"/health-check:/home/rust/src messense/rust-musl-cross:aarch64-musl cargo build --release
docker run --user $(UID):$(GID) --rm -v ~/.cargo/registry:/root/.cargo/registry -v "$(shell pwd)"/health-check:/home/rust/src messense/rust-musl-cross:aarch64-musl musl-strip target/aarch64-unknown-linux-musl/release/health-check
cp --remove-destination health-check/target/aarch64-unknown-linux-musl/release/health-check health-check/target/aarch64-unknown-linux-musl/release/health-check.tmp
mv --force health-check/target/aarch64-unknown-linux-musl/release/health-check.tmp health-check/target/aarch64-unknown-linux-musl/release/health-check
cp health-check/target/aarch64-unknown-linux-musl/release/health-check health-check/target/aarch64-unknown-linux-musl/release/health-check.tmp
mv health-check/target/aarch64-unknown-linux-musl/release/health-check.tmp health-check/target/aarch64-unknown-linux-musl/release/health-check

configurator/target/x86_64-unknown-linux-musl/release/configurator: $(CONFIGURATOR_SRC)
docker run --user $(UID):$(GID) --rm -v ~/.cargo/registry:/root/.cargo/registry -v "$(shell pwd)"/configurator:/home/rust/src messense/rust-musl-cross:x86_64-musl cargo build --release
docker run --user $(UID):$(GID) --rm -v ~/.cargo/registry:/root/.cargo/registry -v "$(shell pwd)"/configurator:/home/rust/src messense/rust-musl-cross:x86_64-musl musl-strip target/x86_64-unknown-linux-musl/release/configurator
cp --remove-destination configurator/target/x86_64-unknown-linux-musl/release/configurator configurator/target/x86_64-unknown-linux-musl/release/configurator.tmp
mv --force configurator/target/x86_64-unknown-linux-musl/release/configurator.tmp configurator/target/x86_64-unknown-linux-musl/release/configurator
cp configurator/target/x86_64-unknown-linux-musl/release/configurator configurator/target/x86_64-unknown-linux-musl/release/configurator.tmp
mv configurator/target/x86_64-unknown-linux-musl/release/configurator.tmp configurator/target/x86_64-unknown-linux-musl/release/configurator

health-check/target/x86_64-unknown-linux-musl/release/health-check: $(HEALTH_CHECK_SRC)
docker run --user $(UID):$(GID) --rm -v ~/.cargo/registry:/root/.cargo/registry -v "$(shell pwd)"/health-check:/home/rust/src messense/rust-musl-cross:x86_64-musl cargo build --release
docker run --user $(UID):$(GID) --rm -v ~/.cargo/registry:/root/.cargo/registry -v "$(shell pwd)"/health-check:/home/rust/src messense/rust-musl-cross:x86_64-musl musl-strip target/x86_64-unknown-linux-musl/release/health-check
cp --remove-destination health-check/target/x86_64-unknown-linux-musl/release/health-check health-check/target/x86_64-unknown-linux-musl/release/health-check.tmp
mv --force health-check/target/x86_64-unknown-linux-musl/release/health-check.tmp health-check/target/x86_64-unknown-linux-musl/release/health-check
cp health-check/target/x86_64-unknown-linux-musl/release/health-check health-check/target/x86_64-unknown-linux-musl/release/health-check.tmp
mv health-check/target/x86_64-unknown-linux-musl/release/health-check.tmp health-check/target/x86_64-unknown-linux-musl/release/health-check

scripts/embassy.js: scripts/**/*.ts
deno bundle scripts/embassy.ts scripts/embassy.js
9 changes: 9 additions & 0 deletions configurator/src/lnd.conf.template
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,15 @@ protocol.no-anchors={protocol_no_anchors}
protocol.no-script-enforced-lease={protocol_disable_script_enforced_lease}
protocol.option-scid-alias={protocol_option_scid_alias}
protocol.zero-conf={protocol_zero_conf}
protocol.simple-taproot-chans={protocol_simple_taproot_chans}

[sweeper]
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}
Expand Down
22 changes: 21 additions & 1 deletion 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 @@ -179,9 +190,11 @@ struct AdvancedConfig {
protocol_option_scid_alias: bool,
protocol_no_anchors: bool,
protocol_disable_script_enforced_lease: bool,
protocol_simple_taproot_chans: bool,
gc_canceled_invoices_on_startup: bool,
allow_circular_route: bool,
bitcoin: BitcoinChannelConfig,
sweeper: SweeperConfig,
}

#[derive(serde::Serialize, serde::Deserialize)]
Expand Down Expand Up @@ -406,7 +419,7 @@ fn main() -> Result<(), anyhow::Error> {
alias = alias,
color = config.color,
feeurl_row = if use_neutrino {
"feeurl=https://nodes.lightning.computer/fees/v1/btc-fee-estimates.json"
"fee.url=https://nodes.lightning.computer/fees/v1/btc-fee-estimates.json"
Dominion5254 marked this conversation as resolved.
Show resolved Hide resolved
} else {
""
},
Expand Down Expand Up @@ -438,6 +451,13 @@ fn main() -> Result<(), anyhow::Error> {
protocol_no_anchors = config.advanced.protocol_no_anchors,
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
8 changes: 6 additions & 2 deletions manifest.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
id: lnd
title: LND
version: 0.17.5.1
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
* Minor changes
* 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
11 changes: 11 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 @@ -53,8 +62,10 @@ export const matchAdvanced2 = shape({
"protocol-option-scid-alias": boolean,
"protocol-no-anchors": boolean,
"protocol-disable-script-enforced-lease": boolean,
"protocol-simple-taproot-chans": boolean,
"gc-canceled-invoices-on-startup": boolean,
bitcoin: matchBitcoin,
"sweeper": matchSweeperOptions,
}, ["recovery-window"]);

export const matchRoot = shape({
Expand Down
77 changes: 77 additions & 0 deletions scripts/services/getConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -457,6 +457,13 @@ export const getConfig: T.ExpectedExports.getConfig = compat.getConfig({
"Set to disable support for script enforced lease channel commitments. If not set, lnd will accept these channels by default if the remote channel party proposes them. Note that lnd will require 1 UTXO to be reserved for this channel type if it is enabled.\nNote: This may cause you to be unable to close a channel and your wallets may not understand why",
"default": false,
},
"protocol-simple-taproot-chans": {
"type": "boolean",
"name": "Experimental Taproot Channels",
"description":
"Taproot Channels improve both privacy and cost efficiency of on-chain transactions. Note: Taproot Channels are experimental and only available for unannounced (private) channels at this time.",
"default": false,
},
"gc-canceled-invoices-on-startup": {
"type": "boolean",
"name": "Cleanup Canceled Invoices on Startup",
Expand Down Expand Up @@ -545,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,
},
}
},
},
},
});
42 changes: 41 additions & 1 deletion scripts/services/migrations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,46 @@ export const migration: T.ExpectedExports.migration = compat.migrations
throw new Error("Cannot downgrade");
},
},
"0.18.0": {
up: compat.migrations.updateConfig(
(config: any) => {
config.advanced["protocol-zero-conf"] = false;
config.advanced["protocol-option-scid-alias"] = false;
ProofOfKeags marked this conversation as resolved.
Show resolved Hide resolved
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,
{ version: "0.18.0", type: "up" }
),
down: compat.migrations.updateConfig(
(config) => {
if (matches.shape({
advanced: matches.shape({
"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;
},
true,
{ version: "0.18.0", type: "down" }
)
}
},
"0.17.5.1",
"0.18.0",
);