8000 fix(minvmd): a relay's end names the rows it marked by their own numbers by bryan-minimal · Pull Request #3918 · gominimal/minimal · GitHub
[go: up one dir, main page]

Skip to content

fix(minvmd): a relay's end names the rows it marked by their own numbers - #3918

Merged
bryan-minimal merged 3 commits into
mainfrom
net/host-gate-followup
Dec 3, 2026
Merged

bryan-minimal merged 3 commits into
mainfrom
net/host-gate-followup

Conversation

@bryan-minimal
@bryan-minimal bryan-minimal commented Dec 1, 2026 •
Copy link
Copy Markdown
Member

What

Two changes after the last review round on #3869, which arrived as it merged.

  1. A relay's end names the rows it marked by their own numbers (two commits: the change, and four of the gate's tests that read a report's entries). A relay's withdrawal report named a row by its address and box id. A box keeps its id across a stop and a resume, so a relay that ended after its box was resumed under another relay named the reinstated row. Its end then emptied that row's DNS tables and took the other relay's carrier from it, and the row was withdrawn at the grace's end while in use. The report now also carries the row's number (BoxRecord::generation), and the tables are emptied and the carrier taken only when the row at the address is the one the relay marked.
  2. CI. The Verus job stops with what Verus printed when verus --version names no toolchain, where it went on to install nothing. Three comments gave the network kernel's default Kani set as 104 harnesses; it has 105, and the comments now name the file that lists it.

Why (1) is safe to take alone

Tests

  • a_late_report_leaves_a_reinstated_row_another_relay_carries: a row is withdrawn under an open relay and resumed, another relay carries the new row, and the old relay's end neither detaches it nor lets the grace withdraw it; its own relay's end detaches it.
  • a_relays_end_empties_the_tables_of_the_rows_it_carried also files a report with the row's box id under another number, and the tables stay.
  • In VMs on Linux hosts, Ubuntu 24.04 and Fedora, this change against the last release, which is from before feat(minvmd): decide the host gate's frames with a verified kernel (netcore) #3869: 10 of 10 runs pass on both sides and no verdict differs. The five scenarios open the host alias through the VM gate, publish a port with egress declared, resolve a name off the allow list, activate again quickly at one address, and run the baseline. None of them makes two relays carry one box, so they show nothing regressed, and the tests above are what show the fix.

Not in this change

From the same review round, each answered on its thread in #3869:

  • carry marks every source on a row change, not only the frame's own. With the report keyed by the row's number the count stays balanced. Marking per source would let a box that is resumed and stays silent lose its row at the resume bound while its relay is live, so that is a design question and not a fix to slip in here.
  • Pins::admit refuses Full without reclaiming other names' expired addresses. Not reachable with the table as minvmd sizes it (names times the per-name quota); reachable only for a box that declares more names than the table was sized for, which is already logged. The fix changes a theorem's statement, so it goes with the kernel's next proof round.
  • Outcome's three status fields are public. No caller changes them. Making them private changes the kernel's locked view, so it goes with the same round.
  • The lock tooling can judge an old run under a new cut when the operator pairs the wrong directories, and the self-test would write through a symlink if the crate had one. Both are tooling and go together in a change to crates/netcore-lock.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes
    • Relay withdrawals now verify that a report still matches the current connection before acting on it. This prevents delayed reports from disconnecting a replacement box or clearing its kernel tables, helping preserve active connections and their state.

bryan-minimal and others added 3 commits December 1, 2026 08:49
A relay's withdrawal report named a row by its address and box id. A box
keeps its id across a stop and a resume, so a relay that ended after its
box was resumed under another relay named the reinstated row: its end
emptied that row's DNS tables and took the other relay's carrier from it,
and the row was withdrawn at the grace's end while in use.

The report now carries the row's number as well, and the tables are
emptied and the carrier taken only when the row at the address is the one
the relay marked. A relay that marks a reinstated row files it as a row of
its own.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
… count

The Verus job read the toolchain from verus --version and installed
whatever it read. An empty read now stops the job there, with what Verus
printed. The comments that gave the network kernel's default set as 104
harnesses name the file that lists it instead: it has 105.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…ests

Four of the gate's tests read a report's entries as pairs.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@bryan-minimal
bryan-minimal requested a review from a team as a code owner December 1, 2026 21:01
@coderabbitai
coderabbitai Bot commented Dec 1, 2026 •
< 7438 span class="Button-label"> Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Withdrawal reports now include row generations, and registry updates require a report to match the current row’s address, box ID, and generation. The Verus setup step also checks for an empty toolchain name, and Kani comments update the netcore harness information.

Changes: Relay withdrawal identity

Layer / File(s) Summary
Carry row identity in withdrawal reports
crates/minvmd/src/box_registry.rs
Withdrawal reports identify carried rows by address, box ID, and generation.
Match reports to current rows
crates/minvmd/src/box_registry.rs, crates/minvmd/src/net/egress_gate.rs
detach and kernel-table clearing check all three row values before acting. Tests cover stale reports for reinstated rows and reports with matching or incorrect generations. Report assertions use the updated three-element tuple.

