Skip to content

Deduplicate relay events after verification - #6

Merged
sol-znn merged 2 commits into
sol-znn:092026-auditfrom
edgepillar:codex/verified-relay-delivery
Sep 15, 2026
Merged

sol-znn merged 2 commits into
sol-znn:092026-auditfrom
edgepillar:codex/verified-relay-delivery

Conversation

@edgepillar

@edgepillar edgepillar commented Sep 12, 2026

Copy link
Copy Markdown
Contributor

Record relay event IDs only after the existing WASM verification succeeds. A synchronous acceptance gate lets session and board consumers apply each verified event once, including when multiple copies finish verification concurrently. Pending verification and deliveries from retired connections are prevented from updating a replacement session or board.

Adds 12 offline regression tests using the actual relay pool, session, board, and Vue modules with fake sockets and stubbed API replies. The suite runs through npm test and the existing build workflow. No dependencies are added.

Targets 092026-audit at 028c03d01c27494a420dc19df121fb39d6da3be8, including the merged #8 and #9 changes. Both the date-formatting and relay-delivery checks are retained in npm test and the build workflow. The contribution remains limited to six files and the relay-delivery scope discussed in #5.

Local validation of 09e87d70aed58dcba9554acdc611f9ee75310aac with Node 24.19.0 and Go 1.27.1:

  • npm test passed: Go tests, wallet-provider checks, printed-command checks, date-formatting checks, 12/12 relay tests, and production WASM smoke checks. The relay suite uses its existing runner without TypeScript transformation flags.
  • npm run typecheck and npm run lint passed.
  • go test -race ./..., host go vet ./..., and GOOS=js GOARCH=wasm go vet ./... passed.
  • Production and development builds passed; each WASM smoke suite passed 145/145 checks.

The relay fixtures are synthetic and contain no keys or signed messages. JavaScript fetch access was disabled through a local preload for npm test and the development smoke run; Go HTTP tests used their own local test servers. Dependencies were reused from an installation with the identical lockfile. These are local results, with no live wallet/chain or hosted-CI validation claimed.

@sol-znn

sol-znn commented Sep 13, 2026

Copy link
Copy Markdown
Owner

Please let me know when this is ready for review

@edgepillar
edgepillar force-pushed the codex/verified-relay-delivery branch from f7c932a to 09e87d7 Compare September 13, 2026 05:05
@edgepillar
edgepillar marked this pull request as ready for review September 13, 2026 05:06
@edgepillar

Copy link
Copy Markdown
Contributor Author

Ready for review at 09e87d70aed58dcba9554acdc611f9ee75310aac.

Rebased onto the current 092026-audit (028c03d01c27494a420dc19df121fb39d6da3be8). The package/workflow conflicts are resolved with both the date-formatting checks from #9 and the relay-delivery checks preserved. The relay implementation and its 12 regression tests are unchanged; the PR still covers six files.

Local validation passed with Node 24.19.0 and Go 1.27.1: the full npm test chain, including 12/12 relay tests with the existing runner; typecheck and lint; Go race tests and vet for both targets; production and development builds, each with 145/145 WASM smoke checks. JavaScript fetch access was disabled for the full test chain and smoke runs. No live wallet/chain or hosted-CI result is claimed.

The separate #7 integration concerns remain tracked in #7 (comment).

0x3639 added a commit to 0x3639/ferry-web that referenced this pull request Sep 13, 2026
…pe stripping

Two findings from review of the branch (edgepillar, PR sol-znn#7).

The Web Lock wrapper discarded the promise that locks.request returns. A
request the manager rejects before granting -- the specification allows a
SecurityError -- never invokes the holder, so nothing answered the call and
it hung past the API timeout, which starts only once the lock is held. The
rejection is now handled: before a grant it answers the call as a refusal,
naming the reason; once the holder is running it changes nothing, because
the work is under way and its save may already have landed, so the only
true answer is the work's own. The answer goes through a once, so no path
can send twice on the channel from a browser callback, and a manager that
throws synchronously releases both callbacks it never took. The smoke
suite stands in a lock manager for each shape: refused before grant,
granting in order and serialising two calls, rejecting after the holder
has released, rejecting while it still runs, and throwing; and it counts
any rejection left unhandled as a failure.

EngineError declared its code as a constructor parameter property, which
Node's type stripping refuses. Nothing under Node reached wasm.ts on this
branch alone, but sol-znn#6's relay test loads useSession.ts, which now imports
isStaleWrite from it, so the combined tree failed to load. The field is
declared and assigned instead. Verified by merging sol-znn#6 on top and running
its relay:delivery on Node 24: fails before, 12/12 after.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TiMc1yHDcGagiEPA6udCjm
@sol-znn
sol-znn merged commit 37a4e69 into sol-znn:092026-audit Sep 15, 2026
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