enclave: attest floor-rejected bid prices - #45
Closed
josephmilla wants to merge 4 commits into
Closed
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates enclave attestation user data so that floor-rejected bids retain a trusted (post-adjustment) price for downstream analytics, while keeping the attestation payload bounded and unambiguous.
Changes:
- Add an attested representation of floor-rejected bids (ID + adjusted price) to
AuctionAttestationUserData. - Thread floor-rejected bids through enclave proof generation and fail closed when the rejected-bid count or attestation user-data size exceeds limits.
- Extend core auction results to retain the full adjusted floor-rejected bids (not just IDs) and add duplicate bid ID validation in enclave request handling.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| enclaveapi/types.go | Adds AttestedFloorRejectedBid and embeds floor-rejected bid attest data in auction attestation user data. |
| enclaveapi/types_test.go | Adds JSON marshaling coverage for floor_rejected_bids and field-shape expectations. |
| enclave/proofs.go | Threads floor-rejected bids into attestation, enforces max count and max user-data byte size pre-attest. |
| enclave/proofs_test.go | Adds tests ensuring limit checks fail before calling the enclave attester. |
| enclave/auction.go | Rejects duplicate bid IDs early; passes floor-rejected bid details into proof generation. |
| enclave/auction_test.go | Adds tests for duplicate ID rejection and for attesting adjusted floor-rejected bid prices without leaking other bid fields. |
| core/types.go | Extends AuctionResult with FloorRejectedBids to carry adjusted rejected bid values. |
| core/floorenforcement.go | Refactors floor enforcement to partition bids and enable capturing rejected bid structs. |
| core/auction.go | Captures both floor-rejected bid IDs and full adjusted floor-rejected bids in auction results. |
| core/auction_test.go | Adds test ensuring floor-rejected bids in results reflect adjusted (not original) values. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+30
to
33
| func partitionBidsByFloor(bids []CoreBid, floor float64) (eligible, rejected []CoreBid) { | ||
| eligibleBids := make([]CoreBid, 0, len(bids)) | ||
| rejectedIDs := make([]string, 0) | ||
| rejectedBids := make([]CoreBid, 0) | ||
|
|
Contributor
Author
|
Superseded by a follow-up PR after renaming the head branch for public hygiene. |
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.
Context
floor_rejected_bidsfrom attestation user data.Testing
mise run test: covers adjusted encrypted prices, legacy IDs, duplicate rejection, and attestation limits.mise run lint: reports no issues across the changed core, enclave, and API packages.git diff --check origin/main...HEAD: no whitespace errors in the committed diff.