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(en): Fetch L1 batch root hashes from main node #1923

Merged
merged 11 commits into from
May 16, 2024

Conversation

slowli
Copy link
Contributor

@slowli slowli commented May 14, 2024

What ❔

Implements a PoC for the treeless node mode, i.e., a mode in which a node doesn't maintain a Merkle tree locally, but rather downloads necessary data from a trusted peer (i.e., the main node). This extends to the case when a node is configured to start a Merkle tree after some time or immediately; the root hashes produced by the tree (which are expected to be slower than the tree data fetcher) will be used to double-check fetched hashes. Also, these hashes are checked by the consistency checker against L1 commitment transactions.

Why ❔

  • Merkle tree recovery takes more than 50% of overall recovery process on the mainnet, so by introducing this mode, a recovering node can start operating a couple of hours earlier.
  • Merkle tree introduces non-trivial operational requirements (~2.5 TB disk space / ~16 GB RAM on the mainnet), so by not running the tree, these requirements can be reduced.

Checklist

  • PR title corresponds to the body of PR (we generate changelog entries from PRs).
  • Tests for the changes have been added / updated.
  • Documentation comments have been added / updated.
  • Code has been formatted via zk fmt and zk lint.
  • Spellcheck has been run via zk spellcheck.

fix(state-keeper): Fix hanging up during shutdown if L1 batch root hashes are not being computed

Copy link
Contributor Author

@slowli slowli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To keep this PR reasonably small, I'd prefer to add integration testing in a separate PR.

core/bin/external_node/src/main.rs Show resolved Hide resolved
core/lib/dal/src/blocks_dal.rs Show resolved Hide resolved
core/lib/zksync_core/src/state_keeper/keeper.rs Outdated Show resolved Hide resolved
@slowli slowli marked this pull request as ready for review May 14, 2024 12:18
popzxc
popzxc previously approved these changes May 15, 2024
core/bin/external_node/src/main.rs Show resolved Hide resolved
core/lib/dal/src/blocks_dal.rs Show resolved Hide resolved
@slowli slowli added this pull request to the merge queue May 16, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks May 16, 2024
@slowli slowli added this pull request to the merge queue May 16, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks May 16, 2024
@slowli slowli added this pull request to the merge queue May 16, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks May 16, 2024
@slowli slowli added this pull request to the merge queue May 16, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks May 16, 2024
@slowli slowli added this pull request to the merge queue May 16, 2024
Merged via the queue into main with commit 72a3571 May 16, 2024
43 checks passed
@slowli slowli deleted the aov-pla-748-fetch-l1-batch-hashes-when-syncing-ens branch May 16, 2024 13:00
RomanBrodetski pushed a commit that referenced this pull request May 17, 2024
🤖 I have created a release *beep* *boop*
---


##
[24.3.0](core-v24.2.0...core-v24.3.0)
(2024-05-16)


### Features

* Added support for making EN a (non-leader) consensus validator
(BFT-426)
([#1905](#1905))
([9973629](9973629))
* **configs:** Extract secrets to an additional config
([#1956](#1956))
([bab4d65](bab4d65))
* **en:** Fetch L1 batch root hashes from main node
([#1923](#1923))
([72a3571](72a3571))
* **eth-client:** Generalize RPC client
([#1898](#1898))
([a4e099f](a4e099f))
* **Prover CLI:** `requeue` cmd
([#1719](#1719))
([f722df7](f722df7))
* **Prover CLI:** `status batch --verbose`
([#1899](#1899))
([cf80184](cf80184))
* **pruning:** Vacuum freeze started daily
([#1929](#1929))
([5c85e9f](5c85e9f))
* Remove metrics crate
([#1902](#1902))
([5f7bda7](5f7bda7))
* **state-keeper:** Parallel l2 block sealing
([#1801](#1801))
([9b06dd8](9b06dd8))
* tee_verifier_input_producer
([#1860](#1860))
([fea7f16](fea7f16))
* **vm-runner:** implement output handler for VM runner
([#1856](#1856))
([1e4aeb5](1e4aeb5))


### Bug Fixes

* **basic_types:** bincode deserialization for `web3::Bytes`
([#1928](#1928))
([406ec8c](406ec8c))
* **config:** Fix data-handler-config
([#1919](#1919))
([b6bb041](b6bb041))
* **en:** Delete old txs by (init_addr, nonce)
([#1942](#1942))
([fa5f4a7](fa5f4a7))
* **en:** Fix reorg detector logic for dealing with last L1 batch
([#1906](#1906))
([3af5f5b](3af5f5b))
* parentHash in websocket blocks subscription is shown as 0x0
([#1946](#1946))
([fc2efad](fc2efad))
* **Prover CLI:** `status batch` bugs
([#1865](#1865))
([09682f2](09682f2))
* **utils:** bincode ser-/deserialization for `BytesToHexSerde`
([#1947](#1947))
([a75b917](a75b917))

---
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.

2 participants