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

Make database capable of not having the complete storage #1476

Merged
merged 21 commits into from
Dec 17, 2023

Conversation

tomaka
Copy link
Contributor

@tomaka tomaka commented Dec 17, 2023

cc #131

Right now, for each block in the database, either the storage is entirely present or it is entirely absent.

In lights of #131 (comment), it is desirable to allow downloading the storage of a block over time.
In order to achieve, the database now supports inserting individual trie nodes, the idea being that we progressively download the missing trie nodes and insert them in the database over time.
When accessing the storage of a block, the database will now try to fulfill the request with what it has, and return an error if it doesn't have enough.

This PR actually overall simplifies the API of the database, as it removes some unclear corner cases related to inserting the storage of a block.

@tomaka
Copy link
Contributor Author

tomaka commented Dec 17, 2023

This PR also fixes a bug where the branch_nodes parameter of block_storage_next_key wasn't working properly (the database test was wrong and has been fixed).
For this reason, some JSON-RPC tests are failing.

@tomaka tomaka added this pull request to the merge queue Dec 17, 2023
Merged via the queue into smol-dot:main with commit 6e9dd24 Dec 17, 2023
@tomaka tomaka deleted the db-storage-optional branch December 17, 2023 10:05
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