You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Some API queries do not respond the expected result in case we are waiting for a network restart.
For example, the get_stakers() list is empty if we query a cycle that is no longer in the pos_history. We should query the stakers list with the cycle of the last_start_period in that case, not the cycle associated with the current time.
The text was updated successfully, but these errors were encountered:
Where could we found last_start_period ? in gRPC side, we have a dedicated filed called context which gives information about the execution of the query, we could add a message or anything to inform the caller that's It's not the current cycle but a previous one etc
Hey @aoudiamoncef! I'm not 100% sure yet, but I think this should not be resolved at the API level directly. It's more that the info queried by the API should be more resilient.
For example, the get_stakers api point calls get_cycle_active_rolls, that calls get_all_roll_counts(cycle) in the pos_final_state.rs file.
I think it's this last function (that has access to the last_start_period from the final_state) that should handle this case :)
Leo-Besancon
changed the title
Make the API queries more robust in case of a newtork restart
Make the API queries more robust in case of a network restart
Jun 13, 2023
Some API queries do not respond the expected result in case we are waiting for a network restart.
For example, the get_stakers() list is empty if we query a cycle that is no longer in the pos_history. We should query the stakers list with the cycle of the last_start_period in that case, not the cycle associated with the current time.
The text was updated successfully, but these errors were encountered: