Skip to content
Open
Show file tree
Hide file tree
Changes from 74 commits
Commits
Show all changes
112 commits
Select commit Hold shift + click to select a range
fc6b2b9
proofs: expose native EVMYulLean transition target
claude Apr 22, 2026
cdadf59
docs: clarify verity helper calls
claude Apr 22, 2026
1640081
proofs: track native transition blockers
claude Apr 22, 2026
ebbd280
proofs: harden native runtime smoke coverage
claude Apr 22, 2026
747ba1b
proofs: document native env defaults
claude Apr 22, 2026
3ecef1d
proofs: pin native dispatch selector cases
claude Apr 22, 2026
d163384
proofs: pin native dispatch case bodies
claude Apr 22, 2026
0be3e6c
proofs: pin native calldata bridge bytes
claude Apr 22, 2026
14040ca
proofs: pin native dispatcher selector expression
claude Apr 22, 2026
4d91760
docs: clarify native dispatcher execution blocker
claude Apr 22, 2026
0b516fc
proofs: pin native error rollback projection
claude Apr 22, 2026
4d28241
proofs: require native observable slots
claude Apr 22, 2026
e059708
proofs: pin native observable sload
claude Apr 22, 2026
8a5a25d
proofs: cover native IR entrypoint
claude Apr 22, 2026
01fad08
proofs: cover native log projection arities
claude Apr 22, 2026
3a9451c
proofs: cover native transient storage
claude Apr 22, 2026
ef27bda
proofs: cover native stop halt projection
claude Apr 22, 2026
b0d0a87
proofs: cover native value result projection
claude Apr 22, 2026
17c20a2
proofs: cover native return halt projection
claude Apr 22, 2026
616e39d
proofs: pin native halt builtin lowering
claude Apr 22, 2026
93f1b09
proofs: cover native ok storage projection
claude Apr 22, 2026
6e4bb81
proofs: pin native final mapping projection
claude Apr 22, 2026
6846a98
proofs: pin native helper call partition
claude Apr 22, 2026
d846ae2
proofs: pin native initial state bridge
claude Apr 22, 2026
8949e7b
proofs: pin native nested helper rejection
claude Apr 22, 2026
8b431c8
proofs: pin native hard error rollback
claude Apr 22, 2026
14103b9
proofs: pin native return dispatch lowering
claude Apr 22, 2026
4d5013f
proofs: pin native explicit storage slots
claude Apr 22, 2026
41ad1ff
proofs: pin native revert rollback
claude Apr 22, 2026
38cc57b
proofs: pin native IR slot forwarding
claude Apr 22, 2026
c6cf8f0
proofs: pin native transaction environment
claude Apr 22, 2026
3a36713
proofs: name native bridge invariants
claude Apr 22, 2026
0633d53
chore: auto-refresh derived artifacts
github-actions[bot] Apr 22, 2026
1b303a7
proofs: name native projection outcomes
claude Apr 22, 2026
ed9ce9f
chore: auto-refresh derived artifacts
github-actions[bot] Apr 22, 2026
a91031c
proofs: name native initial state invariants
claude Apr 22, 2026
f00b839
chore: auto-refresh derived artifacts
github-actions[bot] Apr 22, 2026
01738dd
proofs: name native storage seeding invariant
claude Apr 22, 2026
4569161
chore: auto-refresh derived artifacts
github-actions[bot] Apr 22, 2026
ebae796
proofs: name native execution pipeline invariant
claude Apr 22, 2026
8d70342
chore: auto-refresh derived artifacts
github-actions[bot] Apr 22, 2026
ac1e113
proofs: name native IR execution pipeline invariant
claude Apr 22, 2026
8b5128e
chore: auto-refresh derived artifacts
github-actions[bot] Apr 22, 2026
3247230
proofs: name native account installation invariant
claude Apr 22, 2026
527fd06
chore: auto-refresh derived artifacts
github-actions[bot] Apr 22, 2026
d36804d
proofs: name native environment defaults invariant
claude Apr 22, 2026
4d44138
chore: auto-refresh derived artifacts
github-actions[bot] Apr 22, 2026
661f8e7
proofs: name native calldata size invariant
claude Apr 22, 2026
7e34efb
chore: auto-refresh derived artifacts
github-actions[bot] Apr 22, 2026
f779f37
proofs: name native halt projection invariants
claude Apr 22, 2026
ae5bb73
chore: auto-refresh derived artifacts
github-actions[bot] Apr 22, 2026
116f924
proofs: name native event projection invariants
claude Apr 22, 2026
79677ed
chore: auto-refresh derived artifacts
github-actions[bot] Apr 22, 2026
6b268a7
proofs: name omitted native storage invariant
claude Apr 22, 2026
f5d763e
proofs: name native finalMappings invariant
claude Apr 22, 2026
120e053
proofs: name native final storage invariants
claude Apr 22, 2026
b5e39b9
proofs: name native result observable invariants
claude Apr 22, 2026
08601d4
proofs: name missing native account storage invariant
claude Apr 22, 2026
cba4038
proofs: name native missing slot result invariants
claude Apr 22, 2026
193e6d6
proofs: name native final mapping invariants
claude Apr 22, 2026
e76a912
proofs: name native non-word return fallback
claude Apr 22, 2026
7f41306
proofs: name native call lowering invariants
claude Apr 22, 2026
e132814
proofs: name native environment bridge fields
claude Apr 22, 2026
71fe730
scripts: recognize partial defs in proof length check
claude Apr 22, 2026
985d7d5
scripts: test partial defs terminate proof spans
claude Apr 22, 2026
f10f5fd
ci: include native harness in evmyullean probe
claude Apr 22, 2026
92092ed
proofs: compare native env smoke with oracle
claude Apr 22, 2026
cb41fda
ci: guard native transition doc status
claude Apr 22, 2026
2799bb3
ci: guard native observable slot caveat
claude Apr 22, 2026
373790b
ci: guard native observable slot api
claude Apr 22, 2026
20e7b90
contracts: close evmyullean transition blockers
claude Apr 22, 2026
f85598c
contracts: harden overload and env accessors
claude Apr 22, 2026
30d108d
contracts: add migration parity surfaces
claude Apr 22, 2026
e01b323
contracts: remove legacy internal call surface
claude Apr 22, 2026
ef46e5b
contracts: fix overload review regressions
claude Apr 22, 2026
647f2f3
contracts: memoize tuple array element index
claude Apr 22, 2026
a9ec28c
contracts: fail closed on ambiguous overload lookup
claude Apr 22, 2026
c06ab65
compiler: recurse trust surface through array element words
claude Apr 22, 2026
ea21ba6
compiler: reject internal external name collisions
claude Apr 22, 2026
909125f
proofs: cover native selector bytes and new source cases
claude Apr 22, 2026
0724aad
contracts: close tuple array element review gaps
claude Apr 22, 2026
04e2186
proofs: add native dispatch oracle
claude Apr 22, 2026
2094769
contracts: harden overload generated names
claude Apr 22, 2026
57ccf1f
proofs: cover memory return native oracle
claude Apr 22, 2026
aae4b46
compiler: document selector-keyed overload dispatch
claude Apr 22, 2026
1b32fd5
proofs: cover native calldata argument oracle
claude Apr 22, 2026
cd0ea42
evmyullean: lower native dispatch lazily
claude Apr 22, 2026
82b7a89
proofs: cover native mapping oracle shapes
claude Apr 22, 2026
d3305cb
evmyullean: scope lazy native dispatch
claude Apr 22, 2026
8ff72e6
proofs: cover native packed mapping oracle
claude Apr 22, 2026
a823227
evmyullean: thread native switch ids
claude Apr 22, 2026
2f1f16a
macro: accept qualified blobbasefee
claude Apr 22, 2026
dba993a
evmyullean: guard native switch fallthrough
claude Apr 22, 2026
bdaa1a9
ci: guard native theorem transition target
claude Apr 22, 2026
6ffd034
ci: pin unbridged native env boundary
claude Apr 22, 2026
d595759
evmyullean: remove dead native stmt wrapper
claude Apr 22, 2026
e484cb8
compilation: split array element helper gates
claude Apr 22, 2026
2e40dd4
macro: reject ABI-erased newtype overloads
claude Apr 22, 2026
f6d9c68
proofs: expose native runtime preservation seam
claude Apr 22, 2026
06eed0e
evmyullean: validate native environment reads
claude Apr 22, 2026
1155569
evmyullean: freshen native switch temps
claude Apr 22, 2026
f1b975a
evmyullean: reserve function switch temps
claude Apr 22, 2026
1b366a0
proofs: align native bridge observables
claude Apr 22, 2026
7d96db1
evmyullean: validate native env on selected path
claude Apr 22, 2026
b1a4551
compiler: restrict plain arrayElement to word arrays
claude Apr 22, 2026
f037645
compiler: share array element usage traversal
claude Apr 22, 2026
9511f9d
proofs: add native bridge intro theorem
claude Apr 22, 2026
f6cee4b
proofs: expose lowered native dispatcher bridge
claude Apr 23, 2026
96e5f23
compiler: preserve shadowed context accessors
claude Apr 23, 2026
2c5e3bc
compiler: include package roots for module imports
claude Apr 23, 2026
08db836
compiler: simplify array element usage detection
claude Apr 23, 2026
9b34373
tests: cover context accessor shadow smoke
claude Apr 23, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions .github/workflows/evmyullean-fork-conformance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ name: EVMYulLean fork conformance
# Weekly probe that the pinned lfglabs-dev/EVMYulLean fork still
# satisfies Verity's bridge assumptions: the fork audit and adapter
# report artifacts are in sync, adapter correctness still builds,
# all universal bridge lemmas still build, the public EndToEnd
# EVMYulLean target still builds, and all 123 concrete `native_decide`
# bridge-equivalence tests still pass.
# all universal bridge lemmas still build, the native transition harness still
# builds, the public EndToEnd EVMYulLean target still builds, and all 123
# concrete `native_decide` bridge-equivalence tests still pass.
#
# Burn-in: the probe step is captured with `continue-on-error: true`
# during the two-week window starting 2026-04-20 (see issue #1722 plan
Expand Down Expand Up @@ -36,6 +36,8 @@ on:
- 'Compiler/Proofs/YulGeneration/Backends/EvmYulLeanBodyClosure.lean'
- 'Compiler/Proofs/YulGeneration/Backends/EvmYulLeanBridgeLemmas.lean'
- 'Compiler/Proofs/YulGeneration/Backends/EvmYulLeanBridgeTest.lean'
- 'Compiler/Proofs/YulGeneration/Backends/EvmYulLeanNativeHarness.lean'
- 'Compiler/Proofs/YulGeneration/Backends/EvmYulLeanNativeSmokeTest.lean'
- 'Compiler/Proofs/YulGeneration/Backends/EvmYulLeanRetarget.lean'
- 'Compiler/Proofs/YulGeneration/Backends/EvmYulLeanSignedArithSpec.lean'
- 'Compiler/Proofs/YulGeneration/Backends/EvmYulLeanSourceExprClosure.lean'
Expand All @@ -58,6 +60,8 @@ on:
- 'Compiler/Proofs/YulGeneration/Backends/EvmYulLeanBodyClosure.lean'
- 'Compiler/Proofs/YulGeneration/Backends/EvmYulLeanBridgeLemmas.lean'
- 'Compiler/Proofs/YulGeneration/Backends/EvmYulLeanBridgeTest.lean'
- 'Compiler/Proofs/YulGeneration/Backends/EvmYulLeanNativeHarness.lean'
- 'Compiler/Proofs/YulGeneration/Backends/EvmYulLeanNativeSmokeTest.lean'
- 'Compiler/Proofs/YulGeneration/Backends/EvmYulLeanRetarget.lean'
- 'Compiler/Proofs/YulGeneration/Backends/EvmYulLeanSignedArithSpec.lean'
- 'Compiler/Proofs/YulGeneration/Backends/EvmYulLeanSourceExprClosure.lean'
Expand Down Expand Up @@ -160,7 +164,7 @@ jobs:
"make test-evmyullean-fork",
"```",
"",
"This guard checks the pinned EVMYulLean fork audit, checks the adapter report, rebuilds adapter correctness and the public EndToEnd target, and runs the concrete bridge-equivalence tests."
"This guard checks the pinned EVMYulLean fork audit, checks the adapter report, rebuilds adapter correctness, the native transition harness, and the public EndToEnd target, and runs the concrete bridge-equivalence tests."
];
const body = bodyLines.join("\n");

Expand Down
5 changes: 3 additions & 2 deletions AXIOMS.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,9 @@ the EVM.
**Soundness controls**:
- `make check` validates the fork-audit artifact against `lake-manifest.json`.
- `make test-evmyullean-fork` rechecks the fork audit, checks the adapter
report, rebuilds adapter correctness and the public EndToEnd EVMYulLean
target, and runs the concrete `native_decide` bridge-equivalence tests.
report, rebuilds adapter correctness, the native transition harness, the
public EndToEnd EVMYulLean target, and the concrete `native_decide`
bridge-equivalence tests.
- `.github/workflows/evmyullean-fork-conformance.yml` runs the conformance probe
weekly; after the burn-in ending 2026-05-04, scheduled/manual failures fail
the workflow and open or update a GitHub issue for drift triage.
Expand Down
4 changes: 4 additions & 0 deletions Compiler/CompilationModel/AbiHelpers.lean
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,10 @@ def eventSignature (eventDef : EventDef) : String :=
def errorSignature (errorDef : ErrorDef) : String :=
s!"{errorDef.name}(" ++ String.intercalate "," (errorDef.params.map paramTypeToSolidityString) ++ ")"

def functionSignature (fn : FunctionSpec) : String :=
let params := fn.params.map (fun p => paramTypeToSolidityString p.ty)
s!"{fn.name}(" ++ String.intercalate "," params ++ ")"

def storageArrayElemTypeToParamType : StorageArrayElemType → ParamType
| .uint256 => .uint256
| .address => .address
Expand Down
10 changes: 10 additions & 0 deletions Compiler/CompilationModel/Compile.lean
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,16 @@ def compileStmt (fields : List Field) (events : List EventDef := [])
compileSetStorage fields dynamicSource field value
| Stmt.setStorageAddr field value =>
compileSetStorage fields dynamicSource field value true
| Stmt.setStorageWord field wordOffset value =>
match findFieldWithResolvedSlot fields field with
| some (_f, slot) => do
let valueExpr ← compileExpr fields dynamicSource value
let slotExpr :=
if wordOffset == 0 then YulExpr.lit slot
else YulExpr.call "add" [YulExpr.lit slot, YulExpr.lit wordOffset]
pure [YulStmt.expr (YulExpr.call "sstore" [slotExpr, valueExpr])]
| none =>
throw s!"Compilation error: unknown storage field '{field}' in setStorageWord"
| Stmt.storageArrayPush field value =>
compileStorageArrayPush fields dynamicSource field value
| Stmt.storageArrayPop field =>
Expand Down
10 changes: 7 additions & 3 deletions Compiler/CompilationModel/Dispatch.lean
Original file line number Diff line number Diff line change
Expand Up @@ -278,9 +278,9 @@ private def validateCompileInputsBeforeFieldWriteConflict
for ext in spec.externals do
let _ ← externalFunctionReturns ext
validateInteropExternalSpec ext
match firstDuplicateName (spec.functions.map (·.name)) with
match firstDuplicateName (spec.functions.map functionSignature) with
| some dup =>
throw s!"Compilation error: duplicate function name '{dup}' in {spec.name}"
throw s!"Compilation error: duplicate function signature '{dup}' in {spec.name}"
Comment thread
Th0rgal marked this conversation as resolved.
Comment thread
Th0rgal marked this conversation as resolved.
| none =>
pure ()
match firstDuplicateName (spec.errors.map (·.name)) with
Expand Down Expand Up @@ -390,7 +390,11 @@ def compileValidatedCore (spec : CompilationModel) (selectors : List Nat) : Exce
let internalFuncDefs ← internalFns.mapM (compileInternalFunction fields spec.events spec.errors spec.adtTypes)
let arrayElementHelpers :=
if arrayHelpersRequired then
[checkedArrayElementCalldataHelper, checkedArrayElementMemoryHelper]
[ checkedArrayElementCalldataHelper
, checkedArrayElementMemoryHelper
, checkedArrayElementWordCalldataHelper
, checkedArrayElementWordMemoryHelper
]
Comment thread
cursor[bot] marked this conversation as resolved.
else
[]
let storageArrayElementHelpers :=
Expand Down
33 changes: 33 additions & 0 deletions Compiler/CompilationModel/DynamicData.lean
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@ def checkedArrayElementCalldataHelperName : String :=
def checkedArrayElementMemoryHelperName : String :=
"__verity_array_element_memory_checked"

