diff --git a/builder/beacon_client.go b/builder/beacon_client.go index 166feac247..16f2ac415e 100644 --- a/builder/beacon_client.go +++ b/builder/beacon_client.go @@ -18,7 +18,8 @@ type IBeaconClient interface { type NilBeaconClient struct{} -func (b *NilBeaconClient) SubscribeToPayloadAttributesEvents(payloadAttrC chan BuilderPayloadAttributes) {} +func (b *NilBeaconClient) SubscribeToPayloadAttributesEvents(payloadAttrC chan BuilderPayloadAttributes) { +} func (b *NilBeaconClient) Start() error { return nil } diff --git a/builder/builder_test.go b/builder/builder_test.go index 31b899751a..bdb57946c3 100644 --- a/builder/builder_test.go +++ b/builder/builder_test.go @@ -7,8 +7,8 @@ import ( builderApiV1 "github.com/attestantio/go-builder-client/api/v1" "github.com/attestantio/go-eth2-client/spec/bellatrix" - "github.com/attestantio/go-eth2-client/spec/deneb" "github.com/attestantio/go-eth2-client/spec/capella" + "github.com/attestantio/go-eth2-client/spec/deneb" "github.com/attestantio/go-eth2-client/spec/phase0" "github.com/ethereum/go-ethereum/beacon/engine" "github.com/ethereum/go-ethereum/common" diff --git a/builder/eth_service.go b/builder/eth_service.go index daa05151a4..6bd229df50 100644 --- a/builder/eth_service.go +++ b/builder/eth_service.go @@ -22,11 +22,13 @@ type IEthereumService interface { type EthereumService struct { eth *eth.Ethereum + cfg *Config } -func NewEthereumService(eth *eth.Ethereum) *EthereumService { +func NewEthereumService(eth *eth.Ethereum, config *Config) *EthereumService { return &EthereumService{ eth: eth, + cfg: config, } } @@ -56,7 +58,7 @@ func (s *EthereumService) BuildBlock(attrs *BuilderPayloadAttributes) (*engine.E resCh <- payload.ResolveFull() }() - timer := time.NewTimer(2 * time.Second) + timer := time.NewTimer(s.cfg.BlockTime) defer timer.Stop() select { diff --git a/builder/eth_service_test.go b/builder/eth_service_test.go index b5d518a0f6..97bbc0fb56 100644 --- a/builder/eth_service_test.go +++ b/builder/eth_service_test.go @@ -90,7 +90,7 @@ func TestBuildBlock(t *testing.T) { Slot: uint64(25), } - service := NewEthereumService(ethservice) + service := NewEthereumService(ethservice, &DefaultConfig) executableData, err := service.BuildBlock(testPayloadAttributes) diff --git a/builder/service.go b/builder/service.go index c6b5ddaf70..201417a872 100644 --- a/builder/service.go +++ b/builder/service.go @@ -89,7 +89,7 @@ func Register(stack *node.Node, backend *eth.Ethereum, cfg *Config) error { beaconClient = NewOpBeaconClient(cfg.BeaconEndpoints[0]) } - ethereumService := NewEthereumService(backend) + ethereumService := NewEthereumService(backend, cfg) builderSk, err := bls.SecretKeyFromBytes(envBuilderSkBytes[:]) if err != nil {