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

Add DbSnapshot to sov-db-schema #1112

Merged
merged 12 commits into from
Oct 30, 2023
Merged

Conversation

citizen-stig
Copy link
Member

@citizen-stig citizen-stig commented Oct 26, 2023

Description

This PR adds: DbSnapshot, a wrapper around sov_schema_db::DB, which has it's local cache in form of adapted SchemaBatch and link to QueryManager. This allows DbSnapshot read/write value to local cache, fetch them from parent snapshots or directly from DB.

Please note, that this functionality is added, but it is not integrated. Next step would be modifying StateDB, NativeDB and LedgerDB to work with DbSnapshot instead of DB directly.

Main modifications:

Linked Issues

Testing

New integration test has been added to test snapshot

Docs

Documentation to the new modules have been added

@citizen-stig citizen-stig self-assigned this Oct 26, 2023
@codecov
Copy link

codecov bot commented Oct 27, 2023

Codecov Report

Merging #1112 (693724f) into nightly (8b4eb37) will increase coverage by 0.1%.
Report is 4 commits behind head on nightly.
The diff coverage is 93.5%.

Files Coverage Δ
full-node/db/sov-db/src/native_db.rs 100.0% <100.0%> (ø)
full-node/db/sov-schema-db/src/lib.rs 92.7% <96.7%> (+4.1%) ⬆️
full-node/db/sov-schema-db/src/snapshot.rs 92.1% <92.1%> (ø)

... and 2 files with indirect coverage changes

@citizen-stig citizen-stig changed the title sov-db-schema with snapshots Add DbSnapshot to sov-db-schema` Oct 27, 2023
@citizen-stig citizen-stig marked this pull request as ready for review October 27, 2023 10:35
@citizen-stig citizen-stig changed the title Add DbSnapshot to sov-db-schema` Add DbSnapshot to sov-db-schema Oct 27, 2023
Copy link
Member

@neysofu neysofu left a comment

Choose a reason for hiding this comment

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

LGTM!

@citizen-stig citizen-stig added this pull request to the merge queue Oct 30, 2023
Merged via the queue into nightly with commit 6f7cb3d Oct 30, 2023
15 checks passed
@citizen-stig citizen-stig deleted the nikolai/sov_db_with_snapshots branch October 30, 2023 12:12
@citizen-stig citizen-stig linked an issue Dec 21, 2023 that may be closed by this pull request
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.

Storage should support nested snapshots
3 participants