Skip to content

Commit

Permalink
fix fastforwards
Browse files Browse the repository at this point in the history
  • Loading branch information
matt-o-how committed Aug 9, 2024
1 parent 6f23c03 commit f1c70e7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 12 deletions.
8 changes: 1 addition & 7 deletions chia/types/blockchain_format/program.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,7 @@
INFINITE_COST = 11000000000

DEFAULT_FLAGS = (
ENABLE_SOFTFORK_CONDITION
| ENABLE_BLS_OPS_OUTSIDE_GUARD
| ENABLE_FIXED_DIV
| AGG_SIG_ARGS
| ENABLE_MESSAGE_CONDITIONS
| DISALLOW_INFINITY_G1
| MEMPOOL_MODE
ENABLE_BLS_OPS_OUTSIDE_GUARD | ENABLE_FIXED_DIV | ENABLE_MESSAGE_CONDITIONS | DISALLOW_INFINITY_G1 | MEMPOOL_MODE
)

T_CLVMStorage = TypeVar("T_CLVMStorage", bound=CLVMStorage)
Expand Down
8 changes: 3 additions & 5 deletions chia/types/eligible_coin_spends.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

from chia.consensus.condition_costs import ConditionCost
from chia.consensus.constants import ConsensusConstants
from chia.consensus.cost_calculator import NPCResult
from chia.types.blockchain_format.coin import Coin
from chia.types.blockchain_format.serialized_program import SerializedProgram
from chia.types.blockchain_format.sized_bytes import bytes32
Expand Down Expand Up @@ -333,18 +332,17 @@ async def process_fast_forward_spends(
)
# We need to run the new spend bundle to make sure it remains valid
# generator = simple_solution_generator(new_sb)
assert mempool_item.npc_result.conds is not None
assert mempool_item.conds is not None
try:
new_sbc_result = get_conditions_from_spendbundle(
new_sb,
mempool_item.npc_result.conds.cost,
mempool_item.conds.cost,
constants,
height,
)
except TypeError as e:
error = Err(e.args[0])
raise ValueError(f"Mempool item became invalid after singleton fast forward with error {error}.")
new_npc_result = NPCResult(None, new_sbc_result)
# Update bundle_coin_spends using the collected data
for coin_id in replaced_coin_ids:
mempool_item.bundle_coin_spends.pop(coin_id, None)
Expand All @@ -356,4 +354,4 @@ async def process_fast_forward_spends(
# change. Still, it's good form to update the spend bundle with the
# new coin spends
mempool_item.spend_bundle = new_sb
mempool_item.conds = new_npc_result.conds
mempool_item.conds = new_sbc_result

0 comments on commit f1c70e7

Please sign in to comment.