zksync-era icon indicating copy to clipboard operation
zksync-era copied to clipboard

feat(vm-runner): implement output handler for VM runner

Open itegulov opened this issue 1 year ago • 1 comments

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 fmt and zk lint.
  • [x] Spellcheck has been run via zk spellcheck.
  • [x] Linkcheck has been run via zk linkcheck.

itegulov avatar May 06 '24 09:05 itegulov

Still working on the documentation but functionally I think the PR is ready for a review

itegulov avatar May 08 '24 04:05 itegulov