def checkedArrayElementWordCalldataHelperName : String :=
"__verity_array_element_word_calldata_checked"

def checkedArrayElementWordMemoryHelperName : String :=
"__verity_array_element_word_memory_checked"

def checkedStorageArrayElementHelperName : String :=
"__verity_storage_array_element_checked"

Expand Down Expand Up @@ -50,6 +56,33 @@ def checkedArrayElementCalldataHelper : YulStmt :=
def checkedArrayElementMemoryHelper : YulStmt :=
checkedArrayElementHelper checkedArrayElementMemoryHelperName "mload"

private def checkedArrayElementWordHelper (helperName loadOp : String) : YulStmt :=
YulStmt.funcDef helperName ["data_offset", "length", "index", "element_words", "word_offset"] ["word"] [
YulStmt.if_ (YulExpr.call "iszero" [
YulExpr.call "lt" [YulExpr.ident "index", YulExpr.ident "length"]
]) [
YulStmt.expr (YulExpr.call "revert" [YulExpr.lit 0, YulExpr.lit 0])
],
YulStmt.assign "word" (YulExpr.call loadOp [
YulExpr.call "add" [
YulExpr.ident "data_offset",
YulExpr.call "mul" [
YulExpr.call "add" [
YulExpr.call "mul" [YulExpr.ident "index", YulExpr.ident "element_words"],
YulExpr.ident "word_offset"
],
YulExpr.lit 32
]
]
])
]

