Skip to content

feat: persist restored channel peers#82

Open
ovitrif wants to merge 3 commits into
mainfrom
fix/persist-peers-connected-by-counterparty
Open

feat: persist restored channel peers#82
ovitrif wants to merge 3 commits into
mainfrom
fix/persist-peers-connected-by-counterparty

Conversation

@ovitrif
Copy link
Copy Markdown
Collaborator

@ovitrif ovitrif commented May 17, 2026

Summary

  • Persist missing announced channel counterparties from the network graph during node startup when channel state exists but the peer store entry is missing.
  • Reuse the same peer recovery helper for inbound ChannelPending handling.
  • Bump to 0.7.0-rc.40 and rebuild Kotlin/Swift bindings.

Why

After a wallet restore, channel state can come back without the persisted peer entry. For announced counterparties, the network graph already has the node address, so ldk-node can recover the peer store entry and let the reconnect loop bring the channel back online automatically.

Release

Validation

  • cargo test peer_store --lib
  • COPYFILE_DISABLE=1 cargo fmt --check
  • COPYFILE_DISABLE=1 cargo test --lib
  • COPYFILE_DISABLE=1 cargo clippy --lib (passes with existing warnings)
  • COPYFILE_DISABLE=1 ./bindgen.sh
  • COPYFILE_DISABLE=1 ./scripts/format_kotlin.sh
  • git diff --check

Note One reviewer's approval is enough, PR can be merged then.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 40e2d1840d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread Cargo.toml
@ovitrif ovitrif changed the title Persist restored channel peers feat: persist restored channel peers May 17, 2026
@ovitrif ovitrif self-assigned this May 17, 2026
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4d6290c8da

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/builder.rs
Comment on lines +2350 to +2355
persist_missing_channel_peers(
channel_manager.list_channels().into_iter().map(|channel| channel.counterparty.node_id),
&network_graph,
&peer_store,
Arc::clone(&logger),
);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Retry peer recovery after RGS populates the graph

When a restored node uses Rapid Gossip Sync and has no local/VSS graph cache yet, this startup-only recovery runs before Node::start launches the background RGS fetch (src/lib.rs:272-291), so persist_missing_channel_peers sees an empty graph and skips every missing channel counterparty. After RGS later adds the announced addresses, nothing calls the recovery helper again, and the reconnect loop only iterates peer_store.list_peers(), leaving those restored channels offline until the user manually connects.

Useful? React with 👍 / 👎.

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