Repository navigation
Conversation
This was referenced Sep 14, 2026
Author
|
Now also proposed upstream as lightningdevkit#1099 (adapted to current main: FundingAmount-era open_channel_inner, the _with_all/_0reserve variants, and the async funding handler). If upstream accepts it, this fork patch reduces to a rebase artifact the next time we re-sync; until then this PR is what the next Zeus release builds against. |
kaloudis
added a commit
to kaloudis/zeus
that referenced
this pull request
Oct 12, 2026
The Open Channel flow collects a sat/vB rate on every backend, but on LDK Node it was discarded: openChannelSync never forwarded it, and the ldk-node API had no parameter to receive it. Every funding transaction went out at the internal estimator's ChannelFunding rate. The API side is fixed in ZeusLN/ldk-node#6, which adds a trailing optional FeeRate to all six open-channel methods. This change threads the user's rate through every layer on the Zeus side: - backends/LdkNode.ts: openChannelSync sanitizes data.sat_per_vbyte with the sanitizeSatPerVbyte guard and passes it to all three branches (fund-max, coin control, plain) - ldknode/LdkNodeInjection.ts + ldknode/LdkNode.d.ts: optional satPerVbyte, forwarded as -1 sentinel when absent, matching the on-chain send convention - android LdkNodeModule.kt and ios LdkNodeModule.swift/.m: the three bridge methods accept satPerVbyte and map it through the existing parseFeeRate helper, so the sentinel becomes null/nil and ldk-node keeps estimator behavior when no rate applies - vendored bindings (ldk_node.kt, LDKNode.swift): open-channel signatures, FFI declarations, and API checksums ported to match the regenerated output from ZeusLN/ldk-node#6 Requires a native rebuild on both platforms and is gated on the next ZeusLN/ldk-node release (fetch-libraries version + SHA256 bump will follow in this PR once tagged).
kaloudis
added a commit
to kaloudis/zeus
that referenced
this pull request
Oct 12, 2026
The Open Channel flow collects a sat/vB rate on every backend, but on LDK Node it was discarded: openChannelSync never forwarded it, and the ldk-node API had no parameter to receive it. Every funding transaction went out at the internal estimator's ChannelFunding rate. The API side is fixed in ZeusLN/ldk-node#6, which adds a trailing optional FeeRate to all six open-channel methods. This change threads the user's rate through every layer on the Zeus side: - backends/LdkNode.ts: openChannelSync sanitizes data.sat_per_vbyte with the sanitizeSatPerVbyte guard and passes it to all three branches (fund-max, coin control, plain) - ldknode/LdkNodeInjection.ts + ldknode/LdkNode.d.ts: optional satPerVbyte, forwarded as -1 sentinel when absent, matching the on-chain send convention - android LdkNodeModule.kt and ios LdkNodeModule.swift/.m: the three bridge methods accept satPerVbyte and map it through the existing parseFeeRate helper, so the sentinel becomes null/nil and ldk-node keeps estimator behavior when no rate applies - vendored bindings (ldk_node.kt, LDKNode.swift): open-channel signatures, FFI declarations, and API checksums ported to match the regenerated output from ZeusLN/ldk-node#6 Requires a native rebuild on both platforms and is gated on the next ZeusLN/ldk-node release (fetch-libraries version + SHA256 bump will follow in this PR once tagged).
kaloudis
added a commit
to kaloudis/zeus
that referenced
this pull request
Oct 13, 2026
The Open Channel flow collects a sat/vB rate on every backend, but on LDK Node it was discarded: openChannelSync never forwarded it, and the ldk-node API had no parameter to receive it. Every funding transaction went out at the internal estimator's ChannelFunding rate. The API side is fixed in ZeusLN/ldk-node#6, which adds a trailing optional FeeRate to all six open-channel methods. This change threads the user's rate through every layer on the Zeus side: - backends/LdkNode.ts: openChannelSync sanitizes data.sat_per_vbyte with the sanitizeSatPerVbyte guard and passes it to all three branches (fund-max, coin control, plain) - ldknode/LdkNodeInjection.ts + ldknode/LdkNode.d.ts: optional satPerVbyte, forwarded as -1 sentinel when absent, matching the on-chain send convention - android LdkNodeModule.kt and ios LdkNodeModule.swift/.m: the three bridge methods accept satPerVbyte and map it through the existing parseFeeRate helper, so the sentinel becomes null/nil and ldk-node keeps estimator behavior when no rate applies - vendored bindings (ldk_node.kt, LDKNode.swift): open-channel signatures, FFI declarations, and API checksums ported to match the regenerated output from ZeusLN/ldk-node#6 Requires a native rebuild on both platforms and is gated on the next ZeusLN/ldk-node release (fetch-libraries version + SHA256 bump will follow in this PR once tagged).
We previouly ran into a quiet error that lead to `docs.rs` not rendering our docs properly, which unfortunately didn't surface until after we pushed out a releas (thankfully only an RC in this case). Here, we add a CI job that tests our docs build with exactly the settings `docs.rs` uses. Additionally, the change also has the benefit that we now only build docs once rather than for every combiantion in our workflow matrix, which was a bit overkill.
In rust-lightning#4220 the `check_closed_event` macros was replaced with a method and is now also only re-exported via `fuctional_test_utils`.
Previously, we could in tests potentially run into listening port collisions resulting into `InvalidSocketAddress` errors. These errors could surface if we rolled port numbers that either collided with other concurrent tests *or* with other unrelated services running on localhost. Here, we simply let the OS assign us a free port number when setting up the testing nodes, which avoids such collisions altoghether (mod the potential TOCTOU race here, which we ignore for now).
This simply adopts the changes of rust-lightning#4250.
As we're about to expose more entropy-related things, we here introduce a new module and start moving related types there.
Now that we don't use the `Runtime` in `VssStore` anymore, we can in fact revert to reuse the public interface.
Previously, the `Builder` allowed setting different entropy sources via its `set_entropy...` methods, defaulting to sourcing from an auto-generated seed file in the storage path. While this allowed for really easy setup, it spared the user to actually think about where to store their node secret. Here, we therefore introduce a mandatory `NodeEntropy` object that, as before, allows the user to source entropy from BIP39 Mnemonic, seed bytes, or a seed file. However, it doesn't implement any default and hence intentionally requires manually setup by the user. Moreover, this API refactor also allows to reuse the same object outside of the `Node`'s `Builder` in a future commit.
We add a simple test calling `read_or_generate_seed_file` twice, asserting it returns the same value in both cases.
Previously, `VssStore` was a private object that could only be constructed internally via the `Builder` object. However, some users might want to use `VssStore` independently of/before the `Node` is constructed. To this end, we here expose a new `VssStoreBuilder` that allows to independently construct a `VssStore` instance that then can be handed to `Builder::build_with_store`. For now we keep the previous VSS-related methods on `Builder` around, but have them reuse the `VssStoreBuilder` internally. This also allows us to not change anything related to bindings. For bindings, we still have to explore if/how we can expose `VssStore` in the future.
In the next commit we'll update `rust-lightning` with the `Pin<Box<dyn ...>>` pattern dropped in favor of native async traits (with `impl Future...`). In anticipation of those traits becoming not-object-safe here we drop the dyn indirection that exists in our gossip validation.
In `rust-lightning` we dropped the `Pin<Box<dyn ...>>` in favor of `impl Future`s on most traits to make the traits native-async-ish. Here we update to implement that change here. However, because we avoid generics in ldk-node through concrete dyn indirections, and having implict associated types on `rust-lightning` traits makes them not-object-safe, we have to do a bit of indirection. Instead, we define a `DynStoreTrait` which re-concretizes the `rust-lightning` storage traits, allowing us to use them `dyn`.
…lices LDK gives us the actual funding output so we no longer need to create a dummy one with fake pubkeys
We insert a channel's funding utxo into our wallet so we can later calculate the fees for the transaction, otherwise our wallet would have incomplete information. We do it before the splice as we only really need this information for splices and not for all channels.
Exposes the funding_redeem_script that LDK already exposes
Add LSPS7 client support following the existing LSPS1 pattern: - LSPS7Client struct with pending request tracking - LSPS7Liquidity public wrapper with sync methods - Event handling for ExtendableChannelsReady, OrderCreated, OrderStatus - Three public APIs: get_extendable_channels, create_order, check_order_status - Builder method set_liquidity_source_lsps7() - FFI type re-exports for LSPS7 types Points lightning-* deps at ZeusLN/rust-lightning lsps7-client-handler branch.
Add LSPS7 types (LSPS7OrderResponse, LSPS7ExtendableChannel, LSPS7OriginalOrder, LSPS7OrderState, LSPS7OrderId) to UDL, FFI type converters, and ArcedNodeBuilder for UniFFI support.
The upstream default of 5 seconds is too short for downloading the full RGS snapshot (~3.5 MB) on mobile network connections, resulting in sparse network graphs. Mutiny Wallet uses a 30-second timeout for the same reason.
If the stored RGS timestamp is non-zero but the network graph has fewer than 1000 channels, force a full sync from timestamp 0. This handles cases where the graph failed to persist (e.g., VSS size limits) but the smaller node_metrics (containing the RGS timestamp) was saved successfully.
Exposes a method to clear the network graph and reset the RGS sync timestamp. This forces the next RGS sync to fetch the full snapshot from timestamp 0, repopulating the graph completely.
Adds a sync API on Node that delegates to GossipSource::update_rgs_snapshot(), allowing callers to trigger an immediate RGS snapshot fetch after resetting the network graph. Also adds the UDL binding.
Native file observer for Android (FileObserver) and iOS (GCD DispatchSource) that pushes new log lines as events to React Native for real-time log viewing.
Includes resetNetworkGraph and updateRgsSnapshot in Swift bindings.
Use ditto --norsrc instead of --sequesterRsrc to prevent macOS resource fork metadata from polluting the zip archive.
…estores Two related fixes to the dual-store (VSS + local SQLite) backend: 1. Gate all VSS pushes on a safety check. The background bulk sync ran unconditionally at construction and pushed every local key to VSS with unconditional puts (version -1). If the local store held a fresh node built over an existing backup (e.g. a restore that fell back to an empty local store), the sync overwrote the real channel manager in VSS within seconds. All pushes (bulk sync, writes, removes) now first verify the poison signature is absent: local has no channel monitors (active or archived) while VSS holds at least one. On detection, VSS writes are disabled for the session and a CRITICAL message is logged. If VSS is unreachable during the check, the verdict stays undetermined and the push is skipped; the next push re-checks. 2. Propagate VSS errors during restore instead of masking them. In restore mode, read() collapsed any VSS failure into NotFound and list() into an empty namespace, so a fast-failing VSS error (auth rejection from clock skew, DNS failure) made the node come up fresh with no channels while reporting a successful build. Non-NotFound errors now fail the read/list — and thereby the build — so callers can surface the failure and retry. Also skips the bulk sync entirely in restore mode: local started empty this session, so there is nothing to catch up.
Each HTTP request is already capped at 10s by vss-client's client-level timeout, but the retry policy allowed 100 attempts with up to 180s of cumulative backoff, so a single VSS operation could keep build_with_dual_store blocked for several minutes — long past the mobile caller's watchdog timeout, which then abandons the build in a still-live thread over the shared storage dir. Cap retries at 6 attempts / 30s total delay (worst case roughly one minute per operation) and stop retrying AuthError, which cannot succeed without new credentials.
…ptions Note that the tuning assumes ZEUS's dual-store fixed-header deployment, that the 30s max-total-delay is only a safety cap, and that the AuthError skip is wrong for lnurl-auth deployments where header-provider token fetches can fail transiently.
…D warnings lib.rs imports bitcoin::OutPoint directly (added with the coin control and remote-closed sweep work), which shadows the ffi glob re-export. Under --features uniffi the re-export is unused, and CI's -D warnings build fails on it. Both names refer to the same type.
rustdoc::private_intra_doc_links is denied in lib.rs, so cargo doc (and CI's docs-rs job) fails on these links. Keep the name in code formatting without the link.
c38d28f added a third payment_timeout_secs parameter to Bolt11Payment::send, and 02c62cb updated the Rust integration tests and benches, but the CLN and LND integration tests and the Kotlin and Python binding tests still called the two-argument form, so check-cln, check-lnd, check-kotlin and check-python failed to compile or errored.
Rust 1.99 reports trailing semicolons inside macros used in expression position, which fails CI's -D warnings build on stable. The upstream 0.7.0-rc.1 base fails the same way under 1.99, so this is toolchain drift, not a fork regression. Same approach as upstream b6e37fa, which does not cherry-pick cleanly onto this base.
The crate-level example (compiled as a doctest) and the README still used the two-argument Bolt11Payment::send.
Append the trailing per-call retry-timeout argument (None) at every bolt11/bolt12/spontaneous send call site in tests/ and benches/. These targets stopped compiling when the configurable payment retry timeout parameter was added; with this, cargo check --all-targets is green again. (cherry picked from commit 02c62cb)
CI's format check fails on files changed by fork commits; the upstream base (3ed1d13) is clean under the same rustfmt. Formatting only.
Move the fork off the stale lsps7-for-ldk-node-close-fix branch (a Dec 2025 snapshot of upstream main missing every 0.2.1-0.2.5 fix, including the 0.2.3 'Through the Loupe' and 0.2.5 'MegaScan' security batches) onto ZeusLN/rust-lightning zeus-0.2, which is upstream 0.2 branch head (= v0.2.5) plus the same five Zeus patches: - LSPS7 (Channel Lease Extensions) client handler - cooperative close feerate floor bypass - BOLT11 route hints override (+ tests) Since v0.2.5 predates upstream #4175 (impl-Future trait methods), this also reverts 84bf2a5 ("Update to new upstream rust-lightning with impl Futures") and adapts the pieces written after it: - DualStore's async KVStore impl returns boxed futures again - builder passes Arc-wrapped DualStore to build_with_store - test helpers updated for LDK 0.2.5 test API (check_closed_event is_check_discard_funding arg) and the fork's 3-arg bolt11 send The pre-existing integration-test compile breakage (bolt11 send call sites in tests/ and benches/, present since the retry-timeout param was added) is untouched except where the revert crossed it.
Move the rust-lightning pin from zeus-0.2 (v0.2.5) to ZeusLN/rust-lightning 4e5cba988, which is upstream v0.2.7 plus the same five Zeus patches carried on zeus-0.2 (LSPS7 client, cooperative close feerate floor bypass, BOLT11 route hints override + tests, LSPS5 test config fix). The patch contents are unchanged; only hunk context moved in the rebase. Pin by rev instead of branch so the lockfile can't drift if the branch is rebased. This picks up the 0.2.6 and 0.2.7 security fixes, including: - conflicting commitment signed at the same index after a peer fakes a lost revoke_and_ack on reconnect (#5057) - unbroadcastable commitment accepted on inbound channels (#4976) - LSPS2 intercepted HTLC amount not checked before JIT open (#5042) - Electrum sync amplification via crafted funding tx (#4867) - bogus-HTLC rejection leaving an undeserializable ChannelManager (#4982) No API changes affect ldk-node; cargo check --all-targets is clean.
DualStore spawned one thread per VSS write and remove. VssStore's per-key version check orders same-key writes, but the version is assigned on the spawned thread, so two writes of one key could still swap; the bulk sync read SQLite before taking its version, so it could overwrite a newer live write; and nothing kept the manager behind its monitors. A VSS copy holding a manager ahead of a monitor it treats as persisted cannot be restored: LDK returns DecodeError::DangerousValue. One worker thread now drains a set of dirty keys, reading the current SQLite value at upload time. It reads the manager before taking each batch, uploads monitor keys (full monitors, MonitorUpdatingPersister updates, archived monitors) first, then removes keys deleted locally, and uploads that manager last, only if every monitor key in the batch went through. Monitor-key removes wait for the batch's monitor writes, so an update key is deleted from VSS only once the full monitor that supersedes it is there. Failed keys stay dirty and retry with backoff (1 s to 60 s). The push safety gate moves into the worker: Disabled drops the batch, Undetermined keeps the keys dirty. The startup bulk sync marks every local key dirty on the same worker (still skipped in restore mode). Dropping the store waits up to 5 s for pending uploads. Fixes #10.
…t read The worker read the manager, then took the dirty set and dropped the manager's mark with it, so a manager write between the two was never uploaded (found in review of ZeusLN/zeus-vls#273, which this ports). The worker now clears the manager's mark before reading it and leaves any later mark in place. If the push verdict is undetermined, the consumed mark is put back. Two regression tests: a manager write paused between the snapshot read and the batch reaches VSS by shutdown (fails before this change with v1 on VSS), and the manager mark survives an undetermined verdict.
All six open-channel entry points (open_channel, open_announced_channel, the _with_utxos and _fund_max variants) gain a trailing optional FeeRate parameter. When set, the rate is stashed in a pending_funding_fee_rates map keyed by user_channel_id, mirroring the existing pending_funding_utxos mechanism, and consumed in the FundingGenerationReady handler, where it overrides the fee estimator's ConfirmationTarget::ChannelFunding rate for the funding transaction. When unset, behavior is unchanged. For the fund_max variants the override also feeds estimate_max_funding_amount, so the maximum channel amount is computed at the rate the funding transaction will actually pay, instead of an estimator rate that could make the resulting funding attempt too large or needlessly small. ChannelClosed now also clears all three pending funding maps (UTXOs, fund_max flags, fee rates), so state stashed for a channel that is rejected or otherwise dies before funding no longer leaks.
kaloudis
force-pushed
the
feat/channel-open-fee-rate
branch
from
October 27, 2026 06:16
748fc5d to
1638cb7
Compare
kaloudis
added a commit
to kaloudis/zeus
that referenced
this pull request
Nov 5, 2026
The Open Channel flow collects a sat/vB rate on every backend, but on LDK Node it was discarded: openChannelSync never forwarded it, and the ldk-node API had no parameter to receive it. Every funding transaction went out at the internal estimator's ChannelFunding rate. The API side is fixed in ZeusLN/ldk-node#6, which adds a trailing optional FeeRate to all six open-channel methods. This change threads the user's rate through every layer on the Zeus side: - backends/LdkNode.ts: openChannelSync converts data.sat_per_vbyte with satPerVbyteToSatPerKwu and passes it to all three branches (fund-max, coin control, plain) - ldknode/LdkNodeInjection.ts + ldknode/LdkNode.d.ts: optional satPerKwu, forwarded as -1 sentinel when absent, matching the on-chain send convention - android LdkNodeModule.kt and ios LdkNodeModule.swift/.m: the three bridge methods accept satPerKwu and map it through the existing parseFeeRate helper, so the sentinel becomes null/nil and ldk-node keeps estimator behavior when no rate applies - vendored bindings (ldk_node.kt, LDKNode.swift): open-channel signatures, FFI declarations, and API checksums ported to match the regenerated output from ZeusLN/ldk-node#6 Requires a native rebuild on both platforms and is gated on the next ZeusLN/ldk-node release (fetch-libraries version + SHA256 bump will follow in this PR once tagged).
kaloudis
added a commit
to kaloudis/zeus
that referenced
this pull request
Nov 6, 2026
The Open Channel flow collects a sat/vB rate on every backend, but on LDK Node it was discarded: openChannelSync never forwarded it, and the ldk-node API had no parameter to receive it. Every funding transaction went out at the internal estimator's ChannelFunding rate. The API side is fixed in ZeusLN/ldk-node#6, which adds a trailing optional FeeRate to all six open-channel methods. This change threads the user's rate through every layer on the Zeus side: - backends/LdkNode.ts: openChannelSync converts data.sat_per_vbyte with satPerVbyteToSatPerKwu and passes it to all three branches (fund-max, coin control, plain) - ldknode/LdkNodeInjection.ts + ldknode/LdkNode.d.ts: optional satPerKwu, forwarded as -1 sentinel when absent, matching the on-chain send convention - android LdkNodeModule.kt and ios LdkNodeModule.swift/.m: the three bridge methods accept satPerKwu and map it through the existing parseFeeRate helper, so the sentinel becomes null/nil and ldk-node keeps estimator behavior when no rate applies - vendored bindings (ldk_node.kt, LDKNode.swift): open-channel signatures, FFI declarations, and API checksums ported to match the regenerated output from ZeusLN/ldk-node#6 Requires a native rebuild on both platforms and is gated on the next ZeusLN/ldk-node release (fetch-libraries version + SHA256 bump will follow in this PR once tagged).
kaloudis
added a commit
to kaloudis/zeus
that referenced
this pull request
Nov 16, 2026
The Open Channel flow collects a sat/vB rate on every backend, but on LDK Node it was discarded: openChannelSync never forwarded it, and the ldk-node API had no parameter to receive it. Every funding transaction went out at the internal estimator's ChannelFunding rate. The API side is fixed in ZeusLN/ldk-node#6, which adds a trailing optional FeeRate to all six open-channel methods. This change threads the user's rate through every layer on the Zeus side: - backends/LdkNode.ts: openChannelSync converts data.sat_per_vbyte with satPerVbyteToSatPerKwu and passes it to all three branches (fund-max, coin control, plain) - ldknode/LdkNodeInjection.ts + ldknode/LdkNode.d.ts: optional satPerKwu, forwarded as -1 sentinel when absent, matching the on-chain send convention - android LdkNodeModule.kt and ios LdkNodeModule.swift/.m: the three bridge methods accept satPerKwu and map it through the existing parseFeeRate helper, so the sentinel becomes null/nil and ldk-node keeps estimator behavior when no rate applies - vendored bindings (ldk_node.kt, LDKNode.swift): open-channel signatures, FFI declarations, and API checksums ported to match the regenerated output from ZeusLN/ldk-node#6 Requires a native rebuild on both platforms and is gated on the next ZeusLN/ldk-node release (fetch-libraries version + SHA256 bump will follow in this PR once tagged).
kaloudis
added a commit
to kaloudis/zeus
that referenced
this pull request
Nov 17, 2026
The Open Channel flow collects a sat/vB rate on every backend, but on LDK Node it was discarded: openChannelSync never forwarded it, and the ldk-node API had no parameter to receive it. Every funding transaction went out at the internal estimator's ChannelFunding rate. The API side is fixed in ZeusLN/ldk-node#6, which adds a trailing optional FeeRate to all six open-channel methods. This change threads the user's rate through every layer on the Zeus side: - backends/LdkNode.ts: openChannelSync converts data.sat_per_vbyte with satPerVbyteToSatPerKwu and passes it to all three branches (fund-max, coin control, plain) - ldknode/LdkNodeInjection.ts + ldknode/LdkNode.d.ts: optional satPerKwu, forwarded as -1 sentinel when absent, matching the on-chain send convention - android LdkNodeModule.kt and ios LdkNodeModule.swift/.m: the three bridge methods accept satPerKwu and map it through the existing parseFeeRate helper, so the sentinel becomes null/nil and ldk-node keeps estimator behavior when no rate applies - vendored bindings (ldk_node.kt, LDKNode.swift): open-channel signatures, FFI declarations, and API checksums ported to match the regenerated output from ZeusLN/ldk-node#6 Requires a native rebuild on both platforms and is gated on the next ZeusLN/ldk-node release (fetch-libraries version + SHA256 bump will follow in this PR once tagged).
kaloudis
added a commit
to kaloudis/zeus
that referenced
this pull request
Dec 2, 2026
The Open Channel flow collects a sat/vB rate on every backend, but on LDK Node it was discarded: openChannelSync never forwarded it, and the ldk-node API had no parameter to receive it. Every funding transaction went out at the internal estimator's ChannelFunding rate. The API side is fixed in ZeusLN/ldk-node#6, which adds a trailing optional FeeRate to all six open-channel methods. This change threads the user's rate through every layer on the Zeus side: - backends/LdkNode.ts: openChannelSync converts data.sat_per_vbyte with satPerVbyteToSatPerKwu and passes it to all three branches (fund-max, coin control, plain) - ldknode/LdkNodeInjection.ts + ldknode/LdkNode.d.ts: optional satPerKwu, forwarded as -1 sentinel when absent, matching the on-chain send convention - android LdkNodeModule.kt and ios LdkNodeModule.swift/.m: the three bridge methods accept satPerKwu and map it through the existing parseFeeRate helper, so the sentinel becomes null/nil and ldk-node keeps estimator behavior when no rate applies - vendored bindings (ldk_node.kt, LDKNode.swift): open-channel signatures, FFI declarations, and API checksums ported to match the regenerated output from ZeusLN/ldk-node#6 Requires a native rebuild on both platforms and is gated on the next ZeusLN/ldk-node release (fetch-libraries version + SHA256 bump will follow in this PR once tagged).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Zeus collects a sat/vB fee rate in its Open Channel flow, but on the LDK Node backend there is nowhere to send it: none of the open-channel APIs accept a fee rate, so every funding transaction goes out at whatever the internal estimator picks for
ConfirmationTarget::ChannelFunding. This is the channel-open counterpart of the on-chain-send gap fixed by ZeusLN/zeus#4354, except here the parameter had to be added to the API itself.All six open-channel entry points (
open_channel,open_announced_channel, the_with_utxosand_fund_maxvariants) gain a trailingFeeRate?parameter, threaded exactly like the existingpending_funding_utxosmechanism:open_channel_innerstashes the rate in a newpending_funding_fee_rates: HashMap<u128, FeeRate>keyed byuser_channel_idoncecreate_channelsucceedsFundingGenerationReadyhandler removes it and passes it toWallet::create_funding_transaction, which now takesOption<FeeRate>and falls back to the estimator whenNone(same pattern assend_to_address)Two deliberate extras:
estimate_max_funding_amountalso takes the override; without this, the max amount would be computed at the estimator's rate, so a user-specified higher rate would produce a funding transaction that no longer fits (or a lower rate would undershoot capacity).ChannelClosednow clears all three pending maps (UTXOs, fund_max flags, fee rates). Previously, state stashed for a channel that was rejected by the peer or died before funding leaked forever; the new map would have inherited the same leak, and worse, a stale entry could apply an old fee rate to a later channel if the 128-bituser_channel_idever collided.Validation
cargo checkandcargo check --features uniffipasscargo test --lib: 23 passedfeeRate: FeeRate?appears on all six methods)cargo check --testshas 28 pre-existing errors onzeusfrom earlier arity changes (fixed on therl-0.2.5-security-bumpline by 02c62cb, not yet onzeus); this PR introduces no new ones, and its own test-call-site updates are includedNotes
backends/LdkNode.ts), which is blocked on the next release tag from this repo.