Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate puzzles away from load_clvm to import from chia_puzzles_py #19055

Open
wants to merge 53 commits into
base: main
Choose a base branch
from

Conversation

matt-o-how
Copy link
Contributor

@matt-o-how matt-o-how commented Dec 17, 2024

Purpose:

This PR migrates the deployed puzzles from living in this repository to being imported from https://github.com/Chia-Network/chia_puzzles/tree/main

The puzzle files are removed and uses of load_clvm() are replaced with Program.from_bytes() where appropriate.
We also remove duplicate redefinitions of the same Program where possible, opting to import the Program from another location instead.
This PR also renames VIRAL_BACKDOOR to REVOCATION_LAYER.

This PR does not remove load_clvm() as it is still useful for chialisp used in tests and for quick prototyping of future chialisp puzzles.

Going forward I believe also that chia\wallet\singleton.py and chia\wallet\puzzles\singleton_top_layer_v1_1.py can be merged into a single file -but this PR is already large enough.

Copy link

socket-security bot commented Dec 17, 2024

New dependencies detected. Learn more about Socket for GitHub ↗︎

Package New capabilities Transitives Size Publisher
pypi/[email protected] None 0 105 kB chia-network

View full report↗︎

@matt-o-how matt-o-how added the Changed Required label for PR that categorizes merge commit message as "Changed" for changelog label Dec 18, 2024
@github-actions github-actions bot added the merge_conflict Branch has conflicts that prevent merge to main label Jan 2, 2025
Copy link
Contributor

github-actions bot commented Jan 2, 2025

This pull request has conflicts, please resolve those before we can evaluate the pull request.

1 similar comment
Copy link
Contributor

github-actions bot commented Jan 2, 2025

This pull request has conflicts, please resolve those before we can evaluate the pull request.

@github-actions github-actions bot removed the merge_conflict Branch has conflicts that prevent merge to main label Jan 3, 2025
Copy link
Contributor

github-actions bot commented Jan 3, 2025

Conflicts have been resolved. A maintainer will review the pull request shortly.

Copy link

socket-security bot commented Jan 3, 2025

👍 Dependency issues cleared. Learn more about Socket for GitHub ↗︎

This PR previously contained dependency changes with security issues that have been resolved, removed, or ignored.

View full report↗︎

@matt-o-how matt-o-how marked this pull request as ready for review January 6, 2025 16:30
@matt-o-how matt-o-how requested a review from a team as a code owner January 6, 2025 16:30
@matt-o-how matt-o-how requested a review from richardkiss January 6, 2025 16:30
@@ -1,5 +1,6 @@
from __future__ import annotations

from chia_puzzles_py.programs import CHIALISP_DESERIALISATION, ROM_BOOTSRAP_GENERATOR
Copy link
Contributor

@richardkiss richardkiss Jan 7, 2025

Choose a reason for hiding this comment

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

typo?

Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
from chia_puzzles_py.programs import CHIALISP_DESERIALISATION, ROM_BOOTSRAP_GENERATOR
from chia_puzzles_py.programs import CHIALISP_DESERIALISATION, ROM_BOOTSTRAP_GENERATOR

Copy link
Contributor Author

Choose a reason for hiding this comment

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

annoyingly this typo is in chia-puzzles - will fix there and then here - good spot

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is resolved now

@@ -0,0 +1,293 @@
from __future__ import annotations
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm curious, what motivated the refactor into this new file?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There was a circular import somewhere if the puzzles stayed in the same place as the utils

Copy link
Contributor

Choose a reason for hiding this comment

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

I take it all of these functions were moved verbatim, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Correct

richardkiss
richardkiss previously approved these changes Jan 7, 2025
Copy link
Contributor

@richardkiss richardkiss left a comment

Choose a reason for hiding this comment

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

I don't see any obvious problems beyond the one typo. Must have been a huge amount of work!

chia/_tests/clvm/test_condition_codes.py Outdated Show resolved Hide resolved
.pre-commit-config.yaml Show resolved Hide resolved
chia/_tests/generator/test_compression.py Show resolved Hide resolved
chia/pools/pool_puzzles.py Outdated Show resolved Hide resolved
chia/rpc/wallet_rpc_api.py Show resolved Hide resolved
chia/wallet/singleton.py Outdated Show resolved Hide resolved
chia/wallet/trading/offer.py Outdated Show resolved Hide resolved
chia/wallet/util/debug_spend_bundle.py Outdated Show resolved Hide resolved
chia/wallet/vc_wallet/vc_drivers.py Outdated Show resolved Hide resolved
Copy link
Contributor

@arvidn arvidn left a comment

Choose a reason for hiding this comment

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

it seems to me that STANDARD_BRICK_PUZZLE (in vc_drivers.py) as well as ACS_TRANSFER_PROGRAM probably should be part of the chia_puzzles wheel.

ACS_TRANSFER_PROGRAM is currently defined in pure python lists, not even hex, which is a bit unusual.

@github-actions github-actions bot added the merge_conflict Branch has conflicts that prevent merge to main label Jan 8, 2025
Copy link
Contributor

github-actions bot commented Jan 8, 2025

This pull request has conflicts, please resolve those before we can evaluate the pull request.

@github-actions github-actions bot removed the merge_conflict Branch has conflicts that prevent merge to main label Jan 8, 2025
Copy link
Contributor

github-actions bot commented Jan 8, 2025

Conflicts have been resolved. A maintainer will review the pull request shortly.

Copy link
Contributor

@arvidn arvidn left a comment

Choose a reason for hiding this comment

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

poetry.lock should be restored (apart from the new chia-puzzles dependency)

poetry.lock Outdated Show resolved Hide resolved
@github-actions github-actions bot added the merge_conflict Branch has conflicts that prevent merge to main label Jan 10, 2025
Copy link
Contributor

This pull request has conflicts, please resolve those before we can evaluate the pull request.

@github-actions github-actions bot removed the merge_conflict Branch has conflicts that prevent merge to main label Jan 10, 2025
Copy link
Contributor

Conflicts have been resolved. A maintainer will review the pull request shortly.

@github-actions github-actions bot added the merge_conflict Branch has conflicts that prevent merge to main label Jan 10, 2025
Copy link
Contributor

This pull request has conflicts, please resolve those before we can evaluate the pull request.

Copy link
Contributor

File Coverage Missing Lines
chia/wallet/nft_wallet/nft_puzzle_utils.py 90.6% lines 48, 53, 61, 73, 203, 216, 223-227, 237, 251
Total Missing Coverage
445 lines 13 lines 97%

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Changed Required label for PR that categorizes merge commit message as "Changed" for changelog coverage-diff merge_conflict Branch has conflicts that prevent merge to main
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants