zksync-era
zksync-era copied to clipboard
feat(vm-runner): implement output handler for VM runner
What ❔
This PR creates a new abstraction OutputHandlerFactory that can orchestrate output handlers in a non-trivial manner. Specifically, for the purposes of VM runner we create an implementation ConcurrentOutputHandlerFactory that can produce delegated output handlers that internally use another output handler (i.e. delegatee is specific to the VM runner implementation). The main benefit of this implementation is that handle_l1_batch is non-blocking and finishes almost immediately. The actual work is spawned as a future and is then handled asynchronously enabling us to create many output handlers in parallel.
Why ❔
One of the components for the upcoming VM runner
Checklist
- [x] PR title corresponds to the body of PR (we generate changelog entries from PRs).
- [x] Tests for the changes have been added / updated.
- [ ] Documentation comments have been added / updated.
- [x] Code has been formatted via
zk fmtandzk lint. - [x] Spellcheck has been run via
zk spellcheck. - [x] Linkcheck has been run via
zk linkcheck.
Still working on the documentation but functionally I think the PR is ready for a review