substrate icon indicating copy to clipboard operation
substrate copied to clipboard

Rename Epoch to Session in BABE and throughout any parts in Substrate

Open gitwithterrence opened this issue 2 years ago • 11 comments

This PR renames the term Epoch to Session in BABE and in other parts of Substrate

Resolves Rename Epoch to Session in BABE and throughout any parts in Substrate #11317

Polkadot Address: 12c13TogHWZxH4tqo6RisztQPyPuG2YJMZb9VZRzD9L6iJf3

gitwithterrence avatar May 01 '22 20:05 gitwithterrence

could skip from epoch 1 to 3, assuming that there were no blocks in epoch 2 (currently we do not recover from empty epochs, but that might change in the future).

If I understand you correctly, you are saying there is currently no difference between epoch and session because we do not recover from an empty epoch, but if we changed that behavior, then these two terms WOULD be different?

Why couldn't we also have an empty session so that the terms are again aligned?

shawntabrizi avatar May 03 '22 11:05 shawntabrizi

i.e. we could skip from epoch 1 to 3, assuming that there were no blocks in epoch 2 (currently we do not recover from empty epochs, but that might change in the future).

This is some feature that doesn't really exists and that is really a little bit bike-shedding :P

I'm for the renaming to have a coherent naming.

However, as @andresilva already pointed out there are currently a lot of breaking changes that needs to be fixed.

bkchr avatar May 03 '22 13:05 bkchr

Why couldn't we also have an empty session so that the terms are again aligned?

That's probably reasonable and doable. Like @bkchr said maybe I'm just bike-shedding, we can deal with that whenever it comes.

andresilva avatar May 03 '22 13:05 andresilva

Hey, is anyone still working on this? Due to the inactivity this issue has been automatically marked as stale. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Jun 05 '22 23:06 stale[bot]

The 'epoch' naming matches the terminology in the paper. I think it makes sense to call it 'epoch' in BABE and say that we use BABE epochs to implement Substrate sessions. They aren't the same thing - session is a broader concept.

rphmeier avatar Jun 06 '22 01:06 rphmeier

The 'epoch' naming matches the terminology in the paper. I think it makes sense to call it 'epoch' in BABE and say that we use BABE epochs to implement Substrate sessions. They aren't the same thing - session is a broader concept.

For sure it matches the terminology in the paper, but it is just confusing to have different terminologies for the same thing. In the docs you can easily mention that "Session are the same as epoch" if you want to read the paper. However, if you read the runtime lib.rs for example you see epoch and session and don't directly know that they are related. IMO it was a huge mistake to ever have introduced these two different namings into the code base.

bkchr avatar Jun 07 '22 10:06 bkchr

IMO it was a huge mistake to ever have introduced these two different namings into the code base.

There's no guarantee that these things will be in the same code base in the future. Separating concepts decouples code, combining them (even when they aren't congruent) makes it harder to decouple in the future. You could imagine splitting the BABE logic into its own repo and then it would make more sense; it's always better to write code in a large repo in a more decoupled way.

"This crate implements BABE consensus on top of Substrate's session abstraction"

rphmeier avatar Jun 07 '22 13:06 rphmeier

If it would be done like grandpa, where the core logic is in its own crate, for sure. However, even for the own crate, the integration should then use the common wording of the code base you are integrating too. Otherwise, you can directly give up on common wording.

bkchr avatar Jun 07 '22 14:06 bkchr

Is there any update on this? I would like to introduce the proper naming on Sassafras from the beginning

davxy avatar Jun 29 '22 07:06 davxy

Hey, is anyone still working on this? Due to the inactivity this issue has been automatically marked as stale. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Jul 29 '22 10:07 stale[bot]

Is there any update on this? I would like to introduce the proper naming on Sassafras from the beginning

Please let's stick to session. There can be just one comment that explains that a session corresponds to an epoch in the paper.

bkchr avatar Jul 29 '22 16:07 bkchr