Repository navigation
id: native bridge dialer in id-sync — the Rust peer role over the bridge wire (#3818) - #12993
Merged
Merged
Conversation
The hosted signed-object bridge v1 landed its endpoint, protocol core and store in PR #12911; the design record named the remaining leg: the Rust dialer inside id-sync, the /id-range-sync/1 peer role over the bridge wire. This is that dialer. crates/id-sync/src/bridge.rs: - The wire codec: one-byte tags, the batch encoding with the hosted receipt bounds enforced in the hosted codec's order, and the frame cap on receipt. - The ID-key proof: the bridge-auth transcript (id.bridge-auth.v1 / binding / nonce / leg / BLAKE3 body hash), signed with the binding record's key; the empty-body hash is the fixtures' pinned af1349b9... value. - BridgeStore: the per-step store seam (heads, sync entries, event bytes, batch ingest, chain frontier), implemented for the native EventStore over the existing RangeStore/ingest surface. - BridgeDialer: the session, mirroring the hosted reference client step for step — CHALLENGE/AUTH, HELLO or RESUME, the proof-carrying range exchange over the native range core (never a height comparison), bounded WANT/BATCH/WANT_END transfer with per-batch outcome summaries, DONE/TOKEN — plus withholding detection producing the investigation's evidence record, and sync_with_retry with the resume-rejected fallback to HELLO. - The transport seam is a trait over whole messages; the production implementation is tokio-tungstenite's WebSocketStream (new workspace dependency edge for id-sync), with a connect helper for the /v1/bridge/ws endpoint. Tests (cargo test -p id-sync bridge:: — 6 passed): batch codec round-trip and bound refusals; transcript and body-hash pins; a full session against a mirrored server session over an in-memory transport pair converging both directions (6 events each side, second session resuming on the token); withholding evidence when the server announces a head it never delivers; auth refusal for a wrong key; and the rejected-resume fallback. One assertion was corrected during verification: the want order is the range exchange's learning order, not chain order, so an event can land as Waiting and be released by its predecessor — the tally varies, the convergence does not. The design record's dialer bullet is updated to match, naming the two remainders: the one-shot HTTPS legs (challenge/heads/push/ pull) as native calls, and a live native-against-hosted session test. Part of #3818 (does not close it). Design source #2046; tracker #2852; PoC #2276.
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 8 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
This was referenced Nov 23, 2026
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.
Part of #3818 (does not close it — the one-shot HTTPS legs as native calls and a live native-against-hosted session test remain, named in the design record). Design source #2046; tracker #2852; PoC #2276.
What this is
The native half of the signed-object bridge v1. PR #12911 landed the hosted endpoint, protocol core and store; its design record named the remaining leg — the Rust dialer inside id-sync, the
/id-range-sync/1peer role over the bridge wire.crates/id-sync/src/bridge.rsis that dialer:id.bridge-auth.v1/ binding / nonce / leg / BLAKE3 body hash) signed with the binding record's key; the empty-body hash is the fixtures' pinnedaf1349b9…value.BridgeStore— the per-step store seam (heads, sync entries, event bytes, batch ingest, chain frontier), implemented for the nativeEventStoreover the existingRangeStore/ingest surface.BridgeDialer— the session, mirroring the hosted reference client step for step: CHALLENGE/AUTH, HELLO or RESUME, the proof-carrying range exchange over the native range core (never a height comparison), bounded WANT/BATCH/WANT_END transfer with per-batch outcome summaries, DONE/TOKEN — plus withholding detection producing the investigation's evidence record, andsync_with_retrywith the resume-rejected fallback to HELLO.WebSocketStream(new dependency edge for id-sync, already a workspace dependency), with aconnecthelper for/v1/bridge/ws.Verification
cargo test -p id-sync bridge::innix develop(laptop worktree off origin/main): 6 passed / 0 failed — batch codec round-trip + bound refusals; transcript/body-hash pins; a full session against a mirrored server session over an in-memory transport pair converging both directions (second session resuming on the token; the convergence test additionally run 5× standalone, 5/5); withholding evidence when the server announces a head it never delivers; auth refusal for a wrong key; rejected-resume fallback.One assertion was corrected during verification: the want order is the range exchange's learning order, not chain order, so an event can land as Waiting and be released by its predecessor — the batch tally varies, the convergence does not. The test now asserts the protocol's actual guarantee (all learned events received, none refused, store converged, chain frontier at 3).
cargo fmt --checkclean for the new file; the design record's dialer bullet is updated in this PR.Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.