Repository navigation
id: check the record join at admission, not only on read - #12470
Merged
Merged
Conversation
New federation::record_join module: is_joined_record / check_join open a joined version's body at admission and refuse each broken join with its own class (BodyNotEnvelope, BodyNotValidRecord, EventIdMismatch, ObjectMismatch, SignerMismatch). ConflictStore::ingest runs the check after the gate, whose refusals keep their precedence, and before any store state changes; refused versions never enter inventory, so replicas never offer them. The sync-path test now asserts all five pinned broken joins are refused at produce and at receive with their class; the path-loaded federation_b07/b09 suites load the new module beside the slices. Plan step B2(a) ticked.
developing-today-fleet
Bot
requested review from
a team and
dezren39
as code owners
November 22, 2026 07:53
|
Important Review skippedBot user detected. To trigger a single review, invoke the
|
This was referenced Nov 22, 2026
dezren39
added a commit
that referenced
this pull request
Nov 22, 2026
…#12492) New federation::record_store module beside record_join: canonical encodings for the gate Envelope (none existed) and for StoredReport, a NodeStore that ingests version records and report records as verified content over iroh's FsStore behind id_store::content_store with a small index file naming them, and a StoredReplica that writes admissions and report changes through at produce/receive and at the end of every exchange. Opening a node replays its version records through Replica::receive and checks the persisted report records against the rebuilt reports. Nothing in b07/b09 changes. The substrate sync-path test gains a restart test: the same exchange between disk-backed nodes dropped and reopened between steps, reading from id:// addresses with no exchange after a restart, the conflict report surviving under the same id, and a post-restart resolution staying closed across a further restart. Plan step B2(b) ticked. Stacked on #12470 (B2(a)).
This was referenced Nov 22, 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.
Closes #12279
Summary
pkgs/id/crates/id-sync/src/federation/record_join.rs(declared infederation/mod.rsin this change):is_joined_record/check_joinopen a joined version's body at admission and check the whole D14 join — body opens as a valid signed record, BLAKE3 envelope digest is the version's event id, the header's object is the record's graph, the version's key is the record's key. Each broken join is refused with its own class from a newJoinRefusalenum in the new module (not newRejectReasonvariants; the gate stays unaware of bodies).ConflictStore::ingestruns the check after the gate, so the gate's refusals keep their precedence and the three pre-existing sync-path tests pass unchanged, and before any store state changes: a refused version is never held, applied, or entered into inventory, so a replica never offers it to a peer.Replica::produceandReplica::receiveboth take this path.planning/plans/2026-11-21_results-first.mdis recorded as landed; (b) on-disk store is next.Evidence
cargo test -p id-sync --test substrate_sync_pathpinned that a broken-join version was admitted (Ok(IngestOutcome::Applied), "the gate does not read bodies") and refused only by the reader.cargo test --manifest-path pkgs/id/Cargo.toml -p id-sync --test substrate_sync_path— 4 passed. The rewritten test asserts each of the five broken joins is refused atproduceand atreceivefrom a peer with its class, never appears ininventory(), and the control record is still admitted and served.cargo test -p id-sync --lib record_join— 3 passed.--test federation_b07— 11 passed.--test federation_b09— 8 passed (both compile and pass against pristine main as well; verified before this change).bash .github/scripts/check-rust-module-reach.sh— OK (818 files in 91 crates, all reached).Merge Danger
IngestErrorgains aJoinRefusedvariant; exhaustive matches onIngestErrorelsewhere will fail to compile until they handle it (none exist in id-sync today).Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.