Skip to content
This repository has been archived by the owner on Mar 25, 2024. It is now read-only.

Mirror to de404a390af2aa37ad23b2a543c5f1b408ca84bf #11

Merged
merged 1 commit into from
Sep 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,40 @@ moved to an ephemeral contract called a bootloader.
We call it ephemeral because it is not physically deployed and cannot be called, but it has a formal address that is used
on msg.sender, when it calls other contracts.

## Building

This repository is used as a submodule of the [zksync-2-dev](https://github.com/matter-labs/zksync-2-dev).

Compile the solidity contracts: `yarn build`

Run the bootloader preprocessor: `yarn preprocess`

Compile the yul contracts: `yarn hardhat run ./scripts/compile-yul.ts`

## Update Process

System contracts handle core functionalities and play a critical role in maintaining the integrity of our protocol. To ensure the highest level of security and reliability, these system contracts undergo an audit before any release.

Here is an overview of the release process of the system contracts which is aimed to preserve agility and clarity on the order of the upgrades:

### `main` branch

The `main` branch contains the latest code that is ready to be deployed into production. It reflects the most stable and audited version of the protocol.

### `dev` branch

The `dev` branch is for active development & the latest code changes. Whenever a new PR with system contract changes is created it should be based on the `dev` branch.

### Creating a new release:

Whenever a new release is planned, a new branch named `release-vX-<name>` should be created off the `dev` branch, where `X` represents the release version, and `<name>` is a short descriptive name for the release. The PR with the new release should point to either the `main` branch or to the release branch with a lower version (in case the previous branch has not been merged into `main` for some reason).

Once the audit for the release branch is complete and all the fixes from the audit are applied, we need to merge the new changes into the `dev` branch. Once the release is final and merged into the `main` branch, the `main` branch should be merged back into the `dev` branch to keep it up-to-date.

### Updating Unaudited Code:

Since scripts, READMEs, etc., are code that is not subject to audits, these are to be merged directly into the `main` branch. The rest of the release branches as well as the `dev` branch should merge `main` to synchronize with these changes.

## License

The zkSync Era system-contracts are distributed under the terms of the MIT license.
Expand Down
4 changes: 2 additions & 2 deletions contracts/SystemContext.sol
Original file line number Diff line number Diff line change
Expand Up @@ -269,8 +269,6 @@ contract SystemContext is ISystemContext, ISystemContextDeprecated {
virtualBlockInfo.number += _maxVirtualBlocksToCreate;
virtualBlockInfo.timestamp = _newTimestamp;

currentVirtualL2BlockInfo = virtualBlockInfo;

// The virtual block number must never exceed the L2 block number.
// We do not use a `require` here, since the virtual blocks are a temporary solution to let the Solidity's `block.number`
// catch up with the L2 block number and so the situation where virtualBlockInfo.number starts getting larger
Expand All @@ -279,6 +277,8 @@ contract SystemContext is ISystemContext, ISystemContextDeprecated {
virtualBlockUpgradeInfo.virtualBlockFinishL2Block = _l2BlockNumber;
virtualBlockInfo.number = _l2BlockNumber;
}

currentVirtualL2BlockInfo = virtualBlockInfo;
}

/// @notice Sets the current block number and timestamp of the L2 block.
Expand Down