Repository navigation
Conversation
(cherry picked from commit 37d3c9362166c3671e2cb771fc67d0acef1166a0)
(cherry picked from commit 6b4ff3761575793e1fbddf037476a9b9c3b6f3b4)
(cherry picked from commit 7c435b76fbdd88478a9325b117c92563f106da2a)
(cherry picked from commit 52a460c12b03e6c352f7c9a4cb207e38fc244bbf)
(cherry picked from commit d62dedba5fa61b164ce17f0953d3a3d39f534894)
The verifier now builds its queries from sorted_parents_and_points, which walked from a bucket root to the trie root with `while node != 0`. #150 bounded the same walk in record_key_paths by the trie's fixed depth so a corrupt parent id cannot spin forever; give this walk the same bound. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
ifma_normalize took words_to_limbs from ifma_committer, a module of the batched trie commitment change, which lands after this one here. Without it the crate does not build on x86_64. Define the helper next to its inverse, limbs_to_words, so both changes take it from one place. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…ir names The diff-scoped mutation gates left 15 survivors in the ported code. Eleven were real gaps, now covered: PathCommitments' is_empty and contains_key; its decode of a wire map that is not in key order or repeats an id (it must give what a BTreeMap gives); the message for a value that is not a map; and create_indexed_queries taking a leaf pair's value from the slot the pair names. That last one matters when a proof declares one level for a bucket and the key lies beyond the first segment: the pair then names another key's slot, and the queries must read that key from kvs or refuse, not use the value of the key that produced the pair. Four are equivalent and suppressed: the two position-reuse guards, the dedup of node ids that are already distinct, and the boundary already reviewed in create_leaf_node_queries, whose entry moves with the code now that the old function is test-only. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Performance Benchmark ComparisonCompared Detailed Comparison
|
Mutation testing - PASSMutation score: 100.0% (2/2 viable mutants killed)
No unsuppressed survivors or timeouts remain. |
Mutation testing - PASSMutation score: 100.0% (46/46 viable mutants killed)
No unsuppressed survivors or timeouts remain. |
This branch has not been deployed
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
Ports PR #5 of
suryuhh/salt-optimizations(commits37d3c93,6b4ff37,7c435b7,52a460c,d62dedb): how a proof holds its node commitments and how the verifier reads them.BTreeMapof 128-byte projective points.The wire format does not change.
Stacked on the vector MSM PR (
liquan/perf/vector-msm).Breaking API changes
SaltProof.parents_commitmentsis aPathCommitments, not aBTreeMap<NodeId, SerdeCommitment>. It keepslen,get,contains_key,keys,values,iter,insertandremove, but they take aNodeIdby value.SerdeCommitmentwraps anAffineElement, not anElement.ipa_multipoint::transcript::Transcript.stateis gone.New:
PathCommitments,AffineElement,multi_scalar_mul_affine,IndexedQuery,MultiPointProof::check_indexed.Changes on top of the external commits
sorted_parents_and_pointsis bounded. The verifier now builds its queries from this new function, which walked from a bucket root to the root withwhile node != 0. fix(salt): allow 2^40 bucket capacity and validate what proofs and witnesses decode #150 bounded the same walk inrecord_key_pathsby the trie's fixed depth; this walk gets the same bound.words_to_limbslives in the shared IFMA module. The external code took it from the batched-commitment module, which lands after this PR in this series. Without the move the crate does not build onx86_64.The decode preallocation is capped at 65,536 entries by the external series' own last commit.
Cherry-pick conflicts were shallow: imports,
multi_scalar_mul_par(already deleted by #152), and two type changes increate_sub_trie.Mutation gates
The diff-scoped gates left 15 survivors.
Eleven were real gaps and are now killed by four tests:
PathCommitments::is_emptyandcontains_key.BTreeMapof the same entries gives.create_indexed_queriesreading a leaf pair's value from the slot the pair names. If a proof declares one level for a bucket and a key lies beyond the first segment, the pair names another key's slot. The queries must read that key fromkvsor refuse, as the old form did, and never use the value of the key that produced the pair.Four are equivalent and suppressed with their reasons in
mutants/suppressions.toml: the two position-reuse guards, the dedup of node ids that are already distinct, and a boundary already reviewed increate_leaf_node_queries(now test-only, so its entry moves to the new function).Result on this head: cargo-mutants 65 of 65 viable mutants killed (3 suppressed, 34 unviable); spec-gate 2 of 2 killed (1 suppressed); suppression hygiene passes.
Testing
Passing on this head, on an Apple Silicon machine:
cargo fmt --all -- --check;cargo clippy --all-targets -- -D warnings, native and--target x86_64-unknown-linux-gnucargo test; withtest-bucket-resize(CI's settings); the random stress test;--no-default-featureswith and withouttest-bucket-resize. These include the byte-level round trip of the committed proof fixtures (salt/tests/proof_fixture_codec.rs).cargo check -p salt --target riscv64imac-unknown-none-elf --no-default-featurescargo check --all-targets --target i686-unknown-linux-gnuNot run:
ifma_normalize.rsand the vector decode insidePathCommitments' deserializer). No such CPU or emulator on the machine used; compiled and linted forx86_64only.Merging
Please keep this trailer in the squash message:
🤖 Generated with Claude Code