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

Implement writing down to db for LvmtStore #17

Merged
merged 5 commits into from
Jan 2, 2025
Merged

Conversation

rongma7
Copy link
Contributor

@rongma7 rongma7 commented Dec 31, 2024

This PR implements writing to the database for LvmtStore within the commit function.

  • For amt_node_store, key_value_store, and slot_alloc_store, the corresponding updates are written to their pending parts. Writing to the history part is beyond the scope of LvmtStore.
  • The auth_changes is a KeyValueStoreBulks, which typically only supports appending. Therefore, all commits, even if they are removed but not confirmed, are written to auth_changes, so consider gc_commit elsewhere. To enable committing auth_changes, the Key type of AuthChangeTable should be changed to ChangeKey to allow the auth_changes to satisfy the KeyValueStoreBulksTrait.

Additionally, references to CommitID have been updated to use the type alias, retaining H256 for other purposes.


This change is Reviewable

@rongma7 rongma7 requested a review from ChenxingLi December 31, 2024 08:13
Copy link
Contributor

@ChenxingLi ChenxingLi left a comment

Choose a reason for hiding this comment

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

Reviewed 2 of 3 files at r1, all commit messages.
Reviewable status: 2 of 3 files reviewed, 1 unresolved discussion (waiting on @rongma7)


src/lvmt/storage.rs line 100 at r1 (raw file):

        // - Write to the history part is beyond the range of [`LvmtStore`].
        // - The `auth_changes` in [`LvmtStore`] includes all commits, even if they are removed but not confirmed,
        //   so consider `gc_commit` elsewhere.

Use TODO: comments for future work.

Avoid using markdown-style comments inside function.

Copy link
Contributor Author

@rongma7 rongma7 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: 2 of 3 files reviewed, 1 unresolved discussion (waiting on @ChenxingLi)


src/lvmt/storage.rs line 100 at r1 (raw file):

Previously, ChenxingLi (Chenxing Li) wrote…

Use TODO: comments for future work.

Avoid using markdown-style comments inside function.

Done.

Copy link
Contributor

@ChenxingLi ChenxingLi left a comment

Choose a reason for hiding this comment

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

Reviewed 1 of 1 files at r2, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @rongma7)

@rongma7 rongma7 merged commit 9adcb44 into master Jan 2, 2025
2 checks passed
@rongma7 rongma7 deleted the write_down_to_db branch January 2, 2025 06:56
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.

2 participants