Re-enable state root computation in blockchain node
Some checks failed
Blockchain Synchronization Verification / sync-verification (push) Successful in 4s
Integration Tests / test-service-integration (push) Failing after 10s
Multi-Node Blockchain Health Monitoring / health-check (push) Successful in 5s
P2P Network Verification / p2p-verification (push) Successful in 3s
Python Tests / test-python (push) Successful in 10s
Security Scanning / security-scan (push) Successful in 20s

- Fix chain_id mismatch (ait-devnet -> ait-mainnet)
- Add logger definition to poa.py for state root computation
- Recompute state_root after genesis account initialization
- Create genesis.json with account allocations for ait-mainnet
- Update config.py supported_chains to ait-mainnet
This commit is contained in:
aitbc
2026-04-22 14:32:30 +02:00
parent 607ad2d434
commit fb15b5c1cb
6 changed files with 30 additions and 22 deletions

View File

@@ -10,7 +10,7 @@ import requests
from datetime import datetime
BASE_URL = "https://aitbc.bubuit.net/rpc"
CHAIN_ID = "ait-devnet"
CHAIN_ID = "ait-mainnet"
def compute_block_hash(height, parent_hash, timestamp):
"""Compute block hash using the same algorithm as PoA proposer"""
@@ -29,7 +29,7 @@ def test_block_import_complete():
# Test 1: Invalid height (0)
print("\n[TEST 1] Invalid height (0)...")
response = requests.post(
f"{BASE_URL}/blocks/import",
f"{BASE_URL}/importBlock",
json={
"height": 0,
"hash": "0x123",
@@ -49,7 +49,7 @@ def test_block_import_complete():
# Test 2: Block conflict
print("\n[TEST 2] Block conflict...")
response = requests.post(
f"{BASE_URL}/blocks/import",
f"{BASE_URL}/importBlock",
json={
"height": 1,
"hash": "0xinvalidhash",
@@ -72,7 +72,7 @@ def test_block_import_complete():
block_data = response.json()
response = requests.post(
f"{BASE_URL}/blocks/import",
f"{BASE_URL}/importBlock",
json={
"height": block_data["height"],
"hash": block_data["hash"],
@@ -95,7 +95,7 @@ def test_block_import_complete():
head = response.json()
response = requests.post(
f"{BASE_URL}/blocks/import",
f"{BASE_URL}/importBlock",
json={
"height": 999999,
"hash": "0xinvalid",
@@ -115,7 +115,7 @@ def test_block_import_complete():
# Test 5: Parent not found
print("\n[TEST 5] Parent block not found...")
response = requests.post(
f"{BASE_URL}/blocks/import",
f"{BASE_URL}/importBlock",
json={
"height": 999998,
"hash": compute_block_hash(999998, "0xnonexistent", "2026-01-29T10:20:00"),
@@ -141,7 +141,7 @@ def test_block_import_complete():
block_hash = compute_block_hash(height, head["hash"], "2026-01-29T10:20:00")
response = requests.post(
f"{BASE_URL}/blocks/import",
f"{BASE_URL}/importBlock",
json={
"height": height,
"hash": block_hash,
@@ -168,7 +168,7 @@ def test_block_import_complete():
block_hash = compute_block_hash(height, head["hash"], "2026-01-29T10:20:00")
response = requests.post(
f"{BASE_URL}/blocks/import",
f"{BASE_URL}/importBlock",
json={
"height": height,
"hash": block_hash,