-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Add DA Check For Data Columns #13938
Conversation
if len(expected) > int(params.BeaconConfig().NumberOfColumns) { | ||
return nil, errMaxDataColumnsExceeded | ||
} | ||
indices, err := bs.Indices(root) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure it works as expected here: indices
is of type [fieldparams.MaxBlobsPerBlock]bool
and fieldparams.MaxBlobsPerBlock == 6
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, great catch will need to fix it
// isDataAvailable blocks until all BlobSidecars committed to in the block are available, | ||
// or an error or context cancellation occurs. A nil result means that the data availability check is successful. | ||
// The function will first check the database to see if all sidecars have been persisted. If any | ||
// sidecars are missing, it will then read from the blobNotifier channel for the given root until the channel is | ||
// closed, the context hits cancellation/timeout, or notifications have been received for all the missing sidecars. | ||
func (s *Service) isDataAvailable(ctx context.Context, root [32]byte, signed interfaces.ReadOnlySignedBeaconBlock) error { | ||
if features.Get().EnablePeerDAS { | ||
return s.isDataAvailableDataColumns(ctx, root, signed) | ||
} | ||
if signed.Version() < version.Deneb { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe create a s.isDataAbiableBlobs
so blobs and data columns are treated equally?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not straightforward due to how we only need a subset of the columns vs all of the blobs. But i can see if its possible
Co-authored-by: Manu NALEPA <enalepa@offchainlabs.com>
@@ -33,4 +33,5 @@ const ( | |||
BlobSize = 131072 // defined to match blob.size in bazel ssz codegen | |||
KzgCommitmentInclusionProofDepth = 17 // Merkle proof depth for blob_kzg_commitments list item | |||
NextSyncCommitteeBranchDepth = 5 // NextSyncCommitteeBranchDepth defines the depth of the next sync committee branch. | |||
NumberOfColumns = 128 // NumberOfColumns refers to the specified number of data columns that can exist in a network. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Defined in cKzg4844.CellsPerExtBlob
. (Should we redefine it here?)
@@ -33,4 +33,5 @@ const ( | |||
BlobSize = 131072 // defined to match blob.size in bazel ssz codegen | |||
KzgCommitmentInclusionProofDepth = 17 // Merkle proof depth for blob_kzg_commitments list item | |||
NextSyncCommitteeBranchDepth = 5 // NextSyncCommitteeBranchDepth defines the depth of the next sync committee branch. | |||
NumberOfColumns = 128 // NumberOfColumns refers to the specified number of data columns that can exist in a network. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Defined in cKzg4844.CellsPerExtBlob
. (Should we redefine it here?)
* Add new DA check * Exit early in the event no commitments exist. * Gazelle * Fix Mock Broadcaster * Fix Test Setup * Update beacon-chain/blockchain/process_block.go Co-authored-by: Manu NALEPA <enalepa@offchainlabs.com> * Manu's Review * Fix Build --------- Co-authored-by: Manu NALEPA <enalepa@offchainlabs.com>
* Add new DA check * Exit early in the event no commitments exist. * Gazelle * Fix Mock Broadcaster * Fix Test Setup * Update beacon-chain/blockchain/process_block.go Co-authored-by: Manu NALEPA <enalepa@offchainlabs.com> * Manu's Review * Fix Build --------- Co-authored-by: Manu NALEPA <enalepa@offchainlabs.com>
* Add new DA check * Exit early in the event no commitments exist. * Gazelle * Fix Mock Broadcaster * Fix Test Setup * Update beacon-chain/blockchain/process_block.go Co-authored-by: Manu NALEPA <enalepa@offchainlabs.com> * Manu's Review * Fix Build --------- Co-authored-by: Manu NALEPA <enalepa@offchainlabs.com>
* Add new DA check * Exit early in the event no commitments exist. * Gazelle * Fix Mock Broadcaster * Fix Test Setup * Update beacon-chain/blockchain/process_block.go Co-authored-by: Manu NALEPA <enalepa@offchainlabs.com> * Manu's Review * Fix Build --------- Co-authored-by: Manu NALEPA <enalepa@offchainlabs.com>
* Add new DA check * Exit early in the event no commitments exist. * Gazelle * Fix Mock Broadcaster * Fix Test Setup * Update beacon-chain/blockchain/process_block.go Co-authored-by: Manu NALEPA <enalepa@offchainlabs.com> * Manu's Review * Fix Build --------- Co-authored-by: Manu NALEPA <enalepa@offchainlabs.com>
* Add new DA check * Exit early in the event no commitments exist. * Gazelle * Fix Mock Broadcaster * Fix Test Setup * Update beacon-chain/blockchain/process_block.go Co-authored-by: Manu NALEPA <enalepa@offchainlabs.com> * Manu's Review * Fix Build --------- Co-authored-by: Manu NALEPA <enalepa@offchainlabs.com>
* Add new DA check * Exit early in the event no commitments exist. * Gazelle * Fix Mock Broadcaster * Fix Test Setup * Update beacon-chain/blockchain/process_block.go Co-authored-by: Manu NALEPA <enalepa@offchainlabs.com> * Manu's Review * Fix Build --------- Co-authored-by: Manu NALEPA <enalepa@offchainlabs.com>
* Add new DA check * Exit early in the event no commitments exist. * Gazelle * Fix Mock Broadcaster * Fix Test Setup * Update beacon-chain/blockchain/process_block.go Co-authored-by: Manu NALEPA <enalepa@offchainlabs.com> * Manu's Review * Fix Build --------- Co-authored-by: Manu NALEPA <enalepa@offchainlabs.com>
* Add new DA check * Exit early in the event no commitments exist. * Gazelle * Fix Mock Broadcaster * Fix Test Setup * Update beacon-chain/blockchain/process_block.go Co-authored-by: Manu NALEPA <enalepa@offchainlabs.com> * Manu's Review * Fix Build --------- Co-authored-by: Manu NALEPA <enalepa@offchainlabs.com>
* Add new DA check * Exit early in the event no commitments exist. * Gazelle * Fix Mock Broadcaster * Fix Test Setup * Update beacon-chain/blockchain/process_block.go Co-authored-by: Manu NALEPA <enalepa@offchainlabs.com> * Manu's Review * Fix Build --------- Co-authored-by: Manu NALEPA <enalepa@offchainlabs.com>
* Add new DA check * Exit early in the event no commitments exist. * Gazelle * Fix Mock Broadcaster * Fix Test Setup * Update beacon-chain/blockchain/process_block.go Co-authored-by: Manu NALEPA <enalepa@offchainlabs.com> * Manu's Review * Fix Build --------- Co-authored-by: Manu NALEPA <enalepa@offchainlabs.com>
* Add new DA check * Exit early in the event no commitments exist. * Gazelle * Fix Mock Broadcaster * Fix Test Setup * Update beacon-chain/blockchain/process_block.go Co-authored-by: Manu NALEPA <enalepa@offchainlabs.com> * Manu's Review * Fix Build --------- Co-authored-by: Manu NALEPA <enalepa@offchainlabs.com>
* Add new DA check * Exit early in the event no commitments exist. * Gazelle * Fix Mock Broadcaster * Fix Test Setup * Update beacon-chain/blockchain/process_block.go Co-authored-by: Manu NALEPA <enalepa@offchainlabs.com> * Manu's Review * Fix Build --------- Co-authored-by: Manu NALEPA <enalepa@offchainlabs.com>
* Add new DA check * Exit early in the event no commitments exist. * Gazelle * Fix Mock Broadcaster * Fix Test Setup * Update beacon-chain/blockchain/process_block.go Co-authored-by: Manu NALEPA <enalepa@offchainlabs.com> * Manu's Review * Fix Build --------- Co-authored-by: Manu NALEPA <enalepa@offchainlabs.com>
* Add new DA check * Exit early in the event no commitments exist. * Gazelle * Fix Mock Broadcaster * Fix Test Setup * Update beacon-chain/blockchain/process_block.go Co-authored-by: Manu NALEPA <enalepa@offchainlabs.com> * Manu's Review * Fix Build --------- Co-authored-by: Manu NALEPA <enalepa@offchainlabs.com>
* Add new DA check * Exit early in the event no commitments exist. * Gazelle * Fix Mock Broadcaster * Fix Test Setup * Update beacon-chain/blockchain/process_block.go Co-authored-by: Manu NALEPA <enalepa@offchainlabs.com> * Manu's Review * Fix Build --------- Co-authored-by: Manu NALEPA <enalepa@offchainlabs.com>
* Add new DA check * Exit early in the event no commitments exist. * Gazelle * Fix Mock Broadcaster * Fix Test Setup * Update beacon-chain/blockchain/process_block.go Co-authored-by: Manu NALEPA <enalepa@offchainlabs.com> * Manu's Review * Fix Build --------- Co-authored-by: Manu NALEPA <enalepa@offchainlabs.com>
* Add new DA check * Exit early in the event no commitments exist. * Gazelle * Fix Mock Broadcaster * Fix Test Setup * Update beacon-chain/blockchain/process_block.go Co-authored-by: Manu NALEPA <enalepa@offchainlabs.com> * Manu's Review * Fix Build --------- Co-authored-by: Manu NALEPA <enalepa@offchainlabs.com>
* Add new DA check * Exit early in the event no commitments exist. * Gazelle * Fix Mock Broadcaster * Fix Test Setup * Update beacon-chain/blockchain/process_block.go Co-authored-by: Manu NALEPA <enalepa@offchainlabs.com> * Manu's Review * Fix Build --------- Co-authored-by: Manu NALEPA <enalepa@offchainlabs.com>
* Add new DA check * Exit early in the event no commitments exist. * Gazelle * Fix Mock Broadcaster * Fix Test Setup * Update beacon-chain/blockchain/process_block.go Co-authored-by: Manu NALEPA <enalepa@offchainlabs.com> * Manu's Review * Fix Build --------- Co-authored-by: Manu NALEPA <enalepa@offchainlabs.com>
* Add new DA check * Exit early in the event no commitments exist. * Gazelle * Fix Mock Broadcaster * Fix Test Setup * Update beacon-chain/blockchain/process_block.go Co-authored-by: Manu NALEPA <enalepa@offchainlabs.com> * Manu's Review * Fix Build --------- Co-authored-by: Manu NALEPA <enalepa@offchainlabs.com>
* Add new DA check * Exit early in the event no commitments exist. * Gazelle * Fix Mock Broadcaster * Fix Test Setup * Update beacon-chain/blockchain/process_block.go Co-authored-by: Manu NALEPA <enalepa@offchainlabs.com> * Manu's Review * Fix Build --------- Co-authored-by: Manu NALEPA <enalepa@offchainlabs.com>
* Add new DA check * Exit early in the event no commitments exist. * Gazelle * Fix Mock Broadcaster * Fix Test Setup * Update beacon-chain/blockchain/process_block.go Co-authored-by: Manu NALEPA <enalepa@offchainlabs.com> * Manu's Review * Fix Build --------- Co-authored-by: Manu NALEPA <enalepa@offchainlabs.com>
* Add new DA check * Exit early in the event no commitments exist. * Gazelle * Fix Mock Broadcaster * Fix Test Setup * Update beacon-chain/blockchain/process_block.go Co-authored-by: Manu NALEPA <enalepa@offchainlabs.com> * Manu's Review * Fix Build --------- Co-authored-by: Manu NALEPA <enalepa@offchainlabs.com>
* Add new DA check * Exit early in the event no commitments exist. * Gazelle * Fix Mock Broadcaster * Fix Test Setup * Update beacon-chain/blockchain/process_block.go Co-authored-by: Manu NALEPA <enalepa@offchainlabs.com> * Manu's Review * Fix Build --------- Co-authored-by: Manu NALEPA <enalepa@offchainlabs.com>
* Add new DA check * Exit early in the event no commitments exist. * Gazelle * Fix Mock Broadcaster * Fix Test Setup * Update beacon-chain/blockchain/process_block.go Co-authored-by: Manu NALEPA <enalepa@offchainlabs.com> * Manu's Review * Fix Build --------- Co-authored-by: Manu NALEPA <enalepa@offchainlabs.com>
What type of PR is this?
Feature Work
What does this PR do? Why is it needed?
As part of the peerDAS P.O.C, this PR modifies our data availability check to ensure that we see the correct amount of data columns from gossip that we are custodied to. In the event we do not, the block fails block processing and is dropped.
Which issues(s) does this PR fix?
N.A
Other notes for review