zksync-era icon indicating copy to clipboard operation
zksync-era copied to clipboard

feat(en): Fetch L1 batch root hashes from main node

Open slowli opened this issue 1 year ago • 0 comments

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

  • [x] PR title corresponds to the body of PR (we generate changelog entries from PRs).
  • [x] 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.

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

slowli avatar May 14 '24 10:05 slowli