-
Notifications
You must be signed in to change notification settings - Fork 11.3k
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
Verify archive state using a one shot in memory store #12730
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 6 Ignored Deployments
|
{ | ||
let mut locked = self.0 .0.write().unwrap(); | ||
locked.checkpoints.clear(); | ||
locked.sequence_number_to_digest.clear(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
delete all previous checkpoints when we add new one
locked.transactions.clear(); | ||
locked.effects.clear(); | ||
locked.contents_digest_to_sequence_number.clear(); | ||
locked.full_checkpoint_contents.clear(); | ||
locked.checkpoint_contents.clear(); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
delete all previous content when we add new one
6ab6ebe
to
8262c7a
Compare
crates/sui-types/src/storage.rs
Outdated
} | ||
|
||
fn insert_committee(&self, new_committee: Committee) -> Result<(), Self::Error> { | ||
self.0.insert_committee(new_committee)?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: just self.0.insert_committee(new_committee)
instead of two lines method should work
crates/sui-types/src/storage.rs
Outdated
@@ -969,3 +969,138 @@ impl Display for DeleteKind { | |||
} | |||
} | |||
} | |||
|
|||
#[derive(Clone, Debug, Default)] | |||
pub struct OneShotSharedInMemoryStore(SharedInMemoryStore); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: maybe SingleCheckpointInMemoryStore
? and a small comment why do we need one
crates/sui-types/src/storage.rs
Outdated
} | ||
} | ||
|
||
impl ReadStore for OneShotSharedInMemoryStore { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would be nice to avoid all the boilerplate code, but not a blocker.
We could use delegate crate or add a capacity parameter to original InMemoryStore(with default setting of u64::MAX)
26a0b42
to
16fe3d9
Compare
16fe3d9
to
03c4291
Compare
## Description Added a shared in memory store which only keeps last checkpoint and its content in memory. This helps iterate over checkpoints really fast as we don't need to use a db and can run verification without writing to rocksdb ever. ## Test Plan Added unit tests
## Description Added a shared in memory store which only keeps last checkpoint and its content in memory. This helps iterate over checkpoints really fast as we don't need to use a db and can run verification without writing to rocksdb ever. ## Test Plan Added unit tests
Description
Added a shared in memory store which only keeps last checkpoint and its content in memory. This helps iterate over checkpoints really fast as we don't need to use a db and can run verification without writing to rocksdb ever.
Test Plan
Added unit tests