From 26989e969ac89566bcf03a4016a009130c9903ff Mon Sep 17 00:00:00 2001 From: aitbc Date: Mon, 13 Apr 2026 23:40:41 +0200 Subject: [PATCH] Comment out mempool empty check in PoA proposer to enable continuous block creation during testing - Comment out propose_only_if_mempool_not_empty check in _propose_block - Add note that check is disabled for testing purposes - Allows block proposal even when mempool is empty - Enables continuous block creation regardless of transaction availability --- .../blockchain-node/src/aitbc_chain/consensus/poa.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/apps/blockchain-node/src/aitbc_chain/consensus/poa.py b/apps/blockchain-node/src/aitbc_chain/consensus/poa.py index 458ebba9..007c58b9 100755 --- a/apps/blockchain-node/src/aitbc_chain/consensus/poa.py +++ b/apps/blockchain-node/src/aitbc_chain/consensus/poa.py @@ -163,12 +163,12 @@ class PoAProposer: from ..config import settings mempool = get_mempool() - # Check if we should only propose when mempool is not empty - if getattr(settings, "propose_only_if_mempool_not_empty", True): - mempool_size = mempool.size(self._config.chain_id) - if mempool_size == 0: - self._logger.info(f"[PROPOSE] Skipping block proposal: mempool is empty (chain={self._config.chain_id})") - return False + # Check if we should only propose when mempool is not empty (disabled for testing) + # if getattr(settings, "propose_only_if_mempool_not_empty", True): + # mempool_size = mempool.size(self._config.chain_id) + # if mempool_size == 0: + # self._logger.info(f"[PROPOSE] Skipping block proposal: mempool is empty (chain={self._config.chain_id})") + # return False with self._session_factory() as session: head = session.exec(select(Block).where(Block.chain_id == self._config.chain_id).order_by(Block.height.desc()).limit(1)).first()