Add generic Unlink audit readiness helpers#1795
Conversation
| \n### CI Failure Hints\n\nFailed jobs: `checks`\n\nCopy-paste local triage:\n```bash\nmake check\nlake build\nFOUNDRY_PROFILE=difftest forge test -vv\n``` |
|
Added a no-output convenience wrapper for the common adapter/router call shape:
Validation passed locally:
|
|
Added a focused regression for the no-output value-call convenience wrapper:
Validation passed locally:
|
|
Added one more pass on the value-call surface:
Validation passed locally:
|
|
Added a correctness pass for the packed static-segment hashing helpers:
Validation passed locally:
|
|
Added macro-surface coverage for the packed static hash ECMs:
Validation passed locally:
|
|
Added a small regression pass for the packed static-segment ECMs:
Validation passed locally:
|
|
Added a BN254 proof-helper pass for the
These make the Unlink/Groth16 public-input reduction helper directly usable in downstream range and already-reduced-value proofs. Validation passed locally:
|
|
Added a small BN254 proof-helper pass for the
These make repeated Groth16/public-input reduction proofs easier by exposing that Validation passed locally:
|
|
Added a small BN254 proof-helper pass for
These avoid reopening the Nat modulo definition in downstream Groth16/public-input proofs when proving zero reductions or congruent public inputs reduce to the same field element. Validation passed locally:
|
|
Added a small BN254 proof-helper pass for
Validation passed locally:
|
|
Follow-up validation after the latest review pass:
Local validation passed:
|
|
Small docs consistency follow-up after the
Validation passed locally:
|
…diness # Conflicts: # PrintAxioms.lean
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit dcd73c0. Configure here.
…diness # Conflicts: # PrintAxioms.lean

Summary
This PR adds generic Verity-core surfaces needed for line-by-line Unlink audit modeling without adding Unlink-specific protocol semantics:
Compiler.Modules.Calls.bubblingValueCallfor Solidity-style arbitrarycall{value: v}(data)over explicit memory slices, including exact revert-returndata bubbling.Compiler.Modules.Precompiles.sha256Memoryandsha256.Compiler.Modules.Hashing:abiEncodePackedWords/abiEncodePackedsha256PackedWords/sha256PackedabiEncodePackedStaticSegmentssha256PackedStaticSegmentsVerity.Stdlib.Math.SNARK_SCALAR_FIELDandmodField.Stmt.assignVarinsideStmt.forEach, multi-value internal helper returns, ECM lowering, invalid arity, mutability rejection, and trust-report assumptions.Trust Boundaries
bubblingValueCallmodels generic EVM call choreography only: gas forwarding, target/value/input/output operands, success check, and revert-returndata bubbling. Calldata meaning, callee behavior, and protocol postconditions remain package-local assumptions.evm_sha256_precompileECM axiom.abi_packed_static_word_layoutorabi_packed_static_segment_layout; they do not claim full Solidity dynamicabi.encodePackedsupport.unlink-veritywith explicit package-local assumptions/proof-status tags.Docs Changed
docs/EXTERNAL_CALL_MODULES.mddocs/INTERPRETER_FEATURE_MATRIX.mddocs/ROADMAP.mddocs/UNLINK_AUDIT_VERITY_CORE_PROMPT.mdCompiler/Modules/README.mddocs-site/content/edsl-api-reference.mdxTests Run
lake build Compiler.Modules.Hashing Compiler.Modules.Precompiles Compiler.Modules.Calls Compiler.CompilationModelFeatureTest Contracts.Smoke Contracts.MacroTranslateInvariantTest Verity.Stdlib.Mathlake build Compilerlake buildpython3 scripts/generate_print_axioms.py --checkgit diff --checklake build Compilerstill reports pre-existingCompiler/Proofs/IRGeneration/ContractFeatureTest.leanunnecessarysimpalinter warnings; this PR does not touch that file.Note
Medium Risk
Adds new external-call and hashing ECMs (including low-level
call{value:…}and SHA-256 precompile usage) plus new math primitives; incorrect lowering or assumptions could affect contract correctness and audit boundaries, though changes are largely additive with extensive feature tests.Overview
Adds new Verity-core ECM surfaces for audit-oriented modeling: a generic low-level
bubblingValueCall/bubblingValueCallNoOutputthat lowers to Yulcallwith exact revert-returndata bubbling, and asha256Memory(aliassha256) precompile helper for hashing existing memory slices.Introduces
Compiler.Modules.Hashingpacked-hash helpers for static preimages (abiEncodePackedWords/abiEncodePacked,sha256PackedWords/sha256Packed, plus mixed-widthabiEncodePackedStaticSegments/sha256PackedStaticSegmentswith width validation), and wires the new module intoCompiler/Modules.leanand docs.Expands test and smoke coverage to validate Yul lowering, arity/mutability rejection, and trust-report assumptions (including new smoke contracts for packed hashing and value-call ECMs), adds a multi-return helper smoke contract, documents
forEachaccumulator limitations, and adds BN254 field helpers (SNARK_SCALAR_FIELD,modField) with accompanying proof lemmas and documentation updates.Reviewed by Cursor Bugbot for commit bbeb9c8. Bugbot is set up for automated code reviews on this repo. Configure here.