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: Changes from 1st Audit #985

Merged
merged 19 commits into from
Apr 16, 2024

Conversation

ranchalp
Copy link
Contributor

@ranchalp ranchalp commented Apr 8, 2024

Draft for the moment. Track changes here.

@jsoares jsoares changed the title Changes from 1st Audit FIP-0086: Changes from 1st Audit Apr 9, 2024
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
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.

Content LGTM

FIPS/fip-0086.md Outdated
ValidEvidence(m= <step, value, instance, round, evidence, ticket>):

if ( step = PREPARE and round = 0) | in the first round,
AND (evidence = nil) | evidence for PREPARE
Copy link
Member

Choose a reason for hiding this comment

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

Alignment of | is broken here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks, addressed.

FIPS/fip-0086.md Outdated
AND ∀ m’ ∈ M: m’.step = PREPARE | of PREPARE messages
AND ∀ m’ ∈ M: m’.round = round | from the same round
AND ∀ m’ ∈ M: m’.value = value) | for the same value, or
OR (value = 丄)) | COMMIT is for 丄 with
Copy link
Member

Choose a reason for hiding this comment

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

This case value = bottom already handled at 480, so should be impossible here (or the message has evidence that it shouldn't)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks, addressed.

@ranchalp
Copy link
Contributor Author

Resolved conflicts

@ranchalp ranchalp marked this pull request as ready for review April 12, 2024 09:27
@ranchalp ranchalp requested a review from TippyFlitsUK as a code owner April 12, 2024 09:27
FIPS/fip-0086.md Outdated
7: evidencenil \* used to communicate optional evidence for the voted value
5: valueproposal \* used to communicate the voted value to others (proposal or 丄)
6: evidencenil \* used to communicate optional evidence for the voted value
7: C{baseChain}

8: while (not decideSent) {
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
8: while (not decideSent) {
8: while (NOT decideSent) {

not and NOT seem to be inconsistently used throughout the pseudocode. Either is fine, I'd probably go with all caps for consistency with other logical operators.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed in the latest commit, rejected here.

Comment on lines +477 to +509
ValidEvidence(m= <step, value, instance, round, evidence, ticket>):

if ( step = PREPARE and round = 0) | in the first round,
AND (evidence = nil) | evidence for PREPARE
return True | is nil

if (step = COMMIT and value = 丄) | a COMMIT for 丄 carries no evidence
AND (evidence = nil)
return True

If (evidence.instance != instance) | the instance of the evidence must be the
return False | same as that of the message

| valid evidences for
return (step = CONVERGE OR (step = PREPARE AND round>0) | CONVERGE and PREPARE in
AND (∃ M: Power(M)>⅔ AND evidence=Aggregate(M) | round>0 is strong quorum
AND ((∀ m’ ∈ M: m’.step = COMMIT AND m’.value = 丄) | of COMMIT msgs for 丄
OR (∀ m’ ∈ M: m’.step = PREPARE AND | or PREPARE msgs for
m’.value = value)) | CONVERGE value
AND (∀ m’ ∈ M: m’.round = round-1))) | from previous round


OR (step=COMMIT | valid COMMIT evidence
AND (∃ M: Power(M)>⅔ AND evidence=Aggregate(M) | is a strong quorum
AND ∀ m’ ∈ M: m’.step = PREPARE | of PREPARE messages
AND ∀ m’ ∈ M: m’.round = round | from the same round
AND ∀ m’ ∈ M: m’.value = value)) | for the same value, or

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
AND ∀ m’ ∈ M: m’.value = value)) | for the same value
Copy link
Member

Choose a reason for hiding this comment

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

The alignment is pretty broken when rendered. Likely a consequence of the mix of space- and tab-based indentation; would be best to go all space as in the previous version. Tabs also show elsewhere in the doc, so maybe configure your editor accordingly.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think you meant in the previous block of pseudocode? My rendered version looks fine here. The fix for the previous block of pseudocode was a combination of indents and whitespaces (as a result of the font not being monospace, due to special symbols like 丄 taking more width). If that is what it was, fixed.

FIPS/fip-0086.md Outdated
@@ -729,7 +754,7 @@ The modifications proposed in this FIP have far-reaching implications for the se

* **Censorship.** F3 and GossiPBFT are designed with censorship resistance in mind. The updated fork choice rule means that an adversary controlling at least more than ⅓ QAP can try to perform a censorship attack if honest participants start an instance of GossiPBFT proposing at least two distinct inputs. While this attack is theoretically possible, it is notably hard to perform on F3 given the QUALITY step of GossiPBFT and other mitigation strategies specifically put in place to protect against this. We strongly believe that, even against a majority adversary, the mitigations designed will prevent such an attack.
* **Liveness.** Implementing F3 introduces the risk that an adversary controlling at least ⅓ QAP prevents termination of a GossiPBFT instance. In that case, the F3 component would halt, not finalizing any tipset anymore. At the same time, EC would still operate, outputting tipsets and considering them final after 900 epochs. The liveness of the system is thus not affected by attacks on the liveness of F3.
* **Safety.** Implementing F3 ensures the safety of finalized outputs during regular or even congested networks against a Byzantine adversary controlling less than ⅓ QAP. For stronger adversaries, F3 provides mitigations to prevent censorship attacks, as outlined above. If deemed necessary, the punishment and recovery from coalitions in the event of an attempted attack on safety can be explored in future FIPs. Note that safety is already significantly improved by F3 compared to the status quo: F3 provides safety of finalized outputs two orders of magnitude faster than the current estimate of 900 epochs during regular network operation.
* **Safety.** Implementing F3 ensures the safety of finalized outputs during regular or even congested networks against a Byzantine adversary controlling less than ⅓ QAP. For stronger adversaries, F3 provides mitigations to prevent censorship attacks, as outlined above. If deemed necessary, the punishment and recovery from coalitions in the event of an attempted attack on safety can be explored in future FIPs. Note that (safe) finality time is already significantly improved by F3 compared to the status quo: F3 provides safety of finalized outputs two orders of magnitude faster than the current estimate of 900 epochs during regular network operation.
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
* **Safety.** Implementing F3 ensures the safety of finalized outputs during regular or even congested networks against a Byzantine adversary controlling less than ⅓ QAP. For stronger adversaries, F3 provides mitigations to prevent censorship attacks, as outlined above. If deemed necessary, the punishment and recovery from coalitions in the event of an attempted attack on safety can be explored in future FIPs. Note that (safe) finality time is already significantly improved by F3 compared to the status quo: F3 provides safety of finalized outputs two orders of magnitude faster than the current estimate of 900 epochs during regular network operation.
* **Safety.** Implementing F3 ensures the safety of finalized outputs during regular or even congested networks against a Byzantine adversary controlling less than ⅓ QAP. For stronger adversaries, F3 provides mitigations to prevent censorship attacks, as outlined above. If deemed necessary, the punishment and recovery from coalitions in the event of an attempted attack on safety can be explored in future FIPs. Note that the (safe) finality time is already significantly improved by F3 compared to the status quo: F3 provides safety of finalized outputs two orders of magnitude faster than the current parameter of 900 epochs during regular network operation.

Not something you changed now, but I think we should refer to the 900 epochs as a parameter/setting rather than an estimate.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed in the latest commit (in batch with your other comments and suggestions), rejected here.

@jennijuju
Copy link
Member

editorial review ✅

@anorth anorth merged commit 6aea945 into filecoin-project:master Apr 16, 2024
1 check passed
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.

5 participants