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

new API endpoint: blocks x validator #117

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Conversation

Marketen
Copy link
Contributor

@Marketen Marketen commented Jun 7, 2023

This PR adds a new API endpoint that returns all blocks proposed, missed or with wrong fee of each validator (defined by validator index). The return is a JSON array of the following object, ordered by validatorIndex:
image

Important: Even though the JSON array is ordered by validatorIndex, the arrays of blocks of each validator are not ordered in this endpoint, since I suppose that the slice of the state that holds the blocks is already ordered by default (since they are appended one by one in each incrementing slot)

Alongside the new API endpoint, a new unit test for the endpoint is also added. The unit test can still be improved. At the time of writing, it mocks a oracle state with 300 blocks different types and +50 different validators so that the endpoint can be tested

@Marketen Marketen requested a review from alrevuelta June 7, 2023 17:53
@Marketen Marketen changed the title Api add block xval new API endpoint: blocks x validator Jun 7, 2023
@Marketen Marketen force-pushed the api_add_blockXval branch 3 times, most recently from 506fc95 to 83a9825 Compare June 8, 2023 11:55
@Marketen Marketen self-assigned this Jun 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant