Closed
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
docs/research/1623-foreach-soundness-audit.mdforEachhelper, compilation-model/source semantics, and generated YulforEachuse and identify the concrete proof surface affected todayWhy Option A
I chose Option A because issue #1623 is a P0 soundness bug and the highest-leverage first step is to pin down the exact mismatch before changing semantics. The audit shows that the trusted EDSL helper executes the loop body once regardless of
count, while compiled Yul emits a real bounded loop, and the currentSourceSemanticslayer does not execute.forEachat all.Issue
Closes #1623
Note
Low Risk
Low risk: this PR only adds research documentation and does not change any code paths, proofs, or compiler behavior.
Overview
Adds a new research note
docs/research/1623-foreach-soundness-audit.mdthat documents the current semantic mismatch forforEachacross the trusted EDSL helper, the compilation-model source semantics, and the generated Yul.The doc enumerates current in-repo
forEachusages and calls out the specific contract surface (Contracts.Counter.previewLowLevel) where the mismatch can make reasoning/proofs unsound, plus outlines the concrete follow-up fixes needed.Written by Cursor Bugbot for commit 4cb07a3. This will update automatically on new commits. Configure here.