enclave: attest floor-rejected bid prices - #46
Open
josephmilla wants to merge 4 commits into
Open
Conversation
There was a problem hiding this comment.
Pull request overview
This PR extends the enclave attestation user data to include trusted, post-adjustment prices for bids rejected by floor enforcement, so downstream analytics can recover these values even when bids were encrypted.
Changes:
- Add
floor_rejected_bidsto attestation user data (ID + adjusted price only). - Plumb adjusted floor-rejected bids from core auction results through enclave proof generation into the attestation, with pre-attestation hard limits (max 4 bids; max 1024 encoded bytes).
- Fail early on duplicate bid IDs in enclave auction processing, and add/extend tests covering the new attestation behavior and limit enforcement.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| enclaveapi/types.go | Introduces AttestedFloorRejectedBid and adds floor_rejected_bids to attestation user data. |
| enclaveapi/types_test.go | Adds JSON marshaling tests ensuring floor_rejected_bids is omitted when empty and includes only ID/price fields. |
| enclave/proofs.go | Threads floor-rejected bids into attestation, with size/count limits checked before calling NSM attestation. |
| enclave/proofs_test.go | Adds tests verifying limit failures happen before calling Attest, and updates call sites for new signatures. |
| enclave/auction.go | Rejects duplicate bid IDs up front; passes core floor-rejected bids into proof generation. |
| enclave/auction_test.go | Adds tests for duplicate ID rejection and for attesting adjusted decrypted floor-rejected prices without leaking other bid fields. |
| core/types.go | Extends AuctionResult to include full post-adjustment FloorRejectedBids alongside IDs. |
| core/floorenforcement.go | Refactors floor enforcement to expose rejected bids internally via partitionBidsByFloor. |
| core/auction.go | Uses floor partitioning to return both FloorRejectedBidIDs and FloorRejectedBids in the result. |
| core/auction_test.go | Adds coverage ensuring floor-rejected bids reflect adjusted values and that inputs aren’t mutated. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.