setchannel: allow upgrading private channels to public - #9428
Open
vincenzopalazzo wants to merge 2 commits into
Open
setchannel: allow upgrading private channels to public#9428vincenzopalazzo wants to merge 2 commits into
vincenzopalazzo wants to merge 2 commits into
Conversation
4 tasks
Collaborator
Author
|
Hi @daywalker90 👋 — replacing #9405 (same commits; the old PR was auto-closed for fork-visibility reasons). Adds |
3 tasks
vincenzopalazzo
added a commit
to vincenzopalazzo/lightning
that referenced
this pull request
Aug 17, 2026
Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
Add an `announce` parameter to the `setchannel` RPC command that allows upgrading an existing private (unannounced) channel to a public (announced) channel. When set to true, the channel_flags are updated to set the CHANNEL_FLAGS_ANNOUNCE_CHANNEL bit, and the gossip state machine transitions from the private states into the public announcement flow. Both peers must independently set announce=true for the channel announcement to complete, as the protocol requires announcement signatures from both sides. To facilitate this, announcement_signatures received while a channel is still private are now stashed rather than rejected, so they are available immediately if/when the local side upgrades. State transitions added: - CGOSSIP_PRIVATE -> CGOSSIP_WAITING_FOR_MATCHING_PEER_SIGS - CGOSSIP_PRIVATE -> CGOSSIP_WAITING_FOR_ANNOUNCE_DEPTH - CGOSSIP_PRIVATE -> CGOSSIP_ANNOUNCED Setting announce=false (public to private) is rejected as this is not possible once a channel has been announced. Changelog-Added: `setchannel` now accepts an `announce` parameter to upgrade private channels to public. Fixes ElementsProject#7438
Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
vincenzopalazzo
force-pushed
the
claude/vigilant-sammet
branch
from
August 17, 2026 11:35
03c45fc to
7d3fc9b
Compare
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.
Summary
announceparameter tosetchannelRPC to upgrade private channels to publicannounce=true, the channel enters the public announcement flow (exchange announcement_signatures, wait for 6 confirmations, broadcast channel_announcement)Details
The channel gossip state machine gains three new transitions from
CGOSSIP_PRIVATE:CGOSSIP_PRIVATE->CGOSSIP_WAITING_FOR_MATCHING_PEER_SIGS(normal case)CGOSSIP_PRIVATE->CGOSSIP_WAITING_FOR_ANNOUNCE_DEPTH(peer sigs already received)CGOSSIP_PRIVATE->CGOSSIP_ANNOUNCED(peer sigs received + 6 confirms already reached)Setting
announce=falseis rejected since public-to-private conversion is not possible.Fixes #7438
Test plan
setchannel <id> announce=trueon both sides, verify channel gets announcedsetchannelwithannounce=falsereturns error