Repository navigation
feat(id): F12.5 blob provider — content-addressed blobs, bounded and journaled (#1062) - #12529
Conversation
blob.put / blob.get / blob.delete join the F12.4 registry as version-1 host requests (Join scope, default ceiling included, like kv.* and records.read). Bounds: content <= 4 KiB (MAX_BLOB_BYTES — the largest power-of-two content whose base64 encoding fits a maximal request-args document with its framing), <= 256 blobs, <= 256 KiB total content per world; blob ids are exactly 64 lowercase hex characters (validate_blob_hash), the iroh-blobs Hash spelling. Adds the blob_hashes_are_64_lowercase_hex test and the catalog pin for the new names.
WorldCore gains the per-world blob set (content address -> bytes). blob.put / blob.delete journal BlobStored / BlobRemoved before their result is delivered; the entries take journal version 14 (JOURNAL_VERSION_BLOB), so older binaries refuse such a journal at the header check. Putting content the world already holds is a no-op: the address is the same, so nothing is journaled. Replay re-checks every bound and verifies each blob against its content address — a stored entry whose content does not hash to its stated hash refuses the restore. Checkpoint compaction emits one BlobStored per live blob and the checkpoint declares only the index (hash + size); replay refuses a checkpoint whose declared index disagrees. Also fixes the max-version pin in write_lease_entries_require_journal_version_7: it asserted 12 while the kv slice had already moved MAX_JOURNAL_VERSION to 13, so the test failed on base; the pin now names version 14 with the trail extended. Tests (the #1062 exit shape for this provider): bound (blob_bounds_refuse_each_violation_with_a_reason, a_journal_past_the_blob_bounds_is_refused), refusal (ungranted and outside-ceiling puts are refused, counted, and store/journal nothing), replay (blob_entries_replay_and_survive_compaction, a_checkpoint_that_disagrees_with_its_blob_index_is_refused, hash-tampered and garbled journals refused, actor round trip including the duplicate-put no-op).
|
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 30 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. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d541381a67
ℹ️ 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".
| caps_ceiling: caps_ceiling.clone(), | ||
| schedules: schedules.clone(), | ||
| kv: kv.clone(), | ||
| blobs: blobs.clone(), |
There was a problem hiding this comment.
Keep combined provider state within the checkpoint scalar budget
When a world holds a full KV store, 64 maximal recurring targeted schedules, 256 1-KiB blobs, and 1,024 open participants, the new blob index pushes the checkpoint's scalar remainder above MAX_CHECKPOINT_PART_BYTES (192 KiB), although each individual store remains within its bounds. The same state without the blob index fits. checkpoint_entries only splits snapshots and event histories, so its scalar-size check continues to reject compaction while these live sets remain, allowing the journal to grow without trimming. Split the provider declarations too, or enforce a combined bound that guarantees a valid world can still compact.
Useful? React with 👍 / 👎.
| core.blobs.insert(blob_id(b"alpha"), b"alpha".to_vec()); | ||
| core.blobs.insert(blob_id(b"gamma"), b"gamma".to_vec()); | ||
| let entries = core.checkpoint_entries("state".to_owned()).unwrap(); |
There was a problem hiding this comment.
Add generated blob state-machine and replay coverage
The new blob provider has state and durability invariants, but its coverage consists entirely of fixed examples; the existing generated journal strategies also never produce BlobStored or BlobRemoved. This violates the testing doctrine in AGENTS.md, which requires property tests for invariants and model-based tests where a specification exists. Add generated put/delete histories against a bounded content-addressed-map model, checking duplicate-put accounting, refusal without mutation, and replay/checkpoint equivalence rather than relying only on this two-blob compaction fixture.
AGENTS.md reference: AGENTS.md:L37-L39
Useful? React with 👍 / 👎.
Second slice of #1062, per the 2026-11-21 decision order (
kvfirst — merged in #12489 — thenblob;http.fetchandnotifyafter). This lands theblobprovider end to end, following thekvpattern throughout.blob.put/blob.get/blob.delete, version-1 host requests, Join scope, in default ceilings. Bounds: content ≤ 4 KiB (MAX_BLOB_BYTES— the largest power-of-two content whose base64 encoding fits a maximal request-args document with its framing), ≤ 256 blobs, ≤ 256 KiB total content per world; blob ids are exactly 64 lowercase hex characters (validate_blob_hash), the iroh-blobsHashspelling.iroh_blobs::Hash::new, the same addressingworld_recordsuses for stored content).blob.put/blob.deletejournalBlobStored/BlobRemovedbefore the result is delivered; putting content the world already holds is a no-op that journals nothing. New entry kinds take journal version 14 (JOURNAL_VERSION_BLOB). Replay re-checks every bound and verifies each blob against its content address — a stored entry whose content does not hash to its stated hash refuses the restore, so the journal is self-verifying. Checkpoint compaction emits oneBlobStoredper live blob and the checkpoint declares only the index (hash + size — content would blow the checkpoint scalar bound); replay refuses a checkpoint whose declared index disagrees. Each use passes the standard grant/ceiling decision, which writes the audit entry. No new Wasm import.write_lease_entries_require_journal_version_7asserted 12 while the kv slice had already movedMAX_JOURNAL_VERSIONto 13, so that test failed on base; the pin now names 14 with the version trail extended.Exit-shape tests for this provider: bound (
blob_bounds_refuse_each_violation_with_a_reason,blob_hashes_are_64_lowercase_hex,a_journal_past_the_blob_bounds_is_refused), refusal (ungranted and outside-ceiling writes refused, counted, store/journal nothing), replay (blob_entries_replay_and_survive_compaction,a_checkpoint_that_disagrees_with_its_blob_index_is_refused, hash-tampered and garbled journals refused, actor round trip including the duplicate-put no-op).Evidence (venue: sandbox — the laptop queue/shell legs were down from this seat when checked, despite the keeper's broker restart):
validate_blob_hash/MAX_BLOB_ID_BYTES); id-worlds 88 errors (all naming the missing blob items:BlobStored/BlobRemoved,CheckpointBlobEntry,JOURNAL_VERSION_BLOB,check_blob_put,blob_id/blob_encode, theblobsfields). The provider does not exist on base.world::tests 470/470, including all 7 new blob tests. (Theworld::filter excludes the live-network modules whose ~40 sandbox failures are pre-existing and filed as id-worlds live-network tests fail with connect timeouts in the Muse sandbox (environmental) #12488.)Left open on #1062:
http.fetchandnotify(off by default, unlisted-host refusal), in the decision's order.Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.