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

Aggressive fan out #366

Closed
wants to merge 4 commits into from
Closed

Aggressive fan out #366

wants to merge 4 commits into from

Conversation

Scooletz
Copy link
Contributor

@Scooletz Scooletz commented Jun 28, 2024

This PR changes the fanout behavior for Id, Storage and Storage Merkle subtrees of the database, increasing the fanout, decreasing the application time of a block and decreasing the speed of querying the database.

Before this PR all the these trees used a FanOutList that consumed 2 nibbles. It was then followed by a FanOutPage that consumed 2 more but already introduced some SlottedArray buffering and copying over.

With this PR the FanOutList is replaced with a component that consumes 4 nibbles out of the path. This is done by using 64 pages as raw content (no header no nothing) that allows to store addresses of 4 nibbles = 16 * 16 * 16 * 16. To deal with COW management, a special vector (long, 64 bits) is added to mark pages as cowed or not as the pages are treated as raw.

In result all the queries against Id, Storage and Storage Merkle have at least one less page to query (FanOutPage). All the writes to these have also one less page to write through. It's worth to mention that for Ids, that represent accounts with some storage (contracts), this might allow to have a lookup of depth of 1 or 2 only.

Copy link

Code Coverage

Package Line Rate Branch Rate Health
Paprika 83% 77%
Summary 83% (4115 / 4949) 77% (1302 / 1686)

Minimum allowed line rate is 75%

@Scooletz Scooletz added 💥Breaking The change introduces a storage breaking change. 🐌 performance Perofrmance related issue labels Jun 28, 2024
@Scooletz Scooletz mentioned this pull request Jul 16, 2024
@Scooletz
Copy link
Contributor Author

Scooletz commented Sep 4, 2024

Substituted by #375

@Scooletz Scooletz closed this Sep 4, 2024
@Scooletz Scooletz deleted the aggressive-fan-out branch September 4, 2024 12:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💥Breaking The change introduces a storage breaking change. 🐌 performance Perofrmance related issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant