feat(Codegen): factor solidityPanicPayload for Panic(uint256) emission (#1999)#2030
Merged
Conversation
#1999) Extract the Panic(uint256) revert payload (selector 0x4e487b71 + one ABI word holding the panic code) into a reusable solidityPanicPayload builder so panic emission is compiler-owned and reusable for checked-arithmetic paths; assert the encoded code words (mstore(4, 17/18)) in the arithmetic-panic smoke test.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Th0rgal
added a commit
that referenced
this pull request
Jun 19, 2026
* Support dynamic internal helper args * feat: allow runtime scalar custom error args * feat: add source-shaped dynamic event proof surface * Emit checked arithmetic helpers * feat(Codegen): factor solidityPanicPayload for Panic(uint256) emission (#1999) (#2030) Extract the Panic(uint256) revert payload (selector 0x4e487b71 + one ABI word holding the panic code) into a reusable solidityPanicPayload builder so panic emission is compiler-owned and reusable for checked-arithmetic paths; assert the encoded code words (mstore(4, 17/18)) in the arithmetic-panic smoke test. * feat: self-delegate multicall helper (#1997) (#2029) * feat: add self-delegate multicall helper * fix(verity): multicall offset-wrap bound check + documented trusted ECM (#2029) * fix(merge): drop duplicate internal-call helpers from Compile.lean The #1997 refactor moved findInternalFunctionForCall?, compileInternalCallArg, compileInternalCallArgsWithParams, and compileInternalCallArgs into ExpressionCompile.lean. The merge of origin/main kept the stale copies in Compile.lean too, producing "already been declared" errors. Remove the stale copies; ExpressionCompile.lean is the single source. * fix(proofs): set noCheckedArithmetic on scalarEventSmoke supported spec The merge brought in main's scalar-events supported-spec smoke test, which the SupportedSpecSurfaceWithScalarEvents struct now requires to discharge the noCheckedArithmetic obligation added in this PR. Prove it by simp over the spec definitions. * fix(merge): restore CompilationModelFeatureTest content dropped by botched origin/main merge The eb9fadb merge of origin/main into task/1993a-checked-arith dropped ~3385 lines of origin/main test content and left the namespace structure broken (InternalHelperDynamicArgs never closed), causing the compiler-regressions CI job to fail with a parse error. Restore origin/main's full feature-test file and re-graft task/1993a's unique checked-arithmetic helper assertions on top, so the union of both sides' test cases is preserved.
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.
Summary
Panic(uint256)ABI payload into a reusablesolidityPanicPayloadbuilder inCompiler/CompilationModel/DynamicData.lean;panicErrorHelpernow delegates to it. Behavior-preserving emission refactor (emitted Yul unchanged).mstore(4, 17)/mstore(4, 18)panic-code stores.Notes
task/1993a-checked-arith) — the smoke test exercises the checked-arithmetic emission landed there, so this merges after the Tier-1 chain. The downstreamsolidityPanicModuleECM kill lives in morpho-verity and is out of scope here.Verification
lake build Verity Contracts Compiler PrintAxioms→ Build completed successfullyscripts/refresh_verification_artifacts.sh→[refresh] PASSmake check→ All checks passed (607 tests)Note
Low Risk
Refactor-only codegen with strengthened compile-to-Yul assertions; emitted panic shape is unchanged.
Overview
Extracts Solidity
Panic(uint256)revert emission into a reusablesolidityPanicPayloadbuilder inDynamicData.lean;panicErrorHelpernow wraps that list in a Yul function definition instead of inlining the samemstore/revert(0, 36)sequence.The arithmetic-panic compile smoke test now also checks that panic helpers store codes 17 and 18 at word offset 4 (
mstore(4, 17)/mstore(4, 18)), alongside the existing selector andrevert(0, 36)assertions. Intended as a behavior-preserving refactor for reuse (e.g. downstream panic module work).Reviewed by Cursor Bugbot for commit 17cba05. Bugbot is set up for automated code reviews on this repo. Configure here.