mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
simple logging change
This commit is contained in:
parent
9e233ccb69
commit
07da7a9795
2 changed files with 6 additions and 4 deletions
|
|
@ -205,6 +205,7 @@ func (api *ConsensusAPI) verifyPayloadAttributes(attr *engine.PayloadAttributes)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO: figure out the timing here
|
||||||
func (api *ConsensusAPI) forkchoiceUpdated(update engine.ForkchoiceStateV1, payloadAttributes *engine.PayloadAttributes) (engine.ForkChoiceResponse, error) {
|
func (api *ConsensusAPI) forkchoiceUpdated(update engine.ForkchoiceStateV1, payloadAttributes *engine.PayloadAttributes) (engine.ForkChoiceResponse, error) {
|
||||||
api.forkchoiceLock.Lock()
|
api.forkchoiceLock.Lock()
|
||||||
defer api.forkchoiceLock.Unlock()
|
defer api.forkchoiceLock.Unlock()
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,6 @@ package execution
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"time"
|
|
||||||
|
|
||||||
"github.com/ethereum/go-ethereum/beacon/engine"
|
"github.com/ethereum/go-ethereum/beacon/engine"
|
||||||
"github.com/ethereum/go-ethereum/common"
|
"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) {
|
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)
|
prevHeadHash := common.BytesToHash(req.PrevBlockHash)
|
||||||
|
|
||||||
// The Engine API has been modified to use transactions from this mempool and abide by it's ordering.
|
// 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{},
|
Random: common.Hash{},
|
||||||
SuggestedFeeRecipient: common.Address{},
|
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)
|
fcStartResp, err := s.consensus.ForkchoiceUpdatedV1(*startForkChoice, payloadAttributes)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
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())
|
// 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.
|
// we should probably just execute + store the block directly instead of using the engine api.
|
||||||
time.Sleep(time.Second)
|
// time.Sleep(time.Second)
|
||||||
payloadResp, err := s.consensus.GetPayloadV1(*fcStartResp.PayloadID)
|
payloadResp, err := s.consensus.GetPayloadV1(*fcStartResp.PayloadID) // this looks like it is totally fine
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Error("failed to call GetPayloadV1", "err", err)
|
log.Error("failed to call GetPayloadV1", "err", err)
|
||||||
return nil, err
|
return nil, err
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue