Skip to content

enclave: log rejected auctions as errors, tighten the zero-floor test, fix doc comments, drop the TCP healthcheck - #103

Merged
nickpell merged 5 commits into
mainfrom
nick/oa-enclave-hygiene
Oct 13, 2026
Merged

nickpell merged 5 commits into
mainfrom
nick/oa-enclave-hygiene

Conversation

@nickpell

@nickpell nickpell commented Oct 13, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Auction failure logging (enclave/server.go): the server logged INFO: Auction processed successfully with TEE attestation data after every ProcessAuction call, including the two cases where ProcessAuction returns Success: false without logging anything (a negative bid_floor, an invalid deal list). The success line is now logged only when the response succeeded; otherwise the server logs ERROR: Auction failed: <message>. The response sent to the host is unchanged.
  • TestProcessAuction_BidFloorZero: the test claimed "all bids pass (no floor enforcement)" but checked only the attested bid hash count, which includes floor-rejected bids, so it could not fail if a zero floor rejected a bid. It now also asserts response.FloorRejected is empty.
  • Doc comments (core/types.go): AuctionResult.RunnerUp is nil when fewer than two bidders have an eligible bid, because ranking keeps only each bidder's highest bid (two eligible bids from one bidder still give no runner-up); the comment said "less than 2 valid bids". The ExcludedBid comment listed floor rejections, which are reported in FloorRejected instead; it now lists the exclusion reasons the enclave uses.
  • Enclave image (enclave/Dockerfile): removes EXPOSE 5000 and the HEALTHCHECK that pinged 127.0.0.1:5000 with nc. The server listens only on vsock, so the probe could never pass, and the image is used only as nitro-cli build-enclave input, where Docker health checks never run. nmap-ncat stays installed. The image config changes, so the EIF PCRs may change (the server change alters the binary in any case); update-pcrs records the new values after merge.

Notes for reviewers

Pre-merge checklist

  • Build passes (go build ./..., go vet ./...; Docker Build green on this branch; a local build of the image shows Healthcheck and ExposedPorts null with nc still present)
  • Lint passes (golangci-lint run: 0 issues)
  • Tests pass (go test -count=1 ./...; with a zero floor made to reject a bid, the new FloorRejected assertion fails while the existing bid hash count check still passes)
  • Diff contains no unintended changes

Post-deploy/apply verification

  • The next EIF build on main after merge is green (Build EIF run 38428105745 for 3e171da succeeded: Build EIF on Nitro EC2 and Update PCR validation file both green)
  • update-pcrs commits the new PCR measurements for the merge commit (8c92743 "Update PCR measurements for 3e171da" on main)

ProcessAuction returns Success=false without logging for a negative bid
floor or an invalid deal list, yet the server logged every auction
request as processed successfully. Log the success line only when the
response succeeded, and log the response message as an error otherwise.
TestProcessAuction_BidFloorZero checked only the attested bid hash count,
which includes floor-rejected bids, so it passed even if a zero floor
rejected bids. Assert the response reports no floor rejections.
RunnerUp is nil when fewer than two bidders have an eligible bid, since
ranking keeps only each bidder's highest bid; two eligible bids from one
bidder still leave it nil.

ExcludedBid no longer covers floor rejections, which are reported in
FloorRejected; list the exclusion reasons the enclave actually uses.
The enclave server listens only on vsock, so the HEALTHCHECK probing
127.0.0.1:5000 could never pass and EXPOSE 5000 named a port nothing
binds. The image is used only as nitro-cli build-enclave input, where
Docker health checks never run. nmap-ncat stays installed.
@nickpell
nickpell requested a balanced review from Copilot October 13, 2026 14:12
ProcessAuction also returns Success=false when attestation fails, which
is not a rejection of the request.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 Approval recommended

The focused changes are consistent with the implementation and introduce no unresolved issues.

0 open findings

What changed in this PR

Improves enclave failure observability, test precision, documentation accuracy, and container metadata.

Changes:

  • Logs unsuccessful auction responses as errors.
  • Strengthens zero-floor behavior validation.
  • Corrects auction type comments and removes an inapplicable TCP health check.
File Description
enclave/​server.go Logs auction outcomes according to response success.
enclave/​auction_test.go Verifies zero-floor auctions reject no bids.
core/​types.go Corrects runner-up and exclusion documentation.
enclave/​Dockerfile Removes unused TCP exposure and health check.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@nickpell
nickpell merged commit 3e171da into main Oct 13, 2026
3 checks passed
@nickpell
nickpell deleted the nick/oa-enclave-hygiene branch October 13, 2026 16:04
@nickpell nickpell mentioned this pull request Oct 26, 2026
3 tasks done
nickpell added a commit that referenced this pull request Oct 26, 2026
## Summary

- Removes `nmap-ncat` from the enclave image (`enclave/Dockerfile`),
which now installs only `ca-certificates`. The package's only user was
the TCP `HEALTHCHECK`, which #103 removed while leaving the package
installed. Nothing else in the image or its build and deploy tooling
runs `nc`, `ncat` or `nmap` inside the enclave image.
- The image contents change, so the EIF and its PCR measurements change;
`update-pcrs` records the new values after merge.

## Pre-merge checklist

- [x] Build passes (PR CI `docker-build` green on 8b10168; a local arm64
build of the image has no `nc`, `ncat` or `nmap` and keeps
`ca-certificates`)
- [x] Diff contains no unintended changes (one line in
`enclave/Dockerfile`)

## Post-deploy/apply verification

- [ ] The main pipeline on the merge commit is green: Go, then Docker
Build, then Build EIF, then the `[skip-build] Update PCR measurements`
commit for the merge commit lands on `main`
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