Skip to content

Commit

Permalink
remove full_node puzzles
Browse files Browse the repository at this point in the history
  • Loading branch information
matt-o-how committed Jan 3, 2025
1 parent dcbb434 commit e3a5f58
Show file tree
Hide file tree
Showing 15 changed files with 35 additions and 69 deletions.
4 changes: 2 additions & 2 deletions chia/_tests/clvm/test_chialisp_deserialization.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
from __future__ import annotations

import pytest
from chia_puzzles_py.programs import CHIALISP_DESERIALISATION

from chia.types.blockchain_format.program import INFINITE_COST, Program
from chia.util.byte_types import hexstr_to_bytes
from chia.wallet.puzzles.load_clvm import load_clvm

DESERIALIZE_MOD = load_clvm("chialisp_deserialisation.clsp", package_or_requirement="chia.consensus.puzzles")
DESERIALIZE_MOD = Program.from_bytes(CHIALISP_DESERIALISATION)


def serialized_atom_overflow(size):
Expand Down
28 changes: 19 additions & 9 deletions chia/_tests/generator/test_compression.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@
import io
from typing import Any

from chia_puzzles_py.programs import (
BLOCK_PROGRAM_ZERO,
CHIALISP_DESERIALISATION,
DECOMPRESS_COIN_SPEND_ENTRY,
DECOMPRESS_COIN_SPEND_ENTRY_WITH_PREFIX,
DECOMPRESS_PUZZLE,
ROM_BOOTSRAP_GENERATOR,
)
from chia_rs import serialized_length
from clvm.serialize import sexp_from_stream
from clvm.SExp import SExp
Expand All @@ -15,18 +23,20 @@
from chia.util.ints import uint32
from chia.wallet.puzzles.load_clvm import load_clvm

TEST_GEN_DESERIALIZE = load_clvm(
"test_generator_deserialize.clsp", package_or_requirement="chia._tests.generator.puzzles"
)
DESERIALIZE_MOD = load_clvm("chialisp_deserialisation.clsp", package_or_requirement="chia.consensus.puzzles")
DESERIALIZE_MOD = Program.from_bytes(CHIALISP_DESERIALISATION)

GENERATOR_MOD: Program = Program.from_bytes(ROM_BOOTSRAP_GENERATOR)

DECOMPRESS_PUZZLE = load_clvm("decompress_puzzle.clsp", package_or_requirement="chia.full_node.puzzles")
DECOMPRESS_CSE = load_clvm("decompress_coin_spend_entry.clsp", package_or_requirement="chia.full_node.puzzles")

