prysm-pulse/runtime/logging/blob.go
kasey 4008ea736f
Verify roblobs (#13245)
* scaffolding for verification package

* WIP blob verification methods

* lock wrapper for safer forkchoice sharing

* more solid cache and verification designs; adding tests

* more test coverage, adding missing cache files

* clearer func name

* remove forkchoice borrower (it's in another PR)

* revert temporary interface experiment

* lint

* nishant feedback

* add comments with spec text to all verifications

* some comments on public methods

* invert confusing verification name

* deep source

* remove cache from ProposerCache + gaz

* more consistently early return on error paths

* messed up the test with the wrong config value

* terence naming feedback

* tests on BeginsAt

* lint

* deep source...

* name errors after failure, not expectation

* deep sooource

* check len()==0 instead of nil so empty lists work

* update test for EIP-7044

---------

Co-authored-by: Kasey Kirkham <kasey@users.noreply.github.com>
2023-12-07 02:36:25 +00:00

22 lines
628 B
Go

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(),
"proposer_index": blob.ProposerIndex(),
"block_root": fmt.Sprintf("%#x", blob.BlockRoot()),
"parent_root": fmt.Sprintf("%#x", blob.ParentRoot()),
"kzg_commitment": fmt.Sprintf("%#x", blob.KzgCommitment),
"index": blob.Index,
}
}