Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove builder status check for block proposal #11052

Merged
merged 1 commit into from
Jul 13, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion beacon-chain/builder/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package builder

import (
"context"
"fmt"
"time"

"github.com/pkg/errors"
Expand All @@ -21,7 +22,6 @@ import (
type BlockBuilder interface {
SubmitBlindedBlock(ctx context.Context, block *ethpb.SignedBlindedBeaconBlockBellatrix) (*v1.ExecutionPayload, error)
GetHeader(ctx context.Context, slot types.Slot, parentHash [32]byte, pubKey [48]byte) (*ethpb.SignedBuilderBid, error)
Status() error
RegisterValidator(ctx context.Context, reg []*ethpb.SignedValidatorRegistrationV1) error
Configured() bool
}
Expand Down Expand Up @@ -60,6 +60,12 @@ func NewService(ctx context.Context, opts ...Option) (*Service, error) {
return nil, err
}
s.c = c

// Is the builder up?
if err := s.c.Status(ctx); err != nil {
return nil, fmt.Errorf("could not connect to builder: %v", err)
}

log.WithField("endpoint", c.NodeURL()).Info("Builder has been configured")
}
return s, nil
Expand Down
6 changes: 0 additions & 6 deletions beacon-chain/builder/testing/mock.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ type MockBuilderService struct {
ErrSubmitBlindedBlock error
Bid *ethpb.SignedBuilderBid
ErrGetHeader error
ErrStatus error
ErrRegisterValidator error
}

Expand All @@ -34,11 +33,6 @@ func (s *MockBuilderService) GetHeader(context.Context, types.Slot, [32]byte, [4
return s.Bid, s.ErrGetHeader
}

// Status for mocking.
func (s *MockBuilderService) Status() error {
return s.ErrStatus
}

// RegisterValidator for mocking.
func (s *MockBuilderService) RegisterValidator(context.Context, []*ethpb.SignedValidatorRegistrationV1) error {
return s.ErrRegisterValidator
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,6 @@ func (vs *Server) getBellatrixBeaconBlock(ctx context.Context, req *ethpb.BlockR
// This function retrieves the payload header given the slot number and the validator index.
// It's a no-op if the latest head block is not versioned bellatrix.
func (vs *Server) getPayloadHeader(ctx context.Context, slot types.Slot, idx types.ValidatorIndex) (*enginev1.ExecutionPayloadHeader, error) {
if err := vs.BlockBuilder.Status(); err != nil {
return nil, err
}
b, err := vs.HeadFetcher.HeadBlock(ctx)
if err != nil {
return nil, err
Expand Down Expand Up @@ -171,9 +168,7 @@ func (vs *Server) unblindBuilderBlock(ctx context.Context, b interfaces.SignedBe
if !vs.BlockBuilder.Configured() {
return b, nil
}
if err := vs.BlockBuilder.Status(); err != nil {
return nil, err
}

agg, err := b.Block().Body().SyncAggregate()
if err != nil {
return nil, err
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,13 +98,6 @@ func TestServer_getPayloadHeader(t *testing.T) {
err string
returnedHeader *v1.ExecutionPayloadHeader
}{
{
name: "builder is not ready",
mock: &builderTest.MockBuilderService{
ErrStatus: errors.New("builder is not ready"),
},
err: "builder is not ready",
},
{
name: "head is not bellatrix ready",
mock: &builderTest.MockBuilderService{},
Expand Down Expand Up @@ -209,19 +202,6 @@ func TestServer_getBuilderBlock(t *testing.T) {
return wb
}(),
},
{
name: "builder is not ready",
blk: func() interfaces.SignedBeaconBlock {
wb, err := wrapper.WrappedSignedBeaconBlock(util.NewBlindedBeaconBlockBellatrix())
require.NoError(t, err)
return wb
}(),
mock: &builderTest.MockBuilderService{
HasConfigured: true,
ErrStatus: errors.New("builder is not ready"),
},
err: "builder is not ready",
},
{
name: "submit blind block error",
blk: func() interfaces.SignedBeaconBlock {
Expand Down