Skip to content

Conversation

dnkolegov-ar
Copy link
Collaborator

This PR updates the spec in quint

import defs.* from "../defs"
import option.* from "../option"
import replica(
N = 6,
Copy link
Contributor

Choose a reason for hiding this comment

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

I purposely removed these changes because they were never used anywhere (and just duplicate info that was already captured in CORRECT/FAULTY).

Copy link
Collaborator Author

@dnkolegov-ar dnkolegov-ar Jul 31, 2025

Choose a reason for hiding this comment

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

They are different. N and F are protocol parameters; they should not be derived from CORRECT/FAULTY in formal verification code. For example, if we do not use faulty replicas in the configuration at all, is F = 0? That is why all files were initially named nNfFbB (e.g., n6f1b0.qnt): F- the maximum number of faulty nodes when the protocol still works, B was the real number of faulty replicas in the configuration. The same with N: what if I want to test that the protocol works for three replicas without faulty? then N = 3 and F = 0. L and Q will not be computed incorrectly for that case if CORRECT/FAULT are used.

BrendanChou
BrendanChou previously approved these changes Aug 6, 2025
L + Q > N + F,

2*F + 1 <= L,
L <= N - 3*F,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Might be nice to have comments for all of these why they are necessary. I couldn't understand why this one is necessary (?)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

These two were the main points of our discussions. But it just follows from inequation if we introduce L from [ 2F+1, N-3F]:

(5*F+1 <= N) => (2*F + 3*F + 1<= N) => (2*F + 1 <= N - 3*F)
if N=5*F+1 then 2*F+1=L=N-3*F

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Also removed.


4*F + 1 <= Q,
Q <= N - F,
Q > L
Copy link
Collaborator

Choose a reason for hiding this comment

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

Q >= L technically I think. For example for N=1, Q=L=1

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Correct, but we actually do not need this. I removed it.

L <= N - 3*F,

4*F + 1 <= Q,
Q <= N - F,
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think you need to keep this invariant, right? Otherwise Q=N could be valid, which would prevent finalization from occurring? Or is Q = N - F and F = 2F+1 hardcoded somewhere?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, they are in the same file -

pure val Q = N - F;
pure val L = 2*F + 1;

4*F + 1 <= Q,
Q <= N - F,
Q > L
2*L <= (N - F) + 1, // Liveness guard, prevents equivocation stall.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nit: 2*L <= Q + 1 perhaps?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

fixed

@BrendanChou BrendanChou merged commit 392f9b5 into main Aug 7, 2025
36 checks passed
@BrendanChou BrendanChou deleted the denis/quint-fix-1 branch August 7, 2025 18:25
Copy link

codecov bot commented Aug 7, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.32%. Comparing base (868a146) to head (14b3bed).
⚠️ Report is 17 commits behind head on main.

@@            Coverage Diff             @@
##             main    #1333      +/-   ##
==========================================
- Coverage   91.37%   91.32%   -0.06%     
==========================================
  Files         251      265      +14     
  Lines       63583    66018    +2435     
==========================================
+ Hits        58097    60288    +2191     
- Misses       5486     5730     +244     

see 52 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 868a146...14b3bed. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

3 participants