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

Add endpoint to evaluate leader performance based on onchain data #709

Open
jbearer opened this issue Oct 15, 2024 · 0 comments
Open

Add endpoint to evaluate leader performance based on onchain data #709

jbearer opened this issue Oct 15, 2024 · 0 comments

Comments

@jbearer
Copy link
Member

jbearer commented Oct 15, 2024

At the moment, we track performance by looking at view timeout logs (view timed out, $.fields.leader gives the node who should have been driving that view). This information is also inferable from looking at the chain, although there is not a nice collated endpoint right now. But the way we would do it is look at decided leaves (e.g. https://query.decaf.testnet.espresso.network/v0/availability/leaf/100 or https://query.decaf.testnet.espresso.network/v0/availability/stream/leaves), look at $.leaf.view_number to see views which are successful, then figuring out which views we aren't seeing to find unsuccessful views, and finally mapping view number back to leader by taking view number mod 100 (total number of nodes) and indexing into the stake table (https://query.decaf.testnet.espresso.network/v0/config/hotshot, $.config.known_nodes_with_stake)

We can make a better endpoint for pulling this data. Th interface should look like GET /node/leader-performance/:pubkey/:from/:to with :from and :to being unix timestamps specifying the window of interest, and returning a float in [0, 1] indicating the fraction of views in that window where that leader was successful. We can also include for convenience an endpoint GET /node/leader-performance/:pubkey/:from where :from indicates a number of seconds back from the current time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant