Skip to content
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

Skip the same slot as in parent block #1329

Merged
merged 1 commit into from
Mar 30, 2023
Merged

Skip the same slot as in parent block #1329

merged 1 commit into from
Mar 30, 2023

Conversation

nazar-pc
Copy link
Member

Substrate already ensures to not claim the same slot twice, but it doesn't have any checks if the parent slot happens to be the same as current, so we need to check it ourselves.

Fixes #1328

Code contributor checklist:

@liuchengxu
Copy link
Contributor

Hmm, doesn't this line ensure the produced slots are always monotonically increasing?

https://github.com/paritytech/substrate/blob/41ae90843b070786ab53071479c141a7c6649ac9/client/consensus/slots/src/slots.rs#L174

@nazar-pc
Copy link
Member Author

No, it only ensures that it claims increasing slots, if parent slot was produced by someone else, there is nothing preventing you from trying to claim the same slot. This is what I was trying to describe in the comment.

@liuchengxu
Copy link
Contributor

if parent slot was produced by someone else

produced by someone else is the key, now I see, I was thinking from the single node context, but it could be from someone else, thanks for the explanation!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants