mirror of
https://github.com/OffchainLabs/prysm.git
synced 2026-01-15 02:18:34 -05:00
* 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.
24 lines
726 B
Go
24 lines
726 B
Go
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,
|
|
}
|
|
}
|