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

Rename CRDS SnapshotHash to SnapshotHashes #20421

Merged
merged 2 commits into from
Oct 5, 2021

Conversation

brooksprumo
Copy link
Contributor

@brooksprumo brooksprumo commented Oct 4, 2021

In future PRs, I'll be adding new types for handling snapshot hashes. One will be an actual alias (or struct) for SnapshotHash. I'll be using that in bootstrap, snapshot packager service, and gossip. So, to avoid confusion, I'm renaming the SnapshotHash in CRDS to be SnapshotHashes.

Related to #20423

Comment on lines +87 to +88
SnapshotHashes(SnapshotHashes),
AccountsHashes(SnapshotHashes),
Copy link
Contributor Author

@brooksprumo brooksprumo Oct 4, 2021

Choose a reason for hiding this comment

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

In this PR comment (#20374 (comment)), @behzadnouri mentioned that following the naming scheme of (old) SnapshotHashes wasn't the right call. So here's the update to make this better.

Comment on lines +163 to 167
pub struct SnapshotHashes {
pub from: Pubkey,
pub hashes: Vec<(Slot, Hash)>,
pub wallclock: u64,
}
Copy link
Contributor Author

@brooksprumo brooksprumo Oct 4, 2021

Choose a reason for hiding this comment

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

And here's the actual struct. The singular "SnapshotHash" was a little strange to me, since there's a vector of hashes inside...

@brooksprumo brooksprumo marked this pull request as ready for review October 4, 2021 20:10
mvines
mvines previously approved these changes Oct 4, 2021
Copy link
Member

@mvines mvines left a comment

Choose a reason for hiding this comment

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

yay, thank you. The old name has bugged me forever

@brooksprumo
Copy link
Contributor Author

yay, thank you. The old name has bugged me forever

Happy to do so!

@mvines Also, looks like the frozen abi digest changed (test failed). This is another case where changing the digest hash is OK, yes?

@mvines
Copy link
Member

mvines commented Oct 4, 2021

@mvines Also, looks like the frozen abi digest changed (test failed). This is another case where changing the digest hash is OK, yes?

Yep. The name here doesn't make it into the ABI.

But careful in general, some types names do make it into the RPC interface. Those types usually contain a #[serde(rename_all = "camelCase")] directive though.

@mergify mergify bot dismissed mvines’s stale review October 4, 2021 21:02

Pull request has been modified.

@codecov
Copy link

codecov bot commented Oct 4, 2021

Codecov Report

Merging #20421 (804c9e8) into master (9ef1f06) will decrease coverage by 0.0%.
The diff coverage is 95.0%.

@@            Coverage Diff            @@
##           master   #20421     +/-   ##
=========================================
- Coverage    82.8%    82.8%   -0.1%     
=========================================
  Files         485      485             
  Lines      135950   135950             
=========================================
- Hits       112659   112621     -38     
- Misses      23291    23329     +38     

@brooksprumo brooksprumo merged commit 5d141fe into solana-labs:master Oct 5, 2021
@brooksprumo brooksprumo deleted the crds-snapshot-hashes branch October 5, 2021 00:03
dankelleher pushed a commit to identity-com/solana that referenced this pull request Nov 24, 2021
frits-metalogix added a commit to identity-com/solana that referenced this pull request Nov 24, 2021
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.

3 participants