Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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, ...]
whereN = 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:
where a
fanout list
is a list of 256 addresses (1kb in total) that consumes 2 nibbles from the path.