Merged
Conversation
…6676) This simplifies tracegen so that it doesn't need to know about setup snapshots and rollbacks anymore, doesn't need special handling for situations when a phase is empty, and omits rows for phases skipped due to reverts. Note that there are two different relevant scenarios: 1. A phase is just "empty". The phase is encountered normally, but has no contents, like when there are no revertible nullifiers to insert, or when app logic has no enqueued calls to execute. **In this case, the phase gets a padding row**. 2. A phase is "skipped" entirely because of a revert. Like if revertible nullifier insertions fail, app-logic won't ever be encountered. **In this case, app-logic doesn't even get a row.** This PR specifically generates events for scenario 1, when a phase is encountered, but "empty". This "empty" event drives tracegen of a "padding" row. Creation of an event that drives padding rows means that tracegen no longer needs to know about setup snapshots and rollbacks to ensure that a padding row after a revert gets the post-revert state! Because now the post-revert state will be in the `EmptyPhaseEvent`, so tracegen can just generate a row from the phase event as it does for other rows. Also note that this now lets us easily differentiate between "empty" phases versus skipped phases. Now, in tracegen, if a phase has no events, it means that it was _skipped_ because if it was "empty" in simulation, it would've generated an `EmptyPhaseEvent`. So, this PR also stops generating padding rows for _skipped_ phases, which was the originally intended mechanism proposed by @IlyasRidhuan, but it was not implemented that way.
Collaborator
|
🤖 Auto-merge enabled after 4 hours of inactivity. This PR will be merged automatically once all checks pass. |
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.
BEGIN_COMMIT_OVERRIDE
chore: refactor avm tx execution to generate "empty phase" events (#16676)
END_COMMIT_OVERRIDE