Skip to content

id: walking skeleton B2(c) — the B09 exchange over the transport between two processes (#12232) - #12652

Closed
dezren39 wants to merge 10 commits into
mainfrom
archer-lane-q/12232-walking-skeleton
Closed

dezren39 wants to merge 10 commits into
mainfrom
archer-lane-q/12232-walking-skeleton

Conversation

@dezren39

@dezren39 dezren39 commented Nov 22, 2026 •

Copy link
Copy Markdown
Member

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 in federation/mod.rs per D13): the wire form of B09's reconcile. One request/response stream per round over id_core::frames framing on a fresh connection per exchange; offers are computed by the real Replica::offer on both sides, admission is the real Replica::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_objects on the B09 slice: the wire-source counterpart to Replica::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 its id:// 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.
  • Plan state line for B2 updated: (c) landed; (b) remains (id: keep versions and reports on disk through id_store::content_store (#12232 slice 4) #12492, in flight as PR id: keep versions and reports on disk through id_store::content_store #12497).

Verification

Fleet-run on developing-today/fleet, repo code at this branch, cargo test -p id-sync inside nix 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


Prove it works
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

archer added 10 commits November 22, 2026 16:19
…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.
@dezren39
dezren39 requested a review from a team as a code owner November 22, 2026 18:37
@coderabbitai

coderabbitai Bot commented Nov 22, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You'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.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: cd66025b-f256-47b8-b93a-bdaca50800e3
Commits

Reviewing files that changed from the base of the PR and between d4317f3 and c16d1a8.

Files selected for processing: 5

  • pkgs/id/crates/id-sync/src/federation/mod.rs
  • pkgs/id/crates/id-sync/src/federation/net_exchange.rs
  • pkgs/id/crates/id-sync/src/federation/slices/b09_anti_entropy.rs
  • pkgs/id/crates/id-sync/tests/substrate_sync_transport.rs
  • planning/plans/2026-11-21_results-first.md
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Share

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 22, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-22T18:41:21.400172Z c16d1a8 PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines +385 to +386
let mut link = self.link.lock().await;
answer(&mut replica, &self.scope, &mut link, request)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

Comment on lines +554 to +558
let Response::Delivered { outcomes } = roundtrip(
&conn,
&Request::Deliver {
versions: forward_versions,
},

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

@dezren39

Copy link
Copy Markdown
Member Author

Closing this PR without merging — the slice it implements has already landed on main by a parallel lane, and a second transport implementation should not merge on top of it.

What landed on main while this branch was in flight (felix's lane, direct commits):

  • f57406a64 "id: walking skeleton step 4 — the exchange session over the wire": id_sync::federation::exchange_net — the B09 exchange over iroh, plus tests/substrate_transport_path.rs, the five steps between two processes.
  • Follow-ups 939739a42 (replica lock released across peer waits) and b52a270fb (hello-time version offers on resumed exchanges), and Inventory::from_object_versions in B09 — the counterpart of this branch's from_objects.

This branch's implementation (net_exchange + substrate_sync_transport) was built independently and verified green — full cargo test -p id-sync via fleet-run 45054268468 — so the path is now proven twice over; that is the only reason this PR exists in a mergeable-but-duplicate state. It is stood down, not merged.

The one non-duplicate piece, the B2 state-line update in the plan, is re-filed on a fresh branch off current main.

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.

1 participant