Skip to content

G2 / Class B: lift E2-E7 + F2-F7 + true S8 to unconditional via per-BridgedStraightStmt observation framework #1884

@Th0rgal

Description

@Th0rgal

Context

Follow-up to merged #1857 (which closed #1737 — the EVMYulLean transition itself). After #1857, the trust boundary is established and the native EvmYul.Yul.callDispatcher is the sole runtime authority for the supported fragment. The legacy reference-oracle stack is removed. Concrete deployed contracts (Storage.sol, SimpleStorage.sol, etc.) are verified unconditionally.

The work that remains is lifting a class of internal helper theorems from conditional to unconditional form. This does not change the trust boundary or the public surface — concrete contract correctness is already unconditional in #1857 — but it removes hypotheses from internal building blocks so that future user-body shapes drop out automatically without manual continuation provision.

Theorems that are currently conditional

In Compiler/Proofs/EndToEnd.lean:

  • NativeGeneratedSelectorHitSuccessBridge.of_leave_body (E2) — takes hCont : LeaveAwareCallDispatcherContinuation
  • NativeGeneratedSelectorHitSuccessBridge.of_block_leave (E4) — same
  • NativeGeneratedSelectorHitSuccessBridge.of_nativePreservableStraightStmts_leave (E6, degenerate) — same
  • NativeGeneratedSelectorHitSuccessBridge.of_bridgedStraightStmts_falling_through E7 — same
  • NativeGeneratedSelectorHitSuccessBridge.of_leave_body_with_label_prefix (F2)
  • NativeGeneratedSelectorHitSuccessBridge.of_block_leave_with_label_prefix (F4)
  • NativeGeneratedSelectorHitSuccessBridge.of_nativePreservableStraightStmts_leave_with_label_prefix (F6, degenerate)
  • F7 (degenerate, delegates to F2)
  • True S8: compile_preserves_native_evmYulLean_of_compile_ok_supported_generated_callDispatcher still has hUserBodyHalt premise. The strengthened private _via_result variant already takes the unified Result bridge.

All of these compile and are correct under their hypotheses. They are not yet useful for new dispatcher-emitted body shapes without manual continuation provision.

Why it's blocked

The LeaveAwareCallDispatcherContinuation provider needs to discharge the _revived form of NativeBlockPreservesWord on the user-body, including Leave-ending bodies. The OLD-form NativeBlockPreservesWord provider in nativeGeneratedCallDispatcherResult_selector_hit_ok_matchesIR_forall_of_compile_ok_supported works for Ok-shaped finals but fails for Checkpoint-Leave finals (because final[name]! returns default for Checkpoint states — see memory yul-state-lookup-bracket-vs-lookup). The _revived form via final.reviveJump[name]! succeeds on Checkpoint Leave but proving it directly requires the per-BridgedStraightStmt IR↔native observation-equivalence framework which does not exist yet.

Scope estimate

  • Framework: ~300–500 LoC, ~2–4 weeks.
  • Parallel _revived dispatcher continuation provider: ~700 LoC, ~3–7 days once framework lands (mirrors nativeGeneratedCallDispatcherResult_selector_hit_ok_matchesIR_forall_of_compile_ok_supported).
  • Wiring E2-E7 + F2-F7 + true S8 to drop LeaveAwareCallDispatcherContinuation / hUserBodyHalt: ~1–3 days.

Design path

See memory entry per-stmt-observation-framework-design.md (in .claude/projects/-workspaces-mission-de9e924b/memory/) and related design notes:

Phase 1: Define statesAligned : IRState → Yul.State → Prop and resultsAligned : IRExecResultWithInternals → Except Yul.Exception Yul.State → Prop. These currently do not exist as top-level abstractions — alignment is woven case-by-case through existing proofs.

Phase 2: Define NativeStraightStmtObserved (stmt : YulStmt) (codeOverride : Option YulContract) : Prop and prove for each of the ~20 constructors of NativePreservableStraightStmt (Compiler/Proofs/YulGeneration/Backends/EvmYulLeanNativeHarness.lean:18510):

  • Easy (~30 LoC each, ~5 constructors): comment, expr_stop, expr_return, expr_revert.
  • Medium (~50 LoC each, ~10 constructors): let_, assign, expr_sstore, expr_mstore, expr_tstore, expr_mstore8, expr_log0..log4.
  • Hard (~80 LoC each, ~5 constructors): letMany, expr_calldatacopy, expr_returndatacopy, generic expr_call.

Phase 3: Inductive step over NativePreservableStraightStmts.

Phase 4: Use the framework to discharge D1/D2/E6/E7 narrowing, then build the parallel _revived dispatcher continuation provider, then drop hCont / hUserBodyHalt from the affected theorems.

Success criteria

  • Every NativeGeneratedSelectorHitSuccessBridge.of_* constructor in EndToEnd.lean is unconditional (no hCont / hExecBridge / LeaveAwareCallDispatcherContinuation hypothesis).
  • compile_preserves_native_evmYulLean_of_compile_ok_supported_generated_callDispatcher (true S8) lands without hUserBodyHalt.
  • git grep -n LeaveAwareCallDispatcherContinuation returns only the definition + the framework's provider (no leftover hypothesis sites).
  • All sorry/axiom counts unchanged or reduced.
  • lake clean && lake build green; make check green; full CI green.

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions