Skip to content

Add channel splicing, private labels and channel status improvements - #184

Open
BitcoinMechanic wants to merge 2 commits into
ElementsProject:mainfrom
BitcoinMechanic:feat/channel-management
Open

BitcoinMechanic wants to merge 2 commits into
ElementsProject:mainfrom
BitcoinMechanic:feat/channel-management

Conversation

@BitcoinMechanic

Copy link
Copy Markdown

Adds splice-in/out to channel details using existing CLN RPCs, with an explicit review and confirmation step. It also brings the related channel-management improvements: private labels, pending-splice status, correctly scaled liquidity bars, wrapping long names/IDs and usable counterparty connection URIs.

Splicing

  • Require a connected, normal channel without pending funding and peer splice feature 62/63 before calling the mutation. Accept only a channel ID and positive whole-satoshi amount; fee overrides and arbitrary scripts are not exposed. CLN chooses the fee using its normal checks.
  • Persist the pending submission before sending it. Double clicks, remounts and lost replies do not automatically submit another splice. Unreadable storage blocks new submission; write failures before submission prevent the RPC; result/dismissal storage failures stay visible.
  • Display pending capacity changes and confirmations from listpeerchannels, a transaction-ID-filtered SQL query and current getinfo height. Missing SQL support/permission produces an explicit unavailable/error state rather than a guessed count. Do not invent the counterparty's required confirmation threshold.
  • The current gRPC schema has no splicein/spliceout methods. Explain that limitation in the UI and reject the operation before any node RPC; REST and Commando use the existing commands.

Related UI changes

  • Private channel labels are stored under cln-application/channel-labels/<channel_id> in the node datastore. Only existing channels and labels up to 80 characters without control characters are accepted. Label lookup failure preserves the channel list and displays the error. Map JSON-RPC datastore mode names to the gRPC enum for label writes.
  • Normalize local/remote liquidity to percentages. Previously passing sat amounts to ProgressBar could overflow its container. Wrap long channel labels and IDs.
  • Show counterparty node IDs and advertised IPv4/IPv6/Tor/DNS URIs, with copy controls. Node Info no longer creates a connection URI from wildcard/loopback listening bindings; show the node ID when no advertised address exists.
  • Refresh selected channel details from current Redux channel data, and document the behavior and transport/permission requirements.

No CLN engine changes, XBT branding, fork-specific invoice validation, price-provider changes or StartOS-specific address-file integration are included. Existing offers and invoice RPCs remain available.

Validation

  • Backend compile and all 20 backend tests pass. New tests cover validation, disconnected/pending/unsupported peers, pre-mutation gRPC rejection, datastore namespace/channel checks, graceful label-read failure and gRPC enum mapping.
  • 23 focused frontend tests pass across splice submission/recovery/storage behavior, labels, channel status, liquidity display and node information.
  • Production frontend build and final frontend TypeScript check pass. ESLint passes for the changed backend files and new UI implementation/helper files.
  • Full frontend suite run: 271 passed, 2 failed. Both failures reproduce on untouched ff2d698 in ChannelOpen.test.tsx and BTCWithdraw.test.tsx, each named “should hide custom fee rate input and show slider when checkbox is unchecked again” (baseline isolated run: 42 passed, 2 failed). The full run also retained an asynchronous handle after its summary. These existing tests are not changed here. The final storage-dismissal guard adds one further passing focused test after that full run.
  • The original UI flow was exercised on a forked CLN deployment before this upstream adaptation. This PR's new checks use mocked RPC responses; a fresh end-to-end splice on stock CLN has not been performed as part of this port. No funded node was changed while preparing it.

Review and confirm splice-in/out through existing CLN RPCs, retain ambiguous submissions across remounts, and derive pending confirmation counts from node state. Validate channel and peer readiness before mutation; explain the gRPC schema limitation. Keep channel lists available when label permissions are missing, map datastore modes for gRPC, normalize liquidity bars and show usable advertised peer URIs.
@BitcoinMechanic

Copy link
Copy Markdown
Author

Disclosure of AI use: openAI's Astra wrote all this and created the PR under my supervision.

Tested with real funds and works great.

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.

1 participant