Skip to content

test(grey-state): add proptests for refine sub-transition#829

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

test(grey-state): add proptests for refine sub-transition#829
wangzishuai1987 wants to merge 1 commit into
jarchain:masterfrom
wangzishuai1987:test/refine-proptest

Conversation

@wangzishuai1987
Copy link
Copy Markdown

Summary

Adds property-based tests for the refine sub-transition's pure functions (Section B):

error_refine_result:

  • Preserves the work item's service_id and code_hash
  • Computes correct payload_hash via blake2b-256
  • OutOfGas with gas_used == gas_limit yields zero accumulate_gas

encode_work_package_simple:

  • Deterministic encoding
  • Concatenates authorization bytes then each item's payload in order
  • Sensitive to authorization byte changes

RefineError display:

  • CodeNotFound contains "code not found"
  • AuthorizationFailed contains the provided message
  • PvmInitFailed contains "PVM"

Refs: #229

Add property-based tests for the refine module's pure functions:
- error_refine_result: preserves identity, correct payload_hash,
  OutOfGas zero accumulate_gas
- encode_work_package_simple: deterministic, concatenation order,
  sensitive to authorization changes
- RefineError display: CodeNotFound, AuthorizationFailed, PvmInitFailed

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: 6d050e3, 6ea885c, 71607b5, currentPR, b60bec0, 9b8aef7, fa14fc5, c0ab02e
novelty: 6d050e3, 6ea885c, 71607b5, currentPR, b60bec0, 9b8aef7, fa14fc5, c0ab02e
design: 6d050e3, 6ea885c, 71607b5, b60bec0, 9b8aef7, currentPR, fa14fc5, c0ab02e
verdict: merge

Adds useful property coverage around refine error-result identity, payload hashing, simple package encoding, and display formatting. It is narrower than the consensus/audit/finality targets and mostly locks existing helper behavior rather than changing architecture, so it sits mid-pack on difficulty and lower on design. Merge is reasonable as focused test coverage.

@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