From 07da7a9795f5f0c17d9f0a9692297651df6f6c95 Mon Sep 17 00:00:00 2001 From: Sam Bukowski Date: Fri, 14 Jul 2023 15:18:18 -0600 Subject: [PATCH] simple logging change --- eth/catalyst/api.go | 1 + grpc/execution/server.go | 9 +++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/eth/catalyst/api.go b/eth/catalyst/api.go index 9077f20bff..7049a45ff2 100644 --- a/eth/catalyst/api.go +++ b/eth/catalyst/api.go @@ -205,6 +205,7 @@ func (api *ConsensusAPI) verifyPayloadAttributes(attr *engine.PayloadAttributes) return nil } +// TODO: figure out the timing here func (api *ConsensusAPI) forkchoiceUpdated(update engine.ForkchoiceStateV1, payloadAttributes *engine.PayloadAttributes) (engine.ForkChoiceResponse, error) { api.forkchoiceLock.Lock() defer api.forkchoiceLock.Unlock() diff --git a/grpc/execution/server.go b/grpc/execution/server.go index 5a46ffd9e0..848be6006c 100644 --- a/grpc/execution/server.go +++ b/grpc/execution/server.go @@ -7,7 +7,6 @@ package execution import ( "context" "fmt" - "time" "github.com/ethereum/go-ethereum/beacon/engine" "github.com/ethereum/go-ethereum/common" @@ -45,7 +44,7 @@ func NewExecutionServiceServer(eth *eth.Ethereum) *ExecutionServiceServer { } func (s *ExecutionServiceServer) DoBlock(ctx context.Context, req *executionv1.DoBlockRequest) (*executionv1.DoBlockResponse, error) { - log.Info("DoBlock called request", "request", req) + log.Info("DoBlock called request [sam version]", "request", req) prevHeadHash := common.BytesToHash(req.PrevBlockHash) // The Engine API has been modified to use transactions from this mempool and abide by it's ordering. @@ -62,6 +61,8 @@ func (s *ExecutionServiceServer) DoBlock(ctx context.Context, req *executionv1.D Random: common.Hash{}, SuggestedFeeRecipient: common.Address{}, } + // NOTE: ForkchoiceUpdatedV1 calls forkchoiceUpdated. forkchoiceUpdated calls api.forkchoiceLock.Lock() + // what is this doing that requires us to wait? fcStartResp, err := s.consensus.ForkchoiceUpdatedV1(*startForkChoice, payloadAttributes) if err != nil { return nil, err @@ -69,8 +70,8 @@ func (s *ExecutionServiceServer) DoBlock(ctx context.Context, req *executionv1.D // super janky but this is what the payload builder requires :/ (miner.worker.buildPayload()) // we should probably just execute + store the block directly instead of using the engine api. - time.Sleep(time.Second) - payloadResp, err := s.consensus.GetPayloadV1(*fcStartResp.PayloadID) + // time.Sleep(time.Second) + payloadResp, err := s.consensus.GetPayloadV1(*fcStartResp.PayloadID) // this looks like it is totally fine if err != nil { log.Error("failed to call GetPayloadV1", "err", err) return nil, err