Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect error logs in relays check #192

Open
Marketen opened this issue Nov 13, 2023 · 0 comments
Open

Incorrect error logs in relays check #192

Marketen opened this issue Nov 13, 2023 · 0 comments
Labels
P2 low priority

Comments

@Marketen
Copy link
Contributor

Marketen commented Nov 13, 2023

If relay response status is OK but response body cant be "unmarshalled" or read, we should not log could not call relayer endpoint error. We should log error while reading relayer X response or something similar

mev-sp-oracle/api/api.go

Lines 888 to 909 in fa2426b

for _, relay := range relayers {
url := fmt.Sprintf("%s/relay/v1/data/validator_registration?pubkey=%s", relay, valPubKey)
resp, err := http.Get(url)
if err != nil {
m.respondError(w, http.StatusInternalServerError, "could not call relayer endpoint: "+err.Error())
return
}
defer resp.Body.Close()
if resp.StatusCode == http.StatusOK {
signedRegistration := &builderApiV1.SignedValidatorRegistration{}
bodyBytes, err := io.ReadAll(resp.Body)
if err != nil {
m.respondError(w, http.StatusInternalServerError, "could not call relayer endpoint: "+err.Error())
return
}
if err = json.Unmarshal(bodyBytes, signedRegistration); err != nil {
m.respondError(w, http.StatusInternalServerError, "could not call relayer endpoint: "+err.Error())
return
}

@Marketen Marketen added the P2 low priority label Nov 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P2 low priority
Projects
None yet
Development

No branches or pull requests

1 participant