Implement inbound and reconnect protections#1200
Merged
quake merged 15 commits intonervosnetwork:developfrom Mar 23, 2026
Merged
Implement inbound and reconnect protections#1200quake merged 15 commits intonervosnetwork:developfrom
quake merged 15 commits intonervosnetwork:developfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR tightens Fiber node admission/control logic around inbound peers and inbound channel-open requests, and adjusts channel reestablish handling to avoid delayed ChannelReady notifications while bounding deferred peer TLC replays.
Changes:
- Enforce inbound no-channel peer budget by evicting the oldest no-channel inbound peers (including immediate enforcement on connect) and add tests for the behavior.
- Add per-peer throttling for “to-be-accepted” inbound channels and expand tests around per-peer behavior.
- Improve reestablish flow to emit
ChannelReadypromptly (or defer it until the missing ACK arrives), and bound deferred peer TLC update queue length by channel constraints.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| crates/fiber-lib/src/fiber/network.rs | Implement inbound no-channel peer eviction ordering + immediate enforcement; add per-peer pending inbound channel throttling. |
| crates/fiber-lib/src/fiber/channel.rs | Add runtime flag for pending reestablish ChannelReady, remove fixed delay, and bound deferred peer TLC updates. |
| crates/fiber-lib/src/fiber/config.rs | Update CLI/docs wording for inbound peer budget and pending inbound channel limits. |
| crates/fiber-lib/src/fiber/tests/network.rs | Add tests for inbound peer budget eviction and per-peer pending inbound channel acceptance. |
| crates/fiber-lib/src/fiber/tests/channel.rs | Add tests for reestablish ChannelReady timing, nonce restoration, deferred TLC replay bounds, and missing revoke+ack gating. |
| crates/fiber-lib/src/fiber/tests/settle_tlc_set_command_tests.rs | Update ChannelActorState test helper to include the new runtime field. |
| crates/fiber-lib/src/store/sample/sample_channel.rs | Update sample ChannelActorState constructors for the new runtime field. |
| crates/fiber-lib/src/store/tests/store.rs | Update store serialization tests to account for the new runtime field. |
Member
one remote peer can only open one connection, it's guarded by tentacle |
Collaborator
Author
Fixed. |
quake
reviewed
Mar 23, 2026
quake
approved these changes
Mar 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Threat Model
resources.
causing correctness risks during replay/retransmission.
while sync is still in progress.
What we are defending
What we are not trying to solve in this series