Skip to content

Add ABI frame lowering layers#1947

Open
Th0rgal wants to merge 3 commits into
mainfrom
codex/abi-frame-lowering
Open

Add ABI frame lowering layers#1947
Th0rgal wants to merge 3 commits into
mainfrom
codex/abi-frame-lowering

Conversation

@Th0rgal
Copy link
Copy Markdown
Member

@Th0rgal Th0rgal commented Jun 4, 2026

Summary

  • add Compiler.ABI.Frame typed ABI frame layouts for nested structs, dynamic bytes/arrays, and calldata/memory/code/storage sources
  • add Compiler.Lowering.StackSafeAbi frame-spilled lowering for events, external calls, and dynamic returns so large payloads are materialized in memory and passed as pointers
  • add Compiler.Modules.CodeData typed CREATE2/SSTORE2 code-as-data read/write facade with explicit trust surface and roundtrip shape tests
  • add Compiler.Proofs.GeneratedTransition minimal reads/writes/guards/events extraction for later Midnight RCF/totalUnits wiring

Verification

  • lake build Compiler.ABI.FrameTest Compiler.Lowering.StackSafeAbiTest Compiler.Modules.CodeDataTest Compiler.Proofs.GeneratedTransitionTest
  • lake build Compiler.Modules
  • lake build Compiler

Note

Medium Risk
New compiler lowering paths affect how ABI payloads reach EVM call/log1/return and CREATE2 deploy buffers; mistakes could change encoding or stack behavior, though changes are isolated behind new modules and not yet wired into the main pipeline per this diff.

Overview
Introduces typed ABI frame layouts and stack-safe lowering so large or dynamic Solidity-style payloads become memory-resident (ptr, size) pairs instead of long Yul argument lists.

Compiler.ABI.Frame defines FrameField / FrameLayout, chooses inline words vs pointer mode (dynamic types or head size above a 4-word threshold), and emits Yul to spill from calldata, memory, code, or storage into an allocated frame buffer.

Compiler.Lowering.StackSafeAbi wraps that for log1 events, call, and return, with #eval! tests for both pointer and small inline payloads.

Compiler.Modules.CodeData adds a typed CREATE2/SSTORE2 write/read facade that materializes a FrameLayout then delegates to existing Create2SSTORE2 ECM modules, plus an explicit trust surface list.

Compiler.Proofs.GeneratedTransition adds a static TransitionSummary extractor (reads, writes, guards, events) over CompilationModel Stmt/Expr, intended for later Midnight RCF / totalUnits wiring.

Compiler.Modules now re-exports Create2SSTORE2 and CodeData; the modules README documents CodeData.lean.

Reviewed by Cursor Bugbot for commit 0df4e11. Bugbot is set up for automated code reviews on this repo. Configure here.

@vercel
Copy link
Copy Markdown

vercel Bot commented Jun 4, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
verity Ready Ready Preview, Comment Jun 4, 2026 1:54pm

Request Review

Comment thread Compiler/ABI/Frame.lean Outdated
Comment thread Compiler/Lowering/StackSafeAbi.lean Outdated
Comment thread Compiler/Lowering/StackSafeAbi.lean Outdated
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 3 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 918faad. Configure here.

Comment thread Compiler/ABI/Frame.lean
Comment thread Compiler/ABI/Frame.lean
Comment thread Compiler/Modules/CodeData.lean
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant