Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(genesis): Using genesis config only during the genesis (#1423)
## What ❔ During the genesis, we have some fixed params, and they are changing only during protocol upgrade. In this PR, I've not created an additional file that represents genesis state, but only loaded it from environmental variables. ## Why ❔ For system config refactoring we have to split our config system to a few different files and it's the first step to it ## Checklist <!-- Check your PR fulfills the following items. --> <!-- For draft PRs check the boxes as you complete them. --> - [x] PR title corresponds to the body of PR (we generate changelog entries from PRs). - [ ] Tests for the changes have been added / updated. - [x] Documentation comments have been added / updated. - [x] Code has been formatted via `zk fmt` and `zk lint`. - [x] Spellcheck has been run via `zk spellcheck`. - [x] Linkcheck has been run via `zk linkcheck`. --------- Signed-off-by: Danil <deniallugo@gmail.com>
- Loading branch information
1 parent
16dce75
commit 4b634fd
Showing
47 changed files
with
844 additions
and
650 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
use serde::{Deserialize, Serialize}; | ||
use zksync_basic_types::{Address, L1ChainId, L2ChainId, H256}; | ||
|
||
/// This config represents the genesis state of the chain. | ||
/// Each chain has this config immutable and we update it only during the protocol upgrade | ||
#[derive(Debug, Serialize, Deserialize, Clone, PartialOrd, PartialEq)] | ||
pub struct GenesisConfig { | ||
pub protocol_version: u16, | ||
pub genesis_root_hash: H256, | ||
pub rollup_last_leaf_index: u64, | ||
pub genesis_commitment: H256, | ||
pub bootloader_hash: H256, | ||
pub default_aa_hash: H256, | ||
pub fee_account: Address, | ||
pub l1_chain_id: L1ChainId, | ||
pub l2_chain_id: L2ChainId, | ||
pub recursion_node_level_vk_hash: H256, | ||
pub recursion_leaf_level_vk_hash: H256, | ||
pub recursion_scheduler_level_vk_hash: H256, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.