Skip to content

channel: keep actors alive across disconnects#1217

Open
jjyr wants to merge 60 commits intonervosnetwork:developfrom
jjyr:refactor/channel-actor-stop-start
Open

channel: keep actors alive across disconnects#1217
jjyr wants to merge 60 commits intonervosnetwork:developfrom
jjyr:refactor/channel-actor-stop-start

Conversation

@jjyr
Copy link
Copy Markdown
Collaborator

@jjyr jjyr commented Mar 18, 2026

Purpose

The Network actor is becoming single point of the system.

This PR keeps the channel actor alive even peer is disconnected, so we can offload channel's bussiness logic from network actor to channel actors.

Summary

  • Keep channel actors alive across peer disconnects instead of stopping and recreating them.
  • Introduce explicit channel connectivity handling (Offline -> Syncing -> Online) and let the channel actor drive reestablish on reconnect.
  • Add official ChannelOnline / ChannelOffline service events so reconnect tests can wait on channel connectivity instead of actor recreation or fixed sleeps.
  • Offload channel tlcs timeout check from network actor to channel actors.

Secondary changes

  • Rework reconnect bookkeeping around Pubkey so requested disconnects and backoff reconnects stay aligned with long-lived actors.
  • Preserve retryable remove-TLC preimages during reestablish and avoid settling forwarding TLCs that are still waiting on downstream results.

@jjyr jjyr force-pushed the refactor/channel-actor-stop-start branch from 29ecc54 to b5e8232 Compare March 18, 2026 17:59
@jjyr jjyr marked this pull request as ready for review March 19, 2026 14:49
@jjyr jjyr requested review from chenyukang, doitian and quake March 19, 2026 14:49
@jjyr jjyr requested a review from quake April 1, 2026 06:33
@jjyr jjyr force-pushed the refactor/channel-actor-stop-start branch from 08131a3 to 04bf90b Compare April 7, 2026 07:28
@jjyr jjyr force-pushed the refactor/channel-actor-stop-start branch from 04bf90b to 38e9417 Compare April 7, 2026 07:32
@quake quake requested a review from Copilot April 8, 2026 12:29
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 23 out of 23 changed files in this pull request and generated 5 comments.

Comment thread crates/fiber-types/src/channel.rs
Comment thread crates/fiber-lib/src/fiber/channel.rs
Comment thread crates/fiber-lib/src/fiber/network.rs Outdated
Comment thread crates/fiber-lib/src/fiber/tests/payment.rs
Comment thread crates/fiber-lib/src/fiber/tests/channel.rs
Comment thread crates/fiber-lib/src/fiber/channel.rs
@jjyr jjyr requested a review from chenyukang April 14, 2026 10:04
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.

4 participants