Skip to content

Commit

Permalink
Do not fail production when consensus block value is unavailable
Browse files Browse the repository at this point in the history
  • Loading branch information
rkapka committed Jun 14, 2024
1 parent b842b7e commit df4490b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions beacon-chain/rpc/eth/validator/handlers_block.go
Original file line number Diff line number Diff line change
Expand Up @@ -220,8 +220,8 @@ func (s *Server) produceBlockV3(ctx context.Context, w http.ResponseWriter, r *h

consensusBlockValue, httpError := getConsensusBlockValue(ctx, s.BlockRewardFetcher, v1alpha1resp.Block)
if httpError != nil {
httputil.WriteError(w, httpError)
return
// Having the consensus block value is not critical to block production
consensusBlockValue = "0"
}

w.Header().Set(api.ExecutionPayloadBlindedHeader, fmt.Sprintf("%v", v1alpha1resp.IsBlinded))
Expand Down Expand Up @@ -297,8 +297,8 @@ func getConsensusBlockValue(ctx context.Context, blockRewardsFetcher rewards.Blo
}
}
if bb.Version() == version.Phase0 {
// ignore for phase 0
return "", nil
// Getting the block value for Phase 0 is very hard, so we ignore it
return "0", nil
}
// Get consensus payload value which is the same as the total from the block rewards api.
// The value is in Gwei, but Wei should be returned from the endpoint.
Expand Down

0 comments on commit df4490b

Please sign in to comment.