Skip to content

research: [1636] event exclusion map for Layer 2 proofs#1643

Open
Th0rgal wants to merge 1 commit intomainfrom
research/1636-event-emission-scope
Open

research: [1636] event exclusion map for Layer 2 proofs#1643
Th0rgal wants to merge 1 commit intomainfrom
research/1636-event-emission-scope

Conversation

@Th0rgal
Copy link
Member

@Th0rgal Th0rgal commented Mar 14, 2026

References #1636.

This is a research-only PR for issue #1636.

I chose Option A and produced docs/research/1636-event-exclusion-map.md because the repository already compiles emit and rawLog correctly; the immediate blocker is the Layer 2 proof-surface gating chain in SupportedSpec.lean. A line-accurate exclusion map is the fastest way to unblock the implementation work that will add event/log-trace support.

The artifact documents:

  • every relevant exclusion site in SupportedSpec.lean, including the legacy compatibility scan, the effect-surface gate, the body witness chain, and the typed-event spec.events = [] gate;
  • what each site currently checks;
  • the exact lines involved;
  • the minimal proof-surface change implied at each site;
  • the existing local_obligations + mstore + rawLog workaround pattern in Th0rgal/morpho-verity, including flashLoan and setAuthorizationWithSig.

Note

Low Risk
Low risk: this PR only adds research documentation and makes no code or proof changes.

Overview
Adds a research note docs/research/1636-event-exclusion-map.md that line-maps where Stmt.emit/Stmt.rawLog are currently excluded from the Layer 2 proof surface (primarily via effect/contract-surface gates and the spec.events = [] requirement), and outlines the minimal proof-surface edits needed to introduce event/log-trace support.

Written by Cursor Bugbot for commit 49882a1. This will update automatically on new commits. Configure here.

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 49882a1cbd

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".


The problem is not code generation.

- `Stmt.emit` and `Stmt.rawLog` are first-class statement constructors in [Compiler/CompilationModel/Types.lean](/workspaces/mission-e5876dfd/repo/Compiler/CompilationModel/Types.lean):410 and [Compiler/CompilationModel/Types.lean](/workspaces/mission-e5876dfd/repo/Compiler/CompilationModel/Types.lean):416.

Choose a reason for hiding this comment

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

P2 Badge Replace machine-local absolute links with repo-relative paths

The document links source references using workspace-specific absolute paths such as /workspaces/mission-e5876dfd/repo/..., which only resolve on the author's machine and are broken in normal checkouts and on GitHub, so readers cannot verify the cited code locations. Please switch these links to repository-relative paths (or stable external URLs) so the research artifact remains usable across environments.

Useful? React with 👍 / 👎.

Copy link

@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 1 potential issue.

Fix All in Cursor

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

- The typed-IR compiler lowers them in [Compiler/TypedIRCompiler.lean](/workspaces/mission-e5876dfd/repo/Compiler/TypedIRCompiler.lean):361-376.
- Typed IR lowers them to `logN` Yul in [Compiler/TypedIRLowering.lean](/workspaces/mission-e5876dfd/repo/Compiler/TypedIRLowering.lean):96-101.
- The typed interpreter appends events to `world.events` in [Verity/Core/Free/TypedIR.lean](/workspaces/mission-e5876dfd/repo/Verity/Core/Free/TypedIR.lean):248-260.
- The contract monad already models event append via `emitEvent` in [Verity/Core.lean](/workspaces/mission-e5876dfd/repo/Verity/Core.lean):463-470.
Copy link

Choose a reason for hiding this comment

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

All links use hardcoded dev-environment workspace paths

Medium Severity

Every link in the document uses hardcoded absolute paths from a dev environment (e.g., /workspaces/mission-e5876dfd/repo/... and /workspaces/mission-e5876dfd/morpho-verity/...). These paths are specific to a Codespace/container workspace and will render as broken links on GitHub and anywhere else. Since this document's core value is serving as a "line-accurate exclusion map," having all ~25 reference links broken significantly undermines its utility.

Additional Locations (2)
Fix in Cursor Fix in Web

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