# Dev Update #13 Hey :wave: For the last two weeks, I have been ironing out the [`attestation_rewards`](https://github.com/sigp/lighthouse/pull/3822) API. Also, I have been testing the endpoint manually, and the data is the same comparing it to beaconcha.in. In *this* update, I want to cover the 4 cases the `attestation_rewards` falls into: - [validator voted correctly](#Validator-voted-correctly-), - [validator didn't vote correctly](#Validator-didn’t-vote-correctly-), - [validator gets penalized](#Validator-gets-penalized-), and - [validator is not eligible](#Validator-is-not-eligible-). The following data is from *epoch x*. beaconcha.in uses a different approach, so we need to compare the API data with *epoch x+2* from beaconcha.in. ## Validator voted correctly :heavy_check_mark: Query: ```bash $ curl --data "[1234, 5678]" -H "Content-Type: application/json" "http://localhost:5052/eth/v1/beacon/rewards/attestations/179090" | jq ``` Output: ```json { "execution_optimistic": false, "data": { "ideal_rewards": [], // ommitted "total_rewards": [ { "validator_index": "1234", "head": "3225", "target": 6451, "source": 3468 }, { "validator_index": "5678", "head": "3225", "target": 6451, "source": 3468 } ] } } ``` [https://beaconcha.in/validator/1234](https://beaconcha.in/validator/1234): ![](https://i.imgur.com/6uNDq3p.png) [https://beaconcha.in/validator/5678](https://beaconcha.in/validator/5678): ![](https://i.imgur.com/OMafWbA.png) ## Validator didn't vote correctly :heavy_check_mark: Query: ```bash $ curl --data "[513464, 513458]" -H "Content-Type: application/json" "http://localhost:5052/eth/v1/beacon/rewards/attestations/179090" | jq ``` Output: ```json { "execution_optimistic": false, "data": { "ideal_rewards": [], // ommitted "total_rewards": [ { "validator_index": "513464", "head": "0", "target": 6451, "source": 3468 }, { "validator_index": "513458", "head": "0", "target": 6451, "source": 3468 } ] } } ``` [https://beaconcha.in/validator/513464](https://beaconcha.in/validator/513464): ![](https://i.imgur.com/FPDdCEv.png) [https://beaconcha.in/validator/513458](https://beaconcha.in/validator/513458): ![](https://i.imgur.com/t5W9W61.png) ## Validator gets penalized :heavy_check_mark: Query: ```bash $ curl --data "[512737, 513184]" -H "Content-Type: application/json" "http://localhost:5052/eth/v1/beacon/rewards/attestations/179090" | jq ``` Output: ```json { "execution_optimistic": false, "data": { "ideal_rewards": [], // ommitted "total_rewards": [ { "validator_index": "512737", "head": "0", "target": -6487, "source": -3493 }, { "validator_index": "513184", "head": "0", "target": -6487, "source": -3493 } ] } } ``` [https://beaconcha.in/validator/512737](https://beaconcha.in/validator/512737): ![](https://i.imgur.com/80cZ1ZC.png) [https://beaconcha.in/validator/513184](https://beaconcha.in/validator/513184): ![](https://i.imgur.com/28yzDNP.png) ## Validator is not eligible :heavy_check_mark: Query: ```bash $ curl --data "[20075]" -H "Content-Type:application/json" "http://localhost:5052/eth/v1/beacon/rewards/attestations/179099" | jq ``` Output: ```json { "execution_optimistic": false, "data": { "ideal_rewards": [], // ommitted "total_rewards": [ { "validator_index": "20075", "head": "0", "target": 0, "source": 0 } ] } } ``` [https://beaconcha.in/validator/20075](https://beaconcha.in/validator/20075): ![](https://i.imgur.com/02YM3hi.png) ## Next steps I am happy that I finally got the API working. However, I still need to dig deeper into the data to ensure it works as intended.