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

K, V Iterator for DbSnapshot #1177

Merged
merged 13 commits into from
Nov 29, 2023
Merged

Conversation

citizen-stig
Copy link
Member

@citizen-stig citizen-stig commented Nov 23, 2023

Description

DbSnapshot struct suppose to swap DB in state_db and native_db, so they can work on top of snapshots.
This PR adds 2 methods to DbSnapshot struct:

  • get_largest - returns the value of the largest key in the schema
  • get_prev - returns the value of the key, that is equal or lower that the given

Secondary changes

  • Move SchemaBatch into its own file
  • Replace HashMap in for BTreeMap inside ScemaBatch, so keys are sorted inside single snapshot
  • Add new method to QueryManager trait, that allows to iterate over all key value pairs in reverse order.

Linked Issues

Testing

Unit and integration tests have been added.

Docs

Docs on public methods have been added.

@citizen-stig citizen-stig self-assigned this Nov 23, 2023
Copy link

codecov bot commented Nov 27, 2023

Codecov Report

Merging #1177 (1a22011) into nightly (1307350) will increase coverage by 1.6%.
Report is 8 commits behind head on nightly.
The diff coverage is 97.3%.

Additional details and impacted files
Files Coverage Δ
adapters/mock-da/src/types/mod.rs 80.6% <100.0%> (+7.5%) ⬆️
full-node/db/sov-db/src/schema/tables.rs 86.4% <ø> (ø)
full-node/db/sov-schema-db/src/iterator.rs 98.6% <100.0%> (+0.4%) ⬆️
full-node/db/sov-schema-db/src/lib.rs 91.5% <100.0%> (-1.2%) ⬇️
full-node/db/sov-schema-db/src/schema_batch.rs 100.0% <100.0%> (ø)
full-node/db/sov-schema-db/src/test.rs 100.0% <100.0%> (ø)
rollup-interface/src/state_machine/da.rs 84.7% <ø> (ø)
adapters/avail/src/spec/hash.rs 0.0% <0.0%> (ø)
...de/sov-prover-storage-manager/src/dummy_storage.rs 96.5% <96.5%> (ø)
...sov-prover-storage-manager/src/snapshot_manager.rs 99.1% <99.1%> (ø)
... and 2 more

... and 15 files with indirect coverage changes

@citizen-stig citizen-stig changed the title Integrating snapshotable storage K, V Iterator for DbSnapshot Nov 27, 2023
@citizen-stig citizen-stig marked this pull request as ready for review November 29, 2023 11:20
@citizen-stig citizen-stig added this pull request to the merge queue Nov 29, 2023
Merged via the queue into nightly with commit bf28a91 Nov 29, 2023
15 checks passed
@citizen-stig citizen-stig deleted the nikolai/snapshots_integration branch November 29, 2023 19:37
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.

Data Availability re-orgs handling tracking issue Storage should support nested snapshots
2 participants