Skip to content
This repository was archived by the owner on Jan 22, 2025. It is now read-only.

Save RNG for generating random storage sampling offsets #4450

Merged
merged 5 commits into from
May 28, 2019

Conversation

pgarg66
Copy link
Contributor

@pgarg66 pgarg66 commented May 28, 2019

Problem

Replicators are supposed to generate new samples of the segment they're storing. Currently they seem to be coming up with the same sampled hash every time.

Summary of Changes

Save RNG so that a new random number is generated.

Fixes #4353

@pgarg66
Copy link
Contributor Author

pgarg66 commented May 28, 2019

@sagar-solana FYI

@sagar-solana
Copy link
Contributor

sagar-solana commented May 28, 2019

Cool, looks good. We'll need to integrate with storage stage as well at some point but this should be fine for now.

@codecov
Copy link

codecov bot commented May 28, 2019

Codecov Report

Merging #4450 into master will increase coverage by 1.8%.
The diff coverage is 58.3%.

@@           Coverage Diff            @@
##           master   #4450     +/-   ##
========================================
+ Coverage    77.5%   79.3%   +1.8%     
========================================
  Files         176     176             
  Lines       31970   31286    -684     
========================================
+ Hits        24789   24824     +35     
+ Misses       7181    6462    -719

@pgarg66 pgarg66 marked this pull request as ready for review May 28, 2019 20:42
@pgarg66 pgarg66 requested a review from sagar-solana May 28, 2019 20:43
@pgarg66 pgarg66 requested a review from sakridge May 28, 2019 20:50
@@ -457,6 +466,7 @@ impl Replicator {
self.hash,
self.slot,
Signature::new(&self.signature.to_bytes()),
proof_index,
Copy link
Contributor

Choose a reason for hiding this comment

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

What is proof_index for?

Copy link
Contributor Author

@pgarg66 pgarg66 May 28, 2019

Choose a reason for hiding this comment

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

It can be used by the new validators to figure out how many random numbers to generate before they can start validating replicator proofs (i.e. catch up to replicator's random number)

Copy link
Contributor

Choose a reason for hiding this comment

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

Ok. I see, it could allow for missing transactions.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Replicator storage samples are not randomized
3 participants