Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion server/get_header.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ func (m *BoostService) getHeader(log *logrus.Entry, slot phase0.Slot, pubkey, pa
"msIntoSlot": msIntoSlot,
}).Infof("getHeader request start - %d milliseconds into slot %d", msIntoSlot, slot)

RecordMsIntoSlot(params.PathGetHeader, float64(msIntoSlot))
var (
mu sync.Mutex
wg sync.WaitGroup
Expand Down Expand Up @@ -321,7 +322,7 @@ func (m *BoostService) sendGetHeaderRequest(
start := time.Now()

resp, err := m.httpClientGetHeader.Do(req)
RecordRelayLatency(params.PathGetHeader, relay.URL.Hostname(), float64(time.Since(start).Microseconds()))
RecordRelayLatency(params.PathGetHeader, relay.URL.Hostname(), float64(time.Since(start).Milliseconds()))
if err != nil {
log.WithError(err).Warn("error calling getHeader on relay")
return nil, ""
Expand Down
12 changes: 11 additions & 1 deletion server/get_payload.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,8 @@ func (m *BoostService) innerGetPayload(log *logrus.Entry, signedBlindedBeaconBlo
"msIntoSlot": msIntoSlot,
}).Infof("submitBlindedBlock request start - %d milliseconds into slot %d", msIntoSlot, slot)

// storing via function to not run into too many decision paths
recordGetPayloadMsIntoSlot(version, msIntoSlot)
// Get the bid!
m.bidsLock.Lock()
originalBid := m.bids[bidKey(slot, blockHash)]
Expand Down Expand Up @@ -231,7 +233,7 @@ func (m *BoostService) innerGetPayload(log *logrus.Entry, signedBlindedBeaconBlo
innerLog.Debug("submitting signed blinded block")
start := time.Now()
resp, err := m.httpClientGetPayload.Do(req)
RecordRelayLatency(endpoint, relay.URL.Hostname(), float64(time.Since(start).Microseconds()))
RecordRelayLatency(endpoint, relay.URL.Hostname(), float64(time.Since(start).Milliseconds()))
if err != nil {
innerLog.WithError(err).Warnf("error calling getPayload%s on relay", versionToUse)
return nil, err
Expand Down Expand Up @@ -696,6 +698,14 @@ func (m *BoostService) respondGetPayloadSSZ(w http.ResponseWriter, result *build
// Other Functions
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

func recordGetPayloadMsIntoSlot(version GetPayloadVersion, msIntoSlot uint64) {
endpoint := params.PathGetPayload
if version == GetPayloadV2 {
endpoint = params.PathGetPayloadV2
}
RecordMsIntoSlot(endpoint, float64(msIntoSlot))
}

// bidKey makes a map key for a specific bid
func bidKey(slot phase0.Slot, blockHash phase0.Hash32) string {
return fmt.Sprintf("%v%v", slot, blockHash)
Expand Down
2 changes: 1 addition & 1 deletion server/register_validator.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ func (m *BoostService) registerValidator(log *logrus.Entry, regBytes []byte, hea
// Send the request
start := time.Now()
resp, err := m.httpClientRegVal.Do(req)
RecordRelayLatency(params.PathRegisterValidator, relay.URL.Hostname(), float64(time.Since(start).Microseconds()))
RecordRelayLatency(params.PathRegisterValidator, relay.URL.Hostname(), float64(time.Since(start).Milliseconds()))
if err != nil {
log.WithError(err).Warn("error calling registerValidator on relay")
respErrCh <- err
Expand Down
2 changes: 1 addition & 1 deletion server/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,7 @@ func (m *BoostService) CheckRelays() int {

start := time.Now()
code, err := SendHTTPRequest(context.Background(), m.httpClientGetHeader, http.MethodGet, url, "", nil, nil, nil)
RecordRelayLatency(params.PathStatus, relay.URL.Hostname(), float64(time.Since(start).Microseconds()))
RecordRelayLatency(params.PathStatus, relay.URL.Hostname(), float64(time.Since(start).Milliseconds()))
if err != nil {
log.WithError(err).Error("relay status error - request failed")
return
Expand Down
Loading