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

Root page separates abandoned #363

Merged
merged 5 commits into from
Jun 26, 2024
Merged

Root page separates abandoned #363

merged 5 commits into from
Jun 26, 2024

Conversation

Scooletz
Copy link
Contributor

@Scooletz Scooletz commented Jun 25, 2024

This PR changes the structure of the root pages in Paprika database.

Previously, each root occupied just one page (4kb). The number of root pages was defined by the historyDepth so that the first pages in the database were: [root0, root1, ..., rootN, regular0, regular1, ...] where N = historyDepth.

This PR changes this structure expanding each root page and allowing to make it of size 2*PageSize (8kb) or even bigger in the future. The changes needed for atomicity are still preserved in the first page, while the second is used as an extension. This makes the first pages in db look like the following: [root0a, root0b, root1a, root1b, ..., rootNa, rootNb].

This extension allows to change the root structure to the following:

  1. 0th page:
    1. metadata - metadata of the root
    2. state - the address of the state root page
    3. ids - a fanout list
    4. storage - a fanout list
    5. storage merkle - a fanout list
  2. 1th page:
    1. abandoned page list - full 4 kb

where a fanout list is a list of 256 addresses (1kb in total) that consumes 2 nibbles from the path.

Copy link

Code Coverage

Package Line Rate Branch Rate Health
Paprika 85% 80%
Summary 85% (4193 / 4920) 80% (1346 / 1680)

Minimum allowed line rate is 75%

@Scooletz Scooletz marked this pull request as ready for review June 26, 2024 10:44
@Scooletz Scooletz merged commit 77eb75f into main Jun 26, 2024
2 checks passed
@Scooletz Scooletz deleted the root-page-separate-abandoned branch June 26, 2024 10:44
Scooletz added a commit that referenced this pull request Jul 8, 2024
Scooletz added a commit that referenced this pull request Jul 8, 2024
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.

1 participant