feat: persist restored channel peers#82
Conversation
There was a problem hiding this comment.
💡 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".
There was a problem hiding this comment.
💡 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".
There was a problem hiding this comment.
💡 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".
There was a problem hiding this comment.
💡 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".
There was a problem hiding this comment.
💡 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".
ben-kaufman
left a comment
There was a problem hiding this comment.
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.
Summary
0.7.0-rc.42and 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 fmtcargo test peer_store --lib./bindgen.shshasum -a 256 bindings/swift/LDKNodeFFI.xcframework.zipmatchesPackage.swift(c2f1d677ae85fe7b1c06670994088abe51a020197a5f2e2b5cd8718856dd624c)git diff --checka7b1d60Note One reviewer approval is enough, PR can be merged then.
Release