Comment out mempool empty check in PoA proposer to enable continuous block creation during testing
Some checks failed
Integration Tests / test-service-integration (push) Has been cancelled
Python Tests / test-python (push) Has been cancelled
Security Scanning / security-scan (push) Has been cancelled

- 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
This commit is contained in:
aitbc
2026-04-13 23:40:41 +02:00
parent 7ff5159e94
commit 26989e969a

View File

@@ -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()