mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2024-12-22 11:41:19 +00:00
More logging for block build requests (#7264)
This commit is contained in:
parent
56bc16b7ab
commit
762b63eb14
@ -152,13 +152,32 @@ func (e *EngineImpl) ForkchoiceUpdatedV2(ctx context.Context, forkChoiceState *F
|
|||||||
return e.forkchoiceUpdated(2, ctx, forkChoiceState, payloadAttributes)
|
return e.forkchoiceUpdated(2, ctx, forkChoiceState, payloadAttributes)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Converts slice of pointers to slice of structs
|
||||||
|
func withdrawalValues(ptrs []*types.Withdrawal) []types.Withdrawal {
|
||||||
|
if ptrs == nil {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
vals := make([]types.Withdrawal, 0, len(ptrs))
|
||||||
|
for _, w := range ptrs {
|
||||||
|
vals = append(vals, *w)
|
||||||
|
}
|
||||||
|
return vals
|
||||||
|
}
|
||||||
|
|
||||||
func (e *EngineImpl) forkchoiceUpdated(version uint32, ctx context.Context, forkChoiceState *ForkChoiceState, payloadAttributes *PayloadAttributes) (map[string]interface{}, error) {
|
func (e *EngineImpl) forkchoiceUpdated(version uint32, ctx context.Context, forkChoiceState *ForkChoiceState, payloadAttributes *PayloadAttributes) (map[string]interface{}, error) {
|
||||||
if e.internalCL {
|
if e.internalCL {
|
||||||
log.Error("EXTERNAL CONSENSUS LAYER IS NOT ENABLED, PLEASE RESTART WITH FLAG --externalcl")
|
log.Error("EXTERNAL CONSENSUS LAYER IS NOT ENABLED, PLEASE RESTART WITH FLAG --externalcl")
|
||||||
return nil, fmt.Errorf("engine api should not be used, restart with --externalcl")
|
return nil, fmt.Errorf("engine api should not be used, restart with --externalcl")
|
||||||
}
|
}
|
||||||
log.Debug("Received ForkchoiceUpdated", "version", version, "head", forkChoiceState.HeadHash, "safe", forkChoiceState.HeadHash, "finalized", forkChoiceState.FinalizedBlockHash,
|
if payloadAttributes == nil {
|
||||||
"build", payloadAttributes != nil)
|
log.Debug("Received ForkchoiceUpdated", "version", version,
|
||||||
|
"head", forkChoiceState.HeadHash, "safe", forkChoiceState.SafeBlockHash, "finalized", forkChoiceState.FinalizedBlockHash)
|
||||||
|
} else {
|
||||||
|
log.Info("Received ForkchoiceUpdated [build]", "version", version,
|
||||||
|
"head", forkChoiceState.HeadHash, "safe", forkChoiceState.SafeBlockHash, "finalized", forkChoiceState.FinalizedBlockHash,
|
||||||
|
"timestamp", payloadAttributes.Timestamp, "prevRandao", payloadAttributes.PrevRandao, "suggestedFeeRecipient", payloadAttributes.SuggestedFeeRecipient,
|
||||||
|
"withdrawals", withdrawalValues(payloadAttributes.Withdrawals))
|
||||||
|
}
|
||||||
|
|
||||||
var attributes *remote.EnginePayloadAttributes
|
var attributes *remote.EnginePayloadAttributes
|
||||||
if payloadAttributes != nil {
|
if payloadAttributes != nil {
|
||||||
|
@ -695,6 +695,7 @@ func (s *EthBackendServer) EngineForkChoiceUpdated(ctx context.Context, req *rem
|
|||||||
|
|
||||||
// First check if we're already building a block with the requested parameters
|
// First check if we're already building a block with the requested parameters
|
||||||
if reflect.DeepEqual(s.lastParameters, ¶m) {
|
if reflect.DeepEqual(s.lastParameters, ¶m) {
|
||||||
|
log.Info("[ForkChoiceUpdated] duplicate build request")
|
||||||
return &remote.EngineForkChoiceUpdatedResponse{
|
return &remote.EngineForkChoiceUpdatedResponse{
|
||||||
PayloadStatus: &remote.EnginePayloadStatus{
|
PayloadStatus: &remote.EnginePayloadStatus{
|
||||||
Status: remote.EngineStatus_VALID,
|
Status: remote.EngineStatus_VALID,
|
||||||
@ -712,7 +713,7 @@ func (s *EthBackendServer) EngineForkChoiceUpdated(ctx context.Context, req *rem
|
|||||||
s.lastParameters = ¶m
|
s.lastParameters = ¶m
|
||||||
|
|
||||||
s.builders[s.payloadId] = builder.NewBlockBuilder(s.builderFunc, ¶m)
|
s.builders[s.payloadId] = builder.NewBlockBuilder(s.builderFunc, ¶m)
|
||||||
log.Debug("BlockBuilder added", "payload", s.payloadId)
|
log.Info("[ForkChoiceUpdated] BlockBuilder added", "payload", s.payloadId)
|
||||||
|
|
||||||
return &remote.EngineForkChoiceUpdatedResponse{
|
return &remote.EngineForkChoiceUpdatedResponse{
|
||||||
PayloadStatus: &remote.EnginePayloadStatus{
|
PayloadStatus: &remote.EnginePayloadStatus{
|
||||||
|
Loading…
Reference in New Issue
Block a user