feat: serve dig.getManifest locally from the embedded public manifest#1
Merged
Conversation
#176 Phase C: dig.getManifest moves from a blind-passthrough alias to a
LOCAL read, resolving the normalized PublicManifest (.dig data-section id
13, Phase A) embedded in a held capsule's compiled module.
- dig-node-core: new Node::get_manifest + read_public_manifest_blocking
(spawn_blocking, mirrors serve_local_blocking). Params {store_id, root}
(a capsule identifier, no retrieval_key needed - the manifest is public,
unencrypted data). A held module with no manifest section (an older
.dig, or a private store) returns `result: null`, never an error
(store-format backwards-compatibility rule); a capsule not held at all
reports -32004, matching dig.fetchRange's miss code.
- dig.stage now sets FinalizeOptions.include_public_manifest for PUBLIC
stores, matching the digstore CLI's own commit rule (a new required
field added by the digstore rev bump below).
- Bumped the pinned digstore rev (dig-node-core + dig-wallet, kept in
sync) to the tip carrying the public-manifest format extension, and
added digstore-compiler as a direct dependency for
extract_data_section_blob (already a transitive dep via digstore-stage).
- dig-node-service: meta.rs catalogue entry flipped to served: "local"
with an updated summary; doc comments in server.rs/rpc.rs updated to
match.
- SPEC.md/README.md/USER_JOURNEY.md updated to describe the new local
behavior instead of the old passthrough alias.
- Tests: dig_get_manifest_returns_embedded_manifest_json_when_present,
dig_get_manifest_returns_null_when_section_absent,
dig_get_manifest_reports_unavailable_when_capsule_not_held,
dig_get_manifest_rejects_malformed_params_without_touching_disk. The
existing passthrough_alias_methods_are_method_not_found_on_the_node
test and the openrpc_drift_guard suite were updated/re-verified against
the new classification.
Verified: cargo fmt --all -- --check, cargo clippy --workspace
--all-targets --all-features -- -D warnings, and cargo test --workspace
all green (dig-node-core 193, dig-node-service 92, dig-wallet 71,
dig-runtime 3 - zero failures).
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.
Summary
#176 Phase C:
dig.getManifestmoves from a blind-passthrough alias to a LOCAL read, resolving the normalizedPublicManifest(.digdata-section id 13, Phase A — already merged in digstore's store-libs) embedded in a held capsule's compiled module.dig-node-core: newNode::get_manifest+read_public_manifest_blocking(runs onspawn_blocking, mirroringserve_local_blocking). Params{store_id, root}(a capsule identifier —storeId:rootHash, matchingdig.getAvailability/dig.fetchRange's shape); noretrieval_keyneeded since the manifest is PUBLIC, unencrypted data.result= the manifest JSON ({schema_version, entries:[...]}, byte-identical toPublicManifest::to_json)..dig, or a private store) →result: null— never an error (store-format §5.1 backwards-compatibility rule).-32004(same codedig.fetchRangeuses on a miss).store_id/root→-32602before any filesystem access.dig.stagenow setsFinalizeOptions.include_public_manifestfor PUBLIC stores (matching the digstore CLI's own commit rule) — required because the digstore rev bump below adds this as a new field on that struct.dig-node-coreanddig-wallet, kept in sync per the existing "bump together" contract) to the tip carrying the public-manifest format extension (digstore-core/-store/-compiler/-stageetc., nodigstore-guestchanges — the vendored guest wasm did not need rebuilding). Addeddigstore-compileras a direct dependency ofdig-node-coreforextract_data_section_blob(a pure wasm-binary-format parse — no wasmtime instantiation needed to read this public section).dig-node-service:meta.rscatalogue entry flippedserved: "passthrough"→"local"with an updated summary; doc comments inserver.rs/rpc.rsupdated to match (a clarifying comment was added torpc.rsexplainingRoute::Passthroughthere is a request-normalization classification, independent of local-vs-relay serving).SPEC.md/README.md/USER_JOURNEY.mdupdated to document the new local behavior (including a new SPEC §5.5.1) instead of describing it as a blind-passthrough alias.Version bump
dig-node-core0.1.0→0.2.0anddig-node-service0.3.0→0.4.0— minor: a new capability (dig.getManifestis now resolved by the node instead of always relaying to the upstream), fully backwards compatible (existing callers of the method still get an answer; everything else is unchanged).Tests (TDD — written before the implementation)
dig_get_manifest_returns_embedded_manifest_json_when_presentdig_get_manifest_returns_null_when_section_absentdig_get_manifest_reports_unavailable_when_capsule_not_helddig_get_manifest_rejects_malformed_params_without_touching_diskBoth manifest-presence tests build a real compiled
.digmodule viadigstore_stage::stage_and_compile(not a mock) so the data-section extraction + decode is exercised end-to-end. The pre-existingpassthrough_alias_methods_are_method_not_found_on_the_nodetest was updated to dropdig.getManifestfrom the passthrough-alias list, and theopenrpc_drift_guardsuite (which dispatches every catalogued method through the realhandle_rpc) was re-verified green against the newserved: "local"classification.How verified
cargo fmt --all -- --check— clean.cargo clippy --workspace --all-targets --all-features -- -D warnings— zero warnings.cargo test --workspace— all green:dig-node-core193 passed,dig-node-service92 passed (incl. the 5openrpc_drift_guardtests + the 25server.rsintegration tests),dig-wallet71 passed,dig-runtime3 passed. Zero failures.digstore-*crate across the whole workspace (dig-wallethad its own independent, now-stale pin — bumped it too to keep the documented "same rev as the node" invariant).Note: this repo's current required PR checks are "Lint commit messages" (commitlint) and "Check version increment" only — there is no
ci.ymlrunningcargo test/clippy/fmtas a required gate yet. I ran all of the above locally per the ecosystem-wide contract; adding a dedicated CI workflow for it would be a separate, repo-wide infra task.