jito-foundation / stakenet

Jito StakeNet
https://www.jito.network/stakenet/
Apache License 2.0
40 stars 17 forks source link

Track Epoch Start Time in the ClusterHistoryAccount #18

Closed ebatsell closed 3 months ago

ebatsell commented 6 months ago

Is your feature request related to a problem? Please describe. In order to better track APY of validators and stake pools on chain, we need to know the real world time that epochs started. The ClusterHistory account is the logical place to store this network-level field.

Describe the solution you'd like Use the epochstart timestamp from the Clock sysvar to read this field on chain for the current epoch and store it in the ClusterHistoryEntry for this epoch. This can be done in the copy_cluster_info instruction.

Describe alternatives you've considered N/A

Additional context N/A

butonium commented 5 months ago

jm :coffee:, could I be assigned to this one? Additionally, do you have any hints for resolving the test_copy_cluster_info failure related to memory allocation?

ebatsell commented 5 months ago

@butonium yes! we're currently working on a fix for that, expect it to be resolved sometime next week. In the meantime, if you get to this before the fix is in, you can comment out the parts of the copy_cluster_info instruction and test related to the slot_history account and total_blocks. Then we can merge the fix into your PR and test everything properly