Skip to content

Comments

feat: introduce CommittedBatchProvider#764

Merged
itegulov merged 17 commits intomainfrom
di/committed-batch-provider
Jan 20, 2026
Merged

feat: introduce CommittedBatchProvider#764
itegulov merged 17 commits intomainfrom
di/committed-batch-provider

Conversation

@itegulov
Copy link
Collaborator

@itegulov itegulov commented Jan 7, 2026

Summary

This PR is one of the final steps for #510. Essentially it simplifies commit watcher logic by introducing CommittedBatchProvider that has the following in-memory mappings:

  • batch -> block_range
  • batch -> DiscoveredCommittedBatch (commit batch info)

As part of L1 discovery on node startup we load this data for batches in [last_executed_batch, last_committed_batch]. Unlike current approach, we do it synchronously before starting the node as part of state recovery.

For batches with numbers higher than last_committed_batch, commit_watcher populates this data. That is, instead of watching the BlockCommit event, it watches ReportCommittedBatchRangeZKsyncOS which has the needed information. Thus, I merge commit_watcher and block_range_watcher and get rid of should_continue field in watcher trait.

This change will allow us to finalize #736 without compromising performance

# Conflicts:
#	node/bin/src/batcher/mod.rs
#	node/bin/src/lib.rs
@github-actions
Copy link

github-actions bot commented Jan 8, 2026

Test results

184 tests   184 ✅  17m 40s ⏱️
 27 suites    0 💤
  1 files      0 ❌

Results for commit 0198bf2.

♻️ This comment has been updated with latest results.

RomanBrodetski
RomanBrodetski previously approved these changes Jan 8, 2026
Copy link
Collaborator

@RomanBrodetski RomanBrodetski left a comment

Choose a reason for hiding this comment

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

nice, I like how with the way you introduced batch_provider you were able to neatly pre-populate it on startup and then continue filling it in in commit watcher.

We still use BatchStorage: ReadBatch in execute_watcher - we will replace it with the batch_provider - the only concern is race condition - it's unlikely but is it possible that execute_watcher discovers a batch execute before the commit_watcher filled in its part? What do we do in such cases?.. On the high level blocking is OK but will probably look terrible in code. Still better than S3 so I'd merge but we may need to revisit right after.

Thinking further about such race condition , maybe we shouldn't have execute and commit watchers as completely separate processes..

@itegulov
Copy link
Collaborator Author

it's unlikely but is it possible that execute_watcher discovers a batch execute before the commit_watcher filled in its part?

Indeed. This is related to @slowli's point about background initialization. get() should ideally be async and wait until requested batch is fetched. This will kill both birds with one stone.

@itegulov itegulov merged commit d3a1cf4 into main Jan 20, 2026
14 checks passed
@itegulov itegulov deleted the di/committed-batch-provider branch January 20, 2026 08:39
RomanBrodetski pushed a commit that referenced this pull request Jan 23, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.14.0](v0.13.0...v0.14.0)
(2026-01-23)


### ⚠ BREAKING CHANGES

* Execution of service interop transactions
([#803](#803))
* use token prices in fee model
([#787](#787))
* token price updater component
([#779](#779))
* Basic V31 Support
([#759](#759))

### Features

* 2FA L1 integration
([#726](#726))
([43a466f](43a466f))
* add bash script to run local chains
([#777](#777))
([b786ad8](b786ad8))
* add more eth-sender metrics. Bump fee limit.
([#789](#789))
([6b6f13b](6b6f13b))
* add support for YAML config files
([#785](#785))
([5f3de80](5f3de80))
* add toHex helper for JS tracer
([#761](#761))
([f9e14aa](f9e14aa))
* adjust pubdata price based on blob fill ratio
([#700](#700))
([a8e6de4](a8e6de4))
* adjust pubdata price based on blob fill ratio (2nd attempt)
([#756](#756))
([167d874](167d874))
* Basic V31 Support
([#759](#759))
([1103ab8](1103ab8))
* **batcher:** make the limit of transaction count per batch
configurable
([#796](#796))
([f09de09](f09de09))
* **deposit tool:** Make it work with https provider; use ether as unit
([#794](#794))
([c6b7839](c6b7839))
* do not require batch storage (S3) for ENs
([#810](#810))
([d542f07](d542f07))
* Execution of service interop transactions
([#803](#803))
([20f5ed2](20f5ed2))
* ignore vulnerability to recover cargo-audit
([#754](#754))
([309887e](309887e))
* Implement interop system transaction
([#712](#712))
([0310dbc](0310dbc))
* Interop roots watcher
([#819](#819))
([66c8fc5](66c8fc5))
* introduce `CommittedBatchProvider`
([#764](#764))
([d3a1cf4](d3a1cf4))
* make block-related logging consistent
([#792](#792))
([485c13c](485c13c))
* more granular buckets for `prove_time_per_million_native`
([#763](#763))
([4e0fe7d](4e0fe7d))
* **network:** add runnable `NetworkService` (disabled by default)
([#773](#773))
([88fdf39](88fdf39))
* **network:** implement bare-bones `zks` RLPx subprotocol
([#716](#716))
([417c6ad](417c6ad))
* record prove time per native
([#757](#757))
([63fd801](63fd801))
* remove hardcoded config constants
([#762](#762))
([adfc998](adfc998))
* return zeroes in `reward` in `eth_feeHistory`
([#800](#800))
([8f09ae7](8f09ae7))
* Revert "feat: adjust pubdata price based on blob fill ratio"
([#753](#753))
([d7a7f54](d7a7f54))
* set total difficulty in rpc block headers
([#801](#801))
([6dac957](6dac957))
* support JSON config files
([#752](#752))
([f94d846](f94d846))
* token price updater component
([#779](#779))
([863b909](863b909))
* use newer version of zkyns-os-revm
([#798](#798))
([aa97f62](aa97f62))
* use token prices in fee model
([#787](#787))
([1f2375f](1f2375f))


### Bug Fixes

* `zksync_os_types` compiles without features
([#815](#815))
([b7dbe66](b7dbe66))
* construct pending block context in `eth_call`-like methods
([#758](#758))
([1e1086a](1e1086a))
* local chain config file is required to start the node
([#771](#771))
([4597cae](4597cae))
* prevent "subtract with overflow" error on EN startup
([#802](#802))
([0678f56](0678f56))
* refactor local-chains structure and update with anvil 1.5.1
([#776](#776))
([24d3852](24d3852))
* rename sandbox to ephemeral
([#778](#778))
([16f6bad](16f6bad))
* **rpc:** make `eth_estimateGas` work when sender has no balance
([#807](#807))
([4ce1018](4ce1018))
* run RPC/status components later in the flow
([#817](#817))
([387999e](387999e))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

---------

Co-authored-by: zksync-era-bot <zksync-era-bot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants