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

Refuse finalizing a timed out round despite being notarized #99

Merged
merged 2 commits into from
Feb 25, 2025

Conversation

yacovm
Copy link
Collaborator

@yacovm yacovm commented Feb 22, 2025

This commit makes it that:

  1. Nodes can accept a notarization of a block that they timed out on
  2. Nodes will not vote on a block that they timed out on.
  3. Nodes will not broadcast a finalization of a block that they accepted its notarization.

@yacovm yacovm marked this pull request as draft February 22, 2025 00:30
@yacovm yacovm force-pushed the notarizationEmptyNot branch from be3f945 to 54e2fdd Compare February 24, 2025 18:00
This commit makes it that:

1) Nodes can accept a notarization of a block that they timed out on
2) Nodes will not vote on a block that they timed out on.
3) Nodes will not broadcast a finalization of a block that they accepted its notarization.

Signed-off-by: Yacov Manevich <[email protected]>
@yacovm yacovm force-pushed the notarizationEmptyNot branch from 54e2fdd to bc2a589 Compare February 24, 2025 20:23
@yacovm yacovm marked this pull request as ready for review February 24, 2025 20:24
@@ -858,6 +858,16 @@ func (mem *InMemStorage) waitForBlockCommit(seq uint64) Block {
}
}

func (mem *InMemStorage) ensureNoBlockCommit(t *testing.T, seq uint64) {
require.Never(t, func() bool {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

interesting, haven't seen Never used before. For readability though, i think it would make sense to create the helper function and pass it in, rather than creating it as a parameter.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally yes, but this is a utility method of the InMemStorage that is re-usable.
If I extract the passed callback to a function, the method would be a one-liner.
I'm not sure it's worth it, as the function extracted then will not be re-usable for anything other than the InMemStorage.

what do you think?

@yacovm yacovm merged commit f85918c into main Feb 25, 2025
4 checks passed
@yacovm yacovm deleted the notarizationEmptyNot branch February 25, 2025 18:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants