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: Implement dynamic L2-to-L1 log tree depth #126

Merged
merged 5 commits into from
Oct 3, 2023

Conversation

slowli
Copy link
Contributor

@slowli slowli commented Oct 2, 2023

What ❔

Implements dynamic depth of the in-memory L2-to-L1 log Merkle tree. Previously, this tree always had 512 items (if necessary, additional zero items were added at the end). With these changes, the tree has at least 512 items (with padding); the actual number of items is max(512, items.len().next_power_of_two()). This makes the change backward-compatible without needing any logic tied to L1 batch number etc.

Why ❔

We want to allow larger Merkle tree depths than previously.

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.

@codecov
Copy link

codecov bot commented Oct 2, 2023

Codecov Report

Attention: 49 lines in your changes are missing coverage. Please review.

Comparison is base (8df1127) 31.57% compared to head (6291e07) 31.58%.
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #126      +/-   ##
==========================================
+ Coverage   31.57%   31.58%   +0.01%     
==========================================
  Files         477      477              
  Lines       25429    25432       +3     
==========================================
+ Hits         8028     8032       +4     
+ Misses      17401    17400       -1     
Files Coverage Δ
core/lib/types/src/commitment.rs 73.19% <ø> (ø)
core/lib/types/src/l2_to_l1_log.rs 100.00% <ø> (ø)
core/lib/mini_merkle_tree/src/lib.rs 63.63% <46.15%> (-5.60%) ⬇️
.../zksync_core/src/api_server/web3/namespaces/zks.rs 0.00% <0.00%> (ø)

... and 2 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@slowli slowli marked this pull request as ready for review October 2, 2023 09:58
@slowli slowli requested a review from a team as a code owner October 2, 2023 09:58
@slowli slowli force-pushed the aov-pla-548-implement-dynamic-l2-l1-log-tree-depth branch from 41197ad to 6291e07 Compare October 3, 2023 12:26
@slowli slowli added this pull request to the merge queue Oct 3, 2023
Merged via the queue into main with commit 7dfbc5e Oct 3, 2023
github-merge-queue bot pushed a commit that referenced this pull request Oct 3, 2023
🤖 I have created a release *beep* *boop*
---


##
[15.1.0](core-v15.0.2...core-v15.1.0)
(2023-10-03)


### Features

* Implement dynamic L2-to-L1 log tree depth
([#126](#126))
([7dfbc5e](7dfbc5e))
* **vm:** Introduce new way of returning from the tracer
[#2569](#2569)
([#116](#116))
([cf44a49](cf44a49))
* **vm:** Restore system-constants-generator
([#115](#115))
([5e61bdc](5e61bdc))

---
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: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Danil <[email protected]>
@slowli slowli deleted the aov-pla-548-implement-dynamic-l2-l1-log-tree-depth branch October 4, 2023 12:49
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.

3 participants