DECOMPRESS_CSE_WITH_PREFIX = load_clvm(
"decompress_coin_spend_entry_with_prefix.clsp", package_or_requirement="chia.full_node.puzzles"
DECOMPRESS_PUZZLE = Program.from_bytes(DECOMPRESS_PUZZLE)
DECOMPRESS_CSE = Program.from_bytes(DECOMPRESS_COIN_SPEND_ENTRY)

DECOMPRESS_CSE_WITH_PREFIX = Program.from_bytes(DECOMPRESS_COIN_SPEND_ENTRY_WITH_PREFIX)
DECOMPRESS_BLOCK = Program.from_bytes(BLOCK_PROGRAM_ZERO)

TEST_GEN_DESERIALIZE = load_clvm(
"test_generator_deserialize.clsp", package_or_requirement="chia._tests.generator.puzzles"
)
DECOMPRESS_BLOCK = load_clvm("block_program_zero.clsp", package_or_requirement="chia.full_node.puzzles")
TEST_MULTIPLE = load_clvm(
"test_multiple_generator_input_arguments.clsp", package_or_requirement="chia._tests.generator.puzzles"
)
Expand Down
12 changes: 5 additions & 7 deletions chia/_tests/generator/test_rom.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from __future__ import annotations

from chia_puzzles_py.programs import CHIALISP_DESERIALISATION, ROM_BOOTSRAP_GENERATOR
from clvm.CLVMObject import CLVMStorage
from clvm_tools import binutils
from clvm_tools.clvmc import compile_clvm_text
Expand All @@ -13,16 +14,13 @@
from chia.types.generator_types import BlockGenerator
from chia.types.spend_bundle_conditions import SpendConditions
from chia.util.ints import uint32
from chia.wallet.puzzles.load_clvm import load_clvm, load_serialized_clvm_maybe_recompile

MAX_COST = 10**15
COST_PER_BYTE = 12000
DESERIALIZE_MOD = Program.from_bytes(CHIALISP_DESERIALISATION)

GENERATOR_MOD: SerializedProgram = SerializedProgram.from_bytes(ROM_BOOTSRAP_GENERATOR)

DESERIALIZE_MOD = load_clvm("chialisp_deserialisation.clsp", package_or_requirement="chia.consensus.puzzles")
GENERATOR_MOD: SerializedProgram = load_serialized_clvm_maybe_recompile(
"rom_bootstrap_generator.clsp", package_or_requirement="chia.consensus.puzzles"
)
MAX_COST = 10**15
COST_PER_BYTE = 12000


GENERATOR_CODE = """
Expand Down
7 changes: 3 additions & 4 deletions chia/_tests/util/run_block.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,21 @@
from pathlib import Path
from typing import Any

from chia_puzzles_py.programs import CHIALISP_DESERIALISATION
from chia_rs import Coin

from chia.consensus.constants import ConsensusConstants
from chia.types.blockchain_format.program import Program
from chia.types.blockchain_format.serialized_program import SerializedProgram
from chia.types.blockchain_format.sized_bytes import bytes32
from chia.types.condition_opcodes import ConditionOpcode
from chia.types.condition_with_args import ConditionWithArgs
from chia.types.generator_types import BlockGenerator
from chia.util.ints import uint32, uint64
from chia.wallet.cat_wallet.cat_utils import match_cat_puzzle
from chia.wallet.puzzles.load_clvm import load_serialized_clvm_maybe_recompile
from chia.wallet.uncurried_puzzle import uncurry_puzzle

DESERIALIZE_MOD = load_serialized_clvm_maybe_recompile(
"chialisp_deserialisation.clsp", package_or_requirement="chia.consensus.puzzles"
)
DESERIALIZE_MOD = Program.from_bytes(CHIALISP_DESERIALISATION)


@dataclass
Expand Down
7 changes: 3 additions & 4 deletions chia/full_node/mempool_check_conditions.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import logging
from typing import Optional

from chia_puzzles_py.programs import CHIALISP_DESERIALISATION
from chia_rs import (
get_flags_for_height_and_constants,
run_chia_program,
Expand All @@ -20,11 +21,9 @@
from chia.util.condition_tools import conditions_for_solution
from chia.util.errors import Err
from chia.util.ints import uint32, uint64
from chia.wallet.puzzles.load_clvm import load_serialized_clvm_maybe_recompile

DESERIALIZE_MOD = load_serialized_clvm_maybe_recompile(
"chialisp_deserialisation.clsp", package_or_requirement="chia.consensus.puzzles"
)
DESERIALIZE_MOD = Program.from_bytes(CHIALISP_DESERIALISATION)


log = logging.getLogger(__name__)

Expand Down
Empty file removed chia/full_node/puzzles/__init__.py
Empty file.
14 changes: 0 additions & 14 deletions chia/full_node/puzzles/block_program_zero.clsp

This file was deleted.

1 change: 0 additions & 1 deletion chia/full_node/puzzles/block_program_zero.clsp.hex

This file was deleted.

5 changes: 0 additions & 5 deletions chia/full_node/puzzles/decompress_coin_spend_entry.clsp

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

6 changes: 0 additions & 6 deletions chia/full_node/puzzles/decompress_puzzle.clsp

This file was deleted.

1 change: 0 additions & 1 deletion chia/full_node/puzzles/decompress_puzzle.clsp.hex

This file was deleted.

10 changes: 3 additions & 7 deletions chia/simulator/block_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
from typing import Any, Callable, Optional

import anyio
from chia_puzzles_py.programs import CHIALISP_DESERIALISATION, ROM_BOOTSRAP_GENERATOR
from chia_rs import ALLOW_BACKREFS, MEMPOOL_MODE, AugSchemeMPL, G1Element, G2Element, PrivateKey, solution_generator

from chia.consensus.block_creation import create_unfinished_block, unfinished_block_to_full_block
Expand Down Expand Up @@ -113,15 +114,10 @@
master_sk_to_pool_sk,
master_sk_to_wallet_sk,
)
from chia.wallet.puzzles.load_clvm import load_serialized_clvm_maybe_recompile

GENERATOR_MOD: SerializedProgram = load_serialized_clvm_maybe_recompile(
"rom_bootstrap_generator.clsp", package_or_requirement="chia.consensus.puzzles"
)
DESERIALIZE_MOD = Program.from_bytes(CHIALISP_DESERIALISATION)

DESERIALIZE_MOD = load_serialized_clvm_maybe_recompile(
"chialisp_deserialisation.clsp", package_or_requirement="chia.consensus.puzzles"
)
GENERATOR_MOD: Program = Program.from_bytes(ROM_BOOTSRAP_GENERATOR)

test_constants = DEFAULT_CONSTANTS.replace(
MIN_PLOT_SIZE=uint8(18),
Expand Down

0 comments on commit e3a5f58

Please sign in to comment.