Add ERC-4337 EntryPoint invariant benchmark case#32
Conversation
Prove the core ERC-4337 security property that Certora could not verify with SMT solvers: execution happens if and only if validation passed. The model abstracts the two-loop handleOps structure as pure Lean functions with universally quantified validation results. All 8 theorems are fully proven (zero sorry), including: - Safety (execution implies validation) - Liveness (validation implies execution) - Combined biconditional invariant - All-validated/all-executed on success - No-execution on revert - Verity contract proofs for single-op model Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 81bd0dfabd
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 81bd0df. Configure here.
…4337 Creates the erc4337 family manifest, erc4337_v09 implementation manifest, and 8 generated task template files to fix CI manifest validation. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Migrated this benchmark PR to the faithful Verity model from lfglabs-dev/verity#1746. Changes pushed in 7891277:
Local verification: |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 789127790c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a8bf0bcd7f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
|
||
| require verity from git | ||
| "https://github.com/Th0rgal/verity.git"@"4ebe4931d25e5a1594fcd3f43ff040ecc3c4225a" | ||
| "https://github.com/lfglabs-dev/verity.git"@"de9377951c00bbd5fbf72e85d56fe50b8ff40d0c" |
There was a problem hiding this comment.
Keep case verity_version in sync with pin bump
Updating the global Verity dependency pin here to de937... without updating existing cases/*/*/case.yaml manifests leaves most cases still declaring 4ebe..., and scripts/run_case.sh records provenance from each case manifest’s verity_version rather than from Lake. In practice, non-ERC4337 runs after this commit build against one Verity commit but publish a different verity_commit in results metadata, which breaks reproducibility/auditability; either update all case manifests in the same commit or source the recorded commit from lakefile.lean.
Useful? React with 👍 / 👎.

Summary
handleOpsstructure (validation phase + execution phase) as pure Lean functions with universally quantified validation resultssorry— builds clean withlake buildWhat is proven
The core ERC-4337 security property from the EIP spec:
This decomposes into:
execution_implies_validationvalidation_implies_executionexecution_iff_validationall_validated_on_successall_executed_on_successno_execution_on_revertsingle_op_execution_on_validationsingle_op_fee_collectedWhy this matters
Certora's SMT-based approach cannot universally quantify over arbitrary Turing-complete programs (the account/paymaster contracts). Lean's interactive theorem proving handles this naturally — the proofs hold for ALL possible validation outcomes via standard universal quantification over
List Bool.Files
Benchmark/Cases/ERC4337/EntryPointInvariant/Contract.lean— Abstract model of handleOps two-loop structureBenchmark/Cases/ERC4337/EntryPointInvariant/Specs.lean— Invariant specificationsBenchmark/Cases/ERC4337/EntryPointInvariant/Proofs.lean— Complete proofs (no sorry)Benchmark/Cases/ERC4337/EntryPointInvariant/Compile.lean— Build gatecases/erc4337/entry_point_invariant/— YAML metadata (case + 8 tasks)Test plan
lake buildpasses with no errorssorryin all proof files🤖 Generated with Claude Code
Note
Medium Risk
Adds a new benchmark case with substantial new Lean/Verity model+proof code and updates the benchmark registry/report, so breakage risk is mostly around build/integration and task generation rather than runtime behavior.
Overview
Adds a new ERC-4337
EntryPointInvariantbenchmark case, including a pure-Lean control-flow model ofhandleOps(validation phase + execution phase), corresponding Verity contract model (EntryPointModel), and completed reference proofs/specs for the execution-attempt iff validation-passed invariant.Wires the new case into the benchmark entrypoints (
Benchmark.lean,Benchmark/Cases.lean) and updatesREPORT.mdto include the new family/case and its associated proof tasks.Includes minor API renaming in the Zama ERC-7984 model (
mintparameterto→recipient) and updates the related specs/proofs and generated task stubs accordingly.Reviewed by Cursor Bugbot for commit a8bf0bc. Bugbot is set up for automated code reviews on this repo. Configure here.