-
Notifications
You must be signed in to change notification settings - Fork 316
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: share state manager and side effect tracer for all enqueued ca…
…lls in tx (#9565) This PR is a bit of a mashup of things as I made sense of what needs to happen to start tracking side effects and state changes at the transaction level. Refactor of `PublicExecutionResult`, `PublicExecutor`, `EnqueuedCallSimulator` & `EnqueuedCallsProcessor`. A lot of this PR is prep for removal of the public kernel and generation of TX-level AVM public inputs & hints. 1. Pulls the `AvmStateManager` (needs rename) up to the `EnqueuedCallsProcessor` and uses it for state checkpointing/forking & rollbacks instead of `WorldStateDB`. This will let us track side effects at the transaction level and eventually generate AVM circuit hints & public inputs at the transaction level. 1. Simplifies the return type (public execution result) from `PublicExecutor.simulate()`. The only consumers of `PublicExecutor.simulate()` are the TXE and the `EnqueuedCallSimulator`. The TXE needs side effects, but the `EnqueuedCallSimulator` shouldn't (although it does until the public kernel is deleted). I provided a minimal return type for each case. `EnqueuedCallSimulator` doesn't receive side effects in the return type from `PublicExecutor.simulate()` and instead makes a call to the `trace` to retrieve `VMCircuitPublicInputs`. Eventually that call to the `trace` will happen in the `EnqueuedCallsProcessor` just once for the entire transaction. 1. Moves some `PublicProcessor` tests into `EnqueudCallsProcessor` tests as they don't really belong at that high a level. 1. Adds tracing of enqueued calls in side effect trace for future use of enqueued call hints. Followup work: 1. Rename `AvmStateManager` -> `PublicStateManager`, rename file accordingly, & move to `simulator/src/public` 2. Once public kernel is removed and new `AVMPublicInputs` are introduced, pull the calls to `stateManager.trace.toVMCircuitPublicInputs()` up to the `EnqueuedCallsProcessor` & modify that function to return the new `AVMPublicInputs` 3. Remove the deprecated `PublicFunctionCallResult` and the old `PublicSideEffectTrace` (to be fully replaced by the `PublicEnqueuedCallSideEffectTrace` which will need a rename). This will require disconnecting the AVM circuit completely until it supports the tx-level `AVMPublicInputs`.
- Loading branch information
Showing
29 changed files
with
1,745 additions
and
1,397 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.