Update Proof of absence for 2 or more missing stems and serialize DepthExtensionPresent accordingly to match implementation in rust-verkle#6
Draft
eclairss17 wants to merge 2 commits into
Conversation
…r a single PoA Stem and serialize DepthExtensionPresent
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
go-verkle was sending only 1 OtherStem in the wire format regardless of how many missing stems shared the same PoA stem. Compact, but this made the proof unverifiable by rust-verkle, which expects one OtherStem entry per missing stem to know which PoA stem proves absence for which missing key.
go-verkle now sends N OtherStems (one per missing stem) in the wire format, matching the rust-verkle expectation.
Discussion
The code change is a correctness fix, not a size optimization.
Before the change, go-verkle was silently dropping OtherStems from the wire format when multiple missing stems shared the same PoA stem. In order to use rust-verkle, if it would receive a proof it cannot correctly map back to the queried keys.
The internal representation was already correct and deduplicated in both versions.
proof.PoaStems is always 1 for N missing stems sharing the same PoA. This is unchanged. The optimization lives here, only one proof-of-absence path is computed cryptographically regardless of how many missing keys reference it.
The wire format now increases with the number of missing stems.
The OtherStems list grows linearly: N missing stems → N wire entries × 31 bytes each. The cryptographic proof (commitments, IPA) does not grow, those stay constant.
The actual tradeoff is correctness vs. wire size.
Verified cross-implementation proofs cost 31 bytes per additional missing stem that shares a PoA. For the mainnet 8-slot scenario, that is 217 extra bytes (33.5% total proof overhead) to gain rust-verkle compatibility.