Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add support for custom genesis state #3259

Merged
merged 43 commits into from
Dec 12, 2024
Merged

feat: add support for custom genesis state #3259

merged 43 commits into from
Dec 12, 2024

Conversation

encody
Copy link
Contributor

@encody encody commented Nov 12, 2024

This PR introduces the custom_genesis_export tool, designed to export zkSync PostgreSQL database state in a format suitable for initializing a custom genesis state for a new chain.

  • Exports initial_writes, storage_logs, and factory_deps (excluding system context entries) into a binary file.
  • Updates the genesis.yaml file with:
    • genesis_root_hash, rollup_last_leaf_index, and genesis_commitment matching the exported data.
    • Adds custom_genesis_state_path pointing to the export file, which is recognised by the server during genesis.
  • Adds support for initialising from a custom genesis state to the server.

@ischasny ischasny marked this pull request as ready for review December 6, 2024 16:36
@ischasny ischasny requested a review from a team as a code owner December 6, 2024 16:37
@ischasny ischasny requested a review from yorik December 6, 2024 16:37
core/bin/custom_genesis_export/README.md Outdated Show resolved Hide resolved
core/bin/custom_genesis_export/src/main.rs Outdated Show resolved Hide resolved
core/bin/custom_genesis_export/src/main.rs Outdated Show resolved Hide resolved
core/node/genesis/src/lib.rs Outdated Show resolved Hide resolved
core/bin/custom_genesis_export/src/main.rs Outdated Show resolved Hide resolved
core/node/genesis/src/lib.rs Outdated Show resolved Hide resolved
core/bin/custom_genesis_export/src/main.rs Outdated Show resolved Hide resolved
core/bin/custom_genesis_export/src/main.rs Outdated Show resolved Hide resolved
core/bin/custom_genesis_export/src/main.rs Outdated Show resolved Hide resolved
core/bin/custom_genesis_export/src/main.rs Outdated Show resolved Hide resolved
core/bin/custom_genesis_export/src/main.rs Outdated Show resolved Hide resolved
core/node/genesis/src/custom_genesis.rs Outdated Show resolved Hide resolved
deny.toml Outdated Show resolved Hide resolved
core/node/node_storage_init/src/main_node/genesis.rs Outdated Show resolved Hide resolved
core/node/genesis/src/custom_genesis.rs Outdated Show resolved Hide resolved
core/node/genesis/src/lib.rs Outdated Show resolved Hide resolved
@ischasny ischasny marked this pull request as ready for review December 12, 2024 11:05
core/lib/dal/src/custom_genesis_export_dal.rs Outdated Show resolved Hide resolved
core/lib/dal/src/lib.rs Show resolved Hide resolved
core/bin/custom_genesis_export/src/main.rs Outdated Show resolved Hide resolved
core/bin/custom_genesis_export/README.md Outdated Show resolved Hide resolved
core/bin/custom_genesis_export/src/main.rs Outdated Show resolved Hide resolved
core/node/genesis/src/lib.rs Outdated Show resolved Hide resolved
core/node/genesis/src/lib.rs Outdated Show resolved Hide resolved
perekopskiy
perekopskiy previously approved these changes Dec 12, 2024
deny.toml Outdated Show resolved Hide resolved
@ischasny ischasny added this pull request to the merge queue Dec 12, 2024
Merged via the queue into main with commit 3cffdb2 Dec 12, 2024
32 checks passed
@ischasny ischasny deleted the jl/data-imex branch December 12, 2024 18:43
github-merge-queue bot pushed a commit that referenced this pull request Dec 19, 2024
🤖 I have created a release *beep* *boop*
---


##
[25.4.0](core-v25.3.0...core-v25.4.0)
(2024-12-19)


### Features

* add support for custom genesis state
([#3259](#3259))
([3cffdb2](3cffdb2))
* **consensus:** Added view_timeout to consensus config
([#3383](#3383))
([fc02a8f](fc02a8f))
* Support stable compiler for VM (and some other crates)
([#3248](#3248))
([cbee99d](cbee99d))
* vm2 account validation
([#2863](#2863))
([af149a0](af149a0))


### Bug Fixes

* **contract-verifier:** Fix version extraction in gh resolver
([#3378](#3378))
([9a10dcf](9a10dcf))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

---------

Co-authored-by: zksync-era-bot <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants