fix: include genesis_state_root in RPC bootstrap to match source chain
Some checks failed
Blockchain Synchronization Verification / sync-verification (push) Failing after 3s
Cross-Chain Functionality Tests / test-cross-chain-sync (push) Failing after 2s
Cross-Chain Functionality Tests / test-cross-chain-transactions (push) Successful in 2s
Cross-Chain Functionality Tests / test-cross-chain-bridge (push) Has been skipped
Cross-Chain Functionality Tests / test-multi-chain-consensus (push) Failing after 3s
Cross-Chain Functionality Tests / aggregate-results (push) Has been skipped
Cross-Node Transaction Testing / transaction-test (push) Successful in 3s
Deploy to Testnet / deploy-testnet (push) Successful in 1m7s
Integration Tests / test-service-integration (push) Successful in 2m8s
Multi-Chain Island Architecture Tests / test-multi-chain-island (push) Successful in 2s
Multi-Node Blockchain Health Monitoring / health-check (push) Successful in 3s
Multi-Node Stress Testing / stress-test (push) Successful in 3s
Node Failover Simulation / failover-test (push) Failing after 2s
P2P Network Verification / p2p-verification (push) Successful in 1s
Python Tests / test-python (push) Failing after 47s
Security Scanning / security-scan (push) Successful in 49s

This commit is contained in:
aitbc
2026-05-09 19:20:53 +02:00
parent 239effc3fd
commit b77d5045aa
2 changed files with 9 additions and 2 deletions

View File

@@ -508,8 +508,14 @@ class PoAProposer:
if rpc_allocations:
self._logger.info(f"Loaded {len(rpc_allocations)} allocations via RPC bootstrap for chain {self._config.chain_id}")
self._create_accounts_from_allocations(session, rpc_allocations)
self._logger.info(f"RPC bootstrap completed successfully for chain {self._config.chain_id}, skipping local file")
return # Return early to avoid falling back to local file
# Use the RPC genesis state_root if available, otherwise recompute
if hasattr(self, '_rpc_genesis_state_root') and self._rpc_genesis_state_root:
self._logger.info(f"Using RPC genesis state_root: {self._rpc_genesis_state_root}")
return self._rpc_genesis_state_root
else:
self._logger.info(f"RPC bootstrap completed successfully for chain {self._config.chain_id}, skipping local file")
return # Return early to avoid falling back to local file
else:
self._logger.warning(f"RPC bootstrap returned no allocations for chain {self._config.chain_id}, skipping account initialization")
except Exception as e:

View File

@@ -279,6 +279,7 @@ async def get_genesis_allocations(chain_id: str = None) -> Dict[str, Any]:
"allocations": allocations,
"genesis_hash": genesis.hash,
"genesis_height": genesis.height,
"genesis_state_root": genesis.state_root, # Include the actual genesis state_root
}
except json.JSONDecodeError as e:
raise HTTPException(status_code=500, detail=f"Failed to parse genesis block metadata: {e}")