config: add option to prevent empty block proposals and improve genesis block handling
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

- Add propose_only_if_mempool_not_empty config option (default: True) to skip block proposals when mempool is empty
- Add detailed logging for transaction processing in block proposals (sender/recipient validation, balance checks, duplicate detection)
- Check for existing transactions in database before adding to prevent duplicates
- Improve genesis block creation: check by height and hash, use "genesis" as proposer to avoid hash conflicts
- Add proper error handling and rollback for
This commit is contained in:
aitbc
2026-04-10 15:32:44 +02:00
parent 56100f0099
commit 632595b0ba
2 changed files with 51 additions and 5 deletions

View File

@@ -43,6 +43,9 @@ class ChainSettings(BaseSettings):
max_block_size_bytes: int = 1_000_000 # 1 MB
max_txs_per_block: int = 500
# Only propose blocks if mempool is not empty (prevents empty blocks)
propose_only_if_mempool_not_empty: bool = True
# Monitoring interval (in seconds)
blockchain_monitoring_interval_seconds: int = 60
min_fee: int = 0 # Minimum fee to accept into mempool