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

FIP-0086 Include message-rebroadcast and skipping rounds #998

Open
wants to merge 22 commits into
base: master
Choose a base branch
from

Conversation

ranchalp
Copy link
Contributor

@ranchalp ranchalp commented Apr 26, 2024

Follow design master issue at filecoin-project/go-f3#177

@ranchalp ranchalp marked this pull request as ready for review May 3, 2024 08:23
@jsoares jsoares requested review from Stebalien, Kubuxu and masih May 3, 2024 10:59
Copy link
Member

@masih masih left a comment

Choose a reason for hiding this comment

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

Indentation in pseudocode looks uneven due to intermittent use if tab vs. space. A quick find/replace should get those sorted out. I recommend replacing them all with spaces.

I am worried that I might misinterpret the pseudocode because of the indentation. I'd be grateful if you can get the indentation fixed first before I leave too many silly comments 😊

FIPS/fip-0086.md Outdated Show resolved Hide resolved
FIPS/fip-0086.md Outdated Show resolved Hide resolved
FIPS/fip-0086.md Outdated Show resolved Hide resolved
ranchalp and others added 4 commits May 3, 2024 15:13
Co-authored-by: Masih H. Derkani <m@derkani.org>
Co-authored-by: Masih H. Derkani <m@derkani.org>
Co-authored-by: Masih H. Derkani <m@derkani.org>
@ranchalp
Copy link
Contributor Author

ranchalp commented May 3, 2024

@masih the indenting has been fixed. Note indenting is not perfect (at least in edit mode) because the \bottom special character occupies more than a regular character (not fully monospace).

Copy link
Member

@anorth anorth left a comment

Choose a reason for hiding this comment

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

More substantive technical questions in #809 (comment) and #809 (comment)

FIPS/fip-0086.md Outdated Show resolved Hide resolved
FIPS/fip-0086.md Outdated

45: reBroadcast <COMMIT, value, instance, round, evidence>; trigger(timeout)
46: collect a clean set M of valid COMMIT messages from this round and instance
OR (NOT mayHaveStrongQuorum(value, round, step, 0) for all value ≠ 丄)
Copy link
Member

Choose a reason for hiding this comment

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

Can we just say has strong quorum of bottom, instead of does not have for any other value? I believe that's a necessary equivalent condition, and this result is relied on at 55. Looping over all values and checking is inelegant if we have this assumption.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, thanks, good catch. Done.

FIPS/fip-0086.md Outdated
47: if (HasStrongQuorumValue(M) AND StrongQuorumValue(M) ≠ 丄) \* decide
48: evidence ← Aggregate(M)
49: reBroadcast <DECIDE, StrongQuorumValue(M), instance, evidence> \* break loop, wait for other DECIDE messages
50: if (∃ m ∈ M: m.value ≠ 丄 s.t. mayHaveStrongQuorum(m.value, r, COMMIT, 1/3)) \* m.value was possibly decided by others
Copy link
Member

Choose a reason for hiding this comment

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

As I noted while implementing, this is simpler to follow if the branches of this if are flipped. Test explicitly for strong quorum of bottom. If that is not found, take the non-buttom value that must exist in some message, with the assertion that it might have been decided by another participant.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done, thanks.

FIPS/fip-0086.md Outdated

45: reBroadcast <COMMIT, value, instance, round, evidence>; trigger(timeout)
46: collect a clean set M of valid COMMIT messages from this round and instance
OR (NOT mayHaveStrongQuorum(value, round, step, 0) for all value ≠ 丄)
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
OR (NOT mayHaveStrongQuorum(value, round, step, 0) for all value ≠ 丄)
OR (NOT mayHaveStrongQuorum(value, round, COMMIT, 0) for all value ≠ 丄)

?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Wrote in a commit not to spam with a commit for this. Hence why not committing the suggestion.

FIPS/fip-0086.md Outdated Show resolved Hide resolved
FIPS/fip-0086.md Outdated
OR (step = DECIDE | valid DECIDE evidence
AND (∃ M: Power(M)>⅔ AND evidence=Aggregate(M) | is a strong quorum
AND ∀ m’ ∈ M: m’.step = COMMIT | of COMMIT messages
AND ∀ m’ ∈ M: m’.round = round | from the same round
Copy link
Member

Choose a reason for hiding this comment

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

DECIDE round is always zero, so this never passes. This instead wants to say the COMMIT messages all have the same round as each other.

(I thought we fixed this once already...)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch, thanks. And yes, it sounds just like what we discussed at some point, but it is part of the modifications in this PR 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Traced back the reintroduction of this typo to #985 . Went through the changes there and could not find any other typo being reintroduced, other than using Power(M)>2/3 instead of IsStrongQuorum (and fixed that in this PR too).

Co-authored-by: Alex North <445306+anorth@users.noreply.github.com>
@ranchalp
Copy link
Contributor Author

ranchalp commented May 7, 2024

Thanks for the review @anorth , the changes have been added.

Copy link
Member

@jsoares jsoares left a comment

Choose a reason for hiding this comment

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

Editorial review. Looks good apart from some formatting issues. Did some checking against the Google doc and they seem consistent -- however, due to some changes in notation and structure, I may have missed something.

FIPS/fip-0086.md Outdated

12: while (step != DECIDE) {
13: if (round = 0)
14: BEBroadcast <QUALITY, value, instance>; trigger (timeout)
Copy link
Member

Choose a reason for hiding this comment

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

The indentation step remains inconsistent, also on formatted preview. Can we standardise on 2 spaces per level or something alike?

image

@anorth
Copy link
Member

anorth commented May 9, 2024

I made my comments on the new v3 version in the Google doc which was published at the same time, for faster/easier initial discussion.

@ranchalp
Copy link
Contributor Author

ranchalp commented May 10, 2024

Went through you comments in the doc and applied most of the changes both here and there. @anorth A couple of standing comments were left in the doc with replies.

Copy link
Member

@anorth anorth left a comment

Choose a reason for hiding this comment

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

Thanks, the major items I raised in discussion are now addressed. There are parts where this spec is much too concrete and doesn't appear to allow implementers much freedom to do it better. I think these would be better if made more abstract and directly describing the properties required, rather than how to achieve them.

There's lots of inconsistent indentation in the pseudocode. Can we stick to 2 spaces?

FIPS/fip-0086.md Outdated Show resolved Hide resolved
FIPS/fip-0086.md Outdated Show resolved Hide resolved
FIPS/fip-0086.md Outdated Show resolved Hide resolved
FIPS/fip-0086.md Outdated Show resolved Hide resolved
FIPS/fip-0086.md Outdated Show resolved Hide resolved
@vukolic
Copy link

vukolic commented May 20, 2024

@anorth your last batch of comments is hopefully now fixed + I polished the indentation

FIPS/fip-0086.md Outdated Show resolved Hide resolved
Copy link
Member

@anorth anorth left a comment

Choose a reason for hiding this comment

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

Thanks, changes LGTM now

@jennijuju
Copy link
Member

@masih / @anorth, can one of you resolve the conflict so we can merge this?

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.

None yet

6 participants