Skip to content

Commit

Permalink
Add commands to check md style with prettier and markdownlint
Browse files Browse the repository at this point in the history
  • Loading branch information
ly0va committed Nov 17, 2020
1 parent 530212a commit ca428e7
Show file tree
Hide file tree
Showing 24 changed files with 1,081 additions and 697 deletions.
8 changes: 8 additions & 0 deletions .markdownlintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"default": true,
"header-increment": false,
"no-duplicate-header": false,
"no-inline-html": false,
"line-length": false,
"fenced-code-language": false
}
44 changes: 26 additions & 18 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,20 @@
### Contracts v3 and protocol (4.09.2020)

- Change pubkey operation requires fee for processing.
- Added support for the forced exit operation which allows user to force a withdrawal from another account
that does not have signing key set and is older than 24h.
- Added support for the forced exit operation which allows user to force a withdrawal from another account that does not
have signing key set and is older than 24h.

### zksync.js 0.6.5

- Support of fast withdrawals was added. Corresponding optional field was added to the object passed to the `withdrawFromSyncToEthereum` method
and `getTransactionFee` now accepts `FastWithdraw` fee type.
- Support of fast withdrawals was added. Corresponding optional field was added to the object passed to the
`withdrawFromSyncToEthereum` method and `getTransactionFee` now accepts `FastWithdraw` fee type.

### zksync.js 0.6.3

- Bundled version for browsers added. File `dist/main.js` can be used in `<script>` html tag.
It requires global `ethers` object from [ethers-io/ethers.js](https://github.com/ethers-io/ethers.js/)
- `zksync.crypto.loadZkSyncCrypto()` method is added for browser builds that loads and compiles `zksync-crypto-web_bg.wasm` file.
Should be called before any calls that use `zksync-crypto`.
- Bundled version for browsers added. File `dist/main.js` can be used in `<script>` html tag. It requires global
`ethers` object from [ethers-io/ethers.js](https://github.com/ethers-io/ethers.js/)
- `zksync.crypto.loadZkSyncCrypto()` method is added for browser builds that loads and compiles
`zksync-crypto-web_bg.wasm` file. Should be called before any calls that use `zksync-crypto`.

### zksync.js 0.6.0

Expand All @@ -26,12 +26,17 @@

- Server: Robustness of the fee ticker's API interacting module was increased. [#786]
- Server: A possibility to get an Ethereum tx hash for withdrawal operation was added. [#751]
- Prover: Bug with delay between receiving a job and starting sending heartbeats was fixed. [7a82dba](https://github.com/matter-labs/zksync/commit/7a82dba)
- Server: Blocks that contain withdraw operations are sealed faster. [bab346b](https://github.com/matter-labs/zksync/commit/bab346b)
- Server: Added support for non-standard Ethereum signatures. [da0670e](https://github.com/matter-labs/zksync/commit/da0670e)
- Prover: Bug with delay between receiving a job and starting sending heartbeats was fixed.
[7a82dba](https://github.com/matter-labs/zksync/commit/7a82dba)
- Server: Blocks that contain withdraw operations are sealed faster.
[bab346b](https://github.com/matter-labs/zksync/commit/bab346b)
- Server: Added support for non-standard Ethereum signatures.
[da0670e](https://github.com/matter-labs/zksync/commit/da0670e)
- Server: `eth_sender` module now can be disabled. [f9642e9](https://github.com/matter-labs/zksync/commit/f9642e9)
- Server: Transfer to zero address (0x00..00) is now forbidden in zkSync. [b3c72cd](https://github.com/matter-labs/zksync/commit/b3c72cd)
- Server: WebSocket server now uses more threads for handling incoming requests. [3a77363](https://github.com/matter-labs/zksync/commit/3a77363)
- Server: Transfer to zero address (0x00..00) is now forbidden in zkSync.
[b3c72cd](https://github.com/matter-labs/zksync/commit/b3c72cd)
- Server: WebSocket server now uses more threads for handling incoming requests.
[3a77363](https://github.com/matter-labs/zksync/commit/3a77363)

### zksync.js

Expand All @@ -40,18 +45,21 @@
### Explorer

- A link to the wallet was added to the explorer. [14424a6](https://github.com/matter-labs/zksync/commit/14424a6)
- Fixed bug with accessing non-existent blocks in explorer. [e8ca026](https://github.com/matter-labs/zksync/commit/e8ca026)
- Fixed bug with accessing non-existent blocks in explorer.
[e8ca026](https://github.com/matter-labs/zksync/commit/e8ca026)

### Contracts v2 (20.07.2020)

- Added event denoting information about pending and completed withdrawals. [bb0d1bd](https://github.com/matter-labs/zksync/commit/bb0d1bd)
- Added support for tokens that aren't fully compatible with ERC20. [c088328](https://github.com/matter-labs/zksync/commit/c088328)
- Added event denoting information about pending and completed withdrawals.
[bb0d1bd](https://github.com/matter-labs/zksync/commit/bb0d1bd)
- Added support for tokens that aren't fully compatible with ERC20.
[c088328](https://github.com/matter-labs/zksync/commit/c088328)
- Block revert interval is changed to 0 hours. [c088328](https://github.com/matter-labs/zksync/commit/c088328)
- Redundant priority request check is removed from contract upgrade logic. [c088328](https://github.com/matter-labs/zksync/commit/c088328)
- Redundant priority request check is removed from contract upgrade logic.
[c088328](https://github.com/matter-labs/zksync/commit/c088328)
- `PRIORITY_EXPRIRATION_PERIOD` is reduced to 3 days. [c12ab40](https://github.com/matter-labs/zksync/commit/c12ab40)
- `UPGRADE_NOTICE_PERIOD` is increased to 8 days. [c12ab40](https://github.com/matter-labs/zksync/commit/c12ab40)


## zkSync 1.0 (18.06.2020)

Changes prior to the 1.0 release are not presented in this changelog.
19 changes: 12 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,24 @@
[![Live on Ropsten](https://img.shields.io/badge/wallet-Live%20on%20Ropsten-blue)](https://ropsten.zksync.io)
[![Join the technical discussion chat at https://gitter.im/matter-labs/zksync](https://badges.gitter.im/matter-labs/zksync.svg)](https://gitter.im/matter-labs/zksync?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)


zkSync is a scaling and privacy engine for Ethereum. Its current functionality scope includes low gas transfers of ETH and ERC20 tokens in the Ethereum network.
zkSync is a scaling and privacy engine for Ethereum. Its current functionality scope includes low gas transfers of ETH
and ERC20 tokens in the Ethereum network.

## Description

zkSync is built on ZK Rollup architecture. ZK Rollup is an L2 scaling solution in which all funds are held by a smart contract on the mainchain, while computation and storage are performed off-chain. For every Rollup block, a state transition zero-knowledge proof (SNARK) is generated and verified by the mainchain contract. This SNARK includes the proof of the validity of every single transaction in the Rollup block. Additionally, the public data update for every block is published over the mainchain network in the cheap calldata.
zkSync is built on ZK Rollup architecture. ZK Rollup is an L2 scaling solution in which all funds are held by a smart
contract on the mainchain, while computation and storage are performed off-chain. For every Rollup block, a state
transition zero-knowledge proof (SNARK) is generated and verified by the mainchain contract. This SNARK includes the
proof of the validity of every single transaction in the Rollup block. Additionally, the public data update for every
block is published over the mainchain network in the cheap calldata.

This architecture provides the following guarantees:

- The Rollup validator(s) can never corrupt the state or steal funds (unlike Sidechains).
- Users can always retrieve the funds from the Rollup even if validator(s) stop cooperating because the data is available (unlike Plasma).
- Thanks to validity proofs, neither users nor a single other trusted party needs to be online to monitor Rollup blocks in order to prevent fraud.
- Users can always retrieve the funds from the Rollup even if validator(s) stop cooperating because the data is
available (unlike Plasma).
- Thanks to validity proofs, neither users nor a single other trusted party needs to be online to monitor Rollup blocks
in order to prevent fraud.

In other words, ZK Rollup strictly inherits the security guarantees of the underlying L1.

Expand All @@ -43,7 +49,6 @@ The following guides for developers are available:

## License

zkSync is distributed under the terms of both the MIT license
and the Apache License (Version 2.0).
zkSync is distributed under the terms of both the MIT license and the Apache License (Version 2.0).

See [LICENSE-APACHE](LICENSE-APACHE), [LICENSE-MIT](LICENSE-MIT) for details.
1 change: 1 addition & 0 deletions contracts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"mocha": "^8.2.0",
"openzeppelin-solidity": "^2.3.0",
"path": "^0.12.7",
"prettier": "^2.1.2",
"prettier-plugin-solidity": "^1.0.0-alpha.59",
"querystring": "^0.2.0",
"solhint": "^3.3.1",
Expand Down
4 changes: 2 additions & 2 deletions core/lib/crypto/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

## License

`zksync_models` is a part of zkSync stack, which is distributed under the terms of both the MIT license
and the Apache License (Version 2.0).
`zksync_models` is a part of zkSync stack, which is distributed under the terms of both the MIT license and the Apache
License (Version 2.0).

See [LICENSE-APACHE](../../LICENSE-APACHE), [LICENSE-MIT](../../LICENSE-MIT) for details.
31 changes: 13 additions & 18 deletions core/lib/types/README.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,23 @@
# zkSync types. Essential types for the zkSync network

`zksync_types` is a crate containing essential zkSync network types, such as transactions, operations and
blockchain primitives.
`zksync_types` is a crate containing essential zkSync network types, such as transactions, operations and blockchain
primitives.

zkSync operations are split into the following categories:

- **transactions**: operations of zkSync network existing purely in the L2.
Currently includes `Transfer`, `Withdraw`, `ChangePubKey` and `ForcedExit`.
All the transactions form an enum named `ZkSyncTx`.
- **priority operations**: operations of zkSync network which are triggered by
invoking the zkSync smart contract method in L1. These operations are discovered by
the zkSync server and included into the block just like L2 transactions.
Currently includes `Deposit` and `FullExit`.
All the priority operations form an enum named `ZkSyncPriorityOp`.
- **operations**: a superset of `ZkSyncTx` and `ZkSyncPriorityOp`.
All the operations are included into an enum named `ZkSyncOp`. This enum contains
all the items that can be included into the block, together with meta-information
about each transaction.
Main difference of operation from transaction/priority operation is that it can form
public data required for the committing the block on the L1.
- **transactions**: operations of zkSync network existing purely in the L2. Currently includes `Transfer`, `Withdraw`,
`ChangePubKey` and `ForcedExit`. All the transactions form an enum named `ZkSyncTx`.
- **priority operations**: operations of zkSync network which are triggered by invoking the zkSync smart contract method
in L1. These operations are discovered by the zkSync server and included into the block just like L2 transactions.
Currently includes `Deposit` and `FullExit`. All the priority operations form an enum named `ZkSyncPriorityOp`.
- **operations**: a superset of `ZkSyncTx` and `ZkSyncPriorityOp`. All the operations are included into an enum named
`ZkSyncOp`. This enum contains all the items that can be included into the block, together with meta-information about
each transaction. Main difference of operation from transaction/priority operation is that it can form public data
required for the committing the block on the L1.

## License

`zksync_models` is a part of zkSync stack, which is distributed under the terms of both the MIT license
and the Apache License (Version 2.0).
`zksync_models` is a part of zkSync stack, which is distributed under the terms of both the MIT license and the Apache
License (Version 2.0).

See [LICENSE-APACHE](../../LICENSE-APACHE), [LICENSE-MIT](../../LICENSE-MIT) for details.
53 changes: 26 additions & 27 deletions docs/architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,17 @@ This document covers the structure of this repository.

zkSync repository consists of several applications:

- zkSync smart contract: a Solidity smart contract deployed on the Ethereum blockchain,
which manages users' balances and verifies the correctness of operations performed within
zkSync network.
- Prover application: a worker application that creates a proof for an executed block.
Prover applications poll Server application for available jobs, and once there is a new
block, server provides a witness (input data to generate a proof), and prover starts working.
Once proof is generated, it is reported to the Server application, and Server publishes the
proof to the smart contract.
Prover application is considered an on-demand worker, thus it is OK to have many provers (if
server load is high) or no provers at all (if there are no incoming transactions).
Generating a proof is a very resource consuming work, thus machines that run a prover application
must have a modern CPU and a lot of RAM.
- zkSync smart contract: a Solidity smart contract deployed on the Ethereum blockchain, which manages users' balances
and verifies the correctness of operations performed within zkSync network.
- Prover application: a worker application that creates a proof for an executed block. Prover applications poll Server
application for available jobs, and once there is a new block, server provides a witness (input data to generate a
proof), and prover starts working. Once proof is generated, it is reported to the Server application, and Server
publishes the proof to the smart contract. Prover application is considered an on-demand worker, thus it is OK to have
many provers (if server load is high) or no provers at all (if there are no incoming transactions). Generating a proof
is a very resource consuming work, thus machines that run a prover application must have a modern CPU and a lot of
RAM.
- Server application: a node running the zkSync network. It is capable of following things:

- Monitoring the smart contract for the onchain operations (such as deposits).
- Accepting transactions.
- Generating zkSync chain blocks.
Expand All @@ -27,28 +25,27 @@ zkSync repository consists of several applications:

Server application exists in two available forms:

- Monolithic application, which provides all the required functionality from one binary.
This form is convenient for the development needs.
Corresponding crate is `core/bin/server`.
- Monolithic application, which provides all the required functionality from one binary. This form is convenient for
the development needs. Corresponding crate is `core/bin/server`.
- Microservices applications, which are capable of working independently from each other:
- `Core` service (`core/bin/zksync_core`) maintains transactions memory pool and commits new blocks.
- `API` service (`core/bin/zksync_api`) provides a server "front-end": REST API & JSON RPC HTTP/WS implementations.
- `Ethereum Sender` service (`core/bin/zksync_eth_sender`) finalizes the blocks by sending corresponding Ethereum transactions to the
L1 smart contract.
- `Witness Generator` service (`core/bin/zksync_witness_generator`) creates input data required for provers to prove blocks, and
implements a private API server for provers to interact with.
- `Prometheus Exporter` service (`core/bin/zksync_prometheus_exporter`) manages exporting data about the application state
for further node behavior analysis.
- Explorer: zkSync network explorer. A web application that receives data from the Server API
and renders it to the convenient blockchain explorer interface.

- `Ethereum Sender` service (`core/bin/zksync_eth_sender`) finalizes the blocks by sending corresponding Ethereum
transactions to the L1 smart contract.
- `Witness Generator` service (`core/bin/zksync_witness_generator`) creates input data required for provers to prove
blocks, and implements a private API server for provers to interact with.
- `Prometheus Exporter` service (`core/bin/zksync_prometheus_exporter`) manages exporting data about the application
state for further node behavior analysis.

- Explorer: zkSync network explorer. A web application that receives data from the Server API and renders it to the
convenient blockchain explorer interface.

Thus, in order to get a local zkSync setup running, the following has to be done:

- zkSync smart contract is compiled and deployed to the Ethereum.
- zkSync server is launched.
- At least one prover is launched and connected to the Server application.


## Low-Level Overview

This section provides an overview on folders / sub-projects that exist in this repository.
Expand All @@ -63,7 +60,8 @@ This section provides an overview on folders / sub-projects that exist in this r
- `/prover`: zkSync prover application.
- `/data_restore`: Utility to restore a state of the zkSync network from a smart contract.
- `/key_generator`: Utility to generate verification keys for network.
- `/gen_token_add_contract`: Utility to generate `TokenDeployInit` smart contract, required for initial network launch.
- `/gen_token_add_contract`: Utility to generate `TokenDeployInit` smart contract, required for initial network
launch.
- `/parse_pub_data`: Utility to parse zkSync operation pubdata.
- `/zksync_core`: zkSync server Core microservice.
- `/zksync_api`: zkSync server API microservice.
Expand All @@ -87,7 +85,8 @@ This section provides an overview on folders / sub-projects that exist in this r
- `/loadtest`: An application for highload testing of zkSync server.
- `/test_account`: A representation of zkSync account which can be used for tests.
- `/testkit`: A relatively low-level testing library and test suite for zkSync.
- `/ts-test`: Integration tests set implemented in TypeScript. Requires a running Server and Prover applications to operate.
- `/ts-test`: Integration tests set implemented in TypeScript. Requires a running Server and Prover applications to
operate.
- `/docker`: Dockerfiles used for development of zkSync and for packaging zkSync for a production environment.
- `/etc`: Configration files.
- `/env`: `.env` files that contain environment variables for different configuration of zkSync Server / Prover.
Expand Down
Loading

0 comments on commit ca428e7

Please sign in to comment.