Skip to content

Conversation

@dbanks12
Copy link
Contributor

@dbanks12 dbanks12 commented Sep 2, 2025

BEGIN_COMMIT_OVERRIDE
chore: refactor avm tx execution to generate "empty phase" events (#16676)
END_COMMIT_OVERRIDE

…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.
Copy link
Collaborator

@ludamad ludamad left a comment

Choose a reason for hiding this comment

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

🤖 Auto-approved

@AztecBot AztecBot added this pull request to the merge queue Sep 2, 2025
@AztecBot
Copy link
Collaborator

AztecBot commented Sep 2, 2025

🤖 Auto-merge enabled after 4 hours of inactivity. This PR will be merged automatically once all checks pass.

Merged via the queue into next with commit 152eadf Sep 2, 2025
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants