Skip to content

Commit

Permalink
Fix for latest rust version
Browse files Browse the repository at this point in the history
  • Loading branch information
matt-o-how committed Aug 7, 2024
1 parent 32547fb commit e80e820
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 11 deletions.
4 changes: 1 addition & 3 deletions chia/full_node/mempool_check_conditions.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,11 @@
from typing import Dict, List, Optional

from chia_rs import (
AGG_SIG_ARGS,
ALLOW_BACKREFS,
DISALLOW_INFINITY_G1,
ENABLE_BLS_OPS_OUTSIDE_GUARD,
ENABLE_FIXED_DIV,
ENABLE_MESSAGE_CONDITIONS,
ENABLE_SOFTFORK_CONDITION,
MEMPOOL_MODE,
)
from chia_rs import get_puzzle_and_solution_for_coin as get_puzzle_and_solution_for_coin_rust
Expand Down Expand Up @@ -40,7 +38,7 @@


def get_flags_for_height_and_constants(height: int, constants: ConsensusConstants) -> int:
flags = ENABLE_SOFTFORK_CONDITION | ENABLE_BLS_OPS_OUTSIDE_GUARD | ENABLE_FIXED_DIV | AGG_SIG_ARGS | ALLOW_BACKREFS
flags = ENABLE_BLS_OPS_OUTSIDE_GUARD | ENABLE_FIXED_DIV | ALLOW_BACKREFS

if height >= constants.SOFT_FORK4_HEIGHT:
flags = flags | ENABLE_MESSAGE_CONDITIONS
Expand Down
3 changes: 1 addition & 2 deletions chia/full_node/mempool_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,6 @@ async def pre_validate_spendbundle(
self.max_tx_clvm_cost,
self.constants,
self.peak.height,
bls_cache,
)
except Exception as e: # take returned TypeError and turn into ValidationError class by
error = Err(e.args[0])
Expand All @@ -293,7 +292,7 @@ async def pre_validate_spendbundle(
self._worker_queue_size -= 1

if bls_cache is not None:
bls_cache.update(new_cache_entries)
bls_cache.update([(e[0], bytes(e[1])) for e in new_cache_entries])

ret = NPCResult(None, sbc)

Expand Down
6 changes: 1 addition & 5 deletions chia/types/blockchain_format/program.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,11 @@
from typing import TYPE_CHECKING, Any, Callable, Dict, Optional, Set, Tuple, Type, TypeVar

from chia_rs import (
AGG_SIG_ARGS,
ALLOW_BACKREFS,
DISALLOW_INFINITY_G1,
ENABLE_BLS_OPS_OUTSIDE_GUARD,
ENABLE_FIXED_DIV,
ENABLE_MESSAGE_CONDITIONS,
ENABLE_SOFTFORK_CONDITION,
MEMPOOL_MODE,
run_chia_program,
tree_hash,
Expand Down Expand Up @@ -143,10 +141,8 @@ def run_with_cost(self, max_cost: int, args: Any) -> Tuple[int, Program]:
# when running puzzles in the wallet, default to enabling all soft-forks
# as well as enabling mempool-mode (i.e. strict mode)
default_flags = (
ENABLE_SOFTFORK_CONDITION
| ENABLE_BLS_OPS_OUTSIDE_GUARD
ENABLE_BLS_OPS_OUTSIDE_GUARD
| ENABLE_FIXED_DIV
| AGG_SIG_ARGS
| ENABLE_MESSAGE_CONDITIONS
| DISALLOW_INFINITY_G1
| MEMPOOL_MODE
Expand Down
2 changes: 1 addition & 1 deletion chia/types/eligible_coin_spends.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
from chia.types.mempool_item import BundleCoinSpend
from chia.types.spend_bundle import SpendBundle
from chia.util.ints import uint32, uint64
from chia.util.errors import Err, ValueError
from chia.util.errors import Err


@dataclasses.dataclass(frozen=True)
Expand Down

0 comments on commit e80e820

Please sign in to comment.