Deneb produce blockv3 (#12708)

Co-authored-by: Radosław Kapka <rkapka@wp.pl>
This commit is contained in:
james-prysm
2023-09-01 05:51:27 -05:00
committed by GitHub
parent 3a8be9fcf8
commit 9a7393a2e3
34 changed files with 8182 additions and 2520 deletions

View File

@@ -27,6 +27,7 @@ go_library(
"//runtime/version:go_default_library",
"@com_github_pkg_errors//:go_default_library",
"@com_github_prysmaticlabs_fastssz//:go_default_library",
"@com_github_sirupsen_logrus//:go_default_library",
"@org_golang_google_protobuf//proto:go_default_library",
],
)

View File

@@ -13,6 +13,7 @@ import (
eth "github.com/prysmaticlabs/prysm/v4/proto/prysm/v1alpha1"
validatorpb "github.com/prysmaticlabs/prysm/v4/proto/prysm/v1alpha1/validator-client"
"github.com/prysmaticlabs/prysm/v4/runtime/version"
log "github.com/sirupsen/logrus"
)
// BeaconBlockIsNil checks if any composite field of input signed beacon block is nil.
@@ -341,10 +342,26 @@ func (b *SignedBeaconBlock) Version() int {
return b.version
}
// IsBlinded metadata on whether a block is blinded
func (b *SignedBeaconBlock) IsBlinded() bool {
return b.block.body.isBlinded
}
// ValueInGwei metadata on the payload value returned by the builder. Value is 0 by default if local.
func (b *SignedBeaconBlock) ValueInGwei() uint64 {
exec, err := b.block.body.Execution()
if err != nil {
log.WithError(err).Warn("failed to retrieve execution payload")
return 0
}
val, err := exec.ValueInGwei()
if err != nil {
log.WithError(err).Warn("failed to retrieve value in gwei")
return 0
}
return val
}
// Header converts the underlying protobuf object from blinded block to header format.
func (b *SignedBeaconBlock) Header() (*eth.SignedBeaconBlockHeader, error) {
if b.IsNil() {

View File

@@ -32,6 +32,7 @@ type ReadOnlySignedBeaconBlock interface {
ssz.Unmarshaler
Version() int
IsBlinded() bool
ValueInGwei() uint64
Header() (*ethpb.SignedBeaconBlockHeader, error)
}

View File

@@ -106,6 +106,10 @@ func (SignedBeaconBlock) Header() (*eth.SignedBeaconBlockHeader, error) {
panic("implement me")
}
func (SignedBeaconBlock) ValueInGwei() uint64 {
panic("implement me")
}
type BeaconBlock struct {
Htr [field_params.RootLength]byte
HtrErr error

View File

@@ -6,6 +6,7 @@ go_library(
"committee_index.go",
"domain.go",
"epoch.go",
"randao.go",
"slot.go",
"sszbytes.go",
"sszuint64.go",

View File

@@ -0,0 +1,3 @@
package primitives
var PointAtInfinity = append([]byte{0xC0}, make([]byte, 95)...)