Repository navigation
refactor(minvmd): move the drop limiter core into its own module - #2349
Merged
norrietaylor merged 1 commit intoOct 20, 2026
Merged
Conversation
dns_pins and egress_gate formed a non-test import cycle: the pins imported DropLimiter from egress_gate, and the gate's refusal lines reached back through dns_pins. Move the limiter's generic core -- the warn cadence constants, the DropKey and WarnDecision enums, and the DropLimiter struct with its window bookkeeping and the DNS refusal emitter -- into a new net::drop_limiter module, verbatim, raising visibility only as far as the net subtree needs. Both modules now import the limiter without importing each other; only cfg(test) test-support references remain between them. No behavior changes; every existing test passes unchanged. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
bryan-minimal
approved these changes
Oct 19, 2026
Member
There was a problem hiding this comment.
A verbatim move: constants, DropKey, WarnDecision and DropLimiter with decide/should_warn_*/warn_dns_refusal land in net::drop_limiter unchanged, the gate keeps its own emit arms in an impl block of its own, and dns_pins/egress_gate no longer import each other outside cfg(test). The three pre-existing minvmd test failures are the known answerer-subscriber races. Approving.
norrietaylor
deleted the
inbox-patch/drop-limiter-core-3af259cc6d866fc3
branch
October 20, 2026 04:25
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.
Routing-Key: inbox-route/I_kwDOSUhdos8AAAABYJPq9w
The daemon's drop limiter lived in
net::egress_gatewhile the DNSpins imported it, and the gate's refusal paths reached back through
net::dns_pins— a non-test import cycle between the two modules.The limiter's core is shared policy machinery, not gate logic, so it
now lives in its own
net::drop_limitermodule: the warn-cadenceconstants, the
DropKeyandWarnDecisionenums, andDropLimiterwith its window bookkeeping and the DNS refusal emitter, moved
verbatim with only the visibility raises the
netsubtree needs.dns_pinsandegress_gateeach import the limiter now withoutimporting each other; the only remaining references between them are
cfg(test)test-support calls. No behavior changes.Verification
cargo fmt --all --check— cleancargo clippy --workspace --all-targets --locked -- -D warnings— cleancargo test --locked -p minvmd— 575 passed, 3 failedmain(verified by re-runningon the stashed clean tree: the same 2 answerer global-subscriber
races and 1 sock path assertion fail identically without this
change; none touch the modules moved here)
dns_pins/egress_gate/drop_limitertests passgrep egress_gate crates/minvmd/src/net/dns_pins.rs— onlycfg(test)test_support::capture_log()lines remaingrep 'dns_pins\|egress_gate' crates/minvmd/src/net/drop_limiter.rs— no imports of either module
Summary by CodeRabbit