From ae115e688a01114cbb12017018637fc5eacd1291 Mon Sep 17 00:00:00 2001 From: William Blanke Date: Wed, 17 Jan 2024 13:42:46 -0800 Subject: [PATCH] try to create foliage after ever eos for diagnostics --- chia/full_node/full_node_api.py | 18 ++++++++++++++++++ chia/full_node/mempool.py | 5 +++++ 2 files changed, 23 insertions(+) diff --git a/chia/full_node/full_node_api.py b/chia/full_node/full_node_api.py index ad8cd451584b4..78f9a62f28297 100644 --- a/chia/full_node/full_node_api.py +++ b/chia/full_node/full_node_api.py @@ -663,6 +663,24 @@ class FullNodeAPI: ) -> Optional[Message]: if self.full_node.sync_store.get_sync_mode(): return None + + async with self.full_node.blockchain.priority_mutex.acquire(priority=BlockchainMutexPriority.high): + peak: Optional[BlockRecord] = self.full_node.blockchain.get_peak() + + if peak is not None: + # Finds the last transaction block before this one + curr_l_tb: BlockRecord = peak + while not curr_l_tb.is_transaction_block: + curr_l_tb = self.full_node.blockchain.block_record(curr_l_tb.prev_hash) + try: + mempool_bundle = self.full_node.mempool_manager.create_bundle_from_mempool( + curr_l_tb.header_hash + ) + except Exception as e: + self.log.error(f"WJB Traceback: {traceback.format_exc()}") + self.full_node.log.error(f"WJB Error making spend bundle {e} peak: {peak}") + mempool_bundle = None + msg, _ = await self.full_node.add_end_of_sub_slot(request.end_of_slot_bundle, peer) return msg diff --git a/chia/full_node/mempool.py b/chia/full_node/mempool.py index 3ec40c686f608..06a9e32a6311e 100644 --- a/chia/full_node/mempool.py +++ b/chia/full_node/mempool.py @@ -412,6 +412,10 @@ class Mempool: item_cost + cost_sum > self.mempool_info.max_block_clvm_cost or fee + fee_sum > DEFAULT_CONSTANTS.MAX_COIN_AMOUNT ): + log.info( + f"WJB item_cost {item_cost} + cost_sum {cost_sum} > self.mempool_info.max_block_clvm_cost {self.mempool_info.max_block_clvm_cost} or fee {fee} + fee_sum {fee_sum} > DEFAULT_CONSTANTS.MAX_COIN_AMOUNT {DEFAULT_CONSTANTS.MAX_COIN_AMOUNT}" + ) + log.info(f"WJB name {name} fee {fee} item {item}") break coin_spends.extend(unique_coin_spends) additions.extend(unique_additions) @@ -422,6 +426,7 @@ class Mempool: except Exception as e: log.debug(f"Exception while checking a mempool item for deduplication: {e}") continue + log.info(f"WJB done") if processed_spend_bundles == 0: return None log.info(