Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Docs
  • Loading branch information
arkpar committed Dec 14, 2022
commit 8b07d49966a9cd0e35123bdcc545f9e63b1e5637
2 changes: 1 addition & 1 deletion client/state-db/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -577,7 +577,7 @@ impl<BlockHash: Hash, Key: Hash, D: MetaDb> StateDb<BlockHash, Key, D> {
self.db.write().unpin(hash)
}

/// Confirm that all changes made to commit sets are on disk. Allow for temporarily pinned
/// Confirm that all changes made to commit sets are on disk. Allows for temporarily pinned
/// blocks to be released.
pub fn sync(&self) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe rename sync method with commit_cannonicals or something more related to commit_operation (commit_synch maybe).

Copy link
Member Author

Choose a reason for hiding this comment

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

I went for a more general name. It basically means that the in-memory state is synchronized with the on-disk state.

self.db.write().sync()
Expand Down
2 changes: 2 additions & 0 deletions client/state-db/src/noncanonical.rs
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,8 @@ impl<BlockHash: Hash, Key: Hash> NonCanonicalOverlay<BlockHash, Key> {
self.last_canonicalized.as_ref().map(|&(_, n)| n)
}

/// Confirm that all changes made to commit sets are on disk. Allows for temporarily pinned
/// blocks to be released.
pub fn sync(&mut self) {
let mut pinned = std::mem::take(&mut self.pinned_canonincalized);
for hash in pinned.iter() {
Expand Down