Skip to content

v1.18: blockstore: always send a coding shred for chained merkle root conflicts (backport of #1353)#1594

Closed
mergify[bot] wants to merge 2 commits intov1.18from
mergify/bp/v1.18/pr-1353
Closed

v1.18: blockstore: always send a coding shred for chained merkle root conflicts (backport of #1353)#1594
mergify[bot] wants to merge 2 commits intov1.18from
mergify/bp/v1.18/pr-1353

Conversation

@mergify
Copy link
Copy Markdown

@mergify mergify Bot commented Jun 4, 2024

Problem

#835 has a chance to send a chained merkle root conflict duplicate proof consisting of 2 data shreds.
With 2 data shreds we cannot verify that they are from adjacent FEC sets. We require that the shred from the lower FEC set be a coding shred.

Summary of Changes

  • Modify the backwards check to always send the coding shred from lower FEC set. We know this is available because there must be an erasure meta.
  • Modify tests to check the upgrade scenario, where the first received coding shred index is not reliable (skip the check in this case).

This ensures that we always send a coding shred for the lower FEC set, meaning the gossip handler can verify that duplicate proofs are for adjacent FEC sets.
Without this verification an attacker can arbitrarily pick non adjacent FEC sets to "prove" that every block is duplicate

Contributes to solana-labs#34897


This is an automatic backport of pull request #1353 done by Mergify.

…cts (#1353)

* blockstore: always send a coding shred for chained merkle root conflicts

* pr feedback: return ErasureMeta

* fix format string indentation

(cherry picked from commit ecb491c)

# Conflicts:
#	ledger/src/blockstore.rs
@mergify mergify Bot requested a review from a team as a code owner June 4, 2024 18:22
@mergify mergify Bot added the conflicts label Jun 4, 2024
@mergify
Copy link
Copy Markdown
Author

mergify Bot commented Jun 4, 2024

Cherry-pick of ecb491c has failed:

On branch mergify/bp/v1.18/pr-1353
Your branch is up to date with 'origin/v1.18'.

You are currently cherry-picking commit ecb491c392.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Changes to be committed:
	modified:   ledger/src/blockstore_meta.rs

Unmerged paths:
  (use "git add <file>..." to mark resolution)
	both modified:   ledger/src/blockstore.rs

To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally

@AshwinSekar
Copy link
Copy Markdown

This backport fixes a bug in the previous change #1009. The previous change allowed a duplicate proof to be created with a data shred, which is unverifiable through gossip. This prevents the feature flag for chained merkle root duplicate proofs from being turned on.

With this change, we modify the proof creation to always use a coding shred. We ignore and log if any errors are encountered, and there are tests verifying that upgrading from an older blockstore does not cause any panics.

@AshwinSekar AshwinSekar closed this Aug 1, 2024
@mergify mergify Bot deleted the mergify/bp/v1.18/pr-1353 branch August 1, 2024 15:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants