gobitfly/eth2-beaconchain-explorer

ApiValidatorAttestationEfficiency does not return pubKey as it used to do sometime ago

luarx opened this issue · 1 comments

Describe the bug
When requesting /api/v1/validator/{Pubkey}/attestationefficiency it returns for each element the validatorindex BUT not the pubkey

Some time ago, /api/v1/validator/{Pubkey}/attestationeffectiveness (now deprecated in favor of /api/v1/validator/{Pubkey}/attestationefficiency) returned the pubkey for each requested validators
Reference commit where the behaviour changed:
image

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
/api/v1/validator/{Pubkey}/attestationefficiency should return the pubkey field for each requested validator (at least if a pubkey or a list of pubkeys are used).
/api/v1/validator/{Index}/attestationefficiency can return also the pubkey or not (in my opinion, for consistency it should also)

Example:
Request: /api/v1/validator/pubkey_1,pubkey_2/attestationefficiency
Response:

{"status":"OK",
"data":[
{"validatorindex":2,"attestation_efficiency":1.0066666666666668},
{"validatorindex":1,"attestation_efficiency":1.005}
]
}

In the last example I am requesting using pubkeys and not validatorindex, so it is difficult to match each element of the data field with the right validator without doint more logic.

The expected behaviour in case that it is possible, should be:
Request: /api/v1/validator/pubkey_1,pubkey_2/attestationefficiency
Response:

{"status":"OK",
"data":[
{"validatorpubkey": pubkey_2, "validatorindex":2,"attestation_efficiency":1.0066666666666668},
{"validatorpubkey": pubkey_1, "validatorindex":1,"attestation_efficiency":1.005}
]
}

Could we push this issue? 🙏