def checkedArrayElementWordCalldataHelper : YulStmt :=
checkedArrayElementWordHelper checkedArrayElementWordCalldataHelperName "calldataload"

def checkedArrayElementWordMemoryHelper : YulStmt :=
checkedArrayElementWordHelper checkedArrayElementWordMemoryHelperName "mload"

def checkedStorageArrayElementHelper : YulStmt :=
YulStmt.funcDef checkedStorageArrayElementHelperName ["slot", "index"] ["word"] [
YulStmt.let_ "__array_len" (YulExpr.call "sload" [YulExpr.ident "slot"]),
Expand Down
17 changes: 17 additions & 0 deletions Compiler/CompilationModel/ExpressionCompile.lean
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,23 @@ def compileExpr (fields : List Field)
YulExpr.ident s!"{name}_length",
indexExpr
])
| Expr.arrayElementWord name index elementWords wordOffset => do
if elementWords == 0 then
throw s!"Compilation error: Expr.arrayElementWord '{name}' requires elementWords > 0"
else if wordOffset >= elementWords then
throw s!"Compilation error: Expr.arrayElementWord '{name}' wordOffset {wordOffset} is outside element width {elementWords}"
else
let indexExpr ← compileExpr fields dynamicSource index
let helperName := match dynamicSource with
| .calldata => checkedArrayElementWordCalldataHelperName
| .memory => checkedArrayElementWordMemoryHelperName
pure (YulExpr.call helperName [
YulExpr.ident s!"{name}_data_offset",
YulExpr.ident s!"{name}_length",
indexExpr,
YulExpr.lit elementWords,
YulExpr.lit wordOffset
])
| Expr.storageArrayLength field =>
match findFieldWithResolvedSlot fields field with
| some (f, slot) =>
Expand Down
9 changes: 6 additions & 3 deletions Compiler/CompilationModel/LogicalPurity.lean
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ partial def exprContainsCallLike (expr : Expr) : Bool :=
| Expr.structMember2 _ key1 key2 _ =>
exprContainsCallLike key1 || exprContainsCallLike key2
| Expr.storageArrayElement _ index
| Expr.arrayElement _ index =>
| Expr.arrayElement _ index
| Expr.arrayElementWord _ index _ _ =>
exprContainsCallLike index
| Expr.dynamicBytesEq _ _ =>
false
Expand Down Expand Up @@ -110,7 +111,8 @@ def exprContainsUnsafeLogicalCallLike (expr : Expr) : Bool :=
| Expr.mapping2 _ key1 key2 | Expr.mapping2Word _ key1 key2 _
| Expr.structMember2 _ key1 key2 _ =>
exprContainsUnsafeLogicalCallLike key1 || exprContainsUnsafeLogicalCallLike key2
| Expr.storageArrayElement _ index | Expr.arrayElement _ index | Expr.returndataOptionalBoolAt index =>
| Expr.storageArrayElement _ index | Expr.arrayElement _ index
| Expr.arrayElementWord _ index _ _ | Expr.returndataOptionalBoolAt index =>
exprContainsUnsafeLogicalCallLike index
| Expr.dynamicBytesEq _ _ =>
false
Expand Down Expand Up @@ -152,7 +154,8 @@ termination_by es => sizeOf es
decreasing_by all_goals simp_wf; all_goals omega

def stmtContainsUnsafeLogicalCallLike : Stmt → Bool
| Stmt.letVar _ value | Stmt.assignVar _ value | Stmt.setStorage _ value | Stmt.setStorageAddr _ value |
| Stmt.letVar _ value | Stmt.assignVar _ value | Stmt.setStorage _ value | Stmt.setStorageAddr _ value
| Stmt.setStorageWord _ _ value |
Stmt.storageArrayPush _ value |
Stmt.return value | Stmt.require value _ =>
exprContainsUnsafeLogicalCallLike value
Expand Down
6 changes: 4 additions & 2 deletions Compiler/CompilationModel/ParamLoading.lean
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,12 @@ private def genDynamicParamLoads
]) [
YulStmt.expr (YulExpr.call "revert" [YulExpr.lit 0, YulExpr.lit 0])
]]
| ParamType.array _ =>
| ParamType.array elemTy =>
let elemWords :=
if isDynamicParamType elemTy then 1 else paramHeadSize elemTy / 32
[YulStmt.if_ (YulExpr.call "gt" [
YulExpr.ident s!"{name}_length",
YulExpr.call "div" [YulExpr.ident tailRemainingName, YulExpr.lit 32]
YulExpr.call "div" [YulExpr.ident tailRemainingName, YulExpr.lit (32 * elemWords)]
]) [
YulStmt.expr (YulExpr.call "revert" [YulExpr.lit 0, YulExpr.lit 0])
]]
Expand Down
15 changes: 14 additions & 1 deletion Compiler/CompilationModel/ScopeValidation.lean
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,18 @@ def validateScopedExprIdentifiers
| none =>
throw s!"Compilation error: {context} references unknown parameter '{name}' in Expr.arrayElement"
validateScopedExprIdentifiers context params paramScope dynamicParams localScope constructorArgCount index
| Expr.arrayElementWord name index elementWords wordOffset => do
if elementWords == 0 then
throw s!"Compilation error: {context} Expr.arrayElementWord '{name}' requires elementWords > 0"
else if wordOffset >= elementWords then
throw s!"Compilation error: {context} Expr.arrayElementWord '{name}' wordOffset {wordOffset} is outside element width {elementWords}"
match findParamType params name with
| some (ParamType.array _) => pure ()
| some ty =>
throw s!"Compilation error: {context} Expr.arrayElementWord '{name}' requires array parameter, got {repr ty}"
| none =>
throw s!"Compilation error: {context} references unknown parameter '{name}' in Expr.arrayElementWord"
validateScopedExprIdentifiers context params paramScope dynamicParams localScope constructorArgCount index
Comment thread
Th0rgal marked this conversation as resolved.
| Expr.mapping _ key | Expr.mappingWord _ key _ | Expr.mappingPackedWord _ key _ _ | Expr.mappingUint _ key
| Expr.structMember _ key _ =>
validateScopedExprIdentifiers context params paramScope dynamicParams localScope constructorArgCount key
Expand Down Expand Up @@ -263,7 +275,8 @@ def validateScopedStmtIdentifiers
throw s!"Compilation error: {context} assigns to undeclared local variable '{name}'"
validateScopedExprIdentifiers context params paramScope dynamicParams localScope constructorArgCount value
pure localScope
| Stmt.setStorage _ value | Stmt.setStorageAddr _ value | Stmt.return value | Stmt.require value _ => do
| Stmt.setStorage _ value | Stmt.setStorageAddr _ value | Stmt.setStorageWord _ _ value
| Stmt.return value | Stmt.require value _ => do
validateScopedExprIdentifiers context params paramScope dynamicParams localScope constructorArgCount value
pure localScope
| Stmt.storageArrayPush _ value => do
Expand Down
6 changes: 6 additions & 0 deletions Compiler/CompilationModel/TrustSurface.lean
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ private partial def collectLowLevelStmtMechanics : Stmt → List String
| .assignVar _ value
| .setStorage _ value
| .setStorageAddr _ value
| .setStorageWord _ _ value
Comment thread
cursor[bot] marked this conversation as resolved.
| .storageArrayPush _ value
| .return value
| .require value _ =>
Expand Down Expand Up @@ -211,6 +212,7 @@ private partial def collectAxiomatizedStmtPrimitives : Stmt → List String
| .assignVar _ value
| .setStorage _ value
| .setStorageAddr _ value
| .setStorageWord _ _ value
| .storageArrayPush _ value
| .return value
| .require value _ =>
Expand Down Expand Up @@ -296,6 +298,7 @@ private partial def collectUnguardedLowLevelStmtMechanics : Stmt → List String
| .assignVar _ value
| .setStorage _ value
| .setStorageAddr _ value
| .setStorageWord _ _ value
| .storageArrayPush _ value
| .return value
| .require value _ =>
Expand Down Expand Up @@ -470,6 +473,7 @@ private partial def collectEventEmissionStmtMechanics : Stmt → List String
| .assignVar _ value
| .setStorage _ value
| .setStorageAddr _ value
| .setStorageWord _ _ value
| .storageArrayPush _ value
| .return value
| .require value _ =>
Expand Down Expand Up @@ -629,6 +633,7 @@ private partial def collectRuntimeIntrospectionStmtMechanics : Stmt → List Str
| .assignVar _ value
| .setStorage _ value
| .setStorageAddr _ value
| .setStorageWord _ _ value
| .storageArrayPush _ value
| .return value
| .require value _ =>
Expand Down Expand Up @@ -776,6 +781,7 @@ private partial def collectExternalStmtNames : Stmt → List String
| .assignVar _ value
| .setStorage _ value
| .setStorageAddr _ value
| .setStorageWord _ _ value
| .storageArrayPush _ value
| .return value
| .require value _ =>
Expand Down
8 changes: 8 additions & 0 deletions Compiler/CompilationModel/Types.lean
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,10 @@ inductive Expr
| internalCall (functionName : String) (args : List Expr) -- Internal function call (#181)
| arrayLength (name : String) -- Length of a dynamic array parameter (#180)
| arrayElement (name : String) (index : Expr) -- Checked element access of a dynamic array parameter (revert on out-of-range) (#180)
/-- Checked word access inside a dynamic array element. `elementWords` is the
static ABI word width of one element and `wordOffset` is the word inside
that element. This supports arrays of static tuple/struct-like values. -/
| arrayElementWord (name : String) (index : Expr) (elementWords wordOffset : Nat)
| storageArrayLength (field : String) -- Read the length word of a storage dynamic array (#1571)
| storageArrayElement (field : String) (index : Expr) -- Checked element access of a storage dynamic array (#1571)
/-- Equality on direct `bytes` / `string` parameters loaded from calldata or memory.
Expand Down Expand Up @@ -413,6 +417,10 @@ inductive Stmt
| assignVar (name : String) (value : Expr) -- Reassign existing variable
| setStorage (field : String) (value : Expr)
| setStorageAddr (field : String) (value : Expr)
/-- Write a full storage word at `field.slot + wordOffset`. Intended for
migration-faithful manual packed-word writes where the source constructs
the packed word explicitly. -/
| setStorageWord (field : String) (wordOffset : Nat) (value : Expr)
| storageArrayPush (field : String) (value : Expr) -- Append to a storage dynamic array (#1571)
| storageArrayPop (field : String) -- Pop from a storage dynamic array (#1571)
| setStorageArrayElement (field : String) (index : Expr) (value : Expr) -- Indexed write (#1571)
Expand Down
Loading
Loading