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

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

Open
wants to merge 2 commits into
base: v1.18
Choose a base branch
from

Conversation

mergify[bot]
Copy link

@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
Copy link
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

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.

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.

None yet

2 participants