refactor(blockchain): use settings.chain_id as default instead of hardcoded "ait-devnet"

- Replace hardcoded "ait-devnet" defaults with settings.chain_id throughout codebase
- Add get_chain_id() helper function in RPC router
- Update mempool methods to use settings.chain_id when chain_id is None
- Update blockchain node main to use settings.chain_id for gossip handlers
- Update RPC endpoints to accept None and default to settings.chain_id
- Update token supply endpoint to handle mainnet vs devnet (
This commit is contained in:
2026-03-19 12:29:24 +01:00
parent d99bb73a9b
commit 6020ad04c4
4 changed files with 103 additions and 40 deletions

View File

@@ -120,10 +120,11 @@ class PoAProposer:
return
async def _propose_block(self) -> None:
# Check internal mempool
# Check internal mempool - but produce empty blocks to keep chain moving
from ..mempool import get_mempool
if get_mempool().size(self._config.chain_id) == 0:
return
mempool_size = get_mempool().size(self._config.chain_id)
if mempool_size == 0:
self._logger.debug("No transactions in mempool, producing empty block")
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()