config: add option to prevent empty block proposals and improve genesis block handling
- 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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user