mirror of
https://github.com/OffchainLabs/prysm.git
synced 2026-01-08 23:18:15 -05:00
Verified roblobs (#13190)
Co-authored-by: Kasey Kirkham <kasey@users.noreply.github.com> Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
This commit is contained in:
12
runtime/logging/BUILD.bazel
Normal file
12
runtime/logging/BUILD.bazel
Normal file
@@ -0,0 +1,12 @@
|
||||
load("@prysm//tools/go:def.bzl", "go_library")
|
||||
|
||||
go_library(
|
||||
name = "go_default_library",
|
||||
srcs = ["blob.go"],
|
||||
importpath = "github.com/prysmaticlabs/prysm/v4/runtime/logging",
|
||||
visibility = ["//visibility:public"],
|
||||
deps = [
|
||||
"//consensus-types/blocks:go_default_library",
|
||||
"@com_github_sirupsen_logrus//:go_default_library",
|
||||
],
|
||||
)
|
||||
20
runtime/logging/blob.go
Normal file
20
runtime/logging/blob.go
Normal file
@@ -0,0 +1,20 @@
|
||||
package logging
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/prysmaticlabs/prysm/v4/consensus-types/blocks"
|
||||
"github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
// BlobFields extracts a standard set of fields from a BlobSidecar into a logrus.Fields struct
|
||||
// which can be passed to log.WithFields.
|
||||
func BlobFields(blob blocks.ROBlob) logrus.Fields {
|
||||
return logrus.Fields{
|
||||
"slot": blob.Slot(),
|
||||
"proposerIndex": blob.ProposerIndex(),
|
||||
"blockRoot": fmt.Sprintf("%#x", blob.BlockRoot()),
|
||||
"kzgCommitment": fmt.Sprintf("%#x", blob.KzgCommitment),
|
||||
"index": blob.Index,
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user