Skip to content

Eliminate bid adjustment factors - #44

Open
lukasschwab wants to merge 2 commits into
mainfrom
ls/rm-bid-adjustment-factors
Open

lukasschwab wants to merge 2 commits into
mainfrom
ls/rm-bid-adjustment-factors

Conversation

@lukasschwab

Copy link
Copy Markdown
Member

This system was effectively unused: all auction requests from the CloudX auction-server bear vacuous (i.e. empty, 1x) bid adjustment factors. There are no immediate plans to use non-vaucous adjustmnets factors, so we removed the logic involved from the auction-server entirely.

This removes the corresponding dead logic from openauction.

Old config field `experimental_monorepo_root` is deprecated in current
versions of mise, which yields warning noise:

```
mise WARN  deprecated [config.experimental_monorepo_root]: `experimental_monorepo_root` in .../openauction/.mise/config.toml is deprecated. Use `monorepo_root` instead. This will be removed in mise 2027.12.0.
```
This system was effectively unused: all auction requests from the CloudX
auction-server bear vacuous (i.e. empty, 1x) bid adjustment factors.
There are no immediate plans to use non-vaucous adjustmnets factors, so
we removed the logic involved from the auction-server entirely.

This removes the corresponding dead logic from openauction.
@lukasschwab
lukasschwab requested a review from nickpell as a code owner July 24, 2026 22:12

@nickpell nickpell left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks solid. Since this changes the attestation we'll want to run it by demand partners before shipping.

Base automatically changed from ls/monorepo-root to main July 29, 2026 19:03
nickpell added a commit that referenced this pull request Sep 30, 2026
## Summary

Remove `ApplySingleBidAdjustmentFactor`, which has no callers in
openauction or cloudexchange.ssp. The unused helper accepts zero and
negative adjustment factors, while `ApplyBidAdjustmentFactors` ignores
them.

This supersedes the single-helper deletion in #44.
That PR's broader removal of bid adjustments remains separate.

## Notes for reviewers

The review of #44 requires demand-partner
coordination for its attestation changes. This deletion preserves the
batch adjustment path and the attestation format, so that condition does
not apply here.

## Pre-merge checklist

- [x] No callers in either repository; `deadcode -test ./...` confirms
the helper is unreachable from openauction tests.
- [x] Build passes: `mise exec -- go build ./...`.
- [x] Lint passes: `mise run //:lint`.
- [x] Full test suite passes: `mise run //:test`.
- [x] Diff contains only the unused helper deletion; `git diff --check`
passes.
- [x] GitHub Actions checks pass: test, lint, and Ratchet Lint.

## Post-deploy/apply verification

- [ ] The main-branch Go, Docker Build, and Build EIF workflows complete
successfully for the merge commit.
nickpell added a commit that referenced this pull request Oct 2, 2026
…ary ignores (#85)

## Summary

- `key-validator` and `auction-validator` each have their own
`showUsage()` text, but neither sets `flag.Usage`. `-h` and an unknown
flag therefore print Go's default `Usage of <path>:` flag list instead
of the tool's usage text. Both tools now set `flag.Usage = showUsage`
before `flag.Parse()`, so `-h`, `-help`, `--help` and flag errors all
print the tool's own usage. The exit codes stay the `flag.ExitOnError`
ones: 0 for `-h`, 2 for a flag error. The tools' own exit-code table
already defines 2 as invalid input.
- In `.gitignore`, the unanchored `key-validator` pattern also matched
the source directory `validation/cmd/key-validator/`, so `git add`
refused new files there without `-f`. `go build` writes the binary to
the directory it runs from. The pattern now names only the binary in the
two usual build directories: the repo root (`go build
./validation/cmd/key-validator`) and the package directory (`go build`
run inside it). `auction-validator` gets the same anchored pair, because
before this change its built binary was not ignored at all.

## Notes for reviewers

- The original `key-validator` ignore line came from #13, under the `#
compiled commands` comment. It was meant for the compiled binary, and
the anchored patterns keep that intent.
- Open #44 edits the body of `auction-validator`'s `showUsage()`. This
PR adds one line next to `flag.Parse()` and does not touch
`showUsage()`, so no textual overlap is expected.
- On a flag error, the flag package writes the error to stderr and the
usage text goes to stdout, because `showUsage()` prints to stdout. The
existing missing-input path has the same split: usage on stdout, error
on stderr.

## Pre-merge checklist

- [x] Build passes (`go build ./...` and `go vet ./...`)
- [x] Lint passes (`mise run //:lint`: 0 issues; `mise run //:tidy`
leaves no changes)
- [x] Tests pass (`go test ./...`)
- [x] For both tools, `-h`, `-help` and `--help` print the tool's usage
text and exit 0. `-bogus` prints `flag provided but not defined: -bogus`
on stderr, then the usage text, and exits 2. Before this change, `-h`
and `-bogus` printed Go's default flag list.
- [x] `git check-ignore -v` matches `/key-validator`,
`/validation/cmd/key-validator/key-validator`, `/auction-validator` and
`/validation/cmd/auction-validator/auction-validator`. It reports no
match for `validation/cmd/key-validator/`,
`validation/cmd/auction-validator/`, or a new file in either directory.
After building both tools from the repo root and from each package
directory, `git status --porcelain --ignored` lists the four binaries as
ignored and the new files as untracked.
- [x] Enclave binary unchanged: `go list -deps ./enclave/...` is
identical before and after
- [x] Diff contains no unintended changes: `.gitignore` and the two
`main.go` files only

