Fix stale blacklist chain_ids, add stale-blacklist warning to sync script

Root cause of the balances-test hang in pezkuwi-wallet-android (silent
for over an hour, cancelled multiple times before finding this):
every single chain_id in blocked-chains.json was stale - none matched
anything in Nova's current chains.json (last_updated 2026-02-11, ~5
months of upstream chain-id drift since). The blacklist mechanism
silently no-opped for all 6 entries, so none of the chains it was
meant to exclude were actually excluded.

With the blacklist ineffective, several chains with genuinely dead RPC
endpoints (confirmed live 2026-07-08: 3DPass, Curio, Quartz, Subsocial
- 502s, timeouts, SSL failures) stayed in the merged output. The
Android app's ChainConnection/NodeAutobalancer has no backoff/circuit
breaker for dead endpoints, so it retried them in an extremely tight
loop (~1 attempt/second, 1500-1800+ attempts observed in a 25 minute
window per chain) - burning resources indefinitely and starving the
app's actual chain-sync/test work, which is what made the Android CI
job hang for over an hour with zero progress.

Fix: re-verified and corrected all chain_ids (matching by current
name against live chains.json), added 3DPass/Curio/Subsocial which
weren't blacklisted before, dropped entries for chains no longer
present upstream at all (Passet Hub Testnet, Darwinia Crab, DeepBrain,
Exosama - nothing to block, kept them as historical noise otherwise).

Also added a stale-blacklist warning to sync_from_nova.py: it now
tracks which blocked chain_ids actually matched something in Nova's
current chains across all versions, and prints a warning listing any
that didn't - so this exact silent drift is caught at sync time going
forward instead of rotting unnoticed for another five months.
This commit is contained in:
2026-07-08 02:04:47 -07:00
parent 95939ab8a2
commit 2efab72f83
65 changed files with 7284 additions and 9091 deletions
+9
View File
@@ -108,6 +108,7 @@ def sync_chains():
blocked_ids = load_blacklist()
print(f" Blacklist: {len(blocked_ids)} chains excluded")
matched_blocked_ids = set()
pezkuwi_chains_file = PEZKUWI_OVERLAY / "chains" / "pezkuwi-chains.json"
pezkuwi_chains = load_json(pezkuwi_chains_file) if pezkuwi_chains_file.exists() else []
@@ -121,6 +122,7 @@ def sync_chains():
nova_file = version_dir / "chains.json"
if nova_file.exists():
nova_chains = load_json(nova_file)
matched_blocked_ids |= blocked_ids & {c['chainId'] for c in nova_chains}
merged = merge_chains(nova_chains, pezkuwi_chains, blocked_ids)
save_json(output_dir / "chains.json", merged)
print(f" {version}/chains.json: {len(pezkuwi_chains)} + {len(nova_chains)} - {len(blocked_ids)} blocked = {len(merged)}")
@@ -145,6 +147,13 @@ def sync_chains():
shutil.rmtree(output_preconfig)
shutil.copytree(nova_preconfig, output_preconfig)
stale_blocked_ids = blocked_ids - matched_blocked_ids
if stale_blocked_ids:
print(f" WARNING: {len(stale_blocked_ids)} blacklist chain_id(s) matched nothing in Nova's current chains "
f"- likely stale (upstream changed the chain's id) and NOT actually blocking anything:")
for stale_id in stale_blocked_ids:
print(f" - {stale_id}")
def sync_xcm():
print("\nSyncing XCM...")