solana-labs / networkexplorer

Retired
13 stars 19 forks source link

TdS uptime should be from the start of the stage #321

Open mvines opened 5 years ago

mvines commented 5 years ago

Currently uptime for a validator is just reported over the last epoch (I think!). Perhaps we report multiple uptimes: last epoch, last N epochs, from the start of the stage?

We probably need to discuss how the implementation of this looks like, and ideally it could be computed directly from a ledger too (for offline analysis)

sbhargava commented 5 years ago

@chris-remus and @mvines to work w/ @sunnygleason on open questions.

sbhargava commented 5 years ago

@sunnygleason did you get everything you need to do this?

cfl0ws commented 5 years ago

I opened #425 about defining uptime, per the 50% requirement in the TdS Participation Agreement. The definition probably requires input from @ericlwilliams and Dominic. We're coordinating that discussion in 5.1 of the FAQ.

sunnygleason commented 4 years ago

A couple (minor?) details I noticed:

image

sunnygleason commented 4 years ago

(un-assigning myself -- if the solution is as easy as (1) compensating for scaling rewards in early epochs and (2) computing over all epochs, I can implement that anytime!)

CriesofCarrots commented 4 years ago

@sunnygleason , the slots_in_epoch values don't look right to me. Epochs double in length until they reach DEFAULT_SLOTS_PER_EPOCH (currently set to 8192 here https://github.com/solana-labs/solana/blob/51ac05b3cf7cc323dfde7351cdb9110fd4ff1361/sdk/src/clock.rs#L12), so the epochs we're looking at in that SS are likely slots_in_epoch: 2048, 1024, 512, 256, 128

Do slots_in_epoch come from the cluster for each epoch? Or is that a constant set somewhere?

sunnygleason commented 4 years ago

@CriesofCarrots great catch - I had forgotten about that!

image

What's the best way to proceed - update the RPC call to include slots_in_epoch?

sunnygleason commented 4 years ago

looking at this further - it appears that there is an EpochSchedule:

https://github.com/solana-labs/solana/blob/master/sdk/src/epoch_schedule.rs#L44

Would it be a good idea to expose this via RPC like getEpochSchedule()?

mvines commented 4 years ago

🎉 https://docs.solana.com/book/v/master/api-reference/jsonrpc-api#getleaderschedule

CriesofCarrots commented 4 years ago

I don't think that's quite what Sunny is looking for. @sunnygleason , we can get the EpochSchedule by getting the account data of the sysvar account, like we're doing here: https://github.com/solana-labs/solana/blob/7e6e7e8406318292b02591520fbe2cac7339090f/cli/src/vote.rs#L281 Of course, we'd need to implement the pattern to deserialize it.

Here's what the EpochSchedule looks like for edge.testnet.solana.com:

EpochSchedule { slots_per_epoch: 8192, leader_schedule_slot_offset: 8192, warmup: true, first_normal_epoch: 8, first_normal_slot: 8160 }

I assume you've figured out how to calculate the slots in the warmup epochs from that data...?

sunnygleason commented 4 years ago

this is live at http://edge.explorer.solana.com/tour-de-sol?force=true

Note: mouse over the uptime to see additional details - if you have inspiration for exposing the multiple uptime values, let me know!

image

sunnygleason commented 4 years ago

Uptime details view:

image

cfl0ws commented 4 years ago

@sunnygleason Can you please help me understand how the ranking is calculated? From what I can see above, the ranking appears to be based on Most Rewards Collected, if I'm interpreting the credits correctly.

If that's the case, we should probably change the name from "Top Validator Ranking" to "Most Rewards Collected, since that is one of the three quantitative rewards categories -

Also, interpreting the stats you posted above -

66935920-d8d9c380-f00a-11e9-80d5-0cde8fecf23e

Is a question that is commonly asked by validators during the dry runs. We've added the explanation to the FAQ.