Skip to content

[LABS-493] Add drivers for common puzzle types - #21373

Merged
emlowe merged 12 commits into
mainfrom
quex.common_puzzle_drivers
Sep 15, 2026
Merged

emlowe merged 12 commits into
mainfrom
quex.common_puzzle_drivers

Conversation

@Quexington

@Quexington Quexington commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Note

Medium Risk
Wide refactor of spend construction across pooling, VC, and CAT flows; behavior should be equivalent but any encoding mistake would affect on-chain spends.

Overview
Introduces typed puzzle drivers for common CLVM patterns: P2Conditions (pay-to-conditions inner puzzles), ACSPuzzle/ACSSolution (always-succeed puzzle and condition-list solutions), and NilPuzzle/NilSolution, each with match() parsing from UnknownPuzzle/UnknownSolution. A small DRIVER_REGISTRY lists these driver pairs for future use.

The bulk of the PR migrates wallet code and tests away from hand-built Program.to((1, …)) tuples and raw opcode lists toward CreateCoin / other Condition types plus .program from the new drivers. Production paths updated include PlotNFT drivers/wallet, VC/CR-CAT drivers, data layer wallet, and DID recovery puzzles.

Tests gain coverage for ACS, Nil, and P2Conditions matching; VerifiedCredential.launch memo typing widens from list[bytes32] to list[bytes].

Reviewed by Cursor Bugbot for commit a5989d6. Bugbot is set up for automated code reviews on this repo. Configure here.

@Quexington
Quexington requested a review from a team as a code owner September 8, 2026 22:38
@Quexington Quexington added the Added Required label for PR that categorizes merge commit message as "Added" for changelog label Sep 8, 2026

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes using high effort and found 2 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Want fixes drafted automatically? Bugbot Autofix can create code changes for findings. A team admin can enable Autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 74ea16b. Configure here.

Comment thread chia/data_layer/data_layer_wallet.py Outdated
Comment thread chia/wallet/vc_wallet/vc_drivers.py
@Quexington
Quexington temporarily deployed to windows-code-signing September 8, 2026 22:52 — with GitHub Actions Inactive
Base automatically changed from quex.uncurried_to_unknown to main September 9, 2026 15:13
@github-actions github-actions Bot added the merge_conflict Branch has conflicts that prevent merge to main label Sep 9, 2026
@github-actions github-actions Bot removed the merge_conflict Branch has conflicts that prevent merge to main label Sep 9, 2026
@Quexington
Quexington temporarily deployed to windows-code-signing September 9, 2026 20:55 — with GitHub Actions Inactive
@richardkiss
richardkiss self-requested a review September 10, 2026 01:35
richardkiss
richardkiss previously approved these changes Sep 10, 2026
@Quexington
Quexington deployed to windows-code-signing September 10, 2026 20:42 — with GitHub Actions Active
@coveralls-official

coveralls-official Bot commented Sep 10, 2026

Copy link
Copy Markdown

Coverage Report for CI Build 34896409727

Warning

Build has drifted: This PR's base is out of sync with its target branch, so coverage data may include unrelated changes.
Quick fix: rebase this PR. Learn more →

Coverage decreased (-0.08%) to 90.178%

Details

  • Coverage decreased (-0.08%) from the base build.
  • Patch coverage: 10 uncovered changes across 2 files (168 of 178 lines covered, 94.38%).
  • 86 coverage regressions across 31 files.

Uncovered Changes

File Changed Covered %
chia/wallet/puzzles/puzzle_driver_registry.py 9 0 0.0%
chia/wallet/did_wallet/did_wallet_puzzles.py 3 2 66.67%
Total (26 files) 178 168 94.38%

Coverage Regressions

86 previously-covered lines in 31 files lost coverage.

Top 10 Files by Coverage Loss Lines Losing Coverage Coverage
chia/_tests/core/util/test_lockfile.py 26 76.11%
chia/server/chia_policy.py 7 88.37%
chia/_tests/core/server/test_event_loop.py 6 83.72%
chia/introducer/introducer.py 5 75.76%
chia/timelord/timelord.py 5 69.88%
chia/_tests/util/misc.py 4 76.35%
chia/data_layer/data_store.py 2 93.22%
chia/farmer/farmer.py 2 84.72%
chia/full_node/full_node_api.py 2 86.21%
chia/full_node/full_node.py 2 84.48%

Coverage Stats

Coverage Status
Relevant Lines: 126694
Covered Lines: 116798
Line Coverage: 92.19%
Relevant Branches: 24892
Covered Branches: 19899
Branch Coverage: 79.94%
Branches in Coverage %: Yes
Coverage Strength: 1.84 hits per line

💛 - Coveralls

@Quexington Quexington closed this Sep 14, 2026
@Quexington Quexington reopened this Sep 14, 2026
@Quexington
Quexington deployed to windows-code-signing September 14, 2026 21:02 — with GitHub Actions Active
@github-actions

Copy link
Copy Markdown
Contributor
File Coverage Missing Lines
chia/wallet/did_wallet/did_wallet_puzzles.py 66.7% lines 147
chia/wallet/puzzles/puzzle_driver_registry.py 0.0% lines 1, 3, 5, 17-21, 24
Total Missing Coverage
178 lines 10 lines 94%

@emlowe
emlowe merged commit db06722 into main Sep 15, 2026
1777 of 1785 checks passed
@emlowe
emlowe deleted the quex.common_puzzle_drivers branch September 15, 2026 19:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Added Required label for PR that categorizes merge commit message as "Added" for changelog coverage-diff

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants