From c53d78bd0843a9a13797c688b6c0bc246a9afe5a Mon Sep 17 00:00:00 2001 From: arvidn Date: Mon, 26 Aug 2024 17:25:59 +0200 Subject: [PATCH] add temporary work-around for mempool block creation not taking block overhead into account, creating blocks that exceed the max size. --- chia/_tests/core/full_node/test_full_node.py | 4 ++-- chia/full_node/mempool_manager.py | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/chia/_tests/core/full_node/test_full_node.py b/chia/_tests/core/full_node/test_full_node.py index 2f4cafbf1e0f..8a23b19565a7 100644 --- a/chia/_tests/core/full_node/test_full_node.py +++ b/chia/_tests/core/full_node/test_full_node.py @@ -935,8 +935,8 @@ async def test_new_transaction_and_mempool(self, wallet_nodes, self_hostname, se # these numbers reflect the capacity of the mempool. In these # tests MEMPOOL_BLOCK_BUFFER is 1. The other factors are COST_PER_BYTE # and MAX_BLOCK_COST_CLVM - assert included_tx == 23 - assert not_included_tx == 10 + assert included_tx == 27 + assert not_included_tx == 6 assert seen_bigger_transaction_has_high_fee # Mempool is full diff --git a/chia/full_node/mempool_manager.py b/chia/full_node/mempool_manager.py index 6d49674f6c08..afc48de758aa 100644 --- a/chia/full_node/mempool_manager.py +++ b/chia/full_node/mempool_manager.py @@ -302,7 +302,9 @@ async def pre_validate_spendbundle( if ret.error is not None: raise ValidationError(Err(ret.error), "pre_validate_spendbundle failed") assert ret.conds is not None - return ret.conds + # TODO: this cost padding is temporary, until we update the mempool's + # block creation logic to take the block overhead into account + return ret.conds.replace(cost=ret.conds.cost + 10000000) async def add_spend_bundle( self,