diff --git a/crates/contract/README.md b/crates/contract/README.md index 9e5a4286b3..83fc2a943b 100644 --- a/crates/contract/README.md +++ b/crates/contract/README.md @@ -323,7 +323,7 @@ These functions require the caller to be a participant or candidate. | `config()` | Returns the contract configuration. | `&ConfigV1` | TBD | TBD | | `version()` | Returns the contract version. | `String` | TBD | TBD | | `update_config(config: ConfigV1)` | Updates the contract configuration for `V1`. | `()` | TBD | TBD | -| `allowed_docker_image_hashes()` | Returns all currently allowed MPC Docker image hashes. | `Vec` | TBD | TBD | +| `allowed_docker_image_hashes()` | Returns all currently allowed MPC Docker image hashes with their eviction expiry, newest first. | `Vec` | TBD | TBD | | `allowed_launcher_image_hashes()` | Returns all currently allowed launcher image hashes. | `Vec` | TBD | TBD | | `allowed_launcher_compose_hashes()` | Returns all currently allowed launcher compose hashes (derived from launcher + MPC image pairs). | `Vec` | TBD | TBD | | `launcher_hash_votes()` | Returns current launcher hash votes, showing each participant's vote. | `LauncherHashVotes` | TBD | TBD | diff --git a/docs/securing-mpc-with-tee-design-doc.md b/docs/securing-mpc-with-tee-design-doc.md index 1d94b1b94b..5e572748cd 100644 --- a/docs/securing-mpc-with-tee-design-doc.md +++ b/docs/securing-mpc-with-tee-design-doc.md @@ -375,7 +375,7 @@ pub struct Contract { ///Returns all whitelisted Docker image hashes that have been approved /// by the DAO and verified by the TEE. - pub fn allowed_docker_image_hashes(&self) -> Vec + pub fn allowed_docker_image_hashes(&self) -> Vec /// Verifies if all current participants have an accepted TEE state. /// Automatically enters a resharing, in case one or more participants do not have an accepted diff --git a/localnet/tee/scripts/rust-launcher/test-hash-override.sh b/localnet/tee/scripts/rust-launcher/test-hash-override.sh index 005bfed447..8362231fa1 100644 --- a/localnet/tee/scripts/rust-launcher/test-hash-override.sh +++ b/localnet/tee/scripts/rust-launcher/test-hash-override.sh @@ -66,7 +66,7 @@ test_override() { # Verify the hash is in the approved list local approved approved="$(near_call_ro allowed_docker_image_hashes '{}' | extract_json_ro)" - if ! echo "$approved" | jq -e --arg h "$override_hash" '.[] | select(. == $h)' >/dev/null 2>&1; then + if ! echo "$approved" | jq -e --arg h "$override_hash" '.[] | select(.image_hash == $h)' >/dev/null 2>&1; then err "Hash $override_hash is NOT in the approved list. Cannot test override." echo "$approved" return 1 diff --git a/localnet/tee/scripts/rust-launcher/test-verify-and-upgrade.sh b/localnet/tee/scripts/rust-launcher/test-verify-and-upgrade.sh index 8b2c67b7b5..a2f8a45a74 100644 --- a/localnet/tee/scripts/rust-launcher/test-verify-and-upgrade.sh +++ b/localnet/tee/scripts/rust-launcher/test-verify-and-upgrade.sh @@ -200,7 +200,7 @@ upgrade_cluster() { # Check if already approved local current_hashes current_hashes="$(near_call_ro allowed_docker_image_hashes '{}' | extract_json_ro)" - if echo "$current_hashes" | jq -e --arg h "$new_hash" '.[] | select(. == $h)' >/dev/null 2>&1; then + if echo "$current_hashes" | jq -e --arg h "$new_hash" '.[] | select(.image_hash == $h)' >/dev/null 2>&1; then warn "Hash $new_hash is already approved — skipping vote" else # --- 2.1 Vote for new MPC hash --- @@ -228,7 +228,7 @@ upgrade_cluster() { # Verify vote succeeded local updated_hashes updated_hashes="$(near_call_ro allowed_docker_image_hashes '{}' | extract_json_ro)" - if echo "$updated_hashes" | jq -e --arg h "$new_hash" '.[] | select(. == $h)' >/dev/null 2>&1; then + if echo "$updated_hashes" | jq -e --arg h "$new_hash" '.[] | select(.image_hash == $h)' >/dev/null 2>&1; then pass "New hash approved on-chain: $new_hash" else fail "Hash not found in approved list after voting"