-
Notifications
You must be signed in to change notification settings - Fork 997
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
Rename 'slot' to 'slot_number' #544
Conversation
@tarasbob could you change to against I remember that we discussed it when we renamed |
I was just reading the spec and trying to understand it. It feels to me that adding the explicit word "number" makes it easier to understand for people who are not familiar with the spec. (For example, it reminds the reader that there are many slots, one after another. Especially since "slot" is a new term, I don't think it's used in Eth 1.0 or other blockchains afaik.) The same reasoning could apply to renaming shard to shard_number. |
I respectfully disagree with this change:
With regards to |
We're going the other direction 😂and removing
The good news is that naming is not technically part of the spec. The spec merely tries to make a sane suggestion. Implementers can use |
Is the ordering of fields in the SSZ list still lexicographic? If so, spec name changes can potentially affect implementations. EDIT: Additionally, keeping naming the same as the spec really helps with cross-referencing whenever the spec changes. Personally, I would change our variable names to match the spec. I speak from experience because my first beacon chain impl used different function names and it was very difficult to track changes. But you're right, 8+ teams aren't "required" to refactor. |
@paulhauner Ordering of ssz fields is based upon ordering in defined datastructure rather than lexicographical. Implementations can name whatever they want (although following spec a decent amount will aid in readability). |
Great, I think this is a good call. I remember it being lexicographic at one stage, but I might be making that up. Lighthouse is using the order they're defined. |
It did use to be lexicographic! |
Closing. I think using |
I think this makes it clearer and explicit. The word "slot" alone intuitively feels like we are referring to some kind of object instead of a number.