Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

kms: record OS image version and dev flag on-chain in the next-gen contract

未关闭
#1,384 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
5/5
预计耗时
一周以上
新手友好度
35/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
活跃
技术栈
rust, solidity

调研方向

Start with the next-generation KMS contract around DstackKms, addOsImageHash, allowedOsImages, and isAppAllowed, then trace the verifier's attestation paths that consume os_image_hash. Resolve the compatibility and dev-image policy questions before implementing storage and events; done means on-chain metadata can be retrieved for each hash and unavailable platform fields can be filled from it.

由索引模型根据 Issue 内容生成。

描述

Problem

The verifier only reports os_image_is_dev / os_image_version on the TDX legacy path, the one path that downloads the image and reads metadata.json. TDX lite, SEV-SNP, GCP TDX, AWS NitroTPM and Nitro Enclave carry only the manifest digest, so both fields are null there (#1266). Right now relying parties can't tell a dev image from a prod image on those paths, and can't enforce a minimum version. The only thing they can do is keep their own os_image_hash allowlist.

DstackKms already whitelists OS images on-chain, but it stores just a bool for each hash (allowedOsImages), so the chain doesn't know what the hash is.

Proposal

In the next-generation KMS contract, store metadata for each OS image hash, for example:

struct OsImageInfo {
    bool allowed;
    bool isDev;
    string version; // e.g. "0.5.10"
}
mapping(bytes32 => OsImageInfo) public osImages;
  • addOsImageHash takes isDev and version, and emits them in the event.
  • Every attestation path can look up version and dev status by os_image_hash from the same source. This doesn't need image downloads or metadata.json.
  • KMS / relying-party policy can reject dev images or enforce a minimum version from on-chain data.
  • The verifier can fill in os_image_is_dev / os_image_version from the contract when the platform doesn't expose them.

The owner who allowlists a hash vouches for its metadata. This is the same trust we already give to the allowlist.

Open questions

  • Keep allowedOsImages(bytes32) -> bool as a view for compatibility with existing consumers?
  • Should dev images be allowed at all on production KMS instances, or should the contract reject isDev images directly in isAppAllowed?
主要语言
Rust
星标
551
派生
97
平均合并
1 天 8 小时
30 天内合并 PR
182

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

Dstack-TEE/dstack 的其他 Issue

查看 Dstack-TEE/dstack 的全部 Issue

相似的 Issue

更多 Rust Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。