Skip to main content
Version: stable (23.9.1)

View block rewards

Use the rewards API to view the validator rewards.

note

You cannot query attestation rewards for the latest epoch.

Enable the rewards API with the --rest-api-enabled command line option.

tip

A Swagger interface is also available. Use the --rest-api-docs-enabled command line option to enable the web interface.

Limitations

The following limitations apply:

  • The rewards API currently supports the altair fork upgrade and later.

  • The rewards API relies on state and block data to retrieve the reward information, meaning you'll receive limited data if the beacon node being queried is not an archive node.

  • You can only query blocks from finalized to head if you are in prune storage mode.

Impact of data storage modes

tip

You can change the data-storage-mode without re-initializing your database.

You can change the frequency that states are stored by specifying data-storage-archive-frequency, but it will only affect the state storage from the time that the change has been made. It will also directly impact the amount of disk space required by Teku.

Consider using a beacon node with archive mode storage if you frequently call the rewards API on finalized data. However, this may produce slow results due to having to replay blocks due to the infrequent storage of states on disk (every 2048 slots by default).

You can consider tuning your data storage to access data quicker, by storing more states (at the cost of disk space), for example, setting the archive frequency to 256 or even 64, and replaying less blocks.

Examples

Query all the rewards from the block currently at head.

curl http://localhost:5051/eth/v1/beacon/rewards/blocks/head |jq

Query all the sync committee rewards from the block at head for validator index 1.

curl -X POST \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
http://localhost:5051/eth/v1/beacon/rewards/sync_committee/head \
-d '["1"]' |jq

Query attestation rewards from epoch 204644, just for validator index 0.

curl -X POST \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
http://localhost:5051/eth/v1/beacon/rewards/attestations/204648 \
-d '["0"]' |jq