Skip to content

Commit

Permalink
add temporary work-around for mempool block creation not taking block…
Browse files Browse the repository at this point in the history
… overhead into account, creating blocks that exceed the max size.
  • Loading branch information
arvidn authored and matt-o-how committed Aug 28, 2024
1 parent f4bd9dd commit 19f6cd6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions chia/_tests/core/full_node/test_full_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -934,8 +934,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
Expand Down
4 changes: 3 additions & 1 deletion chia/full_node/mempool_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 19f6cd6

Please sign in to comment.