Add minimal generic EVM Frames for climb/loop proofs (least surface)#1983
Add minimal generic EVM Frames for climb/loop proofs (least surface)#1983Th0rgal wants to merge 9 commits into
Conversation
…terface-call-integration-preserve
…terface-call-integration-preserve
Extracts the core preservation patterns used for climb/loop proofs without forcing large terms (keccaks, full bodies, etc.). - PreservesBindingsExcept for steps that only write specific names (letVar/assignVar/mstore cases, cased abstractly on evalExpr). - PreservesSelectorCalldata (common for calldata-read verifiers). These are foundational, additive, and carry no new axioms. Intended to be instantiated by consumers (e.g. SPHINCS-) that supply step specs + range suppliers for their specific climbs. This is the smallest useful surface to enable the factoring proposed in the companion SPHINCS- PR. See SPHINCS- PR for motivation, full climb engines, and usage.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Reviewed the minimal Frames extraction (PreservesBindingsExcept for letVar/mstore + PreservesSelectorCalldata, abstract over evalExpr, ~90 lines, no new axioms/sorries). The bundled void-interface EDSL fixes (noReturnModule, resolve for void vs returning typed calls, loadExts/supportInterpreter, dotted external skip in validation, smoke + generated property stubs) had already been evolved and refined on the receiving branch (composite static support for tuple params in typed interfaces per #1982 plan, plus the legacy string safe work). Added the Frames.lean directly and committed as integration of #1983 (see 668d2d16). Conflicts in shared files (Translate, smoke, ValidationCalls, etc.) resolved by taking the more advanced versions from the 1962 lineage + porting intent. lake build + make check green post-integration (macro health, boundary/sync checks, etc. pass). This delivers the reusable frame preservation combinators for downstream climb/loop proofs (SPHINCS- etc.) with least surface on Verity. |
Summary
This is the smallest useful extraction of the frame preservation patterns developed in the SPHINCS- C13 proofs.
The goal (detailed in the companion SPHINCS- PR) is to allow projects like SPHINCS- to factor their climb engines so that:
What is added (intentionally minimal)
Compiler/Proofs/Frames.lean(one small file, ~90 lines)PreservesBindingsExcept+execStmt_letVar/mstorecases (abstract onevalExprso keccaks/bodies are not forced).PreservesSelectorCalldata(very common for verifier contracts that only read from calldata).sorry.This is deliberately the least surface that still gives value for the RAM-control / term-size problem that arises in long climb/loop proofs inside the Verity interpreter model.
Companion change
See the parallel PR on lfglabs-dev/SPHINCS- which:
SphincsMinusVerifiers/to have a thin instantiation layer ("supply step spec + range supplier").C13Concreteetc.) completely separate and untouched.pk".Why this shape (least on Verity side)
ClimbKit/ClimbLoopGuarded/ClimbMemFrame*/ specific segment bodies — those are heavily tied to SPHINCS- memory layout, ADRS, and contract structure.ClimbEnginetaking astep+specStep+DataSupplier+ frame proofs) once the pattern has more consumers.Test plan
lake build Compiler(or the full package) succeeds.Compiler.Proofs.Frames.Note
Medium Risk
Changes external-call lowering and macro typing for real DeFi-style void interfaces; mistakes could revert after successful calls or mis-encode ABI, though smoke tests and guard messages cover main paths.
Overview
This PR bundles proof infrastructure with compiler/EDSL fixes for typed ABI interfaces.
Void typed interface calls: Interface syntax now allows methods without a
returnsclause. The macro resolves void vs returning calls (statement vslet … ←), rejects binding void methods or using returning calls as bare statements, and limits void calls to static single-word parameters for now. Statement-position void calls lower to a newexternalCallNoReturnECM (noReturnModule/noReturn) that ABI-encodes and bubbles failure returndata but skips the 32-byte returndata check and return decode—avoiding spurious reverts after successful void callees (e.g. Aave-stylesupply/borrow). Returning methods still useexternalCallWithReturn.Validation & loading: Dotted interface externals like
IPool.supplyare skipped in Yul identifier validation (#1952). Module spec loading usesloadExts := trueon import andsupportInterpreter := trueon compiler executables so specs referencing ECM modules (e.g.withReturnModule) evaluate correctly (#1951).Proofs: New additive
Compiler/Proofs/Frames.lean(~90 lines) with binding-preservation and selector/calldata preservation lemmas forletVarandmstore, abstracting overevalExprfor climb/loop proofs (no new axioms).Tests: Smoke contracts and
#guard_msgsfor void/view calls and error cases; generated Foundry property stubs for the new smoke contracts.Reviewed by Cursor Bugbot for commit 69150c5. Bugbot is set up for automated code reviews on this repo. Configure here.