BM-3084: fix(market): restore risc0 Digest wire format for deployed-guest inputs - #2060
Merged
Conversation
The SDK decoupling (#2039) replaced risc0_zkvm::sha::Digest ([u32; 8], postcard varint words) with a byte-backed Digest ([u8; 32], raw bytes), silently changing the postcard encoding of every digest embedded in guest inputs. Hosts feeding the deployed assessor guest (image 0x6c5a03c0...) then produce undecodable AssessorInput bytes: the guest panics with DeserializeUnexpectedEnd. CI cannot catch this drift because the in-repo guest rebuilds with the same type, so both sides move together; only the boundary to already-deployed guests breaks. Pin Digest's serde to risc0's word-wise layout (eight little-endian u32 words) and add a byte-exact regression test. Verified against the deployed assessor guest: the encoding is byte-identical to v2.0.2's and the live guest ELF executes past input decode.
ASSESSOR_IMAGE_URL overrides the fulfiller's default assessor guest source (any downloader scheme, e.g. file://). Useful for proving a locally built assessor guest against a router adapter that pins its image id, e.g. in test deployments.
jonastheis
requested review from
a team,
Wollac,
bobbobbio,
capossele,
nahoc,
unizarr,
willemolding and
zeroecco
as code owners
July 7, 2026 09:18
|
Bugbot is not enabled for this team, so this pull request was not reviewed. Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs. |
capossele
approved these changes
Jul 7, 2026
bobbobbio
approved these changes
Jul 7, 2026
bobbobbio
left a comment
Contributor
There was a problem hiding this comment.
thanks for fixing this
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.
The SDK decoupling (#2039) replaced
risc0_zkvm::sha::Digestwith a boundless-nativeDigest, which silently changed the postcard wire format of every digest embedded in guest inputs: risc0'sDigestis[u32; 8](postcard: eight varint-encoded words), the new type was[u8; 32](postcard: 32 raw bytes). Any host proving the deployed assessor guest (image0x6c5a03c0…) now feeds it undecodableAssessorInput— the guest panics withPostcardDeserializeError(DeserializeUnexpectedEnd).CI cannot see this class of drift: the in-repo assessor guest rebuilds with the same type, so host and guest move together and every test stays green. Only the boundary to already-deployed guests breaks. That boundary is load-bearing for the router migration:
R0BoundlessAssessorAdapterdeliberately pins the deployed guest image ("today's R0 STARK assessor proofs remain bit-identically verifiable through the router — no guest changes required"), so both the CLI fulfiller and the broker's STARK-assessor fallback depend on it. Surfaced during router-native market validation on Taiko, where the open-path fulfillment flow (#2052) proved the deployed assessor guest for the first time from this tree.Changes
boundless-market/src/digest.rs— replace the derived serde with customSerialize/Deserializeencoding eight little-endianu32words, wire-identical torisc0_zkvm::sha::Digest. The encoding is a compatibility contract with deployed guests, not an implementation detail; a comment on the impl says so. Verified byte-identical to the v2.0.2 encoder's output, and the deployed assessor guest ELF executes past input decode with an input encoded by this tree.boundless-market/src/digest.rs(test) — byte-exact regression test pinning the postcard encoding (0x42424242word →c2 84 89 92 04, ×8) plus roundtrip, so any future serde change on this type fails loudly instead of drifting.boundless-cli/src/lib.rs—ASSESSOR_IMAGE_URLenv override for the fulfiller's assessor guest source (any downloader scheme, includingfile://), so a locally built guest can be proven against a router adapter that pins its image id in test deployments.Related: #2039 (regression source), #2052 (open-path fulfillment flow that first exercised the deployed-guest boundary).