Changelog
Changelog
Full launch system update (Mar 23rd 2023)
Major updates accross the system including:
- Protocol changes:
- Removed allow list for L1<>L2 communication (zkSync Era is now at Full Launch open to all users).
- Implementation of withdrawal delay.
- Smart contract bytecode packing.
- Multiple bug fixes in circuits and prover.
- Fee model adjusted for L1<>L2 communication and proof generation.
- Security fixes.
- Performance improvements.
- New version of JS SDK zksync-web3
0.14.3
. - New version of
zksync-cli
0.1.4
. - Released new docker images of the local setup for unit tests.
How to update your project
- Update
zksync-web3
to^0.14.3
in yourpackage.json
file and re-install dependencies. - Update
zksync-cli
withnpm update -g zksync-cli
. - Pull the latest docker images of the local setup by running the
./clear.sh
script. More about local setup. - L1->L2 transactions now require gas fees to be paid upfront. The fee can be estimated using the new method
zks_estimateGasL1ToL2
. Read more here. - Provide
_refundRecipient
when usingrequestL2Transaction
indicating the address that will receive refunds. (Optional)
Hardhat plugins update (Feb 24th 2023)
The following hardhat plugin have been released:
hardhat-zksync-verify
version0.1.2
: now returns a verification id, which can be used to query the status of a smart contract verification. More info herehardhat-zksync-deploy
version0.6.2
: integrates with latest version ofzksync-web3
.hardhat-zksync-chai-matchers
version0.1.1
: integrates with latest version ofzksync-web3
.
How to update your project
Update the following versions in the package.json
file of your project:
- Update
@matterlabs/hardhat-zksync-verify
to0.1.2
. - Update
@matterlabs/hardhat-zksync-deploy
to0.6.2
. - Update
@matterlabs/hardhat-zksync-chai-matchers
to0.1.1
.
Compiler & local-setup update (Feb 20th 2023)
Version 1.3.5
of zksolc
has been released and the zksync docker image of the local-setup has been updated. Details:
- Compiler:
- Adds support for Solidity
0.8.18
. - Fixes a broken optimization flag that increased bytecode size of compiled contracts.
- Fixes a bug that detected ERC20
transfer
calls as ETHtransfer
and produced a compilation error. - Detection of
transfer
andsend
methods in smart contracts now returns a warning message (similar tov1.3.1
). The new warning message reminds developers that using these methods to transfer ETH can cause issues and suggest replacing them withpayable(address).call[value: <X>]("")
. transfer
can be used to transfer other tokens (e.g. ERC20) without any issues, although this might be still highlighted by the compiler.
- Adds support for Solidity
- Local setup docker image:
- Improvements in the zksync node error messages returned on estimate gas requests.
How to update your project
- Update the compiler version in the
hardhat.config.ts
file to1.3.5
. - Re-compile contracts.
- Update the docker images of the local-setup with
docker-compose pull
and restart the its state by running the./clear.sh
script.
System update (Feb 10th 2023)
Minor updated that simplifies the fee model to reduce overhead and fix some bugs. It requires an update on the zksync-web3
package to v0.13.1
.
How to update your project
- Update
zksync-web3
tov0.13.1
. - There are no changes in contract interfaces or APIs, so no code changes are required.
- Projects that don't use
zksync-web3
but rely oneth_signTypedData
to sign the transactions would need to manually include a fixedgasPerPubdataByteLimit
of50000
in the transaction overrides.
System update v1.3 (Feb 8th 2023)
This update made several modifications to the system in preparation for the "Fair Onboarding Alpha" milestone. The modifications include:
- Revamp in the fee mechanism:
ergs
have been replaced withgas
to make it easier to understand (after all, we’re all part of the Ethereum ecosystem).- Gas refunds: transactions are refunded for unused gas. You can see these refunds as token transfers in the explorer.
- Updates in the Account Abstraction and Paymaster interfaces.
- Changes in L1 and L2 system contract interfaces.
- Breaking changes in our SDKs where methods and properties that contained
ergs
are renamedgas
. - API error messages now follow the Geth format (more updates coming soon).
These updates were followed by a system regenesis.
How to update your project
To update your project, follow these steps:
- Update all your project dependencies, while continuing to use
ethers v5.7.x
(asethers v6.x
introduces additional breaking changes). - Delete the
artifacts-zk
andcache-zk
folders. - If you’re using the local-setup to run unit tests, update the docker images with
docker-compose pull
and restart the local setup state by running the./clear.sh
script. - Re-compile your project with the latest version of the binary compiler (
v1.3.1
). - Update
zksync-web3
to0.13.x
. All methods that includedergs
have been renamed togas
and some function signatures have changed. - If your project uses zksync system contracts, make sure to update the
@matterlabs/zksync-contracts
package as well. There are changes in multiple contract interfaces. - Paymasters:
- The
ergsPerPubdata: utils.DEFAULT_ERGS_PER_PUBDATA_LIMIT
in the transactioncustomData
should be updated togasPerPubdata: utils.DEFAULT_GAS_PER_PUBDATA_LIMIT
. - Custom paymasters are required to return a magic value after a transaction validation on the
validateAndPayForPaymasterTransaction
method. This value should beACCOUNT_VALIDATION_SUCCESS_MAGIC
(available on theIAccount.sol
interface) if the validation is successful, or an empty valuebytes4(0)
if it fails.
- The
- If your project uses Account Abstraction, keep in mind that the
IAccount
interface has changed.- The Account abstraction multisig tutorial has been updated to reflect the interface changes.
- The
prePaymaster
method has been renamed toprepareForPaymaster
. - Smart contract accounts now include versioning to allow for future updates. This should be included as a parameter when calling
create2Account
from AA Factory contracts. - Accounts are required to return a magic value after a transaction validation on the
validateTransaction
method. This value should beACCOUNT_VALIDATION_SUCCESS_MAGIC
(available on theIAccount.sol
interface) if the validation is successful, or an empty valuebytes4(0)
if it fails.
- If your smart contracts use any methods from the
SystemContractsCaller
library (likesystemCall
), you'd need to compile them with theisSystem
flag set totrue
in thesettings
section ofzksolc
inside thehardhat.config.ts
file. - zkSync system contracts have cycle dependencies and might cause issues flattening contracts with
hardhat flatten
. Use the hardhat verify plugin instead. - As with any other regenesis, it will remove all balances and contracts so you’ll need to deposit funds and redeploy your contracts again.
If after doing these changes you’re still facing issues, please create a support ticket in the "dev-support-beta" channed in our Discord.
The Javascript SDK documentation, Quickstart and Account abstraction multisig tutorials have been updated but some other sections of the docs are not updated yet. We will release updates during the upcoming days. If you find any issues, please contact us.