test: AvlTree degenerate-input eval regressions (pairs with ergo_avltree_rust#14)#892
Draft
mwaddip wants to merge 3 commits into
Draft
test: AvlTree degenerate-input eval regressions (pairs with ergo_avltree_rust#14)#892mwaddip wants to merge 3 commits into
mwaddip wants to merge 3 commits into
Conversation
… verifier semantics The reference impl's verifier construction never throws: a proof that does not match the tree digest yields a verifier with no reconstructed tree, every op fails, and each method maps that per its own semantics (CErgoTreeEvaluator): contains → false (failed lookup); get/getMany → "Tree proof is incorrect" (and getMany with no keys returns the empty collection — no lookup runs); insert → raise pre-v3 / None from v3 (issue #908), None with no entries; update/remove → None (None digest). sigma-rust's BatchAVLVerifier::new instead errors at construction on the digest mismatch, and every method but insertOrUpdate (PR ergoplatform#886) propagated that as an eval error. Catch it per method; the op loops and digest inspection already mirrored the reference. Pinned by prover-built wrong-tree proof tests per method and the JVM-blessed byte vectors (santa-eval AvlTree.wrong_tree_proof contains-false/update-none/remove-none, AvlTree.insert_wrong_tree insert-none). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…e the reference impl The reference impl's remove_eval loops with cfor — no break, no result check: a failed remove invalidates the verifier and the None digest decides the outcome (None). sigma-rust raised "Incorrect remove" at the first failed op, so a valid proof carrying ops that fail against it (e.g. removing a key the proof does not commit) errored where the JVM evaluates to None. Pinned by a valid-proof/mismatched-op test. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
… proof, bad keyLength) Pin the eval-layer behavior for the F4 degenerate-input family: garbage/ unparseable proof bytes and a wrapped-negative key length must route through the wrong-tree-proof arms (contains -> false, get -> raise) once the verifier crate returns an error instead of panicking — rather than crashing the evaluator. The tests are #[ignore]d: they require ergo_avltree_rust with the no-panic fix (ergoplatform/ergo_avltree_rust#14), which is not yet released. Un-ignore on its release + version bump. The op-level wrong-value-length mode (santa-eval AvlTree.per_op_failure) is covered crate-side in ergoplatform#14 and routes like the existing insert-bad-proof test once the op returns Err. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
Draft. Eval-layer regression tests for the F4
AvlTreedegenerate-input family (SANTA conformance): garbage/unparseable proof bytes and a wrapped-negative key length.Merge together with ergoplatform/ergo_avltree_rust#14 (the producer fix). The verifier crate currently panics on these inputs; #14 makes it return
Err, mirroring the reference scorex verifier'sTry-wrapped reconstruction. With that fix, these inputs route through the wrong-tree-proof arms (contains→false, get→raise) instead of crashing the evaluator.Blocked on #14's release + version bump — the tests are
#[ignore]d until then (validated locally via[patch.crates-io]).Stacked on #890 (the wrong-tree-proof arms); merge #890 first. The negative-keyLength cost adjustment is cost-only (#876 / eni), not here.