Repository navigation
id: walking skeleton B2(c) — the B09 exchange over the transport between two processes (#12232) - #12652
id: walking skeleton B2(c) — the B09 exchange over the transport between two processes (#12232)#12652dezren39 wants to merge 10 commits into
Conversation
…processes (#12232 B2(c)) net_exchange: summaries first, then sets, delivery and fetch over the existing iroh framing/connect path; offers computed by Replica::offer on both sides, admission always the receiving replica's own store and gate. Inventory::from_objects builds an inventory from a peer's report. substrate_sync_transport runs the five steps with node B in a child process.
…from_boxed (#12232 B2(c))
…artifact-style (#12232 B2(c))
|
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 33 seconds. 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. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c16d1a896c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| let mut link = self.link.lock().await; | ||
| answer(&mut replica, &self.scope, &mut link, request) |
There was a problem hiding this comment.
Keep exchange state local to each accepted connection
When two initiators exchange with the same responder concurrently, both handlers use this shared LinkState. Their Hello and Sets requests overwrite each other's peer_name, now, and backward_offer; the first Fetch then consumes whichever offer was stored last, and the second fails with fetch before the sets step. Deliveries can also be attributed to the wrong peer or evaluated at the other exchange's logical time. The per-request mutex does not prevent this interleaving between rounds. Create a separate LinkState inside each accept invocation while continuing to share the replica.
Useful? React with 👍 / 👎.
| let Response::Delivered { outcomes } = roundtrip( | ||
| &conn, | ||
| &Request::Deliver { | ||
| versions: forward_versions, | ||
| }, |
There was a problem hiding this comment.
Batch transferred versions within the framing limit
When the missing versions collectively exceed the frame limit, this sends all of them in one Deliver message, but id_core::frames::write_frame rejects payloads over 1 MiB. For example, two envelopes with 300 KiB payloads each serialize to approximately 1.23 MB because payload bytes are hex-encoded, although either envelope individually fits. The exchange therefore fails before transferring anything, and retries make no progress. The responder's Fetch response has the same aggregation problem. Split transfers into bounded batches, with corresponding protocol support, so an otherwise transferable backlog does not permanently prevent synchronization.
Useful? React with 👍 / 👎.
|
Closing this PR without merging — the slice it implements has already landed on What landed on main while this branch was in flight (felix's lane, direct commits):
This branch's implementation ( The one non-duplicate piece, the B2 state-line update in the plan, is re-filed on a fresh branch off current main. |
Slice B2(c) of #12232 (the #9106 walking skeleton): the five steps now run between two processes over the existing iroh transport, not only between two in-process nodes.
What lands
id_sync::federation::net_exchange(new module, declared infederation/mod.rsper D13): the wire form of B09'sreconcile. One request/response stream per round overid_core::framesframing on a fresh connection per exchange; offers are computed by the realReplica::offeron both sides, admission is the realReplica::receive(B32 gate, D14 join), and outcomes cross the wire as applied / conflict (report id survives) / resolved / held / refused — no module on the path is stubbed.Inventory::from_objectson the B09 slice: the wire-source counterpart toReplica::inventory.crates/id-sync/tests/substrate_sync_transport.rs: the acceptance oracle as one integration test — node B runs in a child process (this test binary re-invoked), driven over a test-only control protocol that touches only B's local side. Steps: signed record written at itsid://address on A → not held on B → exchange carries it → B reads back the byte-identical signed bytes from the address → repeat exchange is quiet → conflicting writes on both nodes → exchange reports the conflict on both, with the same key/versions/base → merge on B → exchange resolves it on both → reports closed, merge readable from its address on both nodes → B exits cleanly.Verification
Fleet-run on developing-today/fleet, repo code at this branch,
cargo test -p id-syncinsidenix develop ./pkgs/id: success (run 45054268468) — the whole id-sync crate: library suites, the in-process five-step path, and the new two-process transport test all pass. Earlier focused runs: 45053294701 (transport + sibling suites green).Not in this PR
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.