Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
262501c
Add deneb protobufs (#12363)
terencechain May 5, 2023
e7bbcc7
Add deneb block to consensus types (#12368)
terencechain May 8, 2023
3e67535
Add Deneb state (#12375)
terencechain May 9, 2023
250c5bf
Deneb DB methods (#12379)
terencechain May 11, 2023
52ed3f2
Deneb integration: Beacon API `getStateV2` (#12424)
rkapka May 18, 2023
38f7741
Add Blob Gossip (#12413)
terencechain May 18, 2023
1efca3b
P2P: broadcast blob (#12419)
terencechain May 23, 2023
d8c7742
Add Deneb upgrade function (#12433)
terencechain May 23, 2023
e8542b0
validator signing deneb (#12449)
james-prysm May 24, 2023
3dcf7ed
Deneb: implements engine API end points (#12384)
terencechain May 26, 2023
cb7ff9f
Update block's commitment size (#12470)
terencechain May 27, 2023
60c3bee
Proposer RPC: GetBlock for Deneb (#12481)
terencechain Jun 2, 2023
e581433
Add data gas used field to execution payload (#12488)
terencechain Jun 5, 2023
7ec7937
Update `ProposeBeaconBlock` Prysm RPC for Deneb (Non builder) (#12495)
terencechain Jun 7, 2023
42aeb8f
feat(rpc/validator): stream and use deneb block (#12510)
terencechain Jun 9, 2023
6c583e6
feat(blockchain): update payload attribute for deneb (#12509)
terencechain Jun 9, 2023
9ecd066
feat(config): update max blobs per block to 6 (#12512)
terencechain Jun 10, 2023
c965168
introducing deneb changes and blobs to builder (#12477)
james-prysm Jun 14, 2023
52b58a2
BlobSidecarsByRoot (#12420)
kasey Jun 15, 2023
e01fb39
Integrate generate genesis (#12523)
kasey Jun 15, 2023
21c68d8
ssz detection support for deneb (#12537)
kasey Jun 15, 2023
83b699a
feat(prysmctl): request blobs (#12544)
terencechain Jun 16, 2023
da01412
fix: devnet6 interop issues (#12545)
terencechain Jun 16, 2023
578abb3
feat(deneb): proposer rpc to handle builder flow (#12554)
terencechain Jun 26, 2023
74670be
migrating Beacon API code from eip4844 to deneb-integration (#12568)
james-prysm Jun 28, 2023
0d25a11
Update grpc to 1.53.0 (#12606)
terencechain Jul 10, 2023
c6a0aae
migrating get blob from eip4844 and deneb-integration (#12603)
james-prysm Jul 10, 2023
216e411
adding ssz response for get blobs beacon api endpoint (#12611)
james-prysm Jul 11, 2023
f23d8bf
test(e2e): deneb basic (#12546)
terencechain Jul 14, 2023
8ff51f4
fix: add blob batch flags to main/usage (#12614)
terencechain Jul 14, 2023
f6c6963
fix: use hexutil bytes for blobs bundle (#12623)
terencechain Jul 17, 2023
2c165fd
adding ssz capabilities for deneb publish block v1 (#12622)
james-prysm Jul 17, 2023
7cb325a
adding ssz handling to produce block endpoint for deneb (#12632)
james-prysm Jul 17, 2023
57e2111
fixing rebase conflicts and changes (#12644)
james-prysm Jul 21, 2023
014dd7e
support deneb in fullPayloadFromPayloadBody (#12649)
kasey Jul 21, 2023
53570b3
feat: EIP7045 increase max att inclusion slot (#12565)
terencechain Jul 22, 2023
a894eb2
feat: add builder override (#12601)
terencechain Jul 22, 2023
4e537fd
Deneb: Implement EIP-7044 (#12577)
prestonvanloon Jul 22, 2023
c9db7ed
sync blobs in initial-sync (#12522)
kasey Jul 25, 2023
4a29614
Test: add `deneb` spec test version `beta.0` (#12610)
terencechain Jul 25, 2023
6550491
implementing publishblockv2 for deneb (#12662)
james-prysm Jul 26, 2023
f636fbb
fixing broken test (#12673)
james-prysm Jul 28, 2023
a9dd14d
renaming data to blobs in execution payload (#12664)
james-prysm Jul 31, 2023
8a3d723
Validate blobs feature (#12574)
potuz Aug 3, 2023
e376f76
test:`beta.1` deneb tests (#12680)
terencechain Aug 8, 2023
405f2bf
feat: implement eip4788 (#12570)
terencechain Aug 8, 2023
13ed791
feat: log blob commitment count (#12723)
terencechain Aug 11, 2023
c4dd3d2
feat: add validator blob signing (#12730)
terencechain Aug 14, 2023
862f1c6
Fix: payload attribute v3 return nil (#12736)
terencechain Aug 14, 2023
894855e
fixing route handler and small cleanup items (#12726)
james-prysm Aug 14, 2023
8ace30d
feat: save blobs to db for subscriber (#12734)
terencechain Aug 14, 2023
564cb3d
Update gossip_scoring_params.go (#12732)
terencechain Aug 14, 2023
2b8f59a
fix: validator returning the right # of blobs (#12738)
terencechain Aug 14, 2023
769e22e
Update go.sum
terencechain Aug 16, 2023
5eb7c9f
test: skip deneb e2e test with tracking (#12751)
terencechain Aug 16, 2023
f0ff7a8
Blob channel (#12753)
potuz Aug 18, 2023
e6e8ccd
binary search is the wrong tool for the job, derp (#12757)
kasey Aug 18, 2023
efee78c
Save blob last stage init sync (#12764)
kasey Aug 21, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
10 changes: 5 additions & 5 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ filegroup(
url = "https://github.com/ethereum/EIPs/archive/5480440fe51742ed23342b68cf106cefd427e39d.tar.gz",
)

consensus_spec_version = "v1.4.0-alpha.1"
consensus_spec_version = "v1.4.0-beta.1"

bls_test_version = "v0.1.1"

Expand All @@ -229,7 +229,7 @@ filegroup(
visibility = ["//visibility:public"],
)
""",
sha256 = "1118a663be4a00ba00f0635eb20287157f2b2f993aed64335bfbcd04af424c2b",
sha256 = "24399b60ce3fbeb2311952d213dc3731b6dcb0f8881b016c283de5b518d2bbba",
url = "https://github.com/ethereum/consensus-spec-tests/releases/download/%s/general.tar.gz" % consensus_spec_version,
)

Expand All @@ -245,7 +245,7 @@ filegroup(
visibility = ["//visibility:public"],
)
""",
sha256 = "acde6e10940d14f22277eda5b55b65a24623ac88e4c7a2e34134a6069f5eea82",
sha256 = "8e656ee48d2e2ebc9cf9baedb81f27925bc625b3e3fbb2883444a08758a5884a",
url = "https://github.com/ethereum/consensus-spec-tests/releases/download/%s/minimal.tar.gz" % consensus_spec_version,
)

Expand All @@ -261,7 +261,7 @@ filegroup(
visibility = ["//visibility:public"],
)
""",
sha256 = "49c022f3a3478cea849ba8f877a9f7e4c1ded549edddc09993550bbc5bb192e1",
sha256 = "8bd137da6cc57a25383bfac5bc37e31265098145278bd8002b88e24c8b4718b9",
url = "https://github.com/ethereum/consensus-spec-tests/releases/download/%s/mainnet.tar.gz" % consensus_spec_version,
)

Expand All @@ -276,7 +276,7 @@ filegroup(
visibility = ["//visibility:public"],
)
""",
sha256 = "c3e246ff01f6b7b9e9e41939954a6ff89dfca7297415f88781809165fa83267c",
sha256 = "2bc1edb6e4a4f86c00317c04618a90b0ca29ee1eba833d0a64dd67fdd83fdbe3",
strip_prefix = "consensus-specs-" + consensus_spec_version[1:],
url = "https://github.com/ethereum/consensus-specs/archive/refs/tags/%s.tar.gz" % consensus_spec_version,
)
Expand Down
3 changes: 2 additions & 1 deletion api/client/builder/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ go_library(
importpath = "github.com/prysmaticlabs/prysm/v4/api/client/builder",
visibility = ["//visibility:public"],
deps = [
"//config/fieldparams:go_default_library",
"//consensus-types:go_default_library",
"//consensus-types/blocks:go_default_library",
"//consensus-types/interfaces:go_default_library",
"//consensus-types/primitives:go_default_library",
"//encoding/bytesutil:go_default_library",
"//math:go_default_library",
"//monitoring/tracing:go_default_library",
"//network:go_default_library",
"//network/authorization:go_default_library",
Expand All @@ -40,6 +40,7 @@ go_test(
data = glob(["testdata/**"]),
embed = [":go_default_library"],
deps = [
"//config/fieldparams:go_default_library",
"//config/params:go_default_library",
"//consensus-types/blocks:go_default_library",
"//consensus-types/primitives:go_default_library",
Expand Down
107 changes: 101 additions & 6 deletions api/client/builder/bid.go
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
package builder

import (
"math/big"

"github.com/pkg/errors"
ssz "github.com/prysmaticlabs/fastssz"
consensus_types "github.com/prysmaticlabs/prysm/v4/consensus-types"
"github.com/prysmaticlabs/prysm/v4/consensus-types/blocks"
"github.com/prysmaticlabs/prysm/v4/consensus-types/interfaces"
"github.com/prysmaticlabs/prysm/v4/encoding/bytesutil"
"github.com/prysmaticlabs/prysm/v4/math"
enginev1 "github.com/prysmaticlabs/prysm/v4/proto/engine/v1"
ethpb "github.com/prysmaticlabs/prysm/v4/proto/prysm/v1alpha1"
"github.com/prysmaticlabs/prysm/v4/runtime/version"
)
Expand All @@ -24,6 +22,7 @@ type SignedBid interface {
// Bid is an interface describing the method set of a builder bid.
type Bid interface {
Header() (interfaces.ExecutionData, error)
BlindedBlobsBundle() (*enginev1.BlindedBlobsBundle, error)
Value() []byte
Pubkey() []byte
Version() int
Expand Down Expand Up @@ -116,6 +115,11 @@ func (b builderBid) Header() (interfaces.ExecutionData, error) {
return blocks.WrappedExecutionPayloadHeader(b.p.Header)
}

// BlindedBlobsBundle --
func (b builderBid) BlindedBlobsBundle() (*enginev1.BlindedBlobsBundle, error) {
return nil, errors.New("blinded blobs bundle not available before Deneb")
}

// Version --
func (b builderBid) Version() int {
return version.Bellatrix
Expand Down Expand Up @@ -162,8 +166,12 @@ func WrappedBuilderBidCapella(p *ethpb.BuilderBidCapella) (Bid, error) {
// Header returns the execution data interface.
func (b builderBidCapella) Header() (interfaces.ExecutionData, error) {
// We have to convert big endian to little endian because the value is coming from the execution layer.
v := big.NewInt(0).SetBytes(bytesutil.ReverseByteOrder(b.p.Value))
return blocks.WrappedExecutionPayloadHeaderCapella(b.p.Header, math.WeiToGwei(v))
return blocks.WrappedExecutionPayloadHeaderCapella(b.p.Header, blocks.PayloadValueToGwei(b.p.Value))
}

// BlindedBlobsBundle --
func (b builderBidCapella) BlindedBlobsBundle() (*enginev1.BlindedBlobsBundle, error) {
return nil, errors.New("blinded blobs bundle not available before Deneb")
}

// Version --
Expand Down Expand Up @@ -195,3 +203,90 @@ func (b builderBidCapella) HashTreeRoot() ([32]byte, error) {
func (b builderBidCapella) HashTreeRootWith(hh *ssz.Hasher) error {
return b.p.HashTreeRootWith(hh)
}

type builderBidDeneb struct {
p *ethpb.BuilderBidDeneb
}

// WrappedBuilderBidDeneb is a constructor which wraps a protobuf bid into an interface.
func WrappedBuilderBidDeneb(p *ethpb.BuilderBidDeneb) (Bid, error) {
w := builderBidDeneb{p: p}
if w.IsNil() {
return nil, consensus_types.ErrNilObjectWrapped
}
return w, nil
}

// Version --
func (b builderBidDeneb) Version() int {
return version.Deneb
}

// Value --
func (b builderBidDeneb) Value() []byte {
return b.p.Value
}

// Pubkey --
func (b builderBidDeneb) Pubkey() []byte {
return b.p.Pubkey
}

// IsNil --
func (b builderBidDeneb) IsNil() bool {
return b.p == nil
}

// HashTreeRoot --
func (b builderBidDeneb) HashTreeRoot() ([32]byte, error) {
return b.p.HashTreeRoot()
}

// HashTreeRootWith --
func (b builderBidDeneb) HashTreeRootWith(hh *ssz.Hasher) error {
return b.p.HashTreeRootWith(hh)
}

// Header --
func (b builderBidDeneb) Header() (interfaces.ExecutionData, error) {
// We have to convert big endian to little endian because the value is coming from the execution layer.
return blocks.WrappedExecutionPayloadHeaderDeneb(b.p.Header, blocks.PayloadValueToGwei(b.p.Value))
}

// BlindedBlobsBundle --
func (b builderBidDeneb) BlindedBlobsBundle() (*enginev1.BlindedBlobsBundle, error) {
return b.p.BlindedBlobsBundle, nil
}

type signedBuilderBidDeneb struct {
p *ethpb.SignedBuilderBidDeneb
}

// WrappedSignedBuilderBidDeneb is a constructor which wraps a protobuf signed bit into an interface.
func WrappedSignedBuilderBidDeneb(p *ethpb.SignedBuilderBidDeneb) (SignedBid, error) {
w := signedBuilderBidDeneb{p: p}
if w.IsNil() {
return nil, consensus_types.ErrNilObjectWrapped
}
return w, nil
}

// Message --
func (b signedBuilderBidDeneb) Message() (Bid, error) {
return WrappedBuilderBidDeneb(b.p.Message)
}

// Signature --
func (b signedBuilderBidDeneb) Signature() []byte {
return b.p.Signature
}

// Version --
func (b signedBuilderBidDeneb) Version() int {
return version.Deneb
}

// IsNil --
func (b signedBuilderBidDeneb) IsNil() bool {
return b.p == nil
}
90 changes: 72 additions & 18 deletions api/client/builder/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import (
"github.com/prysmaticlabs/prysm/v4/monitoring/tracing"
"github.com/prysmaticlabs/prysm/v4/network"
"github.com/prysmaticlabs/prysm/v4/network/authorization"
v1 "github.com/prysmaticlabs/prysm/v4/proto/engine/v1"
ethpb "github.com/prysmaticlabs/prysm/v4/proto/prysm/v1alpha1"
"github.com/prysmaticlabs/prysm/v4/runtime/version"
log "github.com/sirupsen/logrus"
Expand Down Expand Up @@ -86,7 +87,7 @@ type BuilderClient interface {
NodeURL() string
GetHeader(ctx context.Context, slot primitives.Slot, parentHash [32]byte, pubkey [48]byte) (SignedBid, error)
RegisterValidator(ctx context.Context, svr []*ethpb.SignedValidatorRegistrationV1) error
SubmitBlindedBlock(ctx context.Context, sb interfaces.ReadOnlySignedBeaconBlock) (interfaces.ExecutionData, error)
SubmitBlindedBlock(ctx context.Context, sb interfaces.ReadOnlySignedBeaconBlock, blobs []*ethpb.SignedBlindedBlobSidecar) (interfaces.ExecutionData, *v1.BlobsBundle, error)
Status(ctx context.Context) error
}

Expand Down Expand Up @@ -220,6 +221,16 @@ func (c *Client) GetHeader(ctx context.Context, slot primitives.Slot, parentHash
return nil, errors.Wrapf(err, "error unmarshaling the builder GetHeader response, using slot=%d, parentHash=%#x, pubkey=%#x", slot, parentHash, pubkey)
}
switch strings.ToLower(v.Version) {
case strings.ToLower(version.String(version.Deneb)):
hr := &ExecHeaderResponseDeneb{}
if err := json.Unmarshal(hb, hr); err != nil {
return nil, errors.Wrapf(err, "error unmarshaling the builder GetHeader response, using slot=%d, parentHash=%#x, pubkey=%#x", slot, parentHash, pubkey)
}
p, err := hr.ToProto()
if err != nil {
return nil, errors.Wrapf(err, "could not extract proto message from header")
}
return WrappedSignedBuilderBidDeneb(p)
case strings.ToLower(version.String(version.Capella)):
hr := &ExecHeaderResponseCapella{}
if err := json.Unmarshal(hb, hr); err != nil {
Expand Down Expand Up @@ -274,20 +285,20 @@ func (c *Client) RegisterValidator(ctx context.Context, svr []*ethpb.SignedValid

// SubmitBlindedBlock calls the builder API endpoint that binds the validator to the builder and submits the block.
// The response is the full execution payload used to create the blinded block.
func (c *Client) SubmitBlindedBlock(ctx context.Context, sb interfaces.ReadOnlySignedBeaconBlock) (interfaces.ExecutionData, error) {
func (c *Client) SubmitBlindedBlock(ctx context.Context, sb interfaces.ReadOnlySignedBeaconBlock, blobs []*ethpb.SignedBlindedBlobSidecar) (interfaces.ExecutionData, *v1.BlobsBundle, error) {
if !sb.IsBlinded() {
return nil, errNotBlinded
return nil, nil, errNotBlinded
}
switch sb.Version() {
case version.Bellatrix:
psb, err := sb.PbBlindedBellatrixBlock()
if err != nil {
return nil, errors.Wrapf(err, "could not get protobuf block")
return nil, nil, errors.Wrapf(err, "could not get protobuf block")
}
b := &SignedBlindedBeaconBlockBellatrix{SignedBlindedBeaconBlockBellatrix: psb}
body, err := json.Marshal(b)
if err != nil {
return nil, errors.Wrap(err, "error encoding the SignedBlindedBeaconBlockBellatrix value body in SubmitBlindedBlock")
return nil, nil, errors.Wrap(err, "error encoding the SignedBlindedBeaconBlockBellatrix value body in SubmitBlindedBlock")
}

versionOpt := func(r *http.Request) {
Expand All @@ -296,29 +307,33 @@ func (c *Client) SubmitBlindedBlock(ctx context.Context, sb interfaces.ReadOnlyS
rb, err := c.do(ctx, http.MethodPost, postBlindedBeaconBlockPath, bytes.NewBuffer(body), versionOpt)

if err != nil {
return nil, errors.Wrap(err, "error posting the SignedBlindedBeaconBlockBellatrix to the builder api")
return nil, nil, errors.Wrap(err, "error posting the SignedBlindedBeaconBlockBellatrix to the builder api")
}
ep := &ExecPayloadResponse{}
if err := json.Unmarshal(rb, ep); err != nil {
return nil, errors.Wrap(err, "error unmarshaling the builder SubmitBlindedBlock response")
return nil, nil, errors.Wrap(err, "error unmarshaling the builder SubmitBlindedBlock response")
}
if strings.ToLower(ep.Version) != version.String(version.Bellatrix) {
return nil, errors.New("not a bellatrix payload")
return nil, nil, errors.New("not a bellatrix payload")
}
p, err := ep.ToProto()
if err != nil {
return nil, errors.Wrapf(err, "could not extract proto message from payload")
return nil, nil, errors.Wrapf(err, "could not extract proto message from payload")
}
return blocks.WrappedExecutionPayload(p)
payload, err := blocks.WrappedExecutionPayload(p)
if err != nil {
return nil, nil, errors.Wrapf(err, "could not wrap execution payload in interface")
}
return payload, nil, nil
case version.Capella:
psb, err := sb.PbBlindedCapellaBlock()
if err != nil {
return nil, errors.Wrapf(err, "could not get protobuf block")
return nil, nil, errors.Wrapf(err, "could not get protobuf block")
}
b := &SignedBlindedBeaconBlockCapella{SignedBlindedBeaconBlockCapella: psb}
body, err := json.Marshal(b)
if err != nil {
return nil, errors.Wrap(err, "error encoding the SignedBlindedBeaconBlockCapella value body in SubmitBlindedBlockCapella")
return nil, nil, errors.Wrap(err, "error encoding the SignedBlindedBeaconBlockCapella value body in SubmitBlindedBlockCapella")
}

versionOpt := func(r *http.Request) {
Expand All @@ -327,22 +342,61 @@ func (c *Client) SubmitBlindedBlock(ctx context.Context, sb interfaces.ReadOnlyS
rb, err := c.do(ctx, http.MethodPost, postBlindedBeaconBlockPath, bytes.NewBuffer(body), versionOpt)

if err != nil {
return nil, errors.Wrap(err, "error posting the SignedBlindedBeaconBlockCapella to the builder api")
return nil, nil, errors.Wrap(err, "error posting the SignedBlindedBeaconBlockCapella to the builder api")
}
ep := &ExecPayloadResponseCapella{}
if err := json.Unmarshal(rb, ep); err != nil {
return nil, errors.Wrap(err, "error unmarshaling the builder SubmitBlindedBlockCapella response")
return nil, nil, errors.Wrap(err, "error unmarshaling the builder SubmitBlindedBlockCapella response")
}
if strings.ToLower(ep.Version) != version.String(version.Capella) {
return nil, errors.New("not a capella payload")
return nil, nil, errors.New("not a capella payload")
}
p, err := ep.ToProto()
if err != nil {
return nil, errors.Wrapf(err, "could not extract proto message from payload")
return nil, nil, errors.Wrapf(err, "could not extract proto message from payload")
}
payload, err := blocks.WrappedExecutionPayloadCapella(p, 0)
if err != nil {
return nil, nil, errors.Wrapf(err, "could not wrap execution payload in interface")
}
return payload, nil, nil
case version.Deneb:
psb, err := sb.PbBlindedDenebBlock()
if err != nil {
return nil, nil, errors.Wrapf(err, "could not get protobuf block")
}

b := &ethpb.SignedBlindedBeaconBlockAndBlobsDeneb{Block: psb, Blobs: blobs}
body, err := json.Marshal(b)
if err != nil {
return nil, nil, errors.Wrap(err, "error encoding the SignedBlindedBeaconBlockDeneb value body in SubmitBlindedBlockDeneb")
}

versionOpt := func(r *http.Request) {
r.Header.Add("Eth-Consensus-Version", version.String(version.Deneb))
}
rb, err := c.do(ctx, http.MethodPost, postBlindedBeaconBlockPath, bytes.NewBuffer(body), versionOpt)
if err != nil {
return nil, nil, errors.Wrap(err, "error posting the SignedBlindedBeaconBlockDeneb to the builder api")
}
ep := &ExecPayloadResponseDeneb{}
if err := json.Unmarshal(rb, ep); err != nil {
return nil, nil, errors.Wrap(err, "error unmarshaling the builder SubmitBlindedBlockDeneb response")
}
if strings.ToLower(ep.Version) != version.String(version.Deneb) {
return nil, nil, errors.New("not a deneb payload")
}
p, blobBundle, err := ep.ToProto()
if err != nil {
return nil, nil, errors.Wrapf(err, "could not extract proto message from payload")
}
payload, err := blocks.WrappedExecutionPayloadDeneb(p, 0)
if err != nil {
return nil, nil, errors.Wrapf(err, "could not wrap execution payload in interface")
}
return blocks.WrappedExecutionPayloadCapella(p, 0)
return payload, blobBundle, nil
default:
return nil, fmt.Errorf("unsupported block version %s", version.String(sb.Version()))
return nil, nil, fmt.Errorf("unsupported block version %s", version.String(sb.Version()))
}
}

Expand Down
Loading