Implement data column sidecars verifications. (#15232)

* Logging: Add `DataColumnFields`.

* `RODataColumn`: Implement `Slot`, `ParentRoot` and `ProposerIndex`.

* Implement verification for data column sidecars.

* Add changelog.

* Fix Terence's comment.

* Fix Terence's comment.

* `SidecarProposerExpected`: Stop returning "sidecar was not proposed by the expected proposer_index" when there is any error in the function.

* `SidecarProposerExpected` & `ValidProposerSignature`: Cache the parent state.

* `VerifyDataColumnsSidecarKZGProofs`: Add benchmarks.

* Fix Kasey's comment.

* Add additional benchmark.

* Fix Kasey's comment.

* Fix Kasey's comment.

* Fix Kasey's comment.

* Fix Preston's comment.

* Fix Preston's comment.

* Fix Preston's comment.
This commit is contained in:
Manu NALEPA
2025-05-20 23:15:29 +02:00
committed by GitHub
parent fa744ff78f
commit 3d4e2c5568
25 changed files with 2098 additions and 49 deletions

View File

@@ -2,7 +2,10 @@ load("@prysm//tools/go:def.bzl", "go_library")
go_library(
name = "go_default_library",
srcs = ["blob.go"],
srcs = [
"blob.go",
"data_column.go",
],
importpath = "github.com/OffchainLabs/prysm/v6/runtime/logging",
visibility = ["//visibility:public"],
deps = [

View File

@@ -0,0 +1,23 @@
package logging
import (
"fmt"
"github.com/OffchainLabs/prysm/v6/consensus-types/blocks"
"github.com/sirupsen/logrus"
)
// DataColumnFields extracts a standard set of fields from a DataColumnSidecar into a logrus.Fields struct
// which can be passed to log.WithFields.
func DataColumnFields(column blocks.RODataColumn) logrus.Fields {
kzgCommitmentCount := len(column.KzgCommitments)
return logrus.Fields{
"slot": column.Slot(),
"propIdx": column.ProposerIndex(),
"blockRoot": fmt.Sprintf("%#x", column.BlockRoot())[:8],
"parentRoot": fmt.Sprintf("%#x", column.ParentRoot())[:8],
"kzgCommitmentCount": kzgCommitmentCount,
"colIdx": column.Index,
}
}