Skip to content

Commit

Permalink
feat(service): add ReceivedAt, UserAgent
Browse files Browse the repository at this point in the history
  • Loading branch information
alextes committed Oct 10, 2023
1 parent d962ca0 commit 53c23a1
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions services/api/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ type registrationMetadata struct {
FeeRecipient string `json:"fee_recipient"`
GasLimit uint64 `json:"gas_limit"`
IPAddress string `json:"ip_address"`
ReceivedAt string `json:"received_at"`
ReceivedAt int64 `json:"received_at"`
Timestamp uint64 `json:"timestamp"`
UserAgent string `json:"user_agent"`
}
Expand Down Expand Up @@ -1145,8 +1145,10 @@ func (api *RelayAPI) handleRegisterValidator(w http.ResponseWriter, req *http.Re
FeeRecipient: signedValidatorRegistration.Message.FeeRecipient.String(),
GasLimit: signedValidatorRegistration.Message.GasLimit,
// Until we have a way to record latency directly, we ping IPs.
IPAddress: req.Header.Get("X-Real-IP"),
Timestamp: signedValidatorRegistration.Message.Timestamp,
IPAddress: req.Header.Get("X-Real-IP"),
ReceivedAt: start.UnixMilli(),
Timestamp: signedValidatorRegistration.Message.Timestamp,
UserAgent: ua,
}
pubkeyMetadataMutex.Lock()
pubkeyMetadata[pkHex.String()] = metadata
Expand Down

0 comments on commit 53c23a1

Please sign in to comment.