Skip to content

go/runtime/host: Improve common.GetQuotePolicy function#6531

Merged
martintomazic merged 5 commits into
masterfrom
martin/trivial/simplify-get-quote-policy
Jun 8, 2026
Merged

go/runtime/host: Improve common.GetQuotePolicy function#6531
martintomazic merged 5 commits into
masterfrom
martin/trivial/simplify-get-quote-policy

Conversation

@martintomazic

@martintomazic martintomazic commented May 21, 2026

Copy link
Copy Markdown
Contributor

Trivial, semantics should be preserved.

Tackles #6474 (comment).

@netlify

netlify Bot commented May 21, 2026

Copy link
Copy Markdown

Deploy Preview for oasisprotocol-oasis-core canceled.

Name Link
🔨 Latest commit 21d5e1e
🔍 Latest deploy log https://app.netlify.com/projects/oasisprotocol-oasis-core/deploys/6a269d33d0500b000895e186

Comment thread go/runtime/host/tdx/qemu.go
@martintomazic martintomazic marked this pull request as ready for review May 21, 2026 10:35
@martintomazic martintomazic force-pushed the martin/trivial/simplify-get-quote-policy branch from d85eb0c to b7140f0 Compare May 22, 2026 14:14
@martintomazic martintomazic self-assigned this May 26, 2026
Comment thread go/runtime/host/sgx/common/common.go Outdated
Comment thread go/runtime/host/sgx/ecdsa.go Outdated
@martintomazic martintomazic requested a review from peternose June 4, 2026 10:57
@martintomazic martintomazic force-pushed the martin/trivial/simplify-get-quote-policy branch 2 times, most recently from 9460bdf to 4b0af05 Compare June 5, 2026 12:00
@martintomazic

Copy link
Copy Markdown
Contributor Author

Things can get further simplified now:

  1. teeState interface no longer makes sense and mock flag should instead be nested with ifs inside the ecdsa like is done elsewhere for the mock flag. Also existing name is confusing, Attester would probably be easier to read, but probably no longer needed anyways.
  2. Get rid of the common package nested inside sgx since it is sgx agnostic and common packages are a smell. E.g. move one level up to attestation package:
runtime/host/attestation/policy.go
  QuotePolicyProvider

runtime/host/attestation/??.go
  UpdateRuntimeQuote
  EndorseCapabilityTEE

runtime/host/attestation/worker.go
  AttestationWorker

runtime/host/attestation/metrics.go
  InitMetrics
  UpdateAttestationMetrics

@codecov

codecov Bot commented Jun 5, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 64.28571% with 20 lines in your changes missing coverage. Please review.
✅ Project coverage is 63.83%. Comparing base (18756c5) to head (4b0af05).
⚠️ Report is 6 commits behind head on master.

Files with missing lines Patch % Lines
go/runtime/host/tdx/qemu.go 40.00% 9 Missing ⚠️
go/runtime/host/provisioner/provisioner.go 72.22% 3 Missing and 2 partials ⚠️
go/runtime/host/sgx/state.go 57.14% 2 Missing and 1 partial ⚠️
go/runtime/host/sgx/ecdsa.go 75.00% 1 Missing and 1 partial ⚠️
go/runtime/host/sgx/mock.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6531      +/-   ##
==========================================
+ Coverage   63.75%   63.83%   +0.07%     
==========================================
  Files         698      697       -1     
  Lines       68293    68166     -127     
==========================================
- Hits        43542    43511      -31     
+ Misses      19757    19675      -82     
+ Partials     4994     4980      -14     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment thread go/runtime/host/sgx/ecdsa.go
@martintomazic martintomazic requested a review from peternose June 8, 2026 09:05

@peternose peternose left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

further simplified now

I would do this in another PR, if needed.

Comment thread go/runtime/host/provisioner/provisioner.go Outdated
Comment thread go/runtime/host/sgx/ecdsa.go
@martintomazic martintomazic force-pushed the martin/trivial/simplify-get-quote-policy branch from 4b0af05 to 21d5e1e Compare June 8, 2026 10:45
@martintomazic martintomazic enabled auto-merge June 8, 2026 10:46
@martintomazic martintomazic merged commit c3eed8d into master Jun 8, 2026
3 of 5 checks passed
@martintomazic martintomazic deleted the martin/trivial/simplify-get-quote-policy branch June 8, 2026 11:36
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.

3 participants