From eaf8a5ea2c29f19c76b4cd909019110d75826d55 Mon Sep 17 00:00:00 2001 From: Matthew Howard Date: Fri, 9 Aug 2024 14:58:05 +0100 Subject: [PATCH 1/3] replace get_flags_for_height_and_constants with rust version --- chia/full_node/mempool_check_conditions.py | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/chia/full_node/mempool_check_conditions.py b/chia/full_node/mempool_check_conditions.py index 0fc1da64a3f6..293f4df96af7 100644 --- a/chia/full_node/mempool_check_conditions.py +++ b/chia/full_node/mempool_check_conditions.py @@ -4,6 +4,7 @@ from typing import Dict, List, Optional from chia_rs import ALLOW_BACKREFS, DISALLOW_INFINITY_G1, ENABLE_BLS_OPS_OUTSIDE_GUARD, ENABLE_FIXED_DIV, MEMPOOL_MODE +from chia_rs import get_flags_for_height_and_constants from chia_rs import get_puzzle_and_solution_for_coin as get_puzzle_and_solution_for_coin_rust from chia_rs import run_block_generator, run_block_generator2, run_chia_program @@ -30,15 +31,6 @@ log = logging.getLogger(__name__) -def get_flags_for_height_and_constants(height: int, constants: ConsensusConstants) -> int: - flags = ENABLE_BLS_OPS_OUTSIDE_GUARD | ENABLE_FIXED_DIV | ALLOW_BACKREFS - - if height >= constants.SOFT_FORK5_HEIGHT: - flags = flags | DISALLOW_INFINITY_G1 - - return flags - - def get_name_puzzle_conditions( generator: BlockGenerator, max_cost: int, From e6dc6a2e8535e2085aa8e040951131b9323c53a3 Mon Sep 17 00:00:00 2001 From: Matthew Howard Date: Fri, 9 Aug 2024 15:31:17 +0100 Subject: [PATCH 2/3] remove unused imports --- chia/full_node/mempool_check_conditions.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/chia/full_node/mempool_check_conditions.py b/chia/full_node/mempool_check_conditions.py index 293f4df96af7..672319724f41 100644 --- a/chia/full_node/mempool_check_conditions.py +++ b/chia/full_node/mempool_check_conditions.py @@ -3,8 +3,10 @@ import logging from typing import Dict, List, Optional -from chia_rs import ALLOW_BACKREFS, DISALLOW_INFINITY_G1, ENABLE_BLS_OPS_OUTSIDE_GUARD, ENABLE_FIXED_DIV, MEMPOOL_MODE -from chia_rs import get_flags_for_height_and_constants +from chia_rs import ( + MEMPOOL_MODE, + get_flags_for_height_and_constants, +) from chia_rs import get_puzzle_and_solution_for_coin as get_puzzle_and_solution_for_coin_rust from chia_rs import run_block_generator, run_block_generator2, run_chia_program From aa19573e8c6e021975f84f65dcad7cb023d2d59b Mon Sep 17 00:00:00 2001 From: Matthew Howard Date: Fri, 9 Aug 2024 15:44:59 +0100 Subject: [PATCH 3/3] isort --- chia/full_node/mempool_check_conditions.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/chia/full_node/mempool_check_conditions.py b/chia/full_node/mempool_check_conditions.py index 672319724f41..f1905364d273 100644 --- a/chia/full_node/mempool_check_conditions.py +++ b/chia/full_node/mempool_check_conditions.py @@ -3,10 +3,7 @@ import logging from typing import Dict, List, Optional -from chia_rs import ( - MEMPOOL_MODE, - get_flags_for_height_and_constants, -) +from chia_rs import MEMPOOL_MODE, get_flags_for_height_and_constants from chia_rs import get_puzzle_and_solution_for_coin as get_puzzle_and_solution_for_coin_rust from chia_rs import run_block_generator, run_block_generator2, run_chia_program