Verification workflow updates

Layer / File(s) Summary
Update verification setup and harness comments
.github/workflows/ci-verus.yml, .github/workflows/ci-kani.yml, scripts/kani.sh
The Verus setup step exits with an error if the reported toolchain name is empty. Kani comments describe running four harnesses at a time and report a total of 112 harnesses.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related issues

  • gominimal/minimal issue 3903 — Both address relay withdrawals affecting rows that may have been reinstated with a newer identity.

Possibly related PRs

  • gominimal/minimal#3869 — This PR builds on the minvmd network-gate code and review context introduced in that change.

Suggested reviewers: norrietaylor, mitodrummer

Merge Risk: Minimal · up to 74f8c

Withdrawal reports now carry the row generation, so a late report from an old relay cannot detach or clear a row that was reinstated under another relay. No concrete merge-blocking risk remains.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title follows Conventional Commit form (fix(minvmd): ...) and names the main change: a relay's end now identifies the rows it marked by their row number, not only by address and box id. The change…
Description check Passed The description follows the template's main sections: What, Why, and Tests. It explains the relay-end fix, the CI Verus and Kani comment changes, the safety reasoning, and named tests with VM run evid…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title follows Conventional Commit form (fix(minvmd): ...) and names the main change: a relay's end now identifies the rows it marked by their row number, not only by address and box id. The changeset matches this, since BoxRecord::generation is added to withdrawal reports and detach and empty_carried_tables now check all three values. The title is specific, though somewhat long at 72 characters and uses a possessive phrasing that is slightly awkward.

Full details: Description check

Explanation

The description follows the template's main sections: What, Why, and Tests. It explains the relay-end fix, the CI Verus and Kani comment changes, the safety reasoning, and named tests with VM run evidence. It does not use the template's exact headings (Summary, Testing, Checklist). It also omits the Checklist items, which cover docs updates and the BREAKING CHANGE footer. The description does not state whether docs were updated or whether the change is breaking. The title-format guidance in the template comment is not repeated in the description, but the title itself satisfies it.

Resolution

Consider adding the template's Summary, Testing, and Checklist headings, or state whether docs were updated and whether this is a breaking change. Also note that the Kani count in the description (105) differs from the 112 in the scripts/kani.sh summary, so verify the number before merge.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

A rabbit checks each row by name,
And adds its generation to the frame.
Old reports meet a newer gate,
While matching rows decide their fate.
Four at once, the harnesses run,
The rabbit hops; the checks are done.

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Essentials
  • Run ID: e24d809a-ccc7-4560-8c78-1ab32a1f26db
Commits

Reviewing files that changed from the base of the PR and between c109a08 and 74f8c82.

Files selected for processing: 5

  • .github/workflows/ci-kani.yml
  • .github/workflows/ci-verus.yml
  • crates/minvmd/src/box_registry.rs
  • crates/minvmd/src/net/egress_gate.rs
  • scripts/kani.sh

Included review availability: This review used your included allowance. Your plan provides up to 5 included reviews per hour; 1 remain after this review.

@minimal-foundry
minimal-foundry Bot commented Dec 1, 2026 •
Copy link
Copy Markdown
Contributor

Approved: no findings at 74f8c82ba519.

Nothing to do.

Clobber: none seen.

@minimal-foundry minimal-foundry Bot left a comment
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

minimal-review — approved

Verdict APPROVE — No findings.

Panel: 3 of 3 personas ran (correctness, security, supply-chain).

@minimal-foundry minimal-foundry Bot added the review:approved minimal-review approved the current head label Dec 1, 2026
@norrietaylor norrietaylor left a comment
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Read at 74f8c82. generation is unique per record, since every BoxRecord takes it from the process-wide counter and no construction copies an older one. detach and empty_carried_tables match and change under one read of the row lock. a_late_report_leaves_a_reinstated_row_another_relay_carries fails on the old box-id-only match.

Notes, none blocking:

  • The doc comment on RelayCarry in crates/minvmd/src/box_registry.rs still says it holds "the sources with the box ids it reports at its end". The field doc below it has the three-field form, so the struct comment is stale.
  • An old relay that is still open and sends no frame after a resume no longer counts toward the reinstated row. The description names this and defers it. No test pins it yet.
  • In a_relays_end_empties_the_tables_of_the_rows_it_carried, the second report's db entry carries the other box's id and generation, so it never matches the db row. A one-line comment would say that is the point.
  • The Verus guard and the Kani comment edits are a separate concern from the fix. They sit in their own commit, which is fine.

@bryan-minimal
bryan-minimal added this pull request to the merge queue Dec 3, 2026
Merged via the queue into main with commit ceaff15 Dec 3, 2026
51 of 53 checks passed
@bryan-minimal
bryan-minimal deleted the net/host-gate-followup branch December 3, 2026 01:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

review:approved minimal-review approved the current head

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

0