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

Reject Duplicate Blocks From Being Saved #7044

Merged
merged 2 commits into from
Aug 18, 2020
Merged

Reject Duplicate Blocks From Being Saved #7044

merged 2 commits into from
Aug 18, 2020

Conversation

nisdas
Copy link
Member

@nisdas nisdas commented Aug 18, 2020

What type of PR is this?

Bug Fix

What does this PR do? Why is it needed?

In #7036 , we allow duplicate blocks to be inserted into the pending block cache. This PR fixes that and
makes sure duplicates are rejected.

Which issues(s) does this PR fix?

N.A

Other notes for review

@nisdas nisdas requested a review from a team as a code owner August 18, 2020 10:29
@codecov
Copy link

codecov bot commented Aug 18, 2020

Codecov Report

Merging #7044 into master will decrease coverage by 0.21%.
The diff coverage is 83.33%.

@@            Coverage Diff             @@
##           master    #7044      +/-   ##
==========================================
- Coverage   62.38%   62.17%   -0.22%     
==========================================
  Files         401      401              
  Lines       31510    31389     -121     
==========================================
- Hits        19657    19515     -142     
- Misses       9081     9104      +23     
+ Partials     2772     2770       -2     

Copy link
Contributor

@farazdagi farazdagi left a comment

Choose a reason for hiding this comment

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

Looks good.

NB: I am not sure how resource intensive proto.Equal call is, if it is too resource intensive, then probably we will need to revamp our blocks data structure to use map (and duplicates will just overwrite previous values).

@nisdas nisdas merged commit d81c9ff into master Aug 18, 2020
@farazdagi farazdagi deleted the rejectDuplicates branch August 18, 2020 13:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority: High High priority item
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants