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

Determining that a round may produce a result #66

Closed
fjarri opened this issue Nov 5, 2024 · 0 comments · Fixed by #68
Closed

Determining that a round may produce a result #66

fjarri opened this issue Nov 5, 2024 · 0 comments · Fixed by #68
Assignees
Labels
API Involves backwards-incompatible changes of the public API bug Something isn't working
Milestone

Comments

@fjarri
Copy link
Member

fjarri commented Nov 5, 2024

In the current API, a round defines a fn possible_next_rounds(&self) -> BTreeSet<RoundId> method, which returns an empty set if there are no possible next rounds. This is a sufficient condition to tell that this round produces a result, but not a necessary one - in some protocols we may either produce a result or enter an error round, in which case the returned set won't be empty.

This is important for the chain combinator from #60, because the empty possible_next_rounds() is how it determines when the first protocol ends. We need to know this to amend possible_next_rounds() to return the first round of the second protocol, so that caching messages in a Session works correctly.

So, the problem is: how do we signal that the round produces a result, in the least intrusive way? Should we add another method to Round, may_produce_result(), with a blanket implementation (returning self.possible_next_rounds().is_empty())? Or is there some way that will better guarantee that users don't forget to implement it if their protocol behaves differently?

@fjarri fjarri added bug Something isn't working API Involves backwards-incompatible changes of the public API labels Nov 5, 2024
@fjarri fjarri added this to the v1.0.0 milestone Nov 5, 2024
@fjarri fjarri self-assigned this Nov 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API Involves backwards-incompatible changes of the public API bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant