Dev Update #13

Hey

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More โ†’

For the last two weeks, I have been ironing out the attestation_rewards 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:

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
Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More โ†’

Query:

$ curl --data "[1234, 5678]" -H "Content-Type: application/json" "http://localhost:5052/eth/v1/beacon/rewards/attestations/179090" | jq

Output:

{
  "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:

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More โ†’

https://beaconcha.in/validator/5678:

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More โ†’

Validator didn't vote correctly
Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More โ†’

Query:

$ curl --data "[513464, 513458]" -H "Content-Type: application/json" "http://localhost:5052/eth/v1/beacon/rewards/attestations/179090" | jq

Output:

{
  "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:

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More โ†’

https://beaconcha.in/validator/513458:

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More โ†’

Validator gets penalized
Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More โ†’

Query:

$ curl --data "[512737, 513184]" -H "Content-Type: application/json" "http://localhost:5052/eth/v1/beacon/rewards/attestations/179090" | jq

Output:

{
  "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:

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More โ†’

https://beaconcha.in/validator/513184:

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More โ†’

Validator is not eligible
Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More โ†’

Query:

$ curl --data "[20075]" -H "Content-Type:application/json" "http://localhost:5052/eth/v1/beacon/rewards/attestations/179099" | jq

Output:

{
  "execution_optimistic": false,
  "data": {
    "ideal_rewards": [], // ommitted
    "total_rewards": [
      {
        "validator_index": "20075",
        "head": "0",
        "target": 0,
        "source": 0
      }
    ]
  }
}

https://beaconcha.in/validator/20075:

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More โ†’

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.