Repository navigation
Make shared EC persistence awaitable - #1526
ChristianPavilonis wants to merge 20 commits into
Conversation
Extract the local-future EC store contract and existing caller awaits from 812354b without native persistence or issuance policy changes. Await pull-sync transport operations directly. Bridge only synchronous Fastly entry-point finalization and post-send hooks with block_on. Keep Fastly KV hostcalls and existing consent and write semantics. Add regression coverage for non-Send yielding stores and pull sync inside the Fastly executor boundary.
prk-Jr
left a comment
There was a problem hiding this comment.
Reviewed e529e55 against cd8977c.
No blocking or non-blocking defects found in the scoped async EC conversion. Inspected storage and caller changes for preservation of issuance backing proof, consent gates, CAS retry and write-precondition behavior, tombstones, snapshot classification, batch failure accounting, and Fastly executor boundaries. The router, pre-send finalization, response streaming, and post-send work execute at sequential boundaries; pull sync directly awaits transport operations.
The delayed non-Send store regression provides useful suspension coverage. Confirmed in current-head hosted logs that it and the pull-sync executor-boundary regression executed and passed. Hosted test and lint results were reused; no local builds or tests were rerun. Large unrelated unchanged publisher and adapter code was sampled around affected paths. Actual entry-point post-send timing, cancellation rollback, native providers, and deployed storage consistency are outside this review's qualification.
CI Status
- CodeQL: PASS
- Analyze (python): PASS
- Analyze (rust): PASS
- Analyze (javascript-typescript): PASS
- Analyze (actions): PASS
- Analyze (javascript-typescript): PASS
- browser integration tests: PASS
- integration tests: PASS
- trace runtime and browser acceptance: PASS
- integration tests (Fastly EC lifecycle): PASS
- docs-proposal scripts: PASS
- CLAUDE.md symlink guard: PASS
- cargo fmt: PASS
- HTML EOF runtime (Fastly): PASS
- CI Node pin guard: PASS
- cargo test: PASS
- format-typescript: PASS
- cargo check/build/test (spin native + wasm32-wasip1): PASS
- format-docs: PASS
- vitest: PASS
- ts dev lint domains (changed lines): PASS
- worker-deadlines (cloudflare): PASS
- cargo check (cloudflare native + wasm32-unknown-unknown): PASS
- cargo test (ts CLI, native) (ubuntu-latest): PASS
- cargo test (cross-adapter parity): PASS
- prepare integration artifacts: PASS
- worker-deadlines (spin): PASS
- cargo test (axum native): PASS
- cargo test (ts CLI, native) (macos-latest): PASS
aram356
left a comment
There was a problem hiding this comment.
Summary
The trait change and caller conversion check out. Production code is the existing logic with async/.await added, plus the inlined withdrawal loop and the removal of the two block_on calls inside pull sync. No operation is reordered, no future is left unawaited, no lock is held across an await, and no new block_on is reachable inside the router or the new bridges. The blocking items are a test gap this PR opens (finalization now runs under futures::executor::block_on, and no test drives it there), spec provenance that cites commits and hashes no reader can resolve, and documentation that has not caught up with the async contract.
11 of the 14 inline comments below carry a one-click GitHub
suggestion. Use Commit suggestion, or Add suggestion to batch for several at once, to apply them as commits on the PR branch. The other 3 describe the fix in prose because it touches lines outside the diff hunks or several sites.Each suggestion was applied alone to this head and checked with rustfmt, all six adapter clippy aliases (the Fastly ones for the
main.rscomment), the finalize or pull-sync tests undercargo test-fastlywhere it adds test code, and docs Prettier for the spec. All of them applied together passcargo test-fastly,test-fastly-reuse,test-axum,test-cloudflare,test-spinand the parity suite.
Blocking
🔧 wrench
- No test drives finalization under the executor Fastly now uses: see inline at
crates/trusted-server-core/src/ec/finalize.rs:681 - The spec names commits and a tree that do not exist: see inline at
docs/superpowers/specs/2026-11-10-shared-async-ec-design.md:5 - The review log cites artifacts nobody can check: see inline at
docs/superpowers/specs/2026-11-10-shared-async-ec-design.md:91 - Assertion messages on the new pull-sync regression: see inline at
crates/trusted-server-core/src/ec/pull_sync.rs:986 - Record why the send sits between the two bridges: see inline at
crates/trusted-server-adapter-fastly/src/main.rs:549 - The
block_oninvariant as written is contradicted by the entry point: see inline atdocs/superpowers/specs/2026-11-10-shared-async-ec-design.md:68 - The two "retained" regressions are new: see inline at
docs/superpowers/specs/2026-11-10-shared-async-ec-design.md:74 EcFinalizeStatehas no snapshots field and is not changed here: see inline atdocs/superpowers/specs/2026-11-10-shared-async-ec-design.md:50- State the cancellation contract on the trait: see inline at
crates/trusted-server-core/src/ec/kv_backend.rs:75 dispatch_pull_syncstill documents itself as background work: see inline atcrates/trusted-server-core/src/ec/pull_sync.rs:116generate_if_neededunder-documents its errors: see inline atcrates/trusted-server-core/src/ec/mod.rs:382handle_batch_syncdocuments failures it does not return: see inline atcrates/trusted-server-core/src/ec/batch_sync.rs:115- Fold the two finalize, send and pull-sync blocks into one helper: see inline at
crates/trusted-server-adapter-fastly/src/main.rs:577 - The active-ID guard on the snapshot correction is untested: see inline at
crates/trusted-server-core/src/ec/finalize.rs:492
Cross-cutting / body-level findings
- 🔧 The real post-send pull sync never runs end to end. The integration fixture (
crates/trusted-server-integration-tests/fixtures/configs/trusted-server.integration.toml) declares two[[ec.partners]], and neither setspull_sync_enabledorpull_sync_url. So the Fastly EC lifecycle job exercises the new finalize bridge but never the pull-sync bridge with the realFastlyPlatformHttpClient, and the new regression usesStubHttpClient. Please either add a pull-enabled partner backed by a local fixture endpoint to the integration suite, or open a follow-up issue and link it from the spec's "Evidence and limits" section. - 🔧 The PR description overstates the checks and mixes in private context.
- "All46 current-head hosted checks passed": the 46 are 23 jobs counted twice (two identical
pull_requestruns).gh pr checksnow reports 29 checks, all passing, since CodeQL finished. - The
pbs.example.comfixture paragraph describes base commitcd8977cad(#1525), brought in by mergee529e5576; it is not part of this diff. - "Retain the original demo RC #1424 and its dirty worktrees", "raw eligibility retained", "Original failure/ignore receipts retained separately" and the claim about "the later compatibility/native descendant" refer to local or private state a reviewer cannot see. Please drop them or link what they refer to.
- "All46" and "All27" are missing a space.
- "All46 current-head hosted checks passed": the 46 are 23 jobs counted twice (two identical
- 🔧 A native backend for this trait needs EdgeZero KV features that do not exist yet. The trait's stated purpose is to let a backend with real async I/O yield, but EdgeZero's
KvStore(imported in core asPlatformKvStore) offers onlyget_bytes,exists,put_bytes,put_bytes_with_ttl,deleteandlist_keys_page, and documents Fastly and Cloudflare KV as eventually consistent. It has no generation token, no conditional (add or if-generation-match) write, no metadata and no strong-consistency listing, andEcKvStorerequires all of these. The native follow-on therefore depends on EdgeZero asks rather than on Trusted Server plumbing. Please record that dependency in the spec's "Evidence and limits" section so the follow-on is scoped against it.
CI Status
- Analyze (actions): PASS
- Analyze (javascript-typescript): PASS
- Analyze (python): PASS
- Analyze (rust): PASS
- browser integration tests: PASS
- cargo check (cloudflare native + wasm32-unknown-unknown): PASS
- cargo check/build/test (spin native + wasm32-wasip1): PASS
- cargo fmt: PASS (required)
- cargo test: PASS (required)
- cargo test (axum native): PASS
- cargo test (cross-adapter parity): PASS
- cargo test (ts CLI, native) (macos-latest): PASS
- cargo test (ts CLI, native) (ubuntu-latest): PASS
- CI Node pin guard: PASS
- CLAUDE.md symlink guard: PASS
- CodeQL: PASS
- docs-proposal scripts: PASS
- format-docs: PASS (required)
- format-typescript: PASS (required)
- HTML EOF runtime (Fastly): PASS
- integration tests: PASS
- integration tests (Fastly EC lifecycle): PASS
- prepare integration artifacts: PASS
- trace runtime and browser acceptance: PASS
- ts dev lint domains (changed lines): PASS
- vitest: PASS
- worker-deadlines (cloudflare): PASS
- worker-deadlines (spin): PASS
There was a problem hiding this comment.
Superseded by a follow-up review with inline comments: #1526 (review)
dhruv8sh
left a comment
There was a problem hiding this comment.
Summary
Makes EcKvStore and its core callers async (async_trait(?Send)), with the Fastly adapter bridging at its synchronous entry-point hooks via sequential block_on calls. The conversion is mechanical and consistent, no guard is held across an await in production code, and CI is green. Two non-blocking nits.
Non-blocking
⛏ nitpick
- Spec cites commits that don't exist here — see inline at
docs/superpowers/specs/2026-11-10-shared-async-ec-design.md:5 - Test name claims a Fastly executor boundary it doesn't exercise — see inline at
crates/trusted-server-core/src/ec/pull_sync.rs:950
CI Status
- Analyze (actions): PASS
- Analyze (javascript-typescript): PASS
- Analyze (python): PASS
- Analyze (rust): PASS
- browser integration tests: PASS
- cargo check/build/test (spin native + wasm32-wasip1): PASS
- cargo check (cloudflare native + wasm32-unknown-unknown): PASS
- cargo fmt: PASS
- cargo test (axum native): PASS
- cargo test (cross-adapter parity): PASS
- cargo test: PASS
- cargo test (ts CLI, native) (macos-latest): PASS
- cargo test (ts CLI, native) (ubuntu-latest): PASS
- CI Node pin guard: PASS
- CLAUDE.md symlink guard: PASS
- CodeQL: PASS
- docs-proposal scripts: PASS
- format-docs: PASS
- format-typescript: PASS
- HTML EOF runtime (Fastly): PASS
- integration tests (Fastly EC lifecycle): PASS
- integration tests: PASS
- prepare integration artifacts: PASS
- trace runtime and browser acceptance: PASS
- ts dev lint domains (changed lines): PASS
- vitest: PASS
- worker-deadlines (cloudflare): PASS
- worker-deadlines (spin): PASS
Per the user, every feature is built once and works on every adapter in platform order, with platform gaps sent to EdgeZero (DEC-16, SH-5). T21 moves the identity routes, EC lifecycle, providers and write-back into one router in core that each adapter mounts; A2, A10, T8, T9, T17 and T18 shrink to turning it on per adapter and passing the conformance suite, and T7, T14 and A11 fold into A2 and A10. EZI-2a adds EdgeZero's local store for Axum development and EZI-4 binds Axum's geo provider from the manifest. Restack the Axum RC units on #1506: #1531 carries A1 in place of #1528, #1533 and #1534 close as copies of #1525 and #1526, and the image and Terraform units sit directly on #1532 so A6 and A7 stop waiting on A2. Record #1566, refresh the provider stack's fixes at their current heads, and flag #1535 as unplanned.
…1622 into rc/identity #1622 (244ca26) now carries the whole chain, each PR merging the one below it: - #1506 (c197404) repins EdgeZero to rc/identity at d063a8e7, which carries EdgeZero main's Fastly SDK 0.13.3 upgrade through every EdgeZero PR here, and merges Trusted Server main's upgrade (#1671): fastly 0.13.3, url 2.5.9 and Viceroy 0.22.0. - #1614, #1525, #1526, #1487 and #1488 take it in turn. #1488 also adds b2d4bfd, which records known UID hashes with a setter. - #1489, the identity spine (#1639, #1640, #1612, #1628 and #1623), #1531 and #1532. - The Axum serving line: #1613, #1616, #1617, #1615, #1635, #1637 and #1627, chained, with #1627's b958107 decoding the Spin discovery document with Response::json and #1627's merge of #1625, which brings #1625's Wrangler pin into the chain. - The held line on #1627: #1533, #1534, #1536, #1535, #1537, #1539, #1538, #1540, #1566, #1624, #1641, #1642 and #1646. #1646 keeps its own shared after-response runner in ec::app::lookups. - #1636 (72096cd) on #1646 (b5a5f62), draining Axum after-response identity tasks on SIGTERM through #1646's shared runner. - The EC route line on #1636: #1626 (067531e), which merges #1636, the draft #1656, #1661, #1662 and #1622, and through #1622's merge of it, #1620's round-6 head. Each conflict was resolved in the PR that sits higher. This merge is clean. Since the last update the chain also takes #1488's hashed-email intake (a610152 and 9104fd3) and its POST, body and header options for the status call (f063a76), #1627's split of the generic runtime KV store into trusted_server_runtime_kv (4d0c1a2), #1646's gate on identity writes for rejected clients (aa31559) its native container test of the failure router (4f4c036) and that test's header check on an ordinary route (71a573a), #1626's withholding of a mirrored UID while another source owner is opted out (d07f789), and #1617's description of the Axum startup failure router (6d174a8) and of the startup failures that still exit before listening (4c07cad). #1636 no longer sits in the Axum serving line; it arrives through #1626, which merges it on top of #1646. Its new head adopts #1646's after-response runner in place of the one rc/identity took with cf1102c. Cloudflare guide: #1627's merge of #1625 now keeps both #1625's tool version clause and #1627's TRUSTED_SERVER_RUNTIME_KV binding in the smoke paragraph, and fixes #1625's smoke script test for #1617's Python floor and Worker build, and #1537's merge fixes its ts stub for #1537's storage template step, so this merge needs no resolution.
Source: review/shared-async-ec at 5fa4461.
|
For the identity integration branch (#1608), I pushed |
|
For the identity integration branch (#1608), I pushed Takes #1525's new head c278d56, which carries #1506's repin of EdgeZero to rc/identity at 1619078a (8edc50e), a revert that removes IABTechLab/edgezero#522 (portable Fastly record providers) and IABTechLab/edgezero#524 (outbound mTLS client identities). The merge is clean. |
Add finalize and generate_if_needed regressions that run inside futures::executor::block_on, which Fastly uses for dispatch and the finalize hook, so a nested block_on fails with EnterError in tests. Rename the pull-sync regression to match and give its assertions messages. Pin that withdrawal keeps the request snapshot on the active ID when the cookie names another identity, and list generate_if_needed's persist and collision errors.
State on EcKvStore that a dropped future may leave a write committed, and describe the Fastly backend without rules for native backends that do not exist. The private BatchSyncWriter takes a generic writer, so it no longer needs async_trait or a boxed future per mapping group.
Fastly drives dispatch, the finalize hook and post-delivery work with futures::executor::block_on, which panics when nested. Add a --lib clippy pass that rejects futures::executor::block_on in trusted-server-core outside tests, run it in the format workflow and list it as CI gate 18.
Replace unverifiable commit, tree and checksum references with the implementing commit and its EdgeZero adaptation, describe the single finalize bridge and #1506's post-delivery bridge, correct the EcFinalizeState fields and regression list, and record the integration gap and EdgeZero record-store dependency for a native backend.
|
This comment answers the review-level points from @aram356's reviews (round 1, round 2). Inline threads each have their own reply.
Commits: 91ce692 (executor and snapshot regressions, |
PR #1525's new head brings wave B: #1506's merge of main ab5c24f (#1501, js_asset_proxy rewriter ordering) and its repin of EdgeZero to rc/identity 8a73c0978806, carried up through the chain. The merge is clean. Cargo.lock changes only the 10 EdgeZero package sources, now at 8a73c097; the codegen crate's nested Cargo.lock is unchanged.
|
Round 12 identity realignment:
Each merge message says what it carries and how any conflict was resolved. |
PR #1525's new head brings #1506's repin of EdgeZero to rc/identity ef5cbf30, which renames Fastly backends to ez_b31v2_* and moves the yanked pin-project-lite, chacha20 and spin. The merge is clean. Cargo.lock changes only the EdgeZero package sources (now ef5cbf30) and the yanked pin-project-lite, chacha20 and spin; the codegen crate's nested Cargo.lock is unchanged.
|
Round 15 identity realignment:
Each merge message says what it carries and how any conflict was resolved. |
…ntegration chain
|
Merged #1614's Trusted Server owns the This merge takes #1525's new head ( Checks on this head: no conflict markers; |
|
Merged #1525's new head into this PR to carry the #1608 review fixes up the stack. This PR has no fix commits of its own. |
Summary
EcKvStore) and its core callers awaitable with local, non-Sendfutures.futures::executor::block_onin its synchronousfinalize_responsehook. Post-delivery pull sync runs under the existingrun_post_deliverybridge from Cut Trusted Server over to EdgeZero PR 275 #1506.scripts/lint-core-block-on.shso core production code cannot callblock_on.Native persisted EC, deployment and production readiness are out of scope.
Stack
Base:
review/http-auction-provider(#1525). Chain: #1506, #1614, #1525, #1526 (GitHub stack 1621, identity integration branch #1608).Changes
Sendlocal futures and retained write and precondition semantics.finalize_response.scripts/lint-core-block-on.shin the format workflow andAGENTS.mdgate 18.Closes #1522.
Test plan
graph_lookup_yields_to_other_work_with_a_non_send_store;finalize_completes_under_futures_block_on,generate_if_needed_completes_under_futures_block_onanddispatch_pull_sync_completes_under_futures_block_on(each fails withEnterErrorif its path nestsblock_on);finalize_withdrawal_keeps_the_active_snapshot_when_the_cookie_id_differs.6fd71bb50:cargo fmt, the six adapter clippy aliases,scripts/lint-core-block-on.sh,test-fastly,test-fastly-reuse,test-axum,test-cloudflare,test-spin.No native provider, cancellation rollback or fleet consistency is implied.