-
Notifications
You must be signed in to change notification settings - Fork 618
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(resharding): state-stats improvements #10119
Conversation
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 you please add the results from execution as well?
tools/state-viewer/src/commands.rs
Outdated
impl Iterator<Item = StateStatsStateRecord> + 'a, | ||
impl FnMut(&StateStatsStateRecord) -> AccountId, | ||
> { | ||
// let iter = chunk_view.iter_flat_state_entries(None, None); |
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: remove
} | ||
} | ||
|
||
// Gets the flat state iterator and groups items by account id. | ||
fn get_state_stats_group_by<'a>( |
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.
Aah this is very clever! Took me some time to understand what's going on, had to read up on the kmerge and group_by functions.
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.
It took me real long to get the types, lifespans and whatnots in order but yeah it's pretty now :)
.field("size", &self.size()) | ||
.finish() | ||
// Finally, group by the account id. | ||
iter.group_by(|state_record| state_record.account_id.clone()) |
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 group_by &state_record.account_id
work here?
Added to the PR description. |
) based on the analysis done in #10119 it's not yet set in stone but it's the most likely candidate so let's set it and test it
results on mainnet