-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Move DoStateCheckpoint off critical path #15411
base: main
Are you sure you want to change the base?
Conversation
⏱️ 2h 52m total CI duration on this PR
|
0eb8d0e
to
ddaade9
Compare
6c4828a
to
6bc9a36
Compare
ae365d6
to
9e9964b
Compare
550a066
to
d59dead
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
✅ Forge suite
|
✅ Forge suite
|
/// the current state and the last checkpoint. shared with outside world. | ||
current_state: Arc<Mutex<LedgerStateWithSummary>>, | ||
/// The most recent checkpoint sent for persistence, not guaranteed to have committed already. | ||
last_snapshot: StateWithSummary, |
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.
here, it is called snapshot, while it is called checkpoint in current_state. maybe rename this to last_persisting_checkpoint to be consistent?
target_items: usize, | ||
current_state: Arc<Mutex<CurrentState>>, | ||
persisted_state: Arc<Mutex<PersistedState>>, | ||
out_current_state: Arc<Mutex<LedgerStateWithSummary>>, |
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: what does "out_" mean?
state_commit_sender: SyncSender<CommitMessage<StateWithSummary>>, | ||
/// Estimated number of items in the buffer. | ||
estimated_items: usize, | ||
/// The target number of items in the buffer between commits. | ||
target_items: usize, |
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.
could target_item be a const instead of a field of bufferedstate?
@@ -354,7 +356,7 @@ pub trait DbReader: Send + Sync { | |||
/// Returns the proof of the given state key and version. | |||
fn get_state_proof_by_version_ext( | |||
&self, | |||
state_key: &StateKey, | |||
key: &HashValue, |
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.
name it as state_key to be explicit ?
|
||
pub struct StateUpdateRefs<'kv> { | ||
pub per_version: PerVersionStateUpdateRefs<'kv>, | ||
pub for_last_checkpoint: Option<BatchedStateUpdateRefs<'kv>>, |
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: "updates_till_last_checkpoint" could be more intuitive?
pub struct StateUpdateRefs<'kv> { | ||
pub per_version: PerVersionStateUpdateRefs<'kv>, | ||
pub for_last_checkpoint: Option<BatchedStateUpdateRefs<'kv>>, | ||
pub for_latest: Option<BatchedStateUpdateRefs<'kv>>, |
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: updates_after_last_checkpoint?
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.
parse through half of the changes. mainly naming suggestions. feel free to drop them
Description
struct State
to represent the speculative state, utilizing the LayeredMap / MapLayerState
.Todo: move it further to a sepate stage.
How Has This Been Tested?
existing coverage
Key Areas to Review
Type of Change
Which Components or Systems Does This Change Impact?
[x] Validator