feat(Codegen): factor solidityPanicPayload for Panic(uint256) emission (#1999)#2030
Open
Th0rgal wants to merge 1 commit into
Open
feat(Codegen): factor solidityPanicPayload for Panic(uint256) emission (#1999)#2030Th0rgal wants to merge 1 commit into
Th0rgal wants to merge 1 commit into
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.
|
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.