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

Implement more memory efficient deposit merkle tree #5501

Merged
merged 8 commits into from
May 22, 2022

Conversation

ajsutton
Copy link
Contributor

PR Description

Switches our merkle tree implementation to a more memory efficient approach that supports smaller snapshots, as per EIP-4881.

Currently storage is unchanged so we aren't taking actually advantage of the snapshot functionality but still benefit from a reduction in memory and likely slightly improved performance when creating a block with deposits (we create the required deposit tree once instead of dynamically restricting the "view" to create the proof for each deposit included in the block.

The old merkle tree implementation has been moved to testFixtures since it's used in tests (and inlined the abstract parent class since it only had one subclass). This provides confirmation that we're getting the same results with the new and old implementation, but in the future we can probably remove it entirely and just use the one implementation.

Fixed Issue(s)

First step towards #5432

Documentation

  • I thought about documentation and added the doc-change-required label to this PR if updates are required.

Changelog

  • I thought about adding a changelog entry, and added one if I deemed necessary.

Copy link
Contributor

@rolfyone rolfyone left a comment

Choose a reason for hiding this comment

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

LGTM, caveat that discussion about left and code analysis

@ajsutton ajsutton enabled auto-merge (squash) May 22, 2022 23:33
@ajsutton ajsutton disabled auto-merge May 22, 2022 23:33
@ajsutton ajsutton enabled auto-merge (squash) May 22, 2022 23:35
@ajsutton ajsutton merged commit 784799f into Consensys:master May 22, 2022
@ajsutton ajsutton deleted the new-merkle-tree branch May 23, 2022 00:01
ajsutton added a commit to ajsutton/teku that referenced this pull request May 27, 2022
ajsutton added a commit that referenced this pull request May 27, 2022
ajsutton added a commit to ajsutton/teku that referenced this pull request May 27, 2022
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