Repository navigation
enclave: log rejected auctions as errors, tighten the zero-floor test, fix doc comments, drop the TCP healthcheck - #103
Merged
Merged
Conversation
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.
ProcessAuction also returns Success=false when attestation fails, which is not a rejection of the request.
There was a problem hiding this comment.
🟢 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.
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`
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
enclave/server.go): the server loggedINFO: Auction processed successfully with TEE attestation dataafter everyProcessAuctioncall, including the two cases whereProcessAuctionreturnsSuccess: falsewithout logging anything (a negativebid_floor, an invalid deal list). The success line is now logged only when the response succeeded; otherwise the server logsERROR: 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 assertsresponse.FloorRejectedis empty.core/types.go):AuctionResult.RunnerUpis 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". TheExcludedBidcomment listed floor rejections, which are reported inFloorRejectedinstead; it now lists the exclusion reasons the enclave uses.enclave/Dockerfile): removesEXPOSE 5000and theHEALTHCHECKthat pinged127.0.0.1:5000withnc. The server listens only on vsock, so the probe could never pass, and the image is used only asnitro-cli build-enclaveinput, where Docker health checks never run.nmap-ncatstays installed. The image config changes, so the EIF PCRs may change (the server change alters the binary in any case);update-pcrsrecords the new values after merge.Notes for reviewers
ExcludedBidcomment dates from centralize core types and use generic failure reasons #4, which moved floor rejections out ofExcludedBidinto a separate list in the same change; the comment kept the old wording.enclave/auction_test.go,core/types.goandenclave/Dockerfileon other lines. A trial merge of each with this branch produces no conflicts beyond those each already has withmain.Pre-merge checklist
go build ./...,go vet ./...; Docker Build green on this branch; a local build of the image showsHealthcheckandExposedPortsnull withncstill present)golangci-lint run: 0 issues)go test -count=1 ./...; with a zero floor made to reject a bid, the newFloorRejectedassertion fails while the existing bid hash count check still passes)Post-deploy/apply verification
mainafter merge is green (Build EIF run 38428105745 for 3e171da succeeded: Build EIF on Nitro EC2 and Update PCR validation file both green)update-pcrscommits the new PCR measurements for the merge commit (8c92743 "Update PCR measurements for 3e171da" on main)