Skip to content

setchannel: allow upgrading private channels to public#8982

Open
vincenzopalazzo wants to merge 1 commit intoElementsProject:masterfrom
vincenzopalazzo:claude/vigilant-sammet
Open

setchannel: allow upgrading private channels to public#8982
vincenzopalazzo wants to merge 1 commit intoElementsProject:masterfrom
vincenzopalazzo:claude/vigilant-sammet

Conversation

@vincenzopalazzo
Copy link
Copy Markdown
Collaborator

@vincenzopalazzo vincenzopalazzo commented Mar 25, 2026

Summary

  • Add announce parameter to setchannel RPC to upgrade private channels to public
  • When both peers set announce=true, the channel enters the public announcement flow (exchange announcement_signatures, wait for 6 confirmations, broadcast channel_announcement)
  • Announcement signatures received while a channel is private are now stashed instead of rejected, enabling seamless upgrade when the peer upgrades first

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=false is rejected since public-to-private conversion is not possible.

Fixes #7438

Test plan

  • CI passes (build + unit tests)
  • Manual test: open private channel, call setchannel <id> announce=true on both sides, verify channel gets announced
  • Verify setchannel with announce=false returns error
  • Verify announcement_signatures from peer are stashed when channel is private

@vincenzopalazzo vincenzopalazzo force-pushed the claude/vigilant-sammet branch from 543a15f to 78c96c9 Compare March 25, 2026 13:44
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
@vincenzopalazzo vincenzopalazzo force-pushed the claude/vigilant-sammet branch from 78c96c9 to bdbb292 Compare March 25, 2026 13:52
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.

Update an existing private channel into a public channel

1 participant