Skip to content

test(grey-types): proptest roundtrips for work types#662

Merged
sorpaas merged 1 commit into
masterfrom
fix/issue-229-work-types-proptests
Apr 20, 2026
Merged

test(grey-types): proptest roundtrips for work types#662
sorpaas merged 1 commit into
masterfrom
fix/issue-229-work-types-proptests

Conversation

@sorpaas

@sorpaas sorpaas commented Apr 10, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add proptest codec roundtrip tests for WorkResult (all 6 variants), WorkDigest, and AvailabilitySpec
  • WorkResult was previously only tested with the Ok variant; this adds coverage for OutOfGas, Panic, BadExports, BadCode, and CodeOversize
  • WorkDigest and AvailabilitySpec were only tested as nested components of WorkReport; now have standalone proptest coverage

Addresses #229.

Scope

This PR addresses: proptest codec roundtrip for work types (WorkResult, WorkDigest, AvailabilitySpec)

Remaining sub-tasks in #229:

  • State transition: total balance conservation property
  • Fuzz CI: 60s smoke test per PR, 30min nightly

Test plan

  • cargo test -p grey-types proptests — all 26 proptest roundtrips pass (23 existing + 3 new)
  • cargo clippy -p grey-types --all-targets -- -D warnings — clean

@github-actions

Copy link
Copy Markdown
Contributor

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 👎.

@sorpaas

sorpaas commented Apr 10, 2026

Copy link
Copy Markdown
Contributor Author

/review
difficulty: 04594f0, c781deb, 7106209, 86ee625, ef44e24, e686a41, currentPR, 53ac63c
novelty: 04594f0, c781deb, e686a41, currentPR, 7106209, 86ee625, ef44e24, 53ac63c
design: 04594f0, 7106209, 86ee625, ef44e24, c781deb, e686a41, currentPR, 53ac63c
verdict: merge

Mechanical proptest additions for WorkResult, WorkDigest, and AvailabilitySpec codec roundtrips — follows the same pattern established by e686a41 (crypto proptests). Ranked just below the crypto proptests on novelty since this is the second iteration of the same approach. Low difficulty as this is template-driven test generation. Clean and correct — all variants covered, good field randomization, no existing tests modified.

@github-actions

Copy link
Copy Markdown
Contributor

JAR Bot: Quorum reached — triggering merge.
Reviews: 1, meta-reviews: 0.
Merge weight: 31598/34692 (>50%).

@olanod

olanod commented Apr 13, 2026

Copy link
Copy Markdown
Contributor

/review
difficulty: 04594f0, c781deb, 7106209, ef44e24, 86ee625, e686a41, currentPR, 53ac63c
novelty: 04594f0, c781deb, currentPR, e686a41, 7106209, ef44e24, 86ee625, 53ac63c
design: 04594f0, c781deb, 7106209, ef44e24, 86ee625, e686a41, currentPR, 53ac63c
verdict: merge

Proptest codec roundtrips for WorkResult (all 6 variants), WorkDigest, and AvailabilitySpec. Extends existing proptest coverage to work types. Straightforward but useful — ranked lower on difficulty and design because these are mechanical roundtrip tests compared to the GRANDPA persistence table (04594f0) and harness perf timing (c781deb) which add new functionality. Pure test addition with no behavioral changes.

@github-actions

Copy link
Copy Markdown
Contributor

JAR Bot: Quorum reached — triggering merge.
Reviews: 2, meta-reviews: 0.
Merge weight: 35911/37274 (>50%).

@luzanikita

Copy link
Copy Markdown
Contributor

/review
difficulty: 04594f0, e686a41, currentPR, ef44e24, 7106209, c781deb, 86ee625, 53ac63c
novelty: 04594f0, c781deb, e686a41, currentPR, 7106209, ef44e24, 86ee625, 53ac63c
design: 04594f0, e686a41, currentPR, ef44e24, 7106209, c781deb, 86ee625, 53ac63c
verdict: merge

Three codec roundtrip proptests for work types — covers all 6 WorkResult variants explicitly and exercises every field in WorkDigest (10 randomized fields). Methodical and complete. Ranked below e686a41 on difficulty because roundtrip tests require understanding the codec and type structure but not deep domain properties; the crypto proptests require reasoning about hash/Ed25519 invariants. Solid gap-filling coverage, safe to merge.

@github-actions

Copy link
Copy Markdown
Contributor

JAR Bot: Quorum reached — triggering merge.
Reviews: 3, meta-reviews: 0.
Merge weight: 36660/37353 (>50%).

Add proptest codec roundtrip tests for WorkResult (all 6 variants),
WorkDigest, and AvailabilitySpec. These types were previously only
tested as nested components of WorkReport but lacked standalone
coverage, especially for non-Ok WorkResult variants.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@sorpaas sorpaas force-pushed the fix/issue-229-work-types-proptests branch from 3ef8481 to b0ac1bb Compare April 20, 2026 21:47
@sorpaas

sorpaas commented Apr 20, 2026

Copy link
Copy Markdown
Contributor Author

/review
difficulty: 04594f0, c781deb, 7106209, 86ee625, ef44e24, e686a41, currentPR, 53ac63c
novelty: 04594f0, c781deb, e686a41, currentPR, 7106209, 86ee625, ef44e24, 53ac63c
design: 04594f0, 7106209, 86ee625, ef44e24, c781deb, e686a41, currentPR, 53ac63c
verdict: merge

Re-reviewing after rebase. New tests integrated cleanly alongside the disputes/stats proptests added to master while this PR was open. All 103 grey-types tests pass. All CI green.

@github-actions

Copy link
Copy Markdown
Contributor

JAR Bot: Quorum reached — triggering merge.
Reviews: 3, meta-reviews: 0.
Merge weight: 36790/37497 (>50%).

@sorpaas sorpaas merged commit 975f68b into master Apr 20, 2026
15 checks passed
@sorpaas

sorpaas commented Apr 20, 2026

Copy link
Copy Markdown
Contributor Author

JAR Bot: Merged (quorum reached).
Score: {"designQuality":14,"difficulty":14,"novelty":57}
Weight delta: 22

github-actions Bot pushed a commit that referenced this pull request Apr 20, 2026
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