Repository navigation
fix(relay): key the message limiter by the frame type (#1301) - #1381
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the
|
🦋 Changeset detectedLatest commit: c6969d3 The changes in this PR will be included in the next version bump. This PR includes changesets to release 0 packagesWhen changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Confidence Score: 5/5
[Medium impact] The PR appears safe to merge.
|
|
@coderabbitai configuration |
|
Configuration used: Auto · no configuration file from this repository applied; Layers: Organization UI Directory configuration: Directory documents have not been loaded for this command. They are resolved separately during a review. Empty YAML lists do not mean the directory has no instructions or checks. CodeRabbit configuration
|
Closes in spirit the review finding F8 of
docs/rewrite/reviews/2026-11-30-relay-storage.md(issue #1301); this PR does not close the issue — it is closed by hand with the merge sha, sinceClosesis inert againstrewrite/main.What
The message limiter keyed one bucket per address and lost the message type, so an EVENT burst spent the REQ budget. It now derives the capture's closed set from the raw frame prefix and keys
{address}:message:{CLASS}:{period_ms}:MessageClass+from_frameinlimits.rs— first 32 bytes rounded down to a char boundary, the capture's[A-Za-z-]{1,8}quoted word, ASCII upper-case,Otherfallback.message_backoff(&self, address, class); the class is derived atrelay.rsfrom the rawtext, beforemessages::decode.NEG-CLOSEis in the capture's set but its nine characters exceed the capture's own eight-character bound, so the frame falls toOther— parity with the capture, proved by a test, not a silent divergence.1 key / 65,536 addressesto1 to 8 / 8,192–65,536.Evidence
socket oraclean_event_burst_leaves_the_req_window_intact: passes at head, and at the base commit fails withCLOSED s1where it expectsEOSE s1` (an EVENT burst spends the REQ window today).cargo test -p nostream-relay --all-targets,cargo fmt --all --check,cargo clippy -p nostream-relay --all-targets --all-features -- -D warningsall green.Noticed, not this PR
crates/nostream-relay/tests/transport.rs:507(a_client_that_answers_every_ping_survives) is a 20 ms liveness test that failed 5/5 on an untouched base copy while sibling builds ran. Filed separately.