proof(#2080): naming-invariant param-load disjointness contract seam#2117
Merged
Th0rgal merged 3 commits intoJul 7, 2026
Conversation
Introduce InternalTableNamesInternalPrefixed and findInternalFunction?_eq_none_of_not_internalPrefixed: a name that is not internal_-prefixed cannot resolve to any helper when the runtime contract's internal table satisfies the naming invariant. Forward-compatible replacement for the internalFunctions = [] disjointness route. Refs #2080
…nvariant Prove that the ABI parameter-load prologue emitted by genParamLoads (the min-input-size guard plus the per-param scalar loads) is disjoint from a runtime contract's internal-function table whenever the table satisfies InternalTableNamesInternalPrefixed. The six EVM/Yul builtins it emits (calldataload, calldatasize, lt, revert, and, iszero) are not internal_-prefixed, so none can resolve to a helper. Replaces the internalFunctions = [] route with a naming-invariant route that survives non-empty helper tables. Refs #2080
… seam Add compileFunctionSpec_correct_generic_with_helper_proofs_and_helper_ir_of_body_goal_of_internalNamesPrefixed, which discharges the genParamLoads prefix-disjointness premise of its _of_body_goal sibling from the runtime contract's InternalTableNamesInternalPrefixed naming invariant instead of taking it as an opaque hypothesis. This is the selector-dispatch consumer seam that lets each per-function obligation feed straight into execIRFunctionWithInternals. Regenerate PrintAxioms.lean and allowlist the signature-dominated wrapper. Refs #2080
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: serverGenReqId_842b1df5-9db6-4d04-8612-c99cb1c86fbf) |
1 task
c91e212
into
paloma/issue-2080-function-exec-withinternals
21 checks passed
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.
Base / dependency (stacked)
paloma/issue-2080-function-exec-withinternals(head of PR proof: bridge function exec with internals #2116).paloma/issue-2080-function-withinternals-bridge. proof: bridge function exec with internals #2116 is OPEN, MERGEABLE, all checks green at time of writing.Summary
Threads the L2 param-load prefix-disjointness fact through to the selector-dispatch consumer seam, reducing reliance on conservative-extension / default-empty helper-world wrappers.
InternalTableNamesInternalPrefixed(contract invariant: every internal-table entry's name carries theinternal_prefix) andfindInternalFunction?_eq_none_of_not_internalPrefixed(a non-prefixed name never resolves in the internal table).genParamLoadscall-disjointness from the internal table out of per-builtinfindInternalFunction? = nonefacts (genScalarLoad/genParamLoadBodyFromrecursion +minInputSizeCheck), then package it asgenParamLoads_callsDisjoint_of_internalNamesPrefixed, which supplies those facts from the naming invariant viaby decideon each builtin's non-internal_prefix.compileFunctionSpec_correct_generic_with_helper_proofs_and_helper_ir_of_body_goal_of_internalNamesPrefixed— same premises as its_of_body_goalsibling except it discharges thehparamDisjointpremise fromInternalTableNamesInternalPrefixed(param supportedness comes fromSupportedSpecviasupported_params_of_supportedSpec). Each per-function obligation now feeds straight intoexecIRFunctionWithInternalswithout an opaque disjointness witness.The naming-invariant route (rather than
internalFunctions = []) is deliberately forward-compatible with non-empty helper tables — the direction #2080 wants to move.Validation
All run via
lean-slot(host-wide gate, Spark offload), fromverity/:lean-slot lake build PrintAxioms→ Build completed successfully. Whole-tree axiom gate (PrintAxioms imports every top-level theorem to#print axioms); Contract.lean's new theorem and all downstream modules compile. Every printed axiom is standard (propext,Classical.choice,Quot.sound) — nosorryAx.IRInterpreter,Function,Contract.python3 scripts/generate_print_axioms.py --check→ OK: PrintAxioms.lean is up to date.python3 scripts/check_proof_length.py→ passed (the signature-dominated wrapper is allowlisted with justification; body is a single term application).git diff --check→ clean.sorry/admit/axiomin any touched proof file.Next slice (not in this PR — kept narrow)
Whole-contract dispatch integration: establish
InternalTableNamesInternalPrefixedfor the compiled runtime contract from the compilation pipeline, and supply the per-function body-preservation goal, so the whole-contract theorem consumes this seam across all selector-dispatched functions and fully retires the default-empty helper-world wrapper.Refs #2080
Note
Low Risk
Lean proof-only changes with no runtime or auth logic; risk is limited to proof maintenance and axiom/theorem registration consistency.
Overview
Adds a forward-compatible proof path so
genParamLoadsABI prefix code cannot collide with internal helpers when the runtime table is non-empty, as long as every helper name carries theinternal_prefix.IRInterpreter: introduces
InternalTableNamesInternalPrefixedandfindInternalFunction?_eq_none_of_not_internalPrefixedso non-prefixed names (EVM/Yul builtins) never resolve in the internal table.Function: proves
genParamLoadscall-disjointness from per-builtinfindInternalFunction? = nonelemmas, then packages it asgenParamLoads_callsDisjoint_of_internalNamesPrefixedusing the naming invariant.Contract: adds
compileFunctionSpec_correct_generic_with_helper_proofs_and_helper_ir_of_body_goal_of_internalNamesPrefixed, mirroring the existing_of_body_goalwrapper but replacing opaquehparamDisjointwithInternalTableNamesInternalPrefixed(param support fromSupportedSpec).Tooling: registers new theorems in
PrintAxioms.leanand allowlists the long signature-only contract wrapper incheck_proof_length.py.Reviewed by Cursor Bugbot for commit 5759254. Bugbot is set up for automated code reviews on this repo. Configure here.