nvx-rs: clone plans refuse the templates of adapters whose guest speaks its own control contract
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 35/100
Research direction
Start with check_template in nvx-rs/src/host/template/clone.rs, then trace how CloneControl and the launch identity are declared and passed into clone plans. Compare those paths with create_template in nvx-rs/src/host/template/store/capture.rs and reattach_clone in nvx-rs/src/host/template/clone/reattach.rs. Done means adapter-owned control contracts can clone and reattach successfully while NVX's own control contract checks remain intact, with affected template API users and tests accounted for.
Written by the indexing model from the issue text.
Description
Summary
check_template (nvx-rs/src/host/template/clone.rs) refuses every template whose key's runtime identity has a control_contract other than this build's contract::CONTROL_CONTRACT_REVISION. An adapter that boots its own guest, and drives a clone's activation through its own CloneControl, records its guest's control protocol in the runtime identity's control_contract, as it does for its cold boots. NVX then captures that adapter's templates, since capture checks no contract, but refuses every clone of them:
the template's generation N speaks other contracts than this build, which restores none of its clones (stage plan, evidence incompatible-host, outcome host)
Where
At dev (b8b82a60):
- The check:
check_templateinnvx-rs/src/host/template/clone.rs(lines 738–760; thecontrol_contractcomparison is line 749), added in #888. - Capture:
create_template(nvx-rs/src/host/template/store/capture.rs, line 406) checks no contract, so the mismatch shows only at the first clone, as a fallback on every start. - Launch and reattach: a clone's launch requires the template's runtime identity (
Evidence::RuntimeMismatch), andreattach_clone(nvx-rs/src/host/template/clone/reattach.rs, line 163) ends a clone's VMM that runs under another identity. So an adapter can't keep its own contract for clones alone.
The workaround available today
Run templates and clones under a second runtime identity: the adapter's own, with CONTROL_CONTRACT_REVISION in place of its guest's control contract. Cold boots keep the adapter's identity. The adapter's readiness check still enforces its guest's protocol at each activation and reattach, and the identity's digests still pin the guest. But the template and clone identities then record a contract that the guest speaks only through the adapter's own framing: a label that NVX requires and doesn't verify.
Proposal
One of:
- Compare with the control that the caller drives. Let the
CloneControlimplementation, or the clone request, declare the control contract it speaks.check_templatethen compares the template'scontrol_contractwith that, instead of NVX's own revision. NVX's own control declaresCONTROL_CONTRACT_REVISION, so its behavior doesn't change. - Compare with the launch identity. The launch already requires the template's runtime identity.
check_templatecould compare the template's runtime with the identity that the caller launches under, and keep the fixed revisions only for NVX's own control.
Either way:
- The boot contract and control session checks can stay as they are, unless an adapter needs the same for them.
create_templatecould refuse what no clone can use, with the same rule. A template whose contracts no clone plan accepts would then fail at capture, not at every clone.
Downstream
Users of the template API that adopted the workaround above should be checked when this changes. They would move to the new declaration, and their templates would be captured again once, since the key changes.
Related: #833, #847.
- Dominant language
- Rust
- Stars
- 758
- Forks
- 48
- Avg merge
- 18h 27m
- Merged PRs (30d)
- 446
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from microsoft/nvx
-
Difficulty 1/5 Under an hour Newbie friendliness 85/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 69/100
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
microsoft/nvx#1055 · 1 comment ·
Maintainers usually reply within 1 day
-
ci: move the performance history's commits off devPossibly taken @ppenna claimed this today. Open
Difficulty 4/5 3-5 days Newbie friendliness 25/100
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
Maintainers usually reply within 1 day
Similar issues
-
ai_p2 bug comp-datalake
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
ClickHouse/ClickHouse#128306 · 1 comment ·
Maintainers usually reply within 1 day
-
documentation
Difficulty 1/5 Under an hour Newbie friendliness 85/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
Maintainers usually reply within 1 day
-
bug triage
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
Maintainers usually reply within 1 day
-
area:cli bug priority:medium
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day