matter-labs/zksync
39.3
Weak · 30 September 2026
65.1k
lines of production code
Rust
with TypeScript, Solidity
2
measurements over time
What this system is
This system is the core infrastructure for the zkSync Layer 2 scaling solution, managing the lifecycle of zero-knowledge rollup transactions from off-chain submission to on-chain settlement. It comprises a modular node architecture that handles transaction mempooling, state maintenance via sparse Merkle trees, and the generation of witness data for PLONK proof systems. The system also provides comprehensive REST and JSON-RPC APIs for user interaction, alongside specialized services for proof generation, Ethereum event monitoring, and data restoration.
How it got here
2018–2020 — zkSync v2 architecture and core implementation
128 changes.
This period marks the foundational development of zkSync v2, characterized by the removal of legacy Bellman and Sapling cryptography in favor of a new Plonk-based proof system and custom circuit logic. The team established the core Rust infrastructure, including the state keeper, storage layer with Diesel/SQLx, and the witness generator, while simultaneously building the smart contract suite and TypeScript/Rust SDKs for client interaction.
2021 — API v0.2 and NFT support expansion
71 changes.
This period focused on expanding the zkSync API with the v0.2 REST interface and introducing comprehensive support for NFTs, including minting, factory management, and full exits. The work also established robust infrastructure for forced exit requests, real-time event streaming, and rigorous testing through load harnesses and contract verification.
2022–2026 — storage schema evolution and withdrawal support
22 changes.
This period focused on expanding the database schema to support new features such as mempool priority operations, unique user metrics, and a complete withdrawal tracking system with pending and finalized states. Concurrently, significant performance optimizations were implemented through the introduction of binary encoding for tree caches, comprehensive database indexing, and the migration of transaction count logic to Rust. The work also included refactoring mempool block proposal logic and enhancing L1 event listener compatibility for newer contract versions.
Features
Add API documentation for accounts, transactions, and network status
This change introduces new API documentation files for the \infrastructure/api-docs/blueprint/groups\ directory, covering accounts, batches, blocks, config, fees, network status, tokens, transactions, and 2FA toggling. The documentation defines endpoints for retrieving account states, submitting transactions, fetching block details, and querying network status, among others. It also includes documentation for fee estimation, token information, and NFT-related endpoints.
infrastructure/api-docs/blueprint/groups · high confidence
Add Docker environment configuration file
A new docker.env file has been added to the etc/env directory, defining environment variables required for the Docker-based deployment. This includes configuration for the Ethereum client web3 URL, fee ticker services (CoinMarketCap, CoinGecko, Uniswap), the database connection string, liquidity token watcher settings, and the chain state keeper miniblock iteration interval.
etc/env · high confidence
Add Mattermost notification capability for new tokens
A new notifier library has been introduced to send alerts to a Mattermost channel. When a new token is detected, the system now formats a message containing the token's ID, address, symbol, and decimals, and posts it to the specified webhook URL via the \send\_new\_token\_notify\ interface.
core/lib/notifier · high confidence
Add committed\_nonce table for tracking account nonces
The database schema now includes a new \committed\_nonce\ table to store account-specific nonce data. This table tracks the committed nonce for each account, recording the account ID, the nonce value, and the associated block number, enabling the system to verify nonces in the API layer.
_core/lib/storage/migrations/2022-03-17-064523\_committed\nonce · high confidence
Add database table for token market volume
The system now persists token market volume data in a new \ticker\_market\_volume\ table. This table stores the market volume and the last update timestamp for each token, linked to the existing \tokens\ table, enabling the application to save and retrieve historical market volume metrics.
_core/lib/storage/migrations/2020-12-18-022905\_token\_market\volume · high confidence
Add mempool priority operations storage table
The system now persists mempool priority operations in a new database table, enabling tracking of transaction details including L1/L2 addresses, transaction hashes, Ethereum block information, and confirmation status. This change supports the ability to store and query priority operations with their associated metadata and state.
_core/lib/storage/migrations/2022-01-05-130339\_mempool\_prioirity\ops · high confidence
Add reading-tool utility for test configuration
A new infrastructure utility, \infrastructure/reading-tool\, has been introduced to centralize the loading of test configuration data. It provides functions to read EIP-1271 and Ethereum constants, test vectors, and token lists from the \etc/test\_config/\ and \etc/tokens/\ directories. The tool allows consumers to optionally include withdrawal helper configurations and exposes a \getTokenList\ function to fetch token data by source, simplifying access to these resources for TypeScript tests and the zksync.js library.
infrastructure/reading-tool · high confidence
Add storage layer for pending and finalized withdrawals
The storage module now persists withdrawal events by saving pending withdrawals to the \withdrawals\ table and finalizing them into the \finalized\_withdrawals\ table. The \finalize\_withdrawal\ method matches incoming withdrawal events against pending records, deducting amounts from multiple pending entries if necessary to satisfy the finalization amount, while ensuring no transaction is processed twice via duplicate checks on \tx\_hash\ and \tx\_log\_index\. A new query endpoint retrieves finalized withdrawals linked by transaction hash, exposing account, token, and amount details for downstream consumption.
core/lib/storage/src/withdrawals · high confidence
Add token-lists-manager utility for updating token lists
A new CLI tool has been added to the infrastructure/token-lists-manager directory to manage token lists. It reads source configurations from .token-lists-sources-config.json (currently configured for CoinGecko), fetches the latest token data, computes diffs using @uniswap/token-lists, and prompts the user for confirmation before saving updates to etc/token-lists/. This allows users to manually review and apply changes to local token lists from external sources.
infrastructure/token-lists-manager · high confidence
Added Geth Docker container with configurable development networks
The \docker/geth\ directory now provides a complete Docker setup for running a Geth Ethereum client. The entrypoint script allows users to launch the node in one of three modes—standard (1-second block time), fast (instant blocks), or mainnet (15-second block time)—by setting the \PLUGIN\_CONFIG\ environment variable or passing an argument. The container is pre-configured with a private development chain (chain ID 9) using Clique consensus, including pre-funded accounts and a pre-generated keystore to enable immediate mining and testing without manual initialization.
docker/geth · high confidence
Added REST API client for forced exit requests
The API client now includes support for interacting with the forced exit requests feature. This adds methods to retrieve the current status of forced exit requests (including configuration details like fees and contract addresses) and to submit new forced exit requests. The client uses camelCase serialization for API payloads and targets the /api/forced\_exit\_requests/v0.1/ scope.
_core/lib/api\_client/src/rest/forced\_exit\requests · high confidence
Added block details caching with async LRU support
The API utility layer now includes a \BlockDetailsCache\ that caches fully verified block details using an async-safe LRU cache (\AsyncLruCache\). This change introduces thread-safe caching primitives (\SharedLruCache\ and \AsyncLruCache\) to improve performance when retrieving block information, ensuring that only verified blocks are stored in the cache to maintain data consistency.
_core/bin/zksync\api/src/utils · high confidence
Added database migration for NFT factory table
A new database migration has been introduced to create the \nft\_factory\ table, which stores the mapping between a creator's ID and their factory address, along with the creator's address and creation timestamp. This change establishes the necessary storage schema for NFT factory functionality.
_core/lib/storage/migrations/2021-04-13-155930\_nft\factory · high confidence
Added database migration for two-factor authentication public key hash storage
A new database migration has been introduced to support two-factor authentication (2FA) by creating the \no\_2fa\_pub\_key\_hash\ table. This table stores the mapping between an \account\_id\ and its corresponding \pub\_key\_hash\, enabling the system to track public key hashes for accounts that do not currently have 2FA enabled or are in the process of setup.
_core/lib/storage/migrations/2021-09-03-163738\no-2fa-pubkey-hash · high confidence
Added database schema for subsidies
A new database migration has been introduced to create the \subsidies\ table. This table stores subsidy records including transaction hashes, token identifiers, and monetary amounts. USD values are stored as scaled integers (fixed-point arithmetic with 6 decimal places) to maintain precision and avoid floating-point issues, while token amounts are stored as numeric values. The schema also includes a column for the subsidy type.
_core/lib/storage/migrations/2021-11-25-163122\_create\subsidies · high confidence
Added example tool to generate exit proofs for fungible tokens and NFTs
A new example script, \generate\_exit\_proof.rs\, has been added to the \prover\_utils\ crate. This tool allows users to generate exit proofs for both fungible tokens and NFTs by connecting to the database, retrieving the verified state, and creating the necessary cryptographic proof for withdrawal. It supports command-line arguments to specify the account address and token (by symbol or address) and utilizes the \vlog\ library for initialization and logging.
_core/lib/prover\utils/examples · high confidence
Added migration tool to assign sequence numbers to transaction filters
A new binary utility has been added to the core system to perform a one-time data migration. This tool connects to the storage layer to identify transactions lacking unique sequence numbers in their filters and updates them. It operates in a loop, processing executed transactions and priority operations sequentially until all relevant records have been assigned their correct sequence numbers, ensuring data consistency for transaction filtering.
_core/bin/add\_seq\no · high confidence
Added proof removal utility tool
A new command-line tool (\remove\_proofs\) has been added to the core binary suite, allowing administrators to delete proof-related data from the database for blocks beyond a specified cutoff. The tool connects to the storage processor, validates that the provided block number is not behind the last proven block to prevent data loss of published proofs, and then clears specific tables including \witness\, \eth\_unprocessed\_aggregated\_ops\, \aggregate\_operations\, \proofs\, \aggregated\_proofs\, and \prover\_job\_queue\ within a single transaction.
_core/bin/remove\proofs · high confidence
Added server configuration storage and retrieval
The storage layer now supports loading and storing server configuration from the database. A new \ConfigSchema\ struct provides methods to load the \ServerConfig\ record (including contract, governance, and NFT factory addresses) and to store it for testing purposes, with SQL query execution times tracked via metrics.
core/lib/storage/src/config · high confidence
Added storage layer for forced exit requests
The storage module now includes a new \forced\_exit\_requests\ component that persists forced exit requests to the database. This implementation provides methods to store new requests, retrieve them by ID or status (oldest unfulfilled, unconfirmed), and update fulfillment details including the \fulfilled\_at\ timestamp and \fulfilled\_by\ transaction hashes. It also includes functionality to delete old unfulfilled requests, ensuring the storage layer can manage the lifecycle of these specific transaction requests.
_core/lib/storage/src/forced\_exit\requests · high confidence
Added storage support for tracking transaction subsidies
A new \misc\ storage schema has been introduced to handle auxiliary data unrelated to core zkSync functionality. This includes a \Subsidy\ record structure and methods to persist subsidy details (such as transaction hash, USD amounts, token information, and subsidy type) into a new \subsidies\ database table, as well as to query the total used subsidy for specific types. This enables the system to track and report on subsidy usage metrics.
core/lib/storage/src/misc · high confidence
Added test configuration and test vector deserialization utilities
The \test\_config\ module now provides structured configuration loading for test environments, including EIP1271 smart wallet settings, Ethereum mnemonic parameters, and API URLs. It also introduces a new \unit\_vectors\ submodule that deserializes test vector JSON files (such as \sdk/test-vectors.json\) into strongly-typed Rust structs for transactions, crypto primitives, and utility tests, enabling consistent and type-safe execution of unit test suites.
_core/lib/config/src/test\config · high confidence
Initial database schema for ZKSync storage
The storage layer now includes the initial database migration scripts (up.sql and down.sql) that define the core schema for ZKSync. This introduces tables for managing blocks, operations, executed transactions, and priority operations, alongside dedicated sections for tokens, accounts (including balance updates, creations, and public key changes), and state restoration. It also provisions tables for Ethereum integration (ETH operations, nonces, stats, and transaction hashes), prover run tracking, and server configuration, establishing the foundational data structures required for node operation.
_core/lib/storage/migrations/2020-04-07-065600\_init\storage · high confidence
Initial implementation of the ZkSync zero-knowledge circuit logic
This change introduces the core Rust implementation for the ZkSync zero-knowledge proof system within the \core/lib/circuit\ crate. It provides the foundational structures and logic required to generate and verify proofs for blockchain operations, including account state management (\account.rs\), operation data allocation (\allocated\_structures.rs\), and the main circuit synthesis (\circuit.rs\). The update also adds specific circuit logic for handling exits and NFTs (\exit\_circuit.rs\), robust signature verification (\signature.rs\), and serialization of prover data (\serialization.rs\), effectively establishing the backend cryptographic engine for transaction processing.
core/lib/circuit/src · high confidence
Initial implementation of the fee ticker calculation engine
The fee ticker module has been introduced to the API service, providing the core logic for calculating transaction fees. This implementation defines base costs for operations such as transfers, withdrawals, ChangePubKey, and swaps, and applies a formula that combines ZK proof costs, gas prices, and token risk factors. It supports specific fee types including fast withdrawals and various ChangePubKey variants, and integrates with external price sources like CoinGecko and CoinMarketCap to determine token values in USD.
_core/bin/zksync\_api/src/fee\ticker · high confidence
Initial release of the zkSync Rust SDK
The \sdk/zksync-rs\ crate is introduced, providing a complete Rust client for interacting with the zkSync network. This SDK enables users to manage wallet credentials (via \WalletCredentials\), execute on-chain operations like ERC20 deposits and full exits (via \EthereumProvider\), and build and send off-chain transactions including transfers, withdrawals, NFT minting, and ChangePubKey operations. It includes built-in support for polling transaction status with configurable timeouts and handles network-specific logic such as ERC20 deposit gas limits.
sdk/zksync-rs · high confidence
Introduce API v0.2 type definitions
The API types crate now includes a new v0.2 module that defines the data structures for the updated API version. This includes account information with support for NFTs and ongoing deposits, block status tracking, transaction details with L1/L2 receipts, fee structures, and pagination helpers. All types use camelCase serialization and integrate with existing ZkSync types for consistency.
_core/lib/api\types/src/v02 · high confidence
Introduce Docker-based data restore tool with database initialization and migration
A new Docker image and entrypoint script are added for the data-restore utility, enabling users to restore blockchain data via containerized execution. The tool initializes the PostgreSQL database, runs schema migrations using Diesel, and supports both 'genesis' and 'continue' restore modes. It allows restoring from a PostgreSQL dump file (PG\_DUMP) and can operate in non-finite mode via the FINITE\_MODE environment variable, while waiting for the database to be ready before starting the restore process.
docker/data-restore · high confidence
Introduce Dockerized Exit Tool for data restoration and proof generation
Users can now run the exit tool within a containerized environment, simplifying setup and execution. The new Dockerfile installs necessary dependencies (Node.js, Rust, SQLx, PostgreSQL client libraries) and builds the required zkSync binaries, including the \generate\_exit\_proof\ example. The accompanying entry script automates the workflow by handling database initialization, running data restoration in finite mode, and generating exit proofs for specified networks (mainnet, rinkeby, ropsten) and tokens, configurable via JSON config files.
docker/exit-tool · high confidence
Introduce Dockerized prover with dummy mode and graceful restarts
The prover is now available as a Docker image built on Rust 1.91 and Debian Bookworm. This image supports a dummy prover mode via the MISC\_DOCKER\_DUMMY\_PROVER environment variable for testing, downloads required Plonk setup powers using axel, and includes a graceful-run.sh entrypoint that handles signal trapping and automatic restarts to mitigate memory leaks.
docker/prover · high confidence
Introduce Ethereum operation storage schema
Added a new \EthereumSchema\ module to the storage layer to persist and retrieve Ethereum-related operations. This includes loading unconfirmed operations with their associated transaction hashes and aggregated operation data, restoring unprocessed operations after a server restart, and loading operations pending Ethereum submission. The change also introduces specific database record structures (\StorageETHOperation\, \ETHOperationData\, \ETHTxHash\, \ETHParams\, \ETHStats\) to map these interactions to the underlying SQL database.
core/lib/storage/src/ethereum · high confidence
Introduce Ethereum signing capabilities via JsonRpcSigner and PrivateKeySigner
The \core/lib/eth\_signer\ library now provides a unified \EthereumSigner\ trait and two concrete implementations: \JsonRpcSigner\ for remote signing via JSON-RPC (supporting message signing with optional Ethereum-signed prefixes, EIP-712 typed data, and raw transaction signing) and \PrivateKeySigner\ for local signing using a raw private key. This change also introduces a dedicated \SignerError\ type to handle specific failure modes like missing keys or decoding errors, and adds \RawTransaction\ support for legacy, access-list, and EIP-1559 transaction types.
_core/lib/eth\signer · high confidence
Introduce EthereumGateway with multiplexer and mock support
The eth\_client library now exposes an EthereumGateway enum that unifies access to Ethereum nodes through three backends: a direct client, a multiplexer for load balancing across multiple URLs, and a mock implementation for testing. This gateway delegates common operations such as nonce retrieval, transaction signing, raw transaction submission, and status checking to the underlying client, allowing users to switch between single-node, multi-node, and test environments without changing the calling code.
_core/lib/eth\client/src · high confidence
Introduce ZkSync key generator CLI for PLONK verification keys
The \key\_generator\ binary now provides a command-line interface to generate PLONK verification keys for the zkSync main and exodus circuits, create verifier contracts, and calculate circuit sizes. Users can run subcommands to generate recursive verification keys, produce sample proofs for testing, and output the necessary artifacts based on environment-configured block chunk sizes and setup powers.
_core/bin/key\generator/src · high confidence
Introduce async database abstraction for state restoration
The state keeper's state restoration logic now uses a new \StateRestoreDb\ trait to abstract database interactions. This change introduces a real implementation (\StateRestoreStorage\) that fetches block data, account updates, and Merkle tree caches from the underlying storage, alongside a mock implementation (\MockStateRestoreStorage\) designed to enable unit testing of the restoration process without requiring a live database.
_core/bin/zksync\_core/src/state\_keeper/state\restore/db · high confidence
Introduce core API types crate
A new \api\_types\ crate has been created to centralize shared data structures for the API layer. This includes \TxWithSignature\, which bundles a transaction with its signature for incoming batch transactions, and \CoreStatus\, which exposes the availability status of the main database, replica database, and Ethereum node connection. Additionally, \PriorityOpLookupQuery\ provides a unified enum for querying priority operations by sync hash, Ethereum hash, or either.
_core/lib/api\types/src · high confidence
Introduce data restore schema for sidechain state recovery
Added a new \data\_restore\ module to the storage layer, providing the \DataRestoreSchema\ interface to reconstruct the sidechain state from Ethereum contract data. This includes logic to save and load rollup operations, persist genesis state updates, track the last watched Ethereum block number, and store block and token events, enabling reliable state restoration from on-chain history.
_core/lib/storage/src/data\restore · high confidence
Introduce database schema for tracking withdrawals and finalization
The storage layer now includes a new migration that creates the \withdrawals\ and \finalized\_withdrawals\ tables. This schema supports tracking pending withdrawals with their full and remaining amounts, linking them to specific transaction hashes and log indices, while the \finalized\_withdrawals\ table records completed withdrawal amounts and references the original pending record via a foreign key constraint.
_core/lib/storage/migrations/2022-09-07-161448\withdrawals · high confidence
Introduce dedicated forced exit request processing actor
A new \zksync\_forced\_exit\_requests\ binary has been added to handle forced exit requests independently. This actor monitors the Ethereum L1 contract for \FundsReceived\ events via a new \EthHttpClient\, validates requests against account age and nonce constraints, and submits the corresponding \ForcedExit\ transactions to the mempool. It includes logic to prepare the sender account, manage request lifecycles (including deletion of old unfulfilled requests), and track fulfillment status, providing a dedicated mechanism for processing forced exits separate from the main server loop.
_core/bin/zksync\_forced\_exit\requests · high confidence
Introduce new REST API client crate
A new \api\_client\ crate has been added to the project, exposing a \rest\ module for REST API interactions. The crate includes a clippy lint allowance to suppress warnings regarding \PartialEq\ implementations without \Eq\.
_core/lib/api\client/src · high confidence
Introduce new Web3 JSON-RPC API server for zkSync
A new Web3-compatible JSON-RPC server has been added to the zkSync API, exposing standard Ethereum endpoints such as \eth\_getBalance\, \eth\_getBlockByNumber\, \eth\_getLogs\, and \eth\_call\. This implementation includes dedicated helpers for processing ERC20 and NFT factory contract calls, mapping internal zkSync operations (like transfers, withdrawals, and minting) to standard Ethereum logs, and handling block resolution with support for aliases like 'latest' and 'pending'. The server runs as a separate HTTP service, wired with its own configuration for token cache invalidation and block range limits, and is accompanied by integration tests verifying the correctness of these RPC responses.
_core/bin/zksync\_api/src/api\server/web3 · high confidence
Introduce parallel Sparse Merkle Tree with circuit-specific account and balance models
The crypto library now provides a new parallel Sparse Merkle Tree implementation (\parallel\_smt\) that supports batch updates and parallel hash calculation via \rayon\, along with a \TreeMemoryUsage\ struct to track RAM consumption. This change introduces specific circuit models for zkSync: \CircuitAccount\ (containing nonce, public key hash, address, and a balance subtree) and \Balance\ (token value), which are used to calculate state root hashes. The tree uses the Rescue hash algorithm via \RescueHasher\ and includes bincode serialization support for the tree cache.
_core/lib/crypto/src/merkle\tree · high confidence
Introduce persistent event logging for blocks, accounts, and transactions
The storage layer now includes a new event system that persists network events (block, account, and transaction) into a dedicated database table. These events are serialized as JSON and stored permanently, allowing external consumers to fetch new events via a cursor-based API. This change provides a reliable, queryable history of state changes for monitoring and synchronization purposes.
core/lib/storage/src/event · high confidence
Introduce prover job queue and proof storage schema
The storage layer now includes a dedicated prover schema that manages the lifecycle of proof generation jobs. This change adds a job queue mechanism where prover tasks are inserted with priorities and types, retrieved using row-level locking to prevent race conditions, and marked as idle if they become stale after 120 seconds. It also introduces storage for single and aggregated proofs, along with records for active provers and block witnesses, enabling the system to track and persist proof generation state.
core/lib/storage/src/prover · high confidence
Introduce standalone data restore tool
A new data restore utility has been added to the core binary suite, allowing users to reconstruct the zkSync state from Ethereum contract events. The tool features a finite mode to restore up to a specific verified block, supports continuing interrupted restores, and includes an in-memory storage interactor for testing. It handles genesis state initialization, token registration, and tree state updates via a configurable driver.
_core/bin/data\restore/src · high confidence
Introduce state schema for persisting and applying chain state updates
The storage layer now includes a \StateSchema\ that manages the chain's state by persisting account updates (creation, deletion, balance changes, public key changes, and NFT minting/removal) to the database before they are applied to the final state snapshot. This two-step process—storing updates upon block commitment and applying them upon verification—enables easy access to historical state for any committed block and allows for rewinding non-final state, supporting provers and state consistency.
core/lib/storage/src/chain/state · high confidence
Introduce the \`zk\` CLI for local development and infrastructure management
A new \zk\ command-line tool is added to the \infrastructure/zk\ directory to streamline local development workflows. Built with Commander.js, it provides a unified interface for managing the ZkSync environment, including subcommands for initializing the network (\init\), managing Docker containers (\docker\), handling database operations (\db\), deploying and building contracts (\contract\), running the prover (\prover\), and managing configuration files (\config\). The tool also includes utilities for code formatting (\fmt\), linting (\lint\), and generating shell completions, replacing previous ad-hoc scripts with a structured, documented CLI.
infrastructure/zk · high confidence
Introduce the standalone zksync\_event\_listener service
Adds a new standalone server application that fetches new events from the zkSync database and streams them to connected WebSocket clients. The service includes an event listener actor to poll for new database entries, a server monitor to manage active WebSocket connections, and a subscriber system that allows clients to register specific filters for account, block, and transaction events. This change brings back the event listener functionality with a new architecture based on the actix actor model and strict typing.
_core/bin/zksync\_event\listener · high confidence
Introduce unified account diff model and storage utilities
The storage crate now includes a new \diff.rs\ module that defines the \StorageAccountDiff\ enum to represent account changes (balance updates, creation, deletion, public key changes, and NFT minting) and converts them into \AccountUpdate\ objects. Additionally, \utils.rs\ provides helper functions for address serialization and an \affected\_accounts\ function to identify accounts involved in various transaction types, while \test\_data.rs\ adds utilities for generating test data including NFTs and blocks.
core/lib/storage/src · high confidence
Introduce zkSync Exit Tool for generating exodus proofs
Added a new infrastructure tool that generates input data for zkSync exit transactions. The tool uses Docker and PostgreSQL to restore network state from Ethereum and produce cryptographic proofs for user withdrawals. It provides shell scripts to initialize the database, run the data restoration process, and continue interrupted operations, requiring Docker, Docker Compose, and access to a Web3 API.
infrastructure/exit-tool · high confidence
Introduces Ethereum client multiplexer for high availability
The \eth\_client\ library now includes a \MultiplexerEthereumClient\ that manages multiple underlying Ethereum node connections. This component allows the system to route requests across several clients, prioritizing a preferred node and automatically falling back to others if a call fails, thereby improving resilience against individual node outages or latency issues.
_core/lib/eth\client/src/clients · high confidence
Introduction of REST API v0.2
The API server now exposes a new v0.2 REST interface alongside the existing v0.1 version. This new version introduces dedicated endpoints for account information (including balances, NFTs, and account type), block details and transaction pagination, network status, token listings and pricing, transaction history, and fee estimation. It also includes a configuration endpoint and a robust error handling system with specific error codes. The implementation uses a modular structure with separate modules for each resource area and integrates with the existing storage and fee ticker systems.
_core/bin/zksync\_api/src/api\server/rest/v02 · high confidence
Introduction of a new REST API client module
A new REST API client implementation has been added to the \core/lib/api\_client/src/rest\ module. This includes a \Client\ struct for interacting with the zkSync REST API v1, a \ClientRequestBuilder\ for constructing requests, and specific error handling types like \ErrorBody\ and \ClientError\. The module also exposes scopes for \forced\_exit\_requests\ and \v02\ endpoints, providing a structured way to make HTTP calls and handle responses.
_core/lib/api\client/src/rest · high confidence
Introduction of core server actors and private API
The core server now runs as a set of independent background actors (Ethereum watcher, state keeper, mempool, committer, token handler, and factory handler) coordinated by a central runtime, and exposes a new private API with a /status health-check endpoint. A dedicated rejected-transaction cleaner removes stale failed transactions, and a transaction-event emitter persists processed operation events to the database, while genesis initialization and token registration are handled by dedicated handlers.
_core/bin/zksync\core/src · high confidence
Introduction of event storage schema with real-time notification support
The database schema now includes a new \events\ table to store blockchain events, categorized by type (Account, Block, Transaction) and linked to a specific block number. Each event record contains JSONB data for flexible payload storage. Additionally, a PostgreSQL trigger and function have been added to automatically notify listeners via the \event\_channel\ whenever a new event is inserted, enabling real-time event processing capabilities.
_core/lib/storage/migrations/2021-03-29-111119\event-schema · high confidence
Introduction of in-memory token and NFT caching layer
The \core/lib/token\_db\_cache\ module now provides an in-memory cache for token metadata and NFT data, reducing direct database load. The \TokenDBCache\ struct maintains a local HashMap of tokens keyed by symbol, ID, and address, with a configurable invalidation duration to ensure data freshness. It exposes methods like \get\_token\ and \get\_nft\_by\_id\ that first check the local cache before falling back to the database via \StorageProcessor\, and includes a \fill\_token\_cache\ method to pre-populate the cache with all known tokens upon initialization.
_core/lib/token\_db\cache · high confidence
Introduction of new CLI wrapper scripts for API docs, CI runs, and the main zk command
New executable shell scripts have been added to the bin directory to streamline development workflows. The \api\_docs\ script now handles building API documentation, automatically running yarn if no arguments are provided or passing arguments directly to the underlying Node.js build script. The \ci\_run\ script allows commands to be executed within the CI docker-compose environment. Additionally, the main \zk\ script provides a unified entry point for building the project, delegating to the infrastructure build scripts while handling yarn dependencies when invoked without arguments.
bin · high confidence
Introduction of new core smart contracts and deployment infrastructure
The contracts directory now contains the foundational smart contracts for the zkSync network, including the main ZkSync contract, Governance, UpgradeGatekeeper, and AdditionalZkSync, along with supporting libraries like Bytes and Operations. A new DeployFactory contract has been added to atomically deploy these components via proxies, establishing the upgradeable architecture. The codebase also introduces interfaces for ERC20 and NFT interactions, a Create2Factory for deterministic deployment, and a ForcedExit contract to handle emergency withdrawals, marking a significant structural shift in the on-chain protocol.
contracts/contracts · high confidence
Introduction of new state management crate with typed error handling and NFT support
A new \core/lib/state\ crate has been added to manage ZkSync state, introducing a structured \ZkSyncState\ that stores accounts in a sparse Merkle tree and includes a dedicated map for NFTs. This change replaces previous error handling with a typed \OpError\ enum that explicitly covers operations like transfers, withdrawals, swaps, and the new MintNFT operation, along with a \TxBatchError\ for batch failures. The state implementation now includes specific logic for handling NFTs (including storage and minting updates), validates transaction timestamps via a new \TxCheck\ trait, and exposes metrics for root hash calculation and account retrieval performance.
core/lib/state/src · high confidence
Introduction of round-robin request balancer
A new \Balancer\ component has been added to the core library to distribute incoming requests across multiple worker instances. It implements a round-robin strategy, cycling through available channels to send equal numbers of requests to each item built via the \BuildBalancedItem\ trait, ensuring balanced load distribution among consumers.
core/lib/balancer · high confidence
Introduction of the Ethereum transaction queue module
The \eth\_sender\ component now includes a new \tx\_queue\ module that manages the lifecycle of Ethereum transactions through three distinct stages: commit, verify, and execute. This module introduces \TxQueue\ and \OperationQueue\ structures to enforce strict ordering of operations by block number, ensuring that operations are processed sequentially and preventing duplicates or out-of-order submissions. It also provides a \TxQueueBuilder\ to facilitate state restoration after restarts by allowing the configuration of pending transaction counts and processed operation counts for each stage.
_core/bin/zksync\_eth\_sender/src/tx\queue · high confidence
Introduction of the zksync\_types crate for core network definitions
The \core/lib/types/src\ location now contains the new \zksync\_types\ crate, which centralizes essential type definitions for the zkSync network. This includes structured types for transactions, operations, blocks, accounts, and blockchain primitives. The crate introduces support for aggregated block operations (commit, proof creation, proof publishing, and execution) and defines the \GasCounter\ logic with specific gas cost constants for various operations like deposits, transfers, withdrawals, and NFT minting. It also formalizes fee structures (\Fee\, \BatchFee\), network identifiers (including Sepolia), token metadata (with NFT support and case-insensitive symbol handling), and event parsing for withdrawals and factory registrations.
core/lib/types/src · high confidence
Major SDK restructure introducing BatchBuilder, RemoteWallet, and REST API support
The zksync.js SDK has been significantly restructured to support new protocol features and improve developer experience. A new BatchBuilder class allows users to construct and sign batches of transactions (including transfers, withdrawals, swaps, and NFT operations) in a single step. The SDK now includes a RemoteWallet implementation for wallets that support ERC-1271 signatures, enabling smart contract wallets to interact with zkSync. Additionally, a new REST provider (RestProvider) has been added alongside the existing RPC provider, offering an alternative HTTP-based interface for network interactions. The crypto module has been updated to support both WebAssembly and asm.js backends, improving compatibility with environments like React Native. The EthMessageSigner has been enhanced to handle EIP-1271 signature verification, and the provider interface now includes methods for NFT operations and 2FA toggling.
sdk/zksync.js · high confidence
Multiplexed Ethereum Gateway Watcher prioritizes optimal backend
The \core/lib/gateway\_watcher\ crate now includes a \MultiplexedGatewayWatcher\ that actively monitors multiple Ethereum gateway backends. It periodically fetches the latest block from each client, then selects the preferred gateway based on three criteria: the longest chain (highest block number), the most frequent block hash among clients, and the lowest request latency. This logic ensures that traffic is routed to the most consistent and responsive Ethereum node, improving reliability for multiplexed gateway configurations.
_core/lib/gateway\watcher · high confidence
New API server implementation with forced exit checks and WebSocket subscriptions
The API server module has been restructured into a new implementation located in \core/bin/zksync\_api/src/api\_server\. This change introduces a dedicated \forced\_exit\_checker.rs\ that enforces a configurable minimum account age before allowing forced exit operations, preventing premature withdrawals for new accounts. The server now supports WebSocket-based event subscriptions for transactions, Ethereum operations, and account states via \rpc\_subscriptions.rs\, allowing clients to receive real-time updates. Additionally, the \tx\_sender.rs\ module centralizes transaction submission logic, handling batch limits, fee calculations, and signature verification, while \helpers.rs\ provides shared utilities for deposit status tracking. This represents a significant architectural shift from the previous API structure to a more modular, thread-per-server design with enhanced validation and real-time capabilities.
_core/bin/zksync\_api/src/api\server · high confidence
New CLI tool to parse public data
A new command-line utility has been added to parse ZkSync public data. Users can now pass a hexadecimal string as a command-line argument, and the tool will decode it, iterate through the public data operations using the ZkSyncOp type, and print the parsed details for each operation to the console.
_core/bin/parse\_pub\data · high confidence
New Forced Exit Requests API v0.1
The API server now exposes a new v0.1 endpoint group at \/api/forced\_exit\_requests\ to manage forced exit operations. This includes a status check to verify if the service is enabled and view configuration details (such as fees and token limits), a submission endpoint to register forced exit requests for specific tokens (with validation for empty token lists, maximum token counts, and exact fee matching), and a retrieval endpoint to fetch the status of a request by its ID. The implementation introduces a dedicated error handling module (\ApiError\) that maps internal submission errors to specific HTTP status codes and error codes, and relies on a \ForcedExitChecker\ to validate account eligibility before processing requests.
_core/bin/zksync\_api/src/api\_server/rest/forced\_exit\requests · high confidence
New Keybase secrets container for automated secret retrieval
A new Docker container has been introduced to fetch secrets from a Git repository using Keybase. The container is based on the Keybase client image and includes an entrypoint script that initializes the Keybase service, clones the specified repository into a local directory, and copies the contents to the /etc directory, making the secrets available to the application.
docker/keybase-secrets · high confidence
New PostgreSQL LISTEN/NOTIFY listener for storage events
The storage library now includes a \StorageListener\ component that wraps PostgreSQL's LISTEN/NOTIFY protocol, allowing the application to receive real-time database notifications. This new module provides methods to connect, subscribe to specific channels, and receive notifications either as individual events (\recv\, \try\_recv\) or as a continuous stream (\into\_stream\). A corresponding \StorageNotification\ type exposes the payload of these events, and a test confirms the end-to-end functionality of sending and receiving notifications.
core/lib/storage/src/listener · high confidence
New Prometheus metrics for transaction volumes and operational counters
The core service now exposes new Prometheus metrics to monitor system health and transaction activity. Users can track the USD volume of transactions per token via the \txs\_volumes\ gauge, which aggregates successful transaction amounts using historical ticker prices. Additionally, the exporter provides operational counters including \count\_operations\ (tracking committed and executed blocks), \stored\_rejected\_txs\, and \mempool\_size\, allowing for better visibility into node performance and state.
_core/lib/prometheus\exporter · high confidence
New REST API v0.2 client implementation
The API client now includes a complete implementation for the v0.2 REST API endpoints, located in the \core/lib/api\_client/src/rest/v02\ module. This adds support for querying account information and transaction histories, retrieving block details and transaction lists, fetching network status and configuration, estimating fees for single transactions and batches, managing token and NFT metadata (including owner lookups), and submitting signed transactions or batches to the network.
_core/lib/api\client/src/rest/v02 · high confidence
New TypeScript-based deployment and publishing infrastructure
The contracts directory now includes a new TypeScript deployment toolchain (\deploy.ts\ and \publish-utils.ts\). This introduces a \Deployer\ class that manages the deployment of core contracts (Governance, ZkSync, Verifier, ForcedExit, etc.) and supports deterministic deployment via a Create2Factory. It also adds functionality to publish verified source code to Etherscan for supported networks (mainnet, goerli, sepolia) using the Solidity standard JSON input format.
contracts/src.ts · high confidence
New ZKsync Witness Generator service with prover job queue and authentication
A new \zksync\_witness\_generator\ crate has been introduced to handle witness generation and prover job management. This service exposes an HTTP API protected by JWT bearer token authentication, allowing provers to request jobs, report progress, and submit proofs. It manages a database-backed job queue for single and aggregated proofs, implements a scaler oracle to determine the required number of prover instances based on pending jobs, and includes a witness generator that caches account trees to optimize block witness creation.
_core/bin/zksync\_witness\generator/src · high confidence
New \`db\_test\` macro for database integration tests
A new procedural macro \db\_test\ is introduced in \core/lib/storage/db\_test\_macro\ to simplify writing database integration tests. When applied to an async function, the macro automatically wraps the test body in a current-thread Tokio runtime and establishes a database connection. It enforces that the test function accepts exactly one argument named \storage\ of type \zksync\_storage::StorageProcessor\, which is then used to start a transaction. This transaction ensures that any database changes made during the test are rolled back when the test completes, providing isolation between tests. The macro also ensures the test is ignored unless the \db\_test\ feature is enabled.
_core/lib/storage/db\_test\macro · high confidence
New block\_revert tool for reverting committed blocks
A new \block\_revert\ binary has been introduced to allow reverting a specified number of recently committed blocks. The tool performs a two-step process: it first reverts state changes in the local database (clearing blocks, pending blocks, account trees, nonces, and prover data) and then submits a transaction to the Ethereum smart contract to revert the corresponding state on-chain. It includes logic to return executed transactions to the mempool, wait for Ethereum transaction confirmation with a timeout, and handle gas limits dynamically based on the number of blocks being reverted.
_core/bin/block\revert · high confidence
New chain storage schema module with stats and tree cache accessors
The storage layer now exposes a new \chain\ module that centralizes access to various data schemas via the \ChainIntermediator\. This includes dedicated schemas for accounts, blocks, operations, state, mempool, and two distinct tree cache formats (JSON and Bincode). Additionally, a new \StatsSchema\ has been introduced to provide metrics-aware counting capabilities, specifically for tracking outstanding proofs and total transaction counts using \SequentialTxId\.
core/lib/storage/src/chain · high confidence
New database function to count unique user addresses
A new database function named \unique\_users\ has been added to the storage layer. This function accepts a time range (start and end timestamps) and returns the count of distinct user addresses found in successful transactions and priority operations within that period. This enables more efficient querying of unique user metrics over specific time windows without requiring application-side aggregation.
_core/lib/storage/migrations/2022-02-23-130237\_unique\accounts · high confidence
New deployment and governance scripts for testnet and local environments
This change introduces a suite of new TypeScript scripts in the contracts/scripts directory to streamline contract deployment, configuration, and governance. Key additions include deploy-erc20 and deploy-testnet-token for managing testnet ERC20 tokens, governance-add-erc20 and server-add-erc20 for registering new tokens with the network's governance and server components, and deploy-testkit for setting up the local testing environment with necessary helper contracts. The update also provides deploy-eip1271 for deploying smart wallet test contracts, deploy-withdrawal-helpers for testing withdrawal logic, and init-faucet-account to prepare testnet faucets. Operational tooling is enhanced with query-contract and read-variable for inspecting on-chain state, revert-reason for debugging transaction failures, and verify-deployed-contract for validating bytecode integrity. Finally, upgrade-testnet and test-upgrade-franklin scripts facilitate the testing and execution of contract upgrades.
contracts/scripts · high confidence
New dev-environment token price and liquidity mock servers
Two new binaries have been added to support local development: \dev-ticker-server\ and \dev-liquidity-token-watcher\. The ticker server simulates CoinMarketCap and CoinGecko API responses by serving randomised token prices (with base values for ETH, wBTC, BAT, etc.) and can operate in a 'sloppy mode' that injects random delays and errors to test client resilience. The liquidity watcher provides a local GraphQL endpoint that returns simulated trading volumes based on configurable whitelist/blacklist regimes and default values. Both servers load token definitions from local JSON files (e.g., \etc/tokens/localhost.json\) and run on actix-web, enabling developers to test frontend and backend integrations without connecting to live external price or liquidity APIs.
_core/bin/zksync\api/src/bin · high confidence
New event notification system for real-time blockchain updates
The API server now includes a new event notification subsystem that allows clients to subscribe to real-time updates for transactions, priority operations, and account states. This system introduces an \EventFetcher\ that polls the database for new committed, verified, and pending blocks, and an \OperationNotifier\ that manages WebSocket subscriptions and broadcasts state changes to connected clients. The implementation includes caching for transaction receipts, block info, and priority operations to reduce database load, and supports subscription limits to prevent resource exhaustion.
_core/bin/zksync\_api/src/api\_server/event\notify · high confidence
New perform\_exodus utility for executing NFT and token exits
A new CLI tool has been added to the infrastructure/exit-tool/perform\_exodus directory, allowing users to execute on-chain exit transactions for accounts with known private keys. The utility reads an input JSON file containing stored block info, account details, and ZK proofs, then interacts with the zkSync contract to perform exodus for both ERC20 tokens and NFTs. It supports configuration via command-line options for the private key, target contract address, Ethereum network, and input file path.
_infrastructure/exit-tool/perform\exodus · high confidence
New prover utilities for proof generation and key management
The prover\_utils crate now provides core infrastructure for generating and managing cryptographic proofs. It introduces aggregated proof generation (aggregated\_proofs.rs) to combine multiple single proofs, and exit proof creation (exit\_proof.rs) for handling account exits in both fungible and NFT scenarios. The crate also centralizes file system operations for reading and caching universal setup keys and verification keys (fs\_utils.rs), implements network utilities to download setup files with retry logic (network\_utils.rs), and defines the API data structures (api.rs) used for prover job requests and responses.
_core/lib/prover\utils/src · high confidence
New storage schema for chain operations and transactions
The storage layer now includes a dedicated \OperationsSchema\ module to manage the persistence of executed transactions, priority operations, and aggregated operations. This change introduces new database tables (\executed\_transactions\, \executed\_priority\_operations\, \aggregate\_operations\) and corresponding Rust record types to store transaction hashes, serial IDs, block indices, and confirmation status. It also adds methods for querying these records by hash or ID, confirming aggregated operations, and handling sequence numbers, effectively centralizing the storage logic for chain operations.
core/lib/storage/src/chain/operations · high confidence
New storage schema for extended transaction operations and API v0.2 data conversion
The storage layer introduces a new \operations\_ext\ module that provides specialized database query methods and data structures for retrieving detailed transaction history, receipts, and batch information. This includes new record types (such as \StorageTxData\ and \StorageTxReceipt\) and conversion logic to map internal storage formats to the API v0.2 transaction types, enabling the API to expose richer transaction details like batch IDs, specific L1/L2 receipt statuses, and aggregated operation data.
_core/lib/storage/src/chain/operations\ext · high confidence
New typed operation types and public data serialization for zkSync operations
The \core/lib/types/src/operations\ module now defines explicit, typed structs for every supported network operation (including Deposit, Transfer, Withdraw, Swap, MintNFT, and WithdrawNFT) alongside a unified \ZkSyncOp\ enum. Each operation type implements serialization and deserialization of its public data (pubdata) committed on Ethereum, supporting both current and legacy chunk formats to ensure data restore compatibility. A dedicated error module provides typed, specific errors for decoding failures across all operation types, replacing generic parsing issues with precise diagnostics for users and developers interacting with the protocol's state.
core/lib/types/src/operations · high confidence
New utility library for conversions, formatting, and serialization
A new \core/lib/utils\ crate has been introduced to centralize common helper functions across the zkSync stack. It provides utilities for converting between \Ratio\<BigUint\>\, \BigDecimal\, and \u64\ (including scaled subsidy amounts), formatting Wei values to token strings (mimicking ethers.js behavior), and parsing environment variables with panic-on-failure semantics. Additionally, it includes custom Serde wrappers for serializing \BigUint\ and byte vectors as prefixed hex strings, a macro for retrying asynchronous operations with delays and timeouts, and a mechanism to notify channels when spawned threads panic.
core/lib/utils · high confidence
New verifier contract generator for Solidity 0.7
The key generator now includes a new module that produces a Solidity verifier contract (VerifierTemplate.sol) compatible with Solidity 0.7. This generated contract embeds verification keys for both aggregated proofs and the legacy 'exodus' single-proof case, using Handlebars templates to render key data into hardcoded constants. The Rust implementation reads verification key files, serializes their components (domain size, inputs, commitments, non-residues, and G2 elements) into hex strings, and writes the final contract source to disk, enabling on-chain verification of Plonk proofs without external storage lookups.
_core/bin/key\_generator/src/verifier\_contract\generator · high confidence
New witness generation implementations for core and NFT operations
The circuit witness module now includes dedicated witness generation logic for a comprehensive set of operations, including deposits, transfers, forced exits, full exits, account closures, off-chain public key changes, swaps, and NFT-specific actions (minting, withdrawing, and full exits). This change introduces the \Witness\ trait and specific implementations (e.g., \DepositWitness\, \MintNFTWitness\, \SwapWitness\) that translate transaction data into the circuit operations and public data required for proof generation, while also adding a playground module for experimental transpilation and testing.
core/lib/circuit/src/witness · high confidence
New zksync-crypto crate for WASM-based transaction signing
A new Rust crate, zksync-crypto, has been introduced to provide cryptographic utilities for signing zkSync transactions, compiled to WebAssembly for use in the zksync.js SDK. This library exposes WASM bindings for generating private keys from seeds, deriving public key hashes, and performing MuSig Schnorr signatures on transaction messages. It includes specific hashing functions for transaction messages and swap orders using the Rescue hash, ensuring that the cryptographic primitives used in the JavaScript layer are consistent with the server-side zksync\_types implementation.
sdk/zksync-crypto · high confidence
REST API v0.1 endpoint implementation and structure
The v0.1 REST API endpoints are now implemented in the \zksync\_api\ service, exposing a stable set of routes under \/api/v0.1\. Users can query network status, retrieve token lists (including those acceptable for fees, with ETH explicitly supported), fetch transaction history (which now includes pending deposits), look up transactions and blocks by hash or ID, and check withdrawal processing times. The implementation uses a dedicated \ApiV01\ struct with caching for receipts and block data, and integrates metrics for monitoring endpoint performance.
_core/bin/zksync\_api/src/api\server/rest/v01 · high confidence
SDK build infrastructure and contract ABIs introduced
The SDK now includes build scripts for compiling the zksync-crypto WebAssembly module (with asm.js fallbacks) and the zksync.js TypeScript sources, alongside a binaryen submodule for the wasm-to-asm conversion. New ABI definitions for core contracts (SyncMain, SyncGov, ZkSyncNFTFactory, Multicall, IERC20, IEIP1271) and NFT-related artifacts are added to the JavaScript SDK, and integration and unit tests for the Rust SDK are introduced to validate wallet operations and cryptographic primitives.
sdk · high confidence
Support for EIP-712 typed data signing and multi-signer transaction batches
The transaction primitives module now includes a full implementation of the EIP-712 standard for hashing and signing typed structured data, enabling users to sign complex data structures via \eth\_signTypedData\. Additionally, transaction batch signing has been updated to support multiple signers within a single batch, generating a structured message that groups transactions by sender address. The signature types have also been extended to support EIP-1271 contract signatures alongside standard Ethereum private key signatures.
core/lib/types/src/tx/primitives · high confidence
Removals
API client v1 module files removed
The v1 REST API client module files (accounts.rs and transactions.rs) have been removed from the codebase, indicating the deprecation or removal of the v1 API client implementation in favor of a newer version or module structure.
_core/lib/api\client/src/rest/v1 · high confidence
Removal of Bellman library metadata and documentation
The Bellman library's supporting documentation and legal files, including the README, MIT license text, copyright notice, and gitignore configuration, have been removed from the project directory. This cleanup eliminates the local copies of these assets, which previously provided usage context and licensing information for the library.
bellman · high confidence
Removal of Groth16 implementation and test infrastructure
The Groth16 zero-knowledge proof module has been removed from the bellman library. This change deletes the core implementation files for key generation, proof creation, and verification, along with the associated test suite and dummy engine used for validation. Users relying on this module for generating or verifying Groth16 proofs will no longer have access to this functionality within the bellman crate.
bellman/src/groth16 · high confidence
Removal of legacy bellman proof system implementation
The \bellman\ crate's core implementation files (\domain.rs\, \lib.rs\, \multicore.rs\, \multiexp.rs\) have been deleted. This removes the previous evaluation domain, circuit synthesis, and multi-exponentiation logic from the library, indicating a structural shift or replacement of the underlying proof system components.
bellman/src · high confidence
Removal of the \`pairing\` crate and its benchmarks
The \pairing\ library, which provided implementations for BLS12-381 and BN256 pairing-friendly elliptic curves, has been removed from the codebase. This change deletes the entire \pairing\ directory, including all source code, documentation, license files, and the comprehensive benchmark suite for both curves. Users relying on this crate for elliptic curve operations will need to migrate to an alternative implementation.
pairing · high confidence
Removal of the sapling-crypto library and its circuit implementations
The \sapling-crypto\ crate, including its Zcash Sapling cryptography implementation, has been removed from the codebase. This deletion eliminates the entire \src/circuit\ module (containing BLAKE2s, boolean, ECC, lookup, and other constraint-system primitives), the Sapling and Sprout circuit definitions, benchmarking examples, and associated license and documentation files. Users relying on this library for zero-knowledge proof generation or verification will no longer have access to these cryptographic primitives.
sapling-crypto · high confidence
Architecture
Introduce centralized ZkSync configuration structure
The configuration module now exposes a unified \ZkSyncConfig\ struct that aggregates settings for all core subsystems, including the API, chain, contracts, database, Ethereum client/sender/watcher, token handler, event listener, gateway watcher, prover, ticker, and forced exit requests. This new structure is populated via a \from\_env\ method, centralizing environment-based configuration loading for the entire system.
core/lib/config/src · high confidence
Behavioural changes
Account model extended to support NFTs and granular state updates
The account type now tracks minted NFTs alongside standard token balances, enabling users to hold and manage non-fungible tokens within their account state. This change introduces a new \AccountUpdate\ enum that explicitly models atomic state changes, including specific operations for minting and removing NFTs, as well as creating, deleting, and updating account balances and public key hashes. Additionally, the account structure now includes a cached circuit account representation to optimize Merkle tree root hash calculations, improving performance for state verification.
core/lib/types/src/account · high confidence
Account tree cache storage format changed to text
The database migration updates the account\_tree\_cache table to store the tree\_cache column as text instead of JSON. This change affects how the account tree cache is persisted in the database, potentially impacting compatibility with existing cached data or requiring application-side adjustments to handle the new text format.
_core/lib/storage/migrations/2020-09-22-140531\_use\_text\_for\_account\_tree\cache · high confidence
Account tree cache storage now uses binary encoding
The storage layer for account Merkle tree caches has been updated to use a new binary (bincode) encoding format instead of the previous JSON format. This change introduces a new database table, \account\_tree\_cache\_new\, for storing the more compact and faster binary caches, while retaining the old \account\_tree\_cache\ table for backward compatibility with existing data and restore tools. The system now prioritizes the new binary format for reads and writes, ensuring improved performance for cache operations.
_core/lib/storage/src/chain/tree\cache · high confidence
Add 'No2FA' value to Ethereum account type enum
The database schema now supports a 'No2FA' value for the Ethereum account type enum. This change allows the system to distinguish accounts that do not use two-factor authentication, ensuring that account type categorization accurately reflects the security configuration of each user's Ethereum account.
_core/lib/storage/migrations/2021-08-12-120540\_no\_2fa\accounts · high confidence
Add average gas price storage to Ethereum parameters
The database schema for Ethereum parameters has been updated to include a new column named average\_gas\_price. This change allows the system to store and retrieve the average gas price value, which is essential for calculating transaction costs and optimizing network interactions.
_core/lib/storage/migrations/2020-10-06-044839\average-gas-price · high confidence
Add block metadata table for fast processing tracking
The database schema now includes a new \block\_metadata\ table to support fast withdrawal functionality. This table tracks the \block\_number\ and a \fast\_processing\ boolean flag for each block, enabling the system to identify and handle blocks eligible for accelerated withdrawal processing.
_core/lib/storage/migrations/2021-02-23-171907\_fast\_withdraw\_aggregated\blocks · high confidence
Add database migration for forced exit requests
A new database migration has been added to create the \forced\_exit\_requests\ table, which stores details about forced exit operations including target identifiers, associated tokens, pricing in wei, validity periods, and fulfillment status. This schema change enables the system to persist and track forced exit requests in the underlying storage layer.
_core/lib/storage/migrations/2021-03-22-134435\_forced\_exit\requests · high confidence
Add gas limit columns to the blocks table
The database schema for the blocks table has been updated to include two new columns: commit\_gas\_limit and verify\_gas\_limit. Both columns are defined as BIGINT and are mandatory (NOT NULL), meaning existing records will need to handle this change during migration, and new blocks must provide values for these fields.
_core/lib/storage/migrations/2020-06-09-084018\_block\_gas\limit · high confidence
Add incomplete blocks table and adjust block metadata constraints
The database schema now includes a new \incomplete\_blocks\ table to store block headers that do not yet have a calculated root hash, containing fields for block number, fee account, operation pointers, size, gas limits, and timestamp. Additionally, the migration removes the existing foreign key constraint on \block\_metadata.block\_number\ to allow entries to be created in metadata before the corresponding full block entry exists in the \blocks\ table.
_core/lib/storage/migrations/2021-12-17-111040\incomplete-blocks · high confidence
Add shared sequence number to executed transactions and priority operations
The database schema now includes a \sequence\_number\ column in both the \executed\_transactions\ and \executed\_priority\_operations\ tables. A shared sequence (\executed\_operations\_seq\_number\) is created to automatically populate this column, ensuring that both types of executed operations are assigned a consistent, monotonically increasing identifier. This change supports sorting and ordering logic that depends on the relative order of these different operation types.
_core/lib/storage/migrations/2022-01-24-155551\_serial\_id\_for\_executed\tx · high confidence
Added creation timestamp to Ethereum operations
The database schema for the \eth\_operations\ table has been updated to include a \created\_at\ column. This new field automatically records the timestamp when an operation is inserted, enabling better tracking of when Ethereum operations were initiated.
_core/lib/storage/migrations/2021-12-14-145016\_eth\_operations\update · high confidence
Added database migration for withdrawn NFT factories
A new database migration introduces the \withdrawn\_nfts\_factories\ table to persist records of withdrawn NFTs. This table stores the \token\_id\ as the primary key and the associated \factory\_address\, enabling the system to track which factories are linked to withdrawn NFTs.
_core/lib/storage/migrations/2021-06-09-130138\_withdrawn\_nfts\factories · high confidence
Added database migrations and SQL queries for storage layer
The storage layer now includes initial Diesel migrations to set up helper functions for automatic timestamp updates, alongside schema changes to support ticker prices, transaction metadata (including Ethereum signature data), block witness storage, and updated primary keys for priority operations. Additionally, new SQL query files have been added to support monitoring and analysis of active provers, prover runs, and transaction throughput (TPS).
(repo-wide) · high confidence
Added nonce column to mint\_nft\_updates table
The database schema for minting NFTs has been updated to include a 'nonce' column in the 'mint\_nft\_updates' table. This new BIGINT column is set to NOT NULL with a default value of 0, allowing the system to track nonces for NFT minting operations.
_core/lib/storage/migrations/2021-08-09-135225\_add\_nonce\_to\_mint\_nft\updates · high confidence
Added placeholder for volatile test configuration directory
A new empty file has been added to the etc/test\_config/volatile directory to ensure the folder is committed to the repository. This allows scripts to populate the directory with test configuration data at runtime, ensuring the path exists without requiring manual directory creation.
_etc/test\config/volatile · low confidence
Adds binding tables and indexes for aggregated block operations
This migration introduces two new tables, \execute\_aggregated\_blocks\_binding\ and \commit\_aggregated\_blocks\_binding\, which map aggregated operations to the specific block numbers they affect. It populates these tables by joining \aggregate\_operations\ with \blocks\ based on block ranges for 'ExecuteBlocks' and 'CommitBlocks' action types, and creates BTREE indexes (\eth\_agg\_op\_binding\_idx\ and \aggregate\_ops\_range\_idx\) to optimize lookups on operation IDs and block ranges.
_core/lib/storage/migrations/2021-02-09-112044\_aggregated\_ops\idx · high confidence
Adds timestamp and block root hash columns to data\_restore\_rollup\_ops
The database schema for the data restore rollup operations table is extended with two new columns: a bigint timestamp and a bytea previous\_block\_root\_hash. This change allows the system to record when a restore operation occurred and which block root hash was associated with it, providing better traceability for data restoration events.
_core/lib/storage/migrations/2021-03-29-105905\data-restore-block-timestamp · high confidence
Block witness data stored as JSON instead of JSONB
The database migration for the block\_witness table now changes the witness column type from JSONB to standard JSON. This means that block witness data will no longer be stored in the binary JSON format, which may affect storage efficiency and indexing capabilities for this specific field.
_core/lib/storage/migrations/2020-09-22-113305\_use\_json\_for\_block\witness · high confidence
Block witness data type changed from JSON to TEXT
The database schema for the block witness has been updated to store witness data as plain text instead of JSON. This change affects how witness information is persisted in the block\_witness table, potentially impacting data validation and parsing logic that previously relied on JSON structures.
_core/lib/storage/migrations/2020-09-22-130104\_use\_text\_for\_block\witness · high confidence
Centralized contract ABI loading for ZkSync and related contracts
The contracts library now loads ABI definitions for ZkSync (versions 0–4), Governance, IERC20, IEIP1271, UpgradeGatekeeper, and ForcedExit from JSON files at runtime instead of using compile-time generated types. This change removes the previous TypeChain/manual type entries and consolidates contract access into a single library that reads ABIs from the specified artifact paths, enabling dynamic contract interaction without rebuilding type bindings for each contract version.
core/lib/contracts · high confidence
Centralized environment configuration for ZKScan and ZKSync services
A new environment configuration file has been introduced to manage connection settings for various deployment targets, including local development, staging, and multiple network environments (Rinkeby, Ropsten, and Mainnet) for both zkscan.io and zksync.dev. This change allows the application to dynamically select the correct API servers, WebSocket addresses, and Ethereum network identifiers based on the current hostname, simplifying the setup for different deployment stages such as beta and breaking changes.
etc/js · high confidence
Comprehensive API type definitions for accounts, transactions, and fees
The API documentation now includes detailed type schemas for core domain objects, providing users with clear specifications for account structures (including full info, balances, and NFTs), transaction types (L1 deposits, L2 transfers, withdrawals, swaps, and NFT operations), fee structures, batch statuses, and network configuration. This addition clarifies the expected data formats and required fields for interacting with the API endpoints related to account management, transaction history, and fee calculations.
infrastructure/api-docs/blueprint/types · high confidence
Corrected transaction count triggers for address and token
The database triggers maintaining the \txs\_count\ table have been rewritten to fix logic errors in how transaction counts are incremented and decremented. The updated \up.sql\ migration for the \fix-triggers\ change replaces the previous trigger functions with corrected logic that properly handles \INSERT\ and \DELETE\ operations on the \tx\_filters\ table, ensuring accurate counting for both specific tokens and the aggregate 'no token' count (represented by token -1). This change resolves issues where counts were incorrectly updated during transaction removals or additions.
_core/lib/storage/migrations/2023-01-18-164812\_txs\count · high confidence
Database index optimization for query performance
This migration updates database indexes to improve query performance. It replaces the single-column index on \tokens.symbol\ with a functional index on \lower(symbol)\ to support case-insensitive lookups. It adds a partial index on \executed\_transactions\ for failed transactions, introduces composite indexes on \prover\_job\_queue\ for job type/status queries, and adds targeted indexes on \aggregate\_operations\ to optimize filtering by action type and block range based on confirmation status.
_core/lib/storage/migrations/2022-07-05-090548\new-indexes · high confidence
Database indexes added for NFTs, tokens, and priority operations
This migration introduces new database indexes to improve query performance for specific data sets. It adds indexes on the \tx\_hash\ column of \executed\_priority\_operations\, the \creator\_account\_id\ and \block\_number\ columns of \mint\_nft\_updates\, the \creator\_account\_id\ column of the \nft\ table, the \action\_type\ column of \aggregate\_operations\, and the \kind\ and \symbol\ columns of the \tokens\ table.
_core/lib/storage/migrations/2022-03-10-071338\_new\indexes · high confidence
Database indexes added for account update tables
A new migration adds database indexes to the \account\_pubkey\_updates\ and \account\_balance\_updates\ tables on the \account\_id\ column. This change is intended to improve query performance for operations filtering or joining on these specific account identifiers.
_core/lib/storage/migrations/2021-11-19-064853\_create\indexes · high confidence
Database migration adds batch\_id column to mempool and executed transaction tables
A new database migration introduces a batch\_id column to the mempool\_txs and executed\_transactions tables. The mempool\_txs table receives a non-nullable bigserial batch\_id, while executed\_transactions receives a nullable BIGINT batch\_id. This change supports grouping transactions into batches, with the down migration removing these columns to reverse the change.
_core/lib/storage/migrations/2020-09-02-103253\_mempool\_txs\batches · high confidence
Database migration adds sequence number and priority columns to transaction filters
The database schema for transaction filters has been updated to include a \sequence\_number\ (BIGINT) and an \is\_priority\ (boolean) column. To support these new fields, existing indexes on \tx\_filters\, \executed\_transactions\, and \executed\_priority\_operations\ have been dropped and replaced with new indexes optimized for sequence-based lookups and priority filtering.
_core/lib/storage/migrations/2022-07-13-134305\_add\_seq\_no\_to\_tx\filters · high confidence
Database migration to replace boolean NFT flag with typed token kind
This change introduces a database migration that modifies the tokens table schema. It replaces the previous boolean \is\_nft\ column with a new \kind\ column of type \token\_kind\ (an enum allowing 'ERC20', 'NFT', or 'None'). Existing records are migrated so that tokens previously marked as NFTs are correctly assigned the 'NFT' kind, while others default to 'ERC20'. This allows for more explicit and extensible token classification in the storage layer.
_core/lib/storage/migrations/2021-08-19-113122\_token\kind · high confidence
Database schema update for contracts v4 migration
This migration updates the database schema to support the contracts v4 version. It adds timestamp and commitment fields to the blocks table, and timestamp and previous\_root\_hash fields to the pending\_block table. New tables are introduced for aggregated operations (aggregate\_operations, eth\_aggregated\_ops\_binding, eth\_unprocessed\_aggregated\_ops), prover job queues (prover\_job\_queue), aggregated proofs (aggregated\_proofs), and Ethereum account types (eth\_account\_types). The data\_restore\_events\_state table gains a contract\_version column. The txs\_batches\_signatures table is modified to include a primary key id column. Finally, the eth\_parameters table columns are renamed from commit\_ops, verify\_ops, and withdraw\_ops to last\_committed\_block, last\_verified\_block, and last\_executed\_block respectively, with an initial data update applied.
_core/lib/storage/migrations/2021-02-02-071220\contracts-v4 · high confidence
Database schema update for priority operations and batch hashes
The database schema has been updated to support tracking Ethereum block indices and transaction hashes for executed priority operations, and to store batch hashes. Specifically, the \executed\_priority\_operations\ table now includes \eth\_block\_index\ and \tx\_hash\ columns, and a new \txs\_batches\_hashes\ table has been created to map batch IDs to their corresponding hashes.
_core/lib/storage/migrations/2021-04-12-144535\_priority\_ops\_and\_batches\hash · high confidence
Database schema update for tracking complete withdrawals
The storage layer now includes two new tables, \pending\_withdrawals\ and \complete\_withdrawals\_transactions\, to support the tracking of withdrawal states. The \pending\_withdrawals\ table stores withdrawal hashes, while the \complete\_withdrawals\_transactions\ table records transaction hashes along with their corresponding queue start and end indices, enabling the system to map completed withdrawals to their specific transaction details.
_core/lib/storage/migrations/2020-09-21-135622\_complete\withdrawals · high confidence
Database schema update to support NFT factory address configuration
The server configuration database table now includes a new text column named nft\_factory\_addr, allowing the system to store the address for an NFT factory. This change is implemented via a new database migration that adds the column on upgrade and removes it on rollback, ensuring the schema can persist this specific configuration value.
_core/lib/storage/migrations/2021-06-08-134938\_add\_nft\_factory\_address\_to\config · high confidence
Database schema updates to support NFT minting
The database schema has been updated to support NFT functionality. New tables \mint\_nft\_updates\ and \nft\ have been added to track minting events and NFT details respectively. The existing \tokens\ table now includes an \is\_nft\ boolean column to distinguish NFTs from other tokens. Additionally, a foreign key constraint on \account\_balance\_updates\ has been removed to allow balance updates before token insertion.
_core/lib/storage/migrations/2021-04-01-064940\_mint\nft · high confidence
Deprecation notice and new exit tool for ZKSync Lite withdrawals
The exit tree generator tool is now documented with a deprecation notice for ZKSync Lite, directing users to lite.zksync.io for standard withdrawals. The tool provides a new workflow for independent proof generation and verification: it can restore the original ZKSync Merkle tree from CSV snapshots or a PostgreSQL database, create new Keccak-256 Merkle tree leaves from account/balance data, and generate L1-compatible Merkle proofs for claiming funds via the withdrawal contract. It also includes a token ID restorer that syncs with Ethereum governance events to map token addresses to IDs.
_core/bin/exit\_tree\generator · high confidence
Enforce code formatting via new Git hooks
New pre-commit and pre-push Git hooks have been added to automatically enforce code formatting standards. The pre-commit hook runs 'cargo fmt --check' to ensure Rust code is formatted before it is committed, while the pre-push hook runs 'zk fmt --check' to verify formatting before pushing changes. If formatting rules are violated, the respective hook will block the action and display an error message instructing the user to run the appropriate formatting command.
.githooks · high confidence
Enforce unique symbols and addresses for tokens
The database schema now enforces that token symbols and addresses are unique, preventing duplicate entries for the same symbol or address in the tokens table.
_core/lib/storage/migrations/2021-03-09-094437\permissionless-token-listing · high confidence
Fee ticker now supports CoinGecko and CoinMarketCap price sources with address-based resolution
The fee ticker API has been refactored to support external price providers via a generic \TokenPriceAPI\ trait, introducing implementations for CoinGecko and CoinMarketCap. CoinGecko integration uses token addresses to resolve IDs, fetching 2-day market charts and calculating prices by averaging the last 6 hours of data (or using the max price for ETH), while CoinMarketCap resolves tokens by symbol. The system now automatically updates stored historical ticker prices in the database every 10 minutes, handling unlisted tokens by setting their price to zero rather than failing.
_core/bin/zksync\_api/src/fee\_ticker/ticker\api · high confidence
Fee token validation now relies on database-backed caching and Uniswap market data
The fee ticker validator has been refactored to determine token eligibility for fees using a new \TokenCacheWrapper\ that stores token metadata and market volumes in the database rather than relying on direct web lookups for every check. Market volume data is now fetched from the Uniswap protocol via GraphQL and persisted to the database, allowing the validator to assess token liquidity against configurable thresholds using up-to-date, cached figures instead of making synchronous external requests for each validation.
_core/bin/zksync\_api/src/fee\ticker/validator · high confidence
Introduce database-backed account storage with multi-state retrieval and 2FA type support
The storage layer for accounts has been refactored to persist account data in the database, introducing new tables for account types (Owned, CREATE2, No2FA) and public key hashes. Users can now retrieve both committed and verified account states simultaneously via the new \account\_state\_by\_id\ method, and the system supports storing and querying 2FA-related account types, including the ability to toggle 2FA by managing public key hashes in the \no\_2fa\_pub\_key\_hash\ table.
core/lib/storage/src/chain/account · high confidence
Introduce new state keeper with pending block and root hash calculator architecture
The state keeper logic has been restructured into a new modular architecture that separates transaction processing, pending block management, and root hash calculation. The state keeper now initializes from a restored database state and manages a \PendingBlock\ to accumulate transactions before sealing, while a dedicated \RootHashCalculator\ runs as an actor to compute root hashes for incomplete blocks in parallel. This change improves recovery from server restarts by persisting and restoring pending blocks and root hash jobs, and introduces throttling and metrics for block proposal operations.
_core/bin/zksync\_core/src/state\keeper · high confidence
Introduce strict, structured event types for account, block, and transaction state changes
The event system in \core/lib/types/src/event\ has been refactored to use strongly-typed structs (\AccountEvent\, \BlockEvent\, \TransactionEvent\) instead of loose or generic representations. This change ensures that event data—such as account balance updates, block commitment status, and transaction execution results—is serialized with precise fields (e.g., \new\_balance\, \commit\_tx\_hash\, \fail\_reason\) and consistent status enums (\Committed\, \Finalized\, \Rejected\). Users interacting with these events will now receive structured, predictable data that accurately reflects the lifecycle of operations on the zkSync network, including support for queued, committed, and rejected transaction states.
core/lib/types/src/event · high confidence
Introduce structured crypto primitives and serialization modules
The \zksync\_crypto\ library now exposes dedicated modules for conversion, error handling, and serialization, replacing ad-hoc implementations. Users benefit from typed error handling via \ConversionError\ and \PackingError\, standardized field-element conversion traits (\FeConvert\) for hex and byte roundtrips, and robust \serde\ support for \Fr\ types and proof structures (\SingleProof\, \AggregatedProof\). This refactoring also centralizes cryptographic parameters (e.g., tree depths, token limits, NFT settings) in \params.rs\ and provides utilities for bit-level operations and Ethereum-compatible serialization in \primitives.rs\, ensuring consistent encoding for on-chain interactions.
core/lib/crypto/src · high confidence
Introduces action\_type enum and index for operations table
The database schema now restricts the action\_type column in the operations table to a specific enum ('COMMIT', 'VERIFY') instead of plain text, and adds an index on this column to improve query performance.
_core/lib/storage/migrations/2021-01-22-134338\_action\_type\enum · high confidence
Introduces binary tree cache storage alongside existing cache
A new database migration adds a binary column (tree\_cache\_binary) to the account\_tree\_cache table and makes the original tree\_cache column optional. This change enables the system to store tree cache data in a binary format, likely for improved performance or compatibility, while maintaining backward compatibility by keeping the original field available.
_core/lib/storage/migrations/2022-03-28-101714\tree-cache-bincode · high confidence
Introduces throttling for the root hash calculator job queue
The state keeper now uses a dedicated job queue for block root hash calculations that monitors its depth and automatically throttles block production when the queue size reaches two or more pending jobs. This prevents the state keeper from outpacing the root hash calculator, ensuring blocks are sealed at a pace that matches the time required to calculate their root hashes. The queue also exposes metrics for monitoring job queue size and tree memory usage.
_core/bin/zksync\_core/src/state\_keeper/root\_hash\calculator · high confidence
Introduction of IncompleteBlock type for sealed block data
The block type definitions in \core/lib/types/src/block\ have been updated to include a new \IncompleteBlock\ struct. This structure represents a sealed block that contains executed transaction data and metadata (such as gas limits and timestamps) but lacks the final root hash required for commitment. The module also exposes \PendingBlock\ for intermediate states and \ExecutedOperations\ to unify L1 priority operations and L2 transactions, providing a clearer lifecycle for block construction before finalization.
core/lib/types/src/block · high confidence
Introduction of an aggregated block committer
The committer component now includes a new \aggregated\_committer\ module that introduces logic for batching and processing blocks in aggregate operations. This change adds specific handling for committing, creating proofs, and executing blocks based on gas limits, deadlines, and fast-processing flags, effectively shifting how block finalization and proof generation are orchestrated within the core node.
_core/bin/zksync\core/src/committer · high confidence
Introduction of strict, named types for core identifiers
The \core/lib/basic\_types\ crate now defines strict, newtype wrappers for fundamental identifiers such as \TokenId\, \AccountId\, \Nonce\, \PriorityOpId\, and \SequentialTxId\. By replacing raw numeric types (like \u32\ or \u64\) with these distinct types, the system prevents accidental mixing of different identifier contexts (e.g., using an account ID where a token ID is expected) while maintaining seamless interoperability with the underlying numeric values through deref coercion and standard trait implementations.
_core/lib/basic\types · high confidence
Introduction of the new standalone ETH sender with aggregated operation support
The \zksync\_eth\_sender\ module has been replaced with a new implementation that supports AggregatedOperations, ensuring proper state restoration after restarts and handling Ethereum transaction confirmations more robustly. This change introduces a new database interface for managing unconfirmed and unprocessed operations, a transaction queue for ordered processing, and gas adjustment logic, effectively decoupling the Ethereum sender from the main node logic to operate as a standalone service.
_core/bin/zksync\_eth\sender/src · high confidence
Introduction of transaction filter storage with address-based indexing
A new database table named \tx\_filters\ has been added to store transaction filtering data, keyed by a composite primary index of address, token, and transaction hash. To optimize lookups, a dedicated hash index on the \address\ column (\tx\_filters\_address\_idx\) is created alongside the table structure, enabling efficient retrieval of filters associated with specific addresses.
_core/lib/storage/migrations/2021-10-14-093424\tx-filter-table · high confidence
L1 event listener now supports ZkSync contract versions V4 through V6
The L1 event listener library has been expanded to parse and process rollup block operations from ZkSync smart contract versions V4, V5, and V6. Previously limited to legacy formats (V0–V3), the listener now uses version-specific decoders to correctly interpret commitment transaction data, enabling accurate recovery of block operations and merkle tree roots for newer contract deployments.
_core/lib/l1\_event\listener · high confidence
Linting configuration migrated to JavaScript files
The linting configuration files in the etc/lint-config directory have been converted from their previous format to JavaScript modules (.js). This change introduces specific linting rules for JavaScript (js.js), Markdown (md.js), Solidity (sol.js), and TypeScript (ts.js), ensuring consistent code style enforcement across these file types within the project.
etc/lint-config · high confidence
Logging subsystem migrated to tracing with Sentry integration and configurable output formats
The core logging library has been replaced with a new implementation based on the \tracing\ ecosystem, providing richer context in log output by automatically including filename, line, and column information for warning and error events. Users can now control the log output format via the \MISC\_LOG\_FORMAT\ environment variable, choosing between plain text and JSON (which uses RFC3339 timestamps). Additionally, the library now integrates with Sentry for error tracking; if the \MISC\_SENTRY\_URL\ environment variable is set, it initializes Sentry with custom fingerprinting logic to group fatal panics and errors by time intervals, reducing noise in error reports.
core/lib/vlog · high confidence
Major L2 transaction type overhaul with new Swap, MintNFT, and WithdrawNFT operations
The \core/lib/types/src/tx\ module has been completely rewritten to support a new generation of L2 transactions. This change introduces new transaction types for decentralized exchange (\Swap\ with \Order\ structures), NFT minting (\MintNFT\), and NFT withdrawals (\WithdrawNFT\), while also updating the core \Transfer\, \Withdraw\, and \ChangePubKey\ types. The \ChangePubKey\ operation now supports multiple authentication methods including ECDSA, CREATE2, and EIP712 signatures. All transaction types now use a versioned serialization format (\TxVersion::V1\ vs \Legacy\) to ensure backward compatibility with older protocol versions. The module also introduces a centralized error handling system (\TransactionError\) that aggregates errors from all specific transaction types.
core/lib/types/src/tx · high confidence
Mempool persistence migrated to database storage
The mempool module now persists pending transactions and batches to the database instead of relying solely on in-memory state. This ensures that transactions awaiting execution are preserved across server restarts, preventing data loss during unexpected reboots. The implementation introduces new database schemas for mempool transactions, batches, and reverted blocks, along with logic to load, group, and retrieve these persisted items.
core/lib/storage/src/chain/mempool · high confidence
Mempool transaction selection and block proposal logic restructured
The mempool library has been refactored to separate transaction handling from block proposal into distinct handlers (\MempoolTransactionsHandler\ and \MempoolBlocksHandler\). Transaction selection now relies on a dedicated \MempoolTransactionsQueue\ that manages ready and pending L2 transactions (sorted by nonce and \valid\_from\ time) alongside L1 priority operations. Block proposal logic has been updated to calculate priority based only on confirmed operations and to respect the actual remaining chunk capacity when selecting transactions for a new block, ensuring that blocks are filled efficiently without exceeding size limits.
core/lib/mempool · high confidence
Merkle tree cache column type changed from JSONB to JSON
The database migration for the account tree cache now stores the tree\_cache column as JSON instead of JSONB. This change affects how large JSON blobs are persisted in the merkle tree cache, potentially impacting storage efficiency and query performance for cached account tree data.
_core/lib/storage/migrations/2020-09-22-065910\_use\_json\_for\_merkle\tree · high confidence
Migrate database connection pooling to sqlx and deadpool with retry logic
The storage layer now uses sqlx and the deadpool library for managing database connections, replacing the previous implementation. This change introduces a connection pool with a configurable size (via the DATABASE\_POOL\_SIZE environment variable) and a 20-second wait timeout. To improve resilience during database outages, the system now implements a retry mechanism that attempts to acquire a connection up to three times with a one-second back-off interval between failures. Additionally, a new environment variable (DATABASE\_REPLICA\_URL) supports read-only replica connections, and metrics are now recorded for connection acquisition latency.
core/lib/storage/src/connection · high confidence
New Ethereum signature verification and API error handling
The API server now includes a dedicated \eth\_checker\ module to validate Ethereum-based signatures, specifically supporting EIP-1271 smart contract signatures and on-chain \ChangePubKey\ authorization checks against the Ethereum gateway. This capability is integrated into the \signature\_checker\ module, which now handles verification for single transactions, transaction batches, orders, and 2FA toggle requests. Additionally, the API introduces specific error handling for 2FA operations via a new \Toggle2FAError\ type, preventing invalid requests such as enabling 2FA with a set \PubKeyHash\.
_core/bin/zksync\api/src · high confidence
New Ethereum watcher implementation for priority operations and token events
The \eth\_watch\ module in \zksync\_core\ has been restructured into a new, independent application that polls the Ethereum node for contract events such as priority operations (deposits, full exits), new token registrations, and NFT factory registrations. This change introduces a robust state management system (\ETHState\) that tracks the last processed Ethereum block, maintains unconfirmed and confirmed priority operation queues, and handles gaps in event logs by recursively splitting block ranges to avoid API rate limits. The watcher now supports a backoff mode to handle Infura request limits and includes logic to expire outdated priority operations based on a configurable expiration period.
_core/bin/zksync\_core/src/eth\watch · high confidence
New JSON-RPC server implementation with IP-based subsidy support
The RPC server module has been restructured into a new implementation that introduces an \IpInsertMiddleWare\ to extract the client's IP address from the \CF-Connecting-IP\ header and inject it into specific JSON-RPC calls (such as \tx\_submit\, \submit\_txs\_batch\, and fee queries). This enables IP-based logic, such as subsidy calculations, to function correctly. The update also defines a comprehensive set of RPC error codes and response types, and exposes new API methods including \toggle\_2fa\, \get\_nft\, \get\_nft\_owner\, and \account\_info\ (which now includes account type and depositing balances).
_core/bin/zksync\_api/src/api\_server/rpc\server · high confidence
New block storage schema and conversion logic
The storage layer for chain blocks has been restructured with new Rust modules (\mod.rs\, \records.rs\, \conversion.rs\) that define database record structs (e.g., \StorageBlock\, \StoragePendingBlock\) and conversion implementations. This change introduces support for storing and retrieving \IncompleteBlock\ and \PendingBlock\ states, adds \batch\_id\ fields to transaction records, and implements logic to handle account type updates (such as CREATE2 vs Owned) during transaction execution. It also standardizes the serialization of transaction data and priority operations for database storage.
core/lib/storage/src/chain/block · high confidence
New database table for account tree cache
The storage layer now includes a dedicated \account\_tree\_cache\_new\ table to store account tree cache data. This table maps blocks to their corresponding binary tree cache data, enabling more efficient retrieval and management of account tree information within the system.
_core/lib/storage/migrations/2023-03-23-065914\new-account-tree-cache · high confidence
New database table for batch transaction signatures
The storage layer now includes a new \txs\_batches\_signatures\ table to persist Ethereum signatures associated with transaction batches. This schema change introduces a \batch\_id\ as the primary key and stores the corresponding \eth\_signature\ as JSONB data, enabling the system to track and retrieve signatures for batched transactions.
_core/lib/storage/migrations/2020-10-28-172923\_batch\_signatures\table · high confidence
New database table for priority operation data restoration
A new database table named \data\_restore\_priority\_op\_data\ has been introduced to support the restoration of priority operation data. This table stores operations as JSONB payloads indexed by a serial ID, enabling the system to fetch and restore Ethereum logs associated with priority operations.
_core/lib/storage/migrations/2021-11-17-141453\_data\_restore\_priority\_op\data · high confidence
New gas price adjustment logic for Ethereum transactions
The Ethereum sender now uses a dedicated GasAdjuster component to dynamically manage gas prices. This component scales up gas prices by 15% for stuck transactions to ensure timely mining, while capping all suggested prices against a configurable maximum limit. It maintains a rolling average of recent gas prices to inform these suggestions and periodically updates the database with the current average gas price and limit values based on configurable intervals.
_core/bin/zksync\_eth\_sender/src/gas\adjuster · high confidence
New modular configuration structures for core components
The core configuration system has been restructured into a modular layout under \core/lib/config/src/configs\, introducing dedicated configuration structs for API, chain, contracts, database, Ethereum client/sender/watch, event listener, forced exit requests, gateway watcher, prover, fee ticker, and token handler. Each module defines its own settings (e.g., API ports, contract addresses, database pool size, Ethereum network parameters, prover intervals) and loads them from environment variables using a unified \envy\_load!\ macro, with corresponding unit tests validating the parsing of these new structures.
core/lib/config/src/configs · high confidence
New modular server entry point with component-based startup
The core server binary now uses a new main.rs entry point that replaces the previous startup logic with a modular, component-based architecture. Users can now control which services run (such as REST API, Web3 API, RPC, EthSender, WitnessGenerator, and Prometheus exporters) via a command-line argument, allowing for flexible deployment configurations and isolated testing of specific server components.
core/bin/server · high confidence
New state restoration logic for the account tree
The state keeper now includes a dedicated module for restoring the account tree state from the database upon startup. This new \RestoredTree\ component attempts to load a cached tree state to speed up initialization, falling back to a full recalculation from committed state if no cache is available. It validates the restored tree's root hash against the database and includes logic to detect and report hash mismatches by scanning block diffs, ensuring the node starts with a consistent state.
_core/bin/zksync\_core/src/state\_keeper/state\restore · high confidence
New transaction handler architecture for state operations
The state keeper now uses a modular handler system where each transaction type (ChangePubKey, Deposit, Transfer, Withdraw, ForcedExit, FullExit, Swap, MintNFT, WithdrawNFT, and Close) is processed by its own dedicated module implementing the TxHandler trait. This refactoring introduces strict invariant checks for every operation, including nonce validation, signature verification, balance sufficiency, and account existence, ensuring that state changes are applied only when all preconditions are met. Fees are now explicitly validated to be payable only in processable tokens, and new NFT-related operations (MintNFT, WithdrawNFT) are fully integrated with their own error types and state update logic.
core/lib/state/src/handler · high confidence
Prettier configuration files migrated to JavaScript format
The Prettier configuration files in the \etc/prettier-config\ directory have been converted from their previous format to JavaScript modules (\.js\). This change introduces specific formatting rules for JavaScript, TypeScript, Markdown, Solidity, and Vue files, such as setting a 120-character print width and defining tab widths (2 spaces for Markdown, 4 spaces for others). Users relying on these configs will now have their code formatted according to these explicit JavaScript-based settings.
etc/prettier-config · high confidence
Priority operations now use typed errors and support legacy data restoration
The \priority\_ops\ module has been restructured to use a dedicated \LogParseError\ enum for parsing failures (such as pubdata length mismatches or unsupported operation types) instead of generic errors, improving error handling clarity. Additionally, the module now supports restoring data with different chunk numbers and handles legacy priority operations, including a migration for \PriorityOp::eth\_hash\ from \Vec\<u8\>\ to \H256\ with backward-compatible serialization that pads shorter vectors and rejects oversized ones.
_core/lib/types/src/priority\ops · high confidence
Prover server now requires authentication and supports optional Prometheus metrics
The prover binary now enforces authorization for all API interactions by generating and attaching JSON Web Tokens (JWTs) to requests, ensuring that only provers with a valid shared secret can fetch jobs or publish proofs. Additionally, the prover can now optionally expose Prometheus metrics via a dedicated exporter, controlled by a configuration flag, allowing operators to monitor prover performance and health. These changes apply to the prover client implementation and its entry points, enhancing security and observability for the proof generation service.
core/bin/prover · high confidence
REST API server initialization and network status monitoring
The REST API server now initializes with a dedicated background thread that periodically updates shared network status (including committed/verified block numbers, transaction counts, and mempool size) by querying the main database replica and the core server's health endpoint. This ensures monitoring tools receive timely status updates rather than null defaults. The server also exposes API v0.1 and v0.2 scopes, including forced exit request handling and transaction submission, with CORS enabled and specific timeouts configured for client requests and keep-alive.
_core/bin/zksync\_api/src/api\server/rest · high confidence
Rebuild API documentation tool with Commander CLI and Handlebars templating
The API documentation tool in infrastructure/api-docs has been restructured to use the Commander library for its CLI interface, replacing the previous setup. It now employs Handlebars templating to generate API Blueprints (.apib) from modular source files, supporting separate compilation for documentation and testing purposes. The tool includes commands to compile these blueprints, generate HTML documentation via Aglio, and run API tests using Dredd, with configuration managed through dredd.yml and TypeScript compilation settings.
infrastructure/api-docs · high confidence
Refactors data restore schema by separating block operations into a dedicated table
The data restore schema is updated to improve data integrity and structure. The previous single table, \data\_restore\_rollup\_ops\, is renamed to \data\_restore\_rollup\_blocks\ and restructured to use \block\_num\ as the primary key, removing the previous \operation\ and \id\ columns. A new table, \data\_restore\_rollup\_block\_ops\, is introduced to store individual operations as JSONB records, linked to blocks via a foreign key on \block\_num\ with cascade deletion. This change ensures that block metadata and its associated operations are stored in separate, normalized relations.
_core/lib/storage/migrations/2021-03-30-104602\_data\_restore\_schema\refactoring · high confidence
Repository restructure and deprecation notice for ZKSync Lite
The repository has been reorganized with a new top-level structure, including a root README that announces the deprecation of ZKSync Lite and provides instructions for withdrawing funds via the Exit Tree Generator. The project now uses dual licensing (Apache 2.0 and MIT) with dedicated license files, and includes a SECURITY.md for the bug bounty program. Development workflows are standardized with new .dockerignore, .gitignore, and .eslintignore files, alongside docker-compose configurations for local infrastructure (Postgres, Geth, dev-ticker). The Rust toolchain is pinned to version 1.91, and the binaryen library is added as a Git submodule.
(repo-wide) · high confidence
Standardized contracts directory configuration and tooling
The contracts directory now includes standardized configuration files for development and deployment, including a Hardhat setup (hardhat.config.ts) that defines network-specific settings for mainnet, testnets (Goerli, Sepolia, Rinkeby, Ropsten), and local environments, along with TypeScript (tsconfig.json, tslint.json) and linting configurations (.eslintrc.js, .prettierrc.js, .solhint.json) to enforce code quality. A .gitignore file is added to exclude build artifacts, cache, and generated types, and a README.md provides an overview of the smart contracts and links to the changelog.
contracts · high confidence
Switch to hash indices for account address lookups
The database migration replaces existing B-tree indices on the \executed\_transactions\ and \account\_creates\ tables with hash indices for columns related to account addresses (such as \from\_account\, \to\_account\, \primary\_account\_address\, and \address\). This change optimizes query performance for equality checks on these fields, which are commonly used in sequence scans, by leveraging the hash index access method instead of the default B-tree structure.
_core/lib/storage/migrations/2021-01-05-131310\_hash\indices · high confidence
Switch transaction table indices to hash-based lookups
The database migration for executed transactions, executed priority operations, and mempool transactions replaces existing B-tree indices with hash-based indices for key lookup columns (tx\_hash, from\_account, to\_account, eth\_hash). This change optimizes query performance for equality checks on these fields by using hash indexing instead of the previous B-tree structure.
_core/lib/storage/migrations/2021-06-04-114545\_hash\_indices\_for\_txs\tables · high confidence
Token storage schema now supports NFTs and market volume metrics
The token storage layer has been updated to distinguish between ERC20 and NFT token types via a new \TokenKind\ enum in the database schema. This change enables the system to store and retrieve NFT-specific metadata (such as serial IDs, creator addresses, and factory information) alongside standard ERC20 token data. Additionally, the storage now persists and serves market volume and ticker price metrics for tokens, allowing users to query historical price and volume data through the API.
core/lib/storage/src/tokens · high confidence
Track reverted priority operation order in mempool transactions
The storage layer now includes a new column, \next\_priority\_op\_serial\_id\, in the \mempool\_txs\ table to track the order of priority operations. This change ensures that reverted priority operations are handled correctly and prevents the mempool from filling blocks with these operations out of order, improving the consistency and reliability of transaction processing.
_core/lib/storage/migrations/2021-06-29-223011\_reverted\_ops\order · high confidence
Transaction count migration rewritten in Rust
The transaction count migration tool has been rewritten from SQL to Rust, replacing the previous implementation with a new binary that iterates through account ranges and updates transaction counts using the ZkSync storage processor. This change improves the reliability and performance of the migration process by leveraging Rust's async capabilities and type safety.
_core/bin/tx\_count\migration · high confidence
Fixes
Fix mempool revert block handling via new migration
This fix introduces a database migration that corrects how reverted blocks are processed. It adds a new \mempool\_reverted\_txs\_meta\ table to store metadata for reverted transactions (including block number, index, type, operation details, and account addresses) and a \reverted\_block\ table to track unprocessed priority operations. Additionally, it adds a \reverted\ boolean column to the existing \mempool\_txs\ table to flag reverted transactions, ensuring the storage layer accurately reflects the state of reverted transactions and blocks.
_core/lib/storage/migrations/2022-01-21-100223\_mempool\_reverted\_tx\metadata · high confidence
Test coverage
Added TypeScript integration test suites for ZkSync core operations and API; Added TypeScript type definitions for API integration tests; Added benchmark suite for ZKSync transaction types; Added benchmark suite for ZkSyncState operations; Added benchmarking suite for transaction fee endpoints; Added benchmarks for CircuitAccount and primitive bit operations; Added benchmarks for Merkle tree operations and Rescue hasher; Added circuit benchmarks for core transaction types; Added circuit witness tests for core operations; Added comprehensive storage chain tests; Added comprehensive test suite for zkSync contracts; Added database integration tests for storage subsystem; Added development and test utility contracts for zkSync; Added flamegraph target binary for performance analysis; Added integration tests for block root hash verification; Added load test account lifecycle and command execution logic; Added load test command definitions and transaction type logic; Added signature verification benchmarks; Added test coverage for the load test report collector components; Added test infrastructure and unit tests for the Ethereum sender; Added test suite for data restore functionality; Added tests for account transaction history retrieval; Added tests for state tree restoration logic; Added tests for the witness generator prover server; Added unit tests for Block structure and operation public data encoding; Added unit tests for state management and transaction validation; Added unit tests for state operations; Establishes unified benchmark entry point for type libraries; Expanded test coverage for ZKsync wallet operations and features; Extracted ZkSyncAccount test helper into dedicated test\_account crate; Initial loadtest harness for stress-testing zkSync; New integration test suites for ZkSync core functionality; New testkit binary tools for block, gas, migration, and revert testing; New testkit infrastructure for integration testing; New unit tests for state keeper operations and block management; Removal of MiMC circuit test file.
Dependencies
Initial dependency lock and manifest configuration for core Rust services and contracts
This change introduces the foundational dependency management for the project by adding a new \Cargo.lock\ file and defining \Cargo.toml\ manifests for the core Rust workspace. The workspace organizes the codebase into binaries (such as \server\, \prover\, \data\_restore\, and \key\_generator\) and libraries (including \zksync\_api\, \zksync\_core\, \zksync\_storage\, and \zksync\_crypto\). It also establishes the \contracts\ directory's \package.json\ for Solidity development using Hardhat and OpenZeppelin. Key dependencies pinned in this configuration include \actix-web\ for the API server, \tokio\ for async runtime, \web3\ and \ethabi\ for Ethereum interaction, and \franklin-crypto\ for cryptographic operations.
(dependencies) · high confidence
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
How this codebase got here
Score
- CAI 38 → 39 (+0.9)
- Rubric changed (rubric-2026.09.11 → rubric-2026.09.18) — scores are not directly comparable.
Lenses
- Code Health 80 → 80 (-0.2)
- Architecture 65 → 70 (+5.5)
- Maturity 57 → 57 (-0.0)
- Readiness 49 → 44 (-4.2)
- Security 17 → 20 (+3.3)
- Domain Modelling 82 → 78 (-3.3)
- Performance 71 (new)
Resolved (225)
- Critical CVE: [CVE redacted] (yarn.lock)
- Critical CVE: [CVE redacted] (package-lock.json)
- Critical CVE: [CVE redacted] (yarn.lock)
- Critical CVE: [GHSA redacted] (infrastructure/exit-tool/perform_exodus/yarn.lock)
- Critical CVE: [GHSA redacted] (package-lock.json)
- Critical CVE: [GHSA redacted] (yarn.lock)
- Critical vulnerability: [GHSA redacted] (infrastructure/exit-tool/perform_exodus/yarn.lock)
- Dependency hygiene PARTLY measured — npm pinning read, dependency currency not (no pnpm-resolved versions to grade)
- Documentation: no installation or build instructions (docs/launch.md)
- Documentation: written for insiders (README.md)
- High CVE: [CVE redacted] (package-lock.json)
- High CVE: [CVE redacted] (package-lock.json)
- High CVE: [CVE redacted] (yarn.lock)
- High CVE: [CVE redacted] (yarn.lock)
- High CVE: [CVE redacted] (yarn.lock)
- High CVE: [CVE redacted] (package-lock.json)
- High CVE: [CVE redacted] (yarn.lock)
- High CVE: [CVE redacted] (package-lock.json)
- High CVE: [CVE redacted] (yarn.lock)
- High CVE: [CVE redacted] (yarn.lock)
- …and 205 more
New (43)
- Ambiguous parameter naming and overlapping intent. account_info takes a generic account_id_or_address string and a state_type to filter, while account_full_info takes the same generic identifier but presumably returns all states. The naming convention account_info vs account_full_info is inconsistent with other methods like block_by_position vs block_transactions. Furthermore, account_id_or_address is a poor API design choice compared to using a dedicated enum or distinct methods for ID vs Address lookups.
- Critical vulnerability: [GHSA redacted] (infrastructure/exit-tool/perform_exodus/yarn.lock)
- End-of-life runtime: Rust 1.91
- High CVE: [GHSA redacted] (package-lock.json)
- High CVE: [GHSA redacted] (package-lock.json)
- High CVE: [GHSA redacted] (package-lock.json)
- High CVE: [GHSA redacted] (package-lock.json)
- High CVE: [GHSA redacted] (package-lock.json)
- High CVE: [GHSA redacted] (package-lock.json)
- High CVE: [GHSA redacted] (package-lock.json)
- High CVE: [GHSA redacted] (package-lock.json)
- High CVE: [GHSA redacted] (package-lock.json)
- High CVE: [GHSA redacted] (package-lock.json)
- High CVE: [GHSA redacted] (package-lock.json)
- High CVE: [GHSA redacted] (package-lock.json)
- High CVE: [GHSA redacted] (package-lock.json)
- High CVE: [GHSA redacted] (package-lock.json)
- High vulnerability: [GHSA redacted] (package-lock.json)
- Inconsistent parameter structure for transaction submission. submit_tx takes a transaction and a signature separately. submit_batch takes a TxWithSignature (which already contains the signature) and a separate EthBatchSignatures. This implies TxWithSignature might be a list or a single item, but the naming and structure are confusing compared to the single tx case.
- Inconsistent parameter typing for token identification. token_by_id uses TokenLike (likely a struct/enum), while token_price uses TokenLike for the first arg but str for token_id_or_usd. This suggests TokenLike might not be fully utilized or that token_price should also accept a structured token identifier for consistency.
- …and 23 more
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
matter-labs/zksync was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.
About this page
- The score is its most recent published measurement, taken on 30 September 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
- Measured at commit 9ecfe440945c46f02060f164a0fb45adfa69e634 — the exact code this score is about.
- Scored under rubric-2026.09.18 — the same rubric and the same method as every other entry in this index.
- Measured by watchdog.canine.dev using codehealth-analyzer preprod-cb25ca4feafa.