Skip to content

feat(solidity-import): admit structured low-level calls and hashed transient words in transient closures - #2965

Merged
Th0rgal merged 1 commit into
mainfrom
feat/solidity-import-transient-lowlevel-and-hashed-slots
Nov 27, 2026
Merged

Th0rgal merged 1 commit into
mainfrom
feat/solidity-import-transient-lowlevel-and-hashed-slots

Conversation

@Th0rgal

@Th0rgal Th0rgal commented Nov 26, 2026 •

Copy link
Copy Markdown
Member

Rebased onto main after #2963 and #2964.

Summary

Extends the transient-closure inline-assembly gate (Compiler/SolidityImport/ExprHelpers.lean) with two structurally matched, library-name-independent block families:

  1. Structured low-level call helpers:
    • staticcallNoReturn and callNoReturn (literal 0 or full-word uint256 value local) over address and bytes memory locals
    • returnDataSize (uint256 target)
    • returnData (reusing matchYulReturndataCopyBlock? from feat(solidity-import): admit LowLevelCall.returnData() and value memory calls #2963 into a bytes memory local)
    • bubbleRevert (both 0-arg free-pointer form and 1-arg revert(add(d, 0x20), mload(d)) over a bytes memory local)
  2. Hashed-base transient words: single-statement tstore(S, v) / v := tload(S) at compile-time bytes32 bases B >= 2^128, add(B, k), or add(B, and(i, M)) with full-word index i and literal mask M < 2^128, keeping all slots in [2^128, 2^256) disjoint from linear transient state slots.

Local Verification (cc950cad00)

  • lake build on ExprHelpers, Import, TransientStructuredAssemblyChecks, TransientStructuredAssemblySequenceModel, TransientNeutralAssemblyChecks, TransientStateVarChecks, TransientGuardChecks: PASS
  • lake env leanchecker on ExprHelpers, Import, TransientStructuredAssemblyChecks, TransientStructuredAssemblySequenceModel: exit 0
  • python3 -m solidity_differential.check_transient_structured_assembly: 96/96 transactions agree bit-for-bit across source EVM (A), Lean Denote (B), and Verity Yul (C)
  • python3 -m unittest scripts/test_solidity_differential.py: 18/18 OK
  • scripts/check_importer_name_selection.py & scripts/lean_lint.py: PASS

@vercel

vercel Bot commented Nov 26, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
veritylang.com Ready Ready Preview Nov 27, 2026 7:28pm UTC

Request Review

…ansient words in transient closures

Extend the transient-closure inline-assembly gate in Compiler/SolidityImport/ExprHelpers.lean with two structurally matched block families:

1. Structured low-level call helpers (library-name independent, matched strictly by Yul AST and local types):
   - staticcallNoReturn and callNoReturn (literal 0 or full-word uint256 value local) over address and bytes memory locals
   - returnDataSize (uint256 target)
   - returnData (reusing matchYulReturndataCopyBlock? into a bytes memory local)
   - bubbleRevert (both the 0-arg free-pointer form and 1-arg bytes memory form)

2. Single-statement hashed-base transient word access (tstore/tload) at compile-time bytes32 bases B >= 2^128, add(B, k), or add(B, and(i, M)) with full-word index i and mask M < 2^128 keeping slots in [2^128, 2^256) disjoint from linear transient state slots.

Rebased onto main after #2963 and #2964 with positive, negative-control, and live Anvil 3-route A/B/C differential tests (96 transactions).
@Th0rgal
Th0rgal marked this pull request as ready for review November 27, 2026 19:27
@Th0rgal
Th0rgal force-pushed the feat/solidity-import-transient-lowlevel-and-hashed-slots branch from 83c4de8 to cc950ca Compare November 27, 2026 19:27
@Th0rgal
Th0rgal merged commit 8bd5dc8 into main Nov 27, 2026
25 checks passed
@Th0rgal
Th0rgal deleted the feat/solidity-import-transient-lowlevel-and-hashed-slots branch November 27, 2026 22:35

This branch was successfully deployed

1 active deployment
Preview — cc950cad Deployed Nov 27, 2026 by vercel[bot]
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