Skip to content

feat: persist restored channel peers#82

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

feat: persist restored channel peers#82
ovitrif wants to merge 9 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.
  • Retry restored peer persistence after Rapid Gossip Sync populates the graph, so RGS restores do not stay offline after an empty initial graph pass.
  • Preserve explicit peer removal during RGS recovery: manual disconnects and last-channel closes suppress automatic RGS peer re-persistence during the current node instance, including races with an in-flight RGS recovery pass.
  • Bump to 0.7.0-rc.42 and rebuild native binding artifacts.

Why

After a wallet restore, channel state can come back without the persisted peer entry. For announced counterparties, the network graph can recover the node address and let the reconnect loop bring the channel back online automatically. When using RGS with no cached graph, that graph data may arrive only after startup, so peer recovery now retries after successful RGS updates.

The RGS retry also needs to respect user-initiated peer removal. Manual disconnects and last-channel closes now exclude that peer from automatic recovery for the current node instance, including the race where RGS recovery is already in flight.

Validation

  • cargo fmt
  • cargo test peer_store --lib
  • ./bindgen.sh
  • shasum -a 256 bindings/swift/LDKNodeFFI.xcframework.zip matches Package.swift (c2f1d677ae85fe7b1c06670994088abe51a020197a5f2e2b5cd8718856dd624c)
  • git diff --check
  • GitHub review thread readback: all review threads resolved after final commit a7b1d60

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

Release

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 Outdated
@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
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: 5ec7acc2a7

ℹ️ 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/lib.rs Outdated
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: 627db07d18

ℹ️ 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/lib.rs
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: 40d149fced

ℹ️ 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/lib.rs Outdated
Comment thread src/peer_store.rs
Comment thread src/lib.rs Outdated
Copy link
Copy Markdown

@ben-kaufman ben-kaufman left a comment

Choose a reason for hiding this comment

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

The helper tests cover persist_missing_channel_peers_excluding, but the behavior this PR is trying to protect depends on the Node methods mutating the RGS recovery exclusion set correctly.

Given the existing test shape in this repo, I don’t think this needs a full RGS end-to-end test. A focused unit test around a small extracted exclusion-state helper would be enough: cover that disconnect() / last-channel close_channel_internal() exclude the peer, and that connect(..., persist = true) / open_channel() clear the exclusion again. That would give us coverage for the real state transitions without adding a complex RGS integration scenario.

Comment thread src/peer_store.rs
Comment thread CHANGELOG.md Outdated
Comment thread src/lib.rs
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.

2 participants