-
Notifications
You must be signed in to change notification settings - Fork 118
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
Incorrect cycle start #2016
Comments
This can be a bit confusing, yes. We try to consider what the node responds in RPC calls as canonical. That would be defined by the pox contract (and is the most simple way of calculating). In simple terms it's the modulo of cycle (total) length (also accounting for first Stacks block height). In this way of counting, we always start with the reward phase (we could imagine the first cycle didn't have a prepare phase -- not sure if that's exactly true, but how I think about it). So, to answer the question more clearly: a cycle starts with the reward phase (and after where
Hope that makes sense -- A bit more info here: https://garden.janniks.com/PoX-Behavior |
Thanks @janniks for the explanation 🙌. Two words though: too complicated 😅 . A cycle's start, what a cycle is, and when the reward phase takes place should be precisely defined and uniformly reported by all API endpoints. It's also ok for different endpoints to report different things, but then those things need different names. Given how fundamental a "cycle" is, I believe it would help alleviate some of the confusion if a "cycle" meant the same thing in all places.
That's a great link, thank you 🙏 |
Yes, I agree. The node (mostly pox endpoint) is the closest thing we have to a definition. I think the ecosystem is getting pretty consistent, but in the code it can be tricky. Even how developers show the cycles in a UI can change how they are perceived.. The important bits are: there's cycles and you have until prepare-length blocks before a cycle starts to make your stacking txs count for that cycle. For the node, the pox endpoints use the terms "phase" and "cycle" avoid confusion, but due to backwards compatibility multiple fields looks very similar. |
The
/v2/pox
and the/extended/v2/pox/cycles/:cycle_number
endpoints are counting cycles differently.When does a cycle start? With the prepare phase or after the prepare phase?
The text was updated successfully, but these errors were encountered: