Skip to content

fix: use async AMD SNP KDS fetch#750

Merged
kvinwang merged 1 commit into
masterfrom
fix/snp-kds-fetch-runtime
Jun 30, 2026
Merged

fix: use async AMD SNP KDS fetch#750
kvinwang merged 1 commit into
masterfrom
fix/snp-kds-fetch-runtime

Conversation

@kvinwang

@kvinwang kvinwang commented Jun 30, 2026

Copy link
Copy Markdown
Collaborator

Fixes #746.

This removes reqwest::blocking from the AMD SEV-SNP KDS fallback path and uses async reqwest::Client instead, so async attestation verification no longer creates/drops a nested Tokio runtime in an async context.

Changes:

  • add AmdKdsClient, which owns the async HTTP client and bounded moka CA/VCEK collateral caches
  • update async attestation verification paths to use a caller-owned KDS client when available
  • make dstack-verifier keep one AMD KDS client instance per verifier instance, instead of using global cache state
  • keep the existing sync/free verifier APIs compatible via compatibility wrappers
  • set KDS connect timeout to 30 seconds and request timeout to 2 minutes

Validation:

  • cargo fmt --check --all
  • cargo check -p sev-snp-qvl -p dstack-attest -p dstack-verifier
  • cargo clippy -p sev-snp-qvl -p dstack-attest -p dstack-verifier -- -D warnings -D clippy::expect_used -D clippy::unwrap_used --allow unused_variables
  • cargo test -p sev-snp-qvl
  • cargo test -p dstack-attest --test sev_snp_verify
  • cargo test -p dstack-verifier
  • live SNP attestation with empty cert chain reaches quote_verified=true via KDS fallback without the Tokio runtime panic from Harden AMD SEV-SNP KDS collateral fetch (async client, timeouts, caching) #746

Copilot AI review requested due to automatic review settings June 30, 2026 10:05

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@kvinwang kvinwang force-pushed the fix/snp-kds-fetch-runtime branch 2 times, most recently from 2c0f1db to 6c6779b Compare June 30, 2026 10:22
@kvinwang kvinwang force-pushed the fix/snp-kds-fetch-runtime branch from 6c6779b to 84eda4f Compare June 30, 2026 10:38
@kvinwang kvinwang merged commit 08c78dc into master Jun 30, 2026
15 checks passed
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.

Harden AMD SEV-SNP KDS collateral fetch (async client, timeouts, caching)

2 participants