Fix genesis creation to only run when block production is enabled
Some checks failed
Cross-Node Transaction Testing / transaction-test (push) Has been cancelled
Deploy to Testnet / deploy-testnet (push) Has been cancelled
Multi-Node Stress Testing / stress-test (push) Has been cancelled
Blockchain Synchronization Verification / sync-verification (push) Has been cancelled
Coverage Phase 1 (70% Target) / test-coverage-70 (push) Has been cancelled
Coverage Phase 2 (85% Target) / test-coverage-85 (push) Has been cancelled
Cross-Chain Functionality Tests / test-cross-chain-sync (push) Has been cancelled
Cross-Chain Functionality Tests / test-cross-chain-transactions (push) Has been cancelled
Cross-Chain Functionality Tests / test-multi-chain-consensus (push) Has been cancelled
Cross-Chain Functionality Tests / aggregate-results (push) Has been cancelled
Integration Tests / test-service-integration (push) Has been cancelled
Multi-Chain Island Architecture Tests / test-multi-chain-island (push) Has been cancelled
Multi-Node Blockchain Health Monitoring / health-check (push) Has been cancelled
Node Failover Simulation / failover-test (push) Has been cancelled
P2P Network Verification / p2p-verification (push) Has been cancelled
Python Tests / test-python (push) Has been cancelled
Security Scanning / security-scan (push) Has been cancelled
Some checks failed
Cross-Node Transaction Testing / transaction-test (push) Has been cancelled
Deploy to Testnet / deploy-testnet (push) Has been cancelled
Multi-Node Stress Testing / stress-test (push) Has been cancelled
Blockchain Synchronization Verification / sync-verification (push) Has been cancelled
Coverage Phase 1 (70% Target) / test-coverage-70 (push) Has been cancelled
Coverage Phase 2 (85% Target) / test-coverage-85 (push) Has been cancelled
Cross-Chain Functionality Tests / test-cross-chain-sync (push) Has been cancelled
Cross-Chain Functionality Tests / test-cross-chain-transactions (push) Has been cancelled
Cross-Chain Functionality Tests / test-multi-chain-consensus (push) Has been cancelled
Cross-Chain Functionality Tests / aggregate-results (push) Has been cancelled
Integration Tests / test-service-integration (push) Has been cancelled
Multi-Chain Island Architecture Tests / test-multi-chain-island (push) Has been cancelled
Multi-Node Blockchain Health Monitoring / health-check (push) Has been cancelled
Node Failover Simulation / failover-test (push) Has been cancelled
P2P Network Verification / p2p-verification (push) Has been cancelled
Python Tests / test-python (push) Has been cancelled
Security Scanning / security-scan (push) Has been cancelled
- Move _ensure_genesis_for_chains() inside block production enabled check in main.py - Prevents follower nodes from creating local genesis blocks - Removes redundant genesis check from poa.start() since genesis creation is now controlled at startup - Follower nodes will sync genesis from hub instead of creating their own
This commit is contained in:
@@ -124,14 +124,6 @@ class PoAProposer:
|
|||||||
if not getattr(settings, "enable_block_production", True):
|
if not getattr(settings, "enable_block_production", True):
|
||||||
self._logger.info("Block production disabled, skipping PoA proposer loop")
|
self._logger.info("Block production disabled, skipping PoA proposer loop")
|
||||||
return
|
return
|
||||||
# Check if genesis block exists before starting proposer loop
|
|
||||||
with self._session_factory() as session:
|
|
||||||
genesis = session.exec(
|
|
||||||
select(Block).where(Block.chain_id == self._config.chain_id).where(Block.height == 0).limit(1)
|
|
||||||
).first()
|
|
||||||
if genesis is None:
|
|
||||||
self._logger.warning("No genesis block found, skipping PoA proposer loop. Block production requires a genesis block.")
|
|
||||||
return
|
|
||||||
self._logger.info("Starting PoA proposer loop", extra={"interval": self._config.interval_seconds})
|
self._logger.info("Starting PoA proposer loop", extra={"interval": self._config.interval_seconds})
|
||||||
await self._ensure_genesis_block()
|
await self._ensure_genesis_block()
|
||||||
|
|
||||||
|
|||||||
@@ -287,9 +287,9 @@ class BlockchainNode:
|
|||||||
else:
|
else:
|
||||||
logger.warning("Island manager not available - island operations will be disabled")
|
logger.warning("Island manager not available - island operations will be disabled")
|
||||||
|
|
||||||
await self._ensure_genesis_for_chains()
|
|
||||||
# Start proposers only if enabled (followers set enable_block_production=False)
|
# Start proposers only if enabled (followers set enable_block_production=False)
|
||||||
if self._block_production_enabled():
|
if self._block_production_enabled():
|
||||||
|
await self._ensure_genesis_for_chains()
|
||||||
self._start_proposers()
|
self._start_proposers()
|
||||||
else:
|
else:
|
||||||
logger.info("Block production disabled on this node", extra={"proposer_id": settings.proposer_id})
|
logger.info("Block production disabled on this node", extra={"proposer_id": settings.proposer_id})
|
||||||
|
|||||||
Reference in New Issue
Block a user