Skip to content

fix: align allowed_docker_image_hashes consumers with new return shape - #3761

Merged
kevindeforth merged 1 commit into
kd/3735-alert-on-grace-periodfrom
kd/3735-consumer-fixups
Jul 9, 2026
Merged

fix: align allowed_docker_image_hashes consumers with new return shape#3761
kevindeforth merged 1 commit into
kd/3735-alert-on-grace-periodfrom
kd/3735-consumer-fixups

Conversation

@barakeinav1

Copy link
Copy Markdown
Contributor

Fixups for #3752 to pull in — consumers of allowed_docker_image_hashes that the return-shape change misses (targets your branch so you can merge it into the PR).

  • Launcher localnet scripts (test-verify-and-upgrade.sh, test-hash-override.sh) parse the view with jq '.[] | select(. == $h)' — that compares each element to a hash string, which never matches now that elements are { image_hash, expiry_timestamp_seconds } objects, so they'd fail even when the hash is approved. Switched to select(.image_hash == $h).
  • Docs return type: contract/README.md and securing-mpc-with-tee-design-doc.md still showed Vec<NodeImageHash>.

Not touched (flagging, your call): softer prose mentions in operator/design docs (running-an-mpc-node-in-tdx-external-guide.md, chain-gateway-design.md receiver type, the attestation-cli README "look in contract state" hint) — they reference the method but not its return shape directly. attestation-cli code itself is unaffected (takes hashes as CLI args).

The view now returns [{ image_hash, expiry_timestamp_seconds }] instead of
bare hashes. Update the launcher localnet test scripts to select by
.image_hash (they compared array elements to a hash string, which never
matches an object), and fix the return type in the contract README and the
securing-mpc design doc.

@kevindeforth kevindeforth 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.

Thank you!

@kevindeforth
kevindeforth marked this pull request as ready for review July 9, 2026 12:48
@kevindeforth
kevindeforth merged commit 1ccf1c7 into kd/3735-alert-on-grace-period Jul 9, 2026
19 checks passed
@kevindeforth
kevindeforth deleted the kd/3735-consumer-fixups branch July 9, 2026 12:48
@claude

claude Bot commented Jul 9, 2026

Copy link
Copy Markdown

PR title type suggestion: This PR changes only documentation and test scripts, so the type prefix should probably be docs: instead of fix:.

Suggested title: docs: align allowed_docker_image_hashes consumers with new return shape

@claude

claude Bot commented Jul 9, 2026

Copy link
Copy Markdown

Pull request overview

Follow-up to #3752 that reshaped allowed_docker_image_hashes()'s return type from Vec<NodeImageHash> to Vec<AllowedMpcDockerImageHash> (adds expiry_timestamp_seconds). This PR fixes two consumers that were silently broken by the shape change and refreshes two doc snippets to match.

Changes:

  • Update jq selectors in the two rust-launcher localnet scripts from select(. == \$h) to select(.image_hash == \$h) so the hash lookup actually matches against the new object elements.
  • Update the return type in crates/contract/README.md and docs/securing-mpc-with-tee-design-doc.md to Vec<AllowedMpcDockerImageHash>; the README description also now notes the newest-first ordering (matches the entries.reverse() at crates/contract/src/lib.rs:2099).

Reviewed changes

Per-file summary
File Description
crates/contract/README.md Public method table row updated to new return type and adds newest-first note.
docs/securing-mpc-with-tee-design-doc.md Design-doc contract signature updated to new return type.
localnet/tee/scripts/rust-launcher/test-hash-override.sh jq selector now reads .image_hash field.
localnet/tee/scripts/rust-launcher/test-verify-and-upgrade.sh Two jq selectors now read .image_hash field (approval precheck + post-vote verification).

Findings

Blocking: none.

Non-blocking:

  • `docs/tee-context-design.md:10` — the design-doc struct still shows `pub allowed_docker_image_hashes: Vec`, whereas the corresponding runtime type at `crates/tee-context/src/types.rs:8` is `Vec`. Drift predates this PR, but since we're chasing feat(metrics): expose the TEE image-hash allowlist expiry metrics #3752 shape mismatches it would be a natural place to land the fix. Not blocking — flagging for a follow-up if you'd rather batch design-doc realignment separately.

✅ Approved

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants