mirror of
https://github.com/OffchainLabs/prysm.git
synced 2026-01-08 23:18:15 -05:00
Deneb produce blockv3 (#12708)
Co-authored-by: Radosław Kapka <rkapka@wp.pl>
This commit is contained in:
@@ -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",
|
||||
],
|
||||
)
|
||||
|
||||
@@ -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() {
|
||||
|
||||
@@ -32,6 +32,7 @@ type ReadOnlySignedBeaconBlock interface {
|
||||
ssz.Unmarshaler
|
||||
Version() int
|
||||
IsBlinded() bool
|
||||
ValueInGwei() uint64
|
||||
Header() (*ethpb.SignedBeaconBlockHeader, error)
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -6,6 +6,7 @@ go_library(
|
||||
"committee_index.go",
|
||||
"domain.go",
|
||||
"epoch.go",
|
||||
"randao.go",
|
||||
"slot.go",
|
||||
"sszbytes.go",
|
||||
"sszuint64.go",
|
||||
|
||||
3
consensus-types/primitives/randao.go
Normal file
3
consensus-types/primitives/randao.go
Normal file
@@ -0,0 +1,3 @@
|
||||
package primitives
|
||||
|
||||
var PointAtInfinity = append([]byte{0xC0}, make([]byte, 95)...)
|
||||
Reference in New Issue
Block a user