Repository navigation
Conversation
Signed-off-by: Leechael Yim <yanleech@gmail.com>
Leechael
force-pushed
the
fix/kms-clear-measurement-cache
branch
from
October 24, 2026 06:16
bc21e19 to
25655b5
Compare
This branch has not been deployed
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.
Problem
Admin.ClearImageCachewith a specificconfig_hashreturns success but deletes nothing.The verifier stores measurement cache entries as
measurements/<key>.json(CvmVerifier::measurement_cache_path), butKmsState::clear_image_cacheremovesmeasurements/<config_hash>, without the suffix.remove_cachefinds neither a dir nor a file at that path and returnsOk(()). Passing<key>.jsonas the key does not work either, because the key must be pure hex.So only
config_hash = "all"actually clears measurements. Clearing one image with{"image_hash": "<hash>", "config_hash": "<key>"}leaves its cached MRs behind, and the next legacy TDX verification re-downloads the image but reuses the stale measurements. The mismatch has existed since the measurement cache moved to<key>.jsonfiles (already the case in v0.5.6).Fix
MEASUREMENT_CACHE_SUFFIX(".json") and uses it inmeasurement_cache_path, so the naming lives in one place.remove_cachetakes asuffix. The KMS passes""forimages/<hash>/andMEASUREMENT_CACHE_SUFFIXformeasurements/."all"behavior are unchanged.Verification
Run in
rust:1.92-bookworm(sev-snp-attestdoes not build on macOS):remove_cache_deletes_the_measurement_cache_file: fails with the old path logic (parent_dir.join(sub_dir), panics at the "named measurement entry must be removed" assertion) and passes with the fix.cargo test -p dstack-kms: 59 passed.cargo test -p dstack-verifier --lib: 39 passed.cargo clippy -p dstack-kms -p dstack-verifier -- -D warnings --allow unused_variables: clean.cargo fmt --all --check: clean.Not covered: a live
ClearImageCachecall against a running KMS.