mirror of
https://github.com/OffchainLabs/prysm.git
synced 2026-01-09 15:37:56 -05:00
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:
@@ -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 = [
|
||||
|
||||
23
runtime/logging/data_column.go
Normal file
23
runtime/logging/data_column.go
Normal 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,
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user