Title | Upgrade Chain Creation Params |
---|---|
Proposal Type | ZIP |
One Sentence Summary: | This proposal fixes the ChainCreationParams for the chain after the ZIP-6 upgrade. |
Proposal Author | Matter Labs, point of contact is @StanislavBreadless |
Proposal Sponsor: | TBC |
Date Created: | TBC |
Version | v1 |
Summary of Action | Updating the genesisBatchHash , genesisBatchCommitment as well as genesisUpgrade |
Link to contracts | v26 creation params patch by StanislavBreadless · Pull Request #1270 · matter-labs/era-contracts · GitHub |
[ZIP-8] Upgrade Chain Creation Params
Summary
This ZIP proposes updating the chain creation parameters for new chains to enable chain creation after ZIP6.
Abstract
When setting ChainCreationParams
for a protocol version, we derive genesisBatchHash
and genesisBatchCommitment
from the zksync-era repository, where these values are continuously tested.
It is expected that system contracts and predeployed contracts (e.g., L2NativeTokenVault
) retain the same hashes at genesis as those in the era-contracts repository. However, due to a configuration issue in foundry.toml, the generated hashes varied depending on the presence of the node_modules folder – despite no dependencies being used from it.
This discrepancy resulted in genesisBatchHash
and genesisBatchCommitment
using contracts that were compiled without node_modules
, while other data was compiled with it, making chain initialization impossible.
This upgrade ensures consistency by aligning genesisBatchHash
and genesisBatchCommitment
with the rest of the contracts, resolving the issue.
Separately, a small issue was found in the genesis upgrade, that led to the default wrapped base token having always having the generic “Wrapped Base Token”/“WBT” name and symbol respectively. This is also fixed in this release.
Motivation
The main objective is to unblock creation of new chains after the ZIP6 upgrade. The secondary objective is to fix with the small L1GenesisUpgrade
.
Specification
The new genesisBatchHash
and genesisBatchCommitment
were taken from the zksync-era after adjusting the compilation to be the same as in the era-contracts
repo:
genesisBatchHash
should be equal to0x7bdb3d822ad837a3611c436d3be457363a08d06d83b74469831482353a7d8277
.genesisBatchCommitment
should be equal to0x81f5e324a4019e4161fb9dc5058a588aa364a551fdd5c0e8788521e64e7ad596
.
Also, the new L1GenesisUpgrade
contract was deployed at address 0x107e92E7360e595d8129B522ABD458361f32f66C. Its bytecode corresponds to the code from this PR: v26 creation params patch by StanislavBreadless · Pull Request #1270 · matter-labs/era-contracts · GitHub at commit 37238f745cf7b0bafbbb041601b5549552465893
.
Rationale
The upgrade approach chosen ensures that no new protocol version (even patch version) is introduced, which ensures that no actions are needed from the existing chains.
Backwards Compatibility
No issues with backwards compatibility.
Security Considerations
The new genesisBatchHash
and genesisBatchCommitment
have been already tested on testnet.
The new L1GenesisUpgrade
corresponds to the code at commit 37238f745cf7b0bafbbb041601b5549552465893
. Its code has been reviewed by OpenZeppelin at commit e3dd33ceee8f803510cbd0debb8ed55fef4007e8
.
The diff between the commits can be seen here. Neither L1GenesisUpgrade
nor any of its dependencies have been amended.