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

Better dupe detection #13992

Merged
merged 1 commit into from
Dec 10, 2020
Merged

Better dupe detection #13992

merged 1 commit into from
Dec 10, 2020

Conversation

sakridge
Copy link
Member

@sakridge sakridge commented Dec 7, 2020

Problem

Duplicate shred cases ignored.

Summary of Changes

Set in duplicate column and ignore on voting.

Fixes #

@sakridge sakridge force-pushed the shred-dupe branch 4 times, most recently from 754f356 to ffc90c7 Compare December 8, 2020 00:32
@codecov
Copy link

codecov bot commented Dec 8, 2020

Codecov Report

Merging #13992 (5b29abb) into master (28b014c) will increase coverage by 0.0%.
The diff coverage is 89.4%.

@@           Coverage Diff            @@
##           master   #13992    +/-   ##
========================================
  Coverage    82.1%    82.1%            
========================================
  Files         381      381            
  Lines       93793    93930   +137     
========================================
+ Hits        77020    77187   +167     
+ Misses      16773    16743    -30     

@sakridge sakridge marked this pull request as ready for review December 8, 2020 17:04
@sakridge sakridge requested a review from carllin December 8, 2020 17:19
@sakridge sakridge added the v1.4 label Dec 8, 2020
ledger/src/blockstore.rs Outdated Show resolved Hide resolved
let mut conflicting_shred = None;
for coding_index in coding_start..coding_end {
if let Ok(Some(shred)) = self.get_coding_shred(slot, coding_index) {
conflicting_shred = Some(shred);
Copy link
Contributor

@carllin carllin Dec 8, 2020

Choose a reason for hiding this comment

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

Before we store the duplicate proof, should we add a sanity check here that this conflicting_shred has

  1. a different num_data_shreds() or num_coding_shreds than the newly received shred
  2. The same fec_set_index

@@ -1051,6 +1051,26 @@ impl Blockstore {
});

if erasure_config != erasure_meta.config {
let coding_start = erasure_meta.first_coding_index;
Copy link
Contributor

Choose a reason for hiding this comment

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

I just realized that the erasure_config != erasure_meta.config check doesn't account for first_coding_index in ErasureMeta, maybe this: https://github.com/solana-labs/solana/pull/13992/files#diff-01b72272fd1033dcbb8fed13821a6232d35913119af6be20a7c2d1e9c772feb9R1037 should be an ErasureMeta so we can do a full equality check

Copy link
Member Author

Choose a reason for hiding this comment

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

ah, good catch

ledger/src/blockstore.rs Outdated Show resolved Hide resolved
@sakridge sakridge force-pushed the shred-dupe branch 7 times, most recently from cb62622 to b7c974a Compare December 9, 2020 21:12
@sakridge sakridge merged commit c5fe076 into solana-labs:master Dec 10, 2020
@sakridge sakridge deleted the shred-dupe branch December 10, 2020 07:14
mergify bot pushed a commit that referenced this pull request Dec 10, 2020
(cherry picked from commit c5fe076)
mergify bot added a commit that referenced this pull request Dec 10, 2020
(cherry picked from commit c5fe076)

Co-authored-by: sakridge <[email protected]>
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.

4 participants