Repository navigation
Conversation
ChristianPavilonis
left a comment
There was a problem hiding this comment.
Reviewed c8467bc52 against feat/s2s-eid-collection-core (59161a541).
Approving so I'm not blocking, on the understanding that you'll handle the comments before merging. R1 is the one I care about. It brings back the per-navigation vendor calls this PR exists to remove, on near-full rows, and can cost a stored ID.
Also, "may remove stored IDs as before" in the description isn't quite right: these outcomes never wrote before, so they never removed anything.
Checks: focused core coordinator and write-plan tests plus the scratch reproduction described in R1.
dhruv8sh
left a comment
There was a problem hiding this comment.
Summary
This PR adds a per-provider retry_after map to KvEntry. A NoMatch result sets a one-hour deadline, and failures or timeouts set a five-minute one. Both the page write and the after-response write persist it. due_sources suppresses the provider, refreshes included, until the deadline passes, and Found or a fresh OptedOut clears it. The backward-compatible serde default, the clearing and renewal rules, and the tests (fake clock, exact-expiry boundary, cross-provider isolation) are solid. One blocking problem remains: on a nearly full row, writing a retry deadline that only exists to save a vendor call can push the row over the size cap, and the cap then deletes a stored partner ID to make room.
Blocking
🔧 wrench
- A retry-only write can evict stored partner IDs through the size cap: see inline at
crates/trusted-server-core/src/ec/write_plan.rs:156
Non-blocking
⛏ nitpick
- Internal PR-gating note in the user-facing configuration guide: see inline at
docs/guide/configuration.md:983
Summary
A provider miss or failed lookup currently writes no retry state, so an EC with no provider ID calls the vendor again on every permitted navigation. This change remembers the outcome on the EC row and skips the provider until its retry deadline expires.
Changes
crates/trusted-server-core/src/ec/kv_types.rscrates/trusted-server-core/src/ec/coordinator/mod.rsskipped_retry_after, and add fake-clock/provider navigation regressions.crates/trusted-server-core/src/ec/coordinator/results.rscrates/trusted-server-core/src/ec/write_plan.rscrates/trusted-server-core/src/ec/after_response.rscrates/trusted-server-core/src/test_support.rsdocs/guide/configuration.mddocs/superpowers/specs/2026-10-30-s2s-eid-collection-design.mdCloses
Closes #1547
Spec
Not a feature: bug fix following #1487. The existing collection design is updated to reflect retry memory.
Base and scope
Targets
feat/s2s-eid-collection-core, starting at #1487 head59161a541ab6d84bde085680c8726cdde52a5439. That PR introduces the coordinator and write planner affected by this bug. #1488 and #1489 do not already implement retry memory. Neithermainnorrc/identityis the base or target.Behavior
NoMatchrecords a one-hour per-provider retry deadline. HTTP 404/204 map to this outcome in the core framework at this base.Five minutes balances fewer repeated calls with recovery from transient outages. A known miss waits one hour to reduce repeated anonymous lookups, at the cost of delaying discovery of a newly available ID. These are distinct named durations, not new operator configuration keys.
The interim brake is the existing #1488 gate on #1547, documented here and already confirmed in the #1487 review thread.
rate_limit_per_hourremains optional and unlimited by default. A new shared-IP default would change traffic budgets for unrelated ECs behind the same IP.Schema compatibility
KvEntry.retry_afteris a provider-ID-to-Unix-deadline map next toopt_outs, withserde(default)and omission when empty. Older rows deserialize with no retry state; the schema version is unchanged. Older readers ignore the unknown field and discard it when rewriting the row, so rollback or mixed-version writers lose suppression while rows remain readable.Test plan
Review-fix commit:
4f9e5270aa07467a2cf3bd190d708b553ba7cae2. The committed files match the locally verified content. Rust 1.98.1 and Node 24.20.0 were selected; runtime fixtures used Viceroy 0.22.0 from this branch's.tool-versions, Spin 4.1.0 and Cargo.lock-matched wasm-bindgen 0.2.126.4f9e5270aa07467a2cf3bd190d708b553ba7cae2.The first sandboxed runtime attempt could not access system certificates or localhost. Those checks were rerun with the required local access and passed; no runtime gate was waived. Existing deliberately ignored tests remain ignored.
Earlier review and runtime evidence
Historical independent local review before review fixes: READY TO REQUEST REVIEW within the agreed targeted-check scope, with zero outstanding code or documentation findings. Its documentation precision finding was resolved by explaining the existing pruning/size-cap exception; the test-helper lint allowance was separately reviewed.
Local Axum verification used a separate integration worktree at native-identity head
6b4a5fdc0aca527eed1f8842eb7b87b89cca6cf8, with the core fix applied semantically. The #1487 Axum adapter itself rejects providers and lacks this identity wiring; none of the later native support is included in this PR.A temporary ignored test served the real Axum application over localhost HTTP with persistent EC records and mocked origin/provider transport. The fictional provider at
https://id.example.com/gs/v2/1234.jsonanswered 204. With the same EC, vendor call counts across two document navigations and a third after expiry were 1, 1, 2, and the first two requests retained the same retry deadline. A two-second interval was supplied only through test-utilities configuration in that disposable integration copy; this PR retains the one-hour default. Disabling the retry guard in the disposable copy produced 1, 2, 3; restoring it confirmed 1, 1, 2 again.This verifies the local Axum application/record flow with controlled upstream responses. It does not claim browser behavior, live vendor TLS/API validation or deployed behavior. No browser, remote proxy task, real credentials or operator configuration was used.
Checklist
unwrap()in production code.logmacros rather thanprintln!.