## Post-deploy/apply verification

- [ ] The Go, Docker Build and EIF build runs on `main` for the merge
commit are green, including `update-pcrs` (the enclave binary does not
depend on these commands)
nickpell added a commit that referenced this pull request Oct 8, 2026
…plicate floor test case (#96)

## Summary

- **key-validator text output lists the validation details.**
`outputText` printed the "Validation Results:" header and the boolean
summary but never `result.ValidationDetails`, so a failed check in the
default text mode showed only `false` with no reason. It now prints a
`Details:` list after the summary, in the same place and form as
`auction-validator`'s text output; JSON mode already included `details`.
`TestOutputTextPrintsDetails` captures stdout and asserts the list, and
fails if the loop is removed.
- **`RunAuction` doc no longer mentions a "full ranking".**
`AuctionResult` has no ranking field and never had one; the Returns line
now lists winner, runner-up, eligible bids and rejected bids.
- **`TestBidMeetsFloor` no longer has a duplicate case.** "decimal
precision edge case - fails" and "very small difference - fails" both
used `2.4999, 2.5, false`. The decimal-precision case now uses
`2.49994`, which is just below the half-step of the 4-decimal rounding
and rounds down to `2.4999`, so it is the failing counterpart of
`2.499999999` (which rounds up to the floor). Unlike `2.4999`, it fails
if `BidMeetsFloor` rounds up instead of to nearest.

Example text output for an attestation with unknown PCRs, no certificate
and a mismatched key:

```
Details:
  - PCR0: aaaa…aaaa (no match)
  - PCR1: bbbb…bbbb (no match)
  - PCR2: cccc…cccc (no match)
  - Missing certificate
  - COSE signature verification failed: parse certificate: x509: malformed certificate
  - Public key mismatch: provided key does not match attested key
```

## Notes for reviewers

- #44 rewrites the surrounding `RunAuction` doc block, so whichever
lands second has a trivial conflict on the Returns line.

## Pre-merge checklist

- [x] Build passes (`go build ./...`, `go vet ./...`)
- [x] Lint passes (`mise run //:lint`, `mise run //:tidy`; CI `lint` and
Ratchet Lint green)
- [x] Tests pass (`mise run //:test`; CI `test` green)
- [x] `TestOutputTextPrintsDetails` fails with the `Details:` loop
removed
- [x] The new `TestBidMeetsFloor` case fails with `Round` replaced by
`RoundCeil` in `BidMeetsFloor`, which the previous duplicate did not
catch
- [x] Diff contains no unintended changes

## Post-deploy/apply verification

- [ ] The EIF build run on `main` for the merge commit is green,
including `update-pcrs`
nickpell added a commit that referenced this pull request Oct 13, 2026
…, fix doc comments, drop the TCP healthcheck (#103)

## 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

- The `ExcludedBid` comment dates from #4, which moved floor rejections
out of `ExcludedBid` into a separate list in the same change; the
comment kept the old wording.
- Open #44, #46 and #102 touch `enclave/auction_test.go`,
`core/types.go` and `enclave/Dockerfile` on other lines. A trial merge
of each with this branch produces no conflicts beyond those each already
has with `main`.

## Pre-merge checklist

- [x] 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)
- [x] Lint passes (`golangci-lint run`: 0 issues)
- [x] 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)
- [x] Diff contains no unintended changes

## Post-deploy/apply verification

- [ ] The next EIF build on `main` after merge is green
- [ ] `update-pcrs` commits the new PCR measurements for the merge
commit
@nickpell nickpell mentioned this pull request Oct 26, 2026
6 tasks done
nickpell added a commit that referenced this pull request Oct 26, 2026
## Summary

- The README's Overview listed `core/`, `enclaveapi/` and `enclave/` but
not `validation/`, the package that verifies enclave attestations (PCRs,
the AWS Nitro certificate chain, the COSE_Sign1 signature, then the key
and auction checks) and that cloudx-io/openarbiter imports. The Overview
now lists it along with its two CLIs, `validation/cmd/auction-validator`
and `validation/cmd/key-validator`, each described from its own usage
text and the package's doc comments.
- The Usage import example now includes
`github.com/cloudx-io/openauction/validation`.

## Notes for reviewers

#44 also edits the Overview, rewording the `core/`
bullet two lines above the new one. A test merge of #44 into this branch
merges `README.md` without a conflict.

## Pre-merge checklist

- [x] Both CLIs exist on `main` and build: `go run
./validation/cmd/key-validator --help` and `go run
./validation/cmd/auction-validator --help` print their usage
- [x] The updated import block (`core`, `enclaveapi`, `validation`)
compiles in a scratch module that replaces
`github.com/cloudx-io/openauction` with this branch
- [x] `go build ./...` and `go vet ./...` pass; the change touches
`README.md` only, so the enclave binary is unchanged
- [x] Go and Ratchet workflows green on this branch: `lint`, `test`,
`docker-build` and `Ratchet Lint` pass on `e708b63`
- [x] Diff contains no unintended changes: `README.md` only

## 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
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