Repository navigation
fix(swarm,node): resolve pending offer slot leak, backoff accounting, glare finger rebind, and session key renewal (#1222, #1223) - #1237
Merged
Conversation
Member
Author
|
Reviewed at
Local validation: Limits: no local browser-runtime execution or retained-key performance benchmark. The overlapping registry changes in #1248 were not jointly tested with this PR. |
This was referenced Nov 10, 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.
Summary
Closes #1222 and #1223.
Issue #1222
send_connection_offer/Swarm::offer_connectionpending slot leak:sender.originate(...)andself.mark_offer_sent(...)errors throughSwarmTransport::classify_step_failureso any failure whileattemptstill owns the unadmitted slot immediately abandons the pending slot and closes the raw WebRTC connection.was_offering: boolonRetiredPendingConnectionandExpiredUnadmittedPeerat the atomic moment thePendingrecord is removed under the lifecycle lock.record_candidate_dial_failureonly when a retired/expired attempt owned an outboundHandshake::Offeringslot, and exempts local capacity refusals (PendingConnectionCapacityExceeded,ConnectionCapacityExceeded) from peer backoff penalties.yield_pending_in):SwarmTransport::rebind_pending_finger_updates(from, to)and updatesyield_pending_into rebind any queued finger convergence proof from the yielding outboundofferingattempt to the replacing inboundansweringattempt instead of cancelling the active finger lookup.Issue #1223
decryption_keys_at(&self, now_ms: u128) -> Vec<DelegateeKey>onextension::ext::registry::{Core, Scope}backed bySessionKeyRing::decryption_keys_at.OnionCircuitShell::hop,circuit::hop::hop,Charged::peel,OnionCell::peel, andpeel_in_placeto acceptkeys: &[DelegateeKey]and trycurrentfollowed by retained unexpired pre-renewal keys when verifying the per-hop Sphinx HMAC.DelegationLessee::encodewithin_margincheck todelegations.hop:within_margin(delegations.hop.expires_at_ms(), now_ms)only ondelegations.hop, allowingdelegations.originas long asexpires_at_ms() > now_msand falling back toDelegationRef::inline(delegation)inside the finalLEASE_MARGIN_MS.SwarmTransport::set_delegatee_keyand serialize renewal undersession_keyswrite lock.Test Plan
cargo test -p rings-core --features dummy --lib swarm::session_linkcargo test -p rings-core --features dummy --lib swarm::transport::tests::test_fingercargo test -p rings-core --features dummy --lib swarm::transport::tests::test_lifecyclecargo test -p rings-node --lib onion::cargo test -p rings-node --lib horizon