Commit a704a097 authored by protolambda's avatar protolambda

make engine API logging less verbose

parent 2b91cc6d
...@@ -70,15 +70,15 @@ func (s *Source) PayloadByNumber(ctx context.Context, number uint64) (*eth.Execu ...@@ -70,15 +70,15 @@ func (s *Source) PayloadByNumber(ctx context.Context, number uint64) (*eth.Execu
// May return an error in ForkChoiceResult, but the error is marshalled into the error return // May return an error in ForkChoiceResult, but the error is marshalled into the error return
func (s *Source) ForkchoiceUpdate(ctx context.Context, fc *eth.ForkchoiceState, attributes *eth.PayloadAttributes) (*eth.ForkchoiceUpdatedResult, error) { func (s *Source) ForkchoiceUpdate(ctx context.Context, fc *eth.ForkchoiceState, attributes *eth.PayloadAttributes) (*eth.ForkchoiceUpdatedResult, error) {
e := s.log.New("state", fc, "attr", attributes) e := s.log.New("state", fc, "attr", attributes)
e.Debug("Sharing forkchoice-updated signal") e.Trace("Sharing forkchoice-updated signal")
fcCtx, cancel := context.WithTimeout(ctx, time.Second*5) fcCtx, cancel := context.WithTimeout(ctx, time.Second*5)
defer cancel() defer cancel()
var result eth.ForkchoiceUpdatedResult var result eth.ForkchoiceUpdatedResult
err := s.rpc.CallContext(fcCtx, &result, "engine_forkchoiceUpdatedV1", fc, attributes) err := s.rpc.CallContext(fcCtx, &result, "engine_forkchoiceUpdatedV1", fc, attributes)
if err == nil { if err == nil {
e.Debug("Shared forkchoice-updated signal") e.Trace("Shared forkchoice-updated signal")
if attributes != nil { if attributes != nil {
e.Debug("Received payload id", "payloadId", result.PayloadID) e.Trace("Received payload id", "payloadId", result.PayloadID)
} }
return &result, nil return &result, nil
} else { } else {
...@@ -96,13 +96,13 @@ func (s *Source) ForkchoiceUpdate(ctx context.Context, fc *eth.ForkchoiceState, ...@@ -96,13 +96,13 @@ func (s *Source) ForkchoiceUpdate(ctx context.Context, fc *eth.ForkchoiceState,
// ExecutePayload executes a built block on the execution engine and returns an error if it was not successful. // ExecutePayload executes a built block on the execution engine and returns an error if it was not successful.
func (s *Source) NewPayload(ctx context.Context, payload *eth.ExecutionPayload) (*eth.PayloadStatusV1, error) { func (s *Source) NewPayload(ctx context.Context, payload *eth.ExecutionPayload) (*eth.PayloadStatusV1, error) {
e := s.log.New("block_hash", payload.BlockHash) e := s.log.New("block_hash", payload.BlockHash)
e.Debug("sending payload for execution") e.Trace("sending payload for execution")
execCtx, cancel := context.WithTimeout(ctx, time.Second*5) execCtx, cancel := context.WithTimeout(ctx, time.Second*5)
defer cancel() defer cancel()
var result eth.PayloadStatusV1 var result eth.PayloadStatusV1
err := s.rpc.CallContext(execCtx, &result, "engine_newPayloadV1", payload) err := s.rpc.CallContext(execCtx, &result, "engine_newPayloadV1", payload)
e.Debug("Received payload execution result", "status", result.Status, "latestValidHash", result.LatestValidHash, "message", result.ValidationError) e.Trace("Received payload execution result", "status", result.Status, "latestValidHash", result.LatestValidHash, "message", result.ValidationError)
if err != nil { if err != nil {
e.Error("Payload execution failed", "err", err) e.Error("Payload execution failed", "err", err)
return nil, fmt.Errorf("failed to execute payload: %v", err) return nil, fmt.Errorf("failed to execute payload: %v", err)
...@@ -113,7 +113,7 @@ func (s *Source) NewPayload(ctx context.Context, payload *eth.ExecutionPayload) ...@@ -113,7 +113,7 @@ func (s *Source) NewPayload(ctx context.Context, payload *eth.ExecutionPayload)
// GetPayload gets the execution payload associated with the PayloadId // GetPayload gets the execution payload associated with the PayloadId
func (s *Source) GetPayload(ctx context.Context, payloadId eth.PayloadID) (*eth.ExecutionPayload, error) { func (s *Source) GetPayload(ctx context.Context, payloadId eth.PayloadID) (*eth.ExecutionPayload, error) {
e := s.log.New("payload_id", payloadId) e := s.log.New("payload_id", payloadId)
e.Debug("getting payload") e.Trace("getting payload")
var result eth.ExecutionPayload var result eth.ExecutionPayload
err := s.rpc.CallContext(ctx, &result, "engine_getPayloadV1", payloadId) err := s.rpc.CallContext(ctx, &result, "engine_getPayloadV1", payloadId)
if err != nil { if err != nil {
...@@ -130,7 +130,7 @@ func (s *Source) GetPayload(ctx context.Context, payloadId eth.PayloadID) (*eth. ...@@ -130,7 +130,7 @@ func (s *Source) GetPayload(ctx context.Context, payloadId eth.PayloadID) (*eth.
} }
return nil, err return nil, err
} }
e.Debug("Received payload") e.Trace("Received payload")
return &result, nil return &result, nil
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment