1 unstable release
0.1.0 | Jul 13, 2024 |
---|
#8 in #confirmation
Used in 2 crates
(via zksync_node_framework)
1.5MB
34K
SLoC
ZKsync Era Eth Watcher
This crate contains an implementation of the ZKsync Era Eth Watcher component, which fetches the changes from the corresponding L1 contract.
Overview
Internally, Eth Watcher contains event processors, each of which provides a relevant topic (i.e., a bytes32
Solidity
event selector) and is responsible for processing the corresponding events. Besides events, processors have access to
the L1 client (to query more info) and to the node Postgres (to persist processing results). Examples of processors are:
- Priority operations processor: persists priority operations (aka L1 transactions)
- Upgrades processor: persists protocol upgrades.
Eth Watcher combines topics from the processors into a single filter and periodically queries L1 for the corresponding events. The fetched events are partitioned per processor and fed to them in succession.
lib.rs
:
Ethereum watcher polls the Ethereum node for the relevant events, such as priority operations (aka L1 transactions), protocol upgrades etc. New events are accepted to the ZKsync network once they have the sufficient amount of L1 confirmations.
Dependencies
~95MB
~2M SLoC