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

feat(storage): store thin state diff in a file #1290

Merged
merged 3 commits into from
Oct 23, 2023

Conversation

dan-starkware
Copy link
Collaborator

@dan-starkware dan-starkware commented Oct 19, 2023

Pull Request type

Please check the type of change your PR introduces:

  • Bugfix
  • Feature
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no API changes)
  • Build-related changes
  • Documentation content changes
  • Other (please describe):

What is the current behavior?

Issue Number: N/A

What is the new behavior?

Does this introduce a breaking change?

  • Yes
  • No

Other information


This change is Reviewable

@codecov
Copy link

codecov bot commented Oct 19, 2023

Codecov Report

Merging #1290 (d13cde1) into main (9f695fc) will increase coverage by 0.13%.
The diff coverage is 77.34%.

@@            Coverage Diff             @@
##             main    #1290      +/-   ##
==========================================
+ Coverage   72.42%   72.55%   +0.13%     
==========================================
  Files          84       84              
  Lines        8144     8257     +113     
  Branches     8144     8257     +113     
==========================================
+ Hits         5898     5991      +93     
+ Misses       1309     1305       -4     
- Partials      937      961      +24     
Files Coverage Δ
crates/papyrus_storage/src/db/mod.rs 83.87% <100.00%> (ø)
crates/papyrus_storage/src/serializers.rs 84.32% <100.00%> (+0.07%) ⬆️
crates/papyrus_storage/src/compiled_class.rs 67.64% <60.00%> (-1.11%) ⬇️
crates/papyrus_storage/src/state/mod.rs 77.62% <76.92%> (-0.05%) ⬇️
crates/papyrus_storage/src/mmap_file/mod.rs 79.23% <76.31%> (+7.65%) ⬆️
crates/papyrus_storage/src/lib.rs 64.73% <77.94%> (+6.33%) ⬆️

... and 1 file with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Copy link
Contributor

@yair-starkware yair-starkware left a comment

Choose a reason for hiding this comment

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

Reviewed 9 of 10 files at r1, 1 of 4 files at r2, 3 of 3 files at r3, all commit messages.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @dan-starkware)


crates/papyrus_storage/src/lib.rs line 527 at r1 (raw file):

                .ok_or(StorageError::DBInconsistency {
                    msg: format!("ThinStateDiff at location {:?} not found.", location),
                })?),

I think you should return None instead of an error.

Code quote:

                .ok_or(StorageError::DBInconsistency {
                    msg: format!("ThinStateDiff at location {:?} not found.", location),
                })?),

crates/papyrus_storage/src/lib.rs line 532 at r1 (raw file):

                .get(location)?
                .ok_or(StorageError::DBInconsistency {
                    msg: format!("ThinStateDiff at location {:?} not found.", location),

same

Code quote:

                .ok_or(StorageError::DBInconsistency {
                    msg: format!("ThinStateDiff at location {:?} not found.", location),

crates/papyrus_storage/src/lib.rs line 546 at r3 (raw file):

            FileAccess::Writers(file_writers) => file_writers.thin_state_diff.flush(),
        }
    }

Shouldn't this be async func?

Code quote:

    fn flush(&self) {
        match self {
            FileAccess::Readers(_) => (),
            FileAccess::Writers(file_writers) => file_writers.thin_state_diff.flush(),
        }
    }

Copy link
Collaborator Author

@dan-starkware dan-starkware left a comment

Choose a reason for hiding this comment

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

Reviewable status: 8 of 12 files reviewed, 1 unresolved discussion (waiting on @yair-starkware)


crates/papyrus_storage/src/lib.rs line 546 at r3 (raw file):

Previously, yair-starkware (Yair) wrote…

Shouldn't this be async func?

Done.

@dan-starkware dan-starkware changed the title Dan/storage/mmap usage sd feat(storage): store thin state diff in a file Oct 23, 2023
Copy link
Contributor

@yair-starkware yair-starkware left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewed 1 of 4 files at r5, 3 of 3 files at r6, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @dan-starkware)

@dan-starkware dan-starkware added this pull request to the merge queue Oct 23, 2023
Merged via the queue into main with commit a9d0411 Oct 23, 2023
36 of 37 checks passed
@dan-starkware dan-starkware deleted the dan/storage/mmap-usage-sd branch October 23, 2023 11:54
@github-actions github-actions bot locked and limited conversation to collaborators Oct 25, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants