Skip to content

test(grey-state): add proptests for transition validation and judgments#830

Open
wangzishuai1987 wants to merge 1 commit into
jarchain:masterfrom
wangzishuai1987:test/transition-proptest
Open

test(grey-state): add proptests for transition validation and judgments#830
wangzishuai1987 wants to merge 1 commit into
jarchain:masterfrom
wangzishuai1987:test/transition-proptest

Conversation

@wangzishuai1987
Copy link
Copy Markdown

Summary

Adds property-based tests for the block state transition module (Section 4):

validate_header:

  • Rejects blocks with timeslot ≤ state timeslot (non-advancing)
  • Accepts blocks with advancing timeslot and valid author index

apply_judgments (Section 10):

  • Supermajority positive votes → report marked "good"
  • Zero positive votes → report marked "bad"
  • Minority positive votes (1 to one-third) → report marked "wonky"
  • Multiple verdicts on different reports are handled independently

rotate_auth_pool:

  • Clears the pool on epoch boundaries

Refs: #229

Add property-based tests for the block state transition module:
- validate_header: rejects non-advancing timeslot, accepts advancing
- apply_judgments: supermajority → good, zero positive → bad,
  minority → wonky, multiple verdicts handled independently
- rotate_auth_pool: clears pool on epoch boundaries

Refs: jarchain#229
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 2, 2026

Genesis Review

Comparison targets:

How to review

Post a comment with the following format (rank from best to worst):

/review
difficulty: <commit1>, <commit2>, ..., <commitN>, currentPR
novelty: <commit1>, <commit2>, ..., <commitN>, currentPR
design: <commit1>, <commit2>, ..., <commitN>, currentPR
verdict: merge

Use the short commit hashes above and currentPR for this PR.
Each line ranks all comparison targets + this PR from best to worst.

To meta-review another reviewer's comment, react with 👍 or 👎.

@johandroid
Copy link
Copy Markdown
Contributor

/review
difficulty: 72e0c9d, f271eba, 2fe2659, currentPR, f334ec7, 011549c, 893afee, 5a3d08f
novelty: 72e0c9d, f271eba, 2fe2659, currentPR, f334ec7, 5a3d08f, 011549c, 893afee
design: 72e0c9d, f271eba, 2fe2659, f334ec7, 011549c, 893afee, 5a3d08f, currentPR
verdict: notMerge

The transition proptest coverage is a good target area, but this patch appears not to compile against the current API: State has no Default implementation, and rotate_auth_pool takes (&mut State, &GuaranteesExtrinsic, &Config), not a boolean. Even aside from compilation, the “valid author index” header test uses a minimal state without constructing validators. Ranked high enough for attempting meaningful state-transition coverage, but design is last until the tests are wired to real fixtures.

@github-actions
Copy link
Copy Markdown
Contributor

JAR Bot: Review recorded from @johandroid (1 reviews, 0 meta-reviews).
Merge weight: 0/37665 (need >50%).

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