Commit 9e341b2
committed
S0.7-norm: normalize 28 chain templates to baseline schema + fix cache var bug
Convert all 28 research-format chain templates (extracted by S0-inv
subagents) to the baseline 7-key schema used by config_loader.sh, so
they can be loaded by the S1 file-based loader without further per-chain
hand-edits. baseline 8 chains untouched.
Eliminates the parallel-entry-trap where two schemas (research format
"chain/public_endpoints/single_method/mixed_methods/rpc_protocol/notes"
vs baseline "chain_type/methods/param_formats/params/rpc_methods/rpc_url/
system_addresses") would otherwise drift through wave S2-A..H.
CHANGES:
1. tools/normalize_chain_templates.py — NEW one-shot normalizer
* Field mapping:
rpc_url ← constant "LOCAL_RPC_URL" (matches baseline 8)
rpc_methods.single ← single_method (string)
rpc_methods.mixed ← ",".join(mixed_methods)
methods ← {} (framework alias dict; new chains fill in S3)
params ← baseline 6-key template + target_address real value
chain_type / param_formats / system_addresses → kept as-is
* Idempotent: re-running on already-normalized file = no-op (detected
via baseline-required-keys subset check).
* Preserves research-only fields under _meta.original_* for traceability.
* Marks `_meta.adapter_required = true` for chains where
rpc_protocol ∈ {rest, mixed} or single_method contains "/". 20/28 chains
match — this is real business boundary (REST chains need an adapter
layer in S3), not schema laziness.
2. config/chains/<chain>.json — 28 files rewritten
acala, algorand, aptos, arbitrum, astar, avalanche-c, avalanche-x,
bch, bitcoin, cardano, celestia, cosmos-hub, dogecoin, hedera,
injective, kusama, linea, litecoin, moonbeam, near, optimism,
osmosis, polkadot, sei, tezos, ton, tron, zksync-era
(baseline 8: solana/ethereum/bsc/base/scroll/polygon/starknet/sui
untouched — verified by L1 byte-equal regression below)
3. config/config_loader.sh — fix bash cache var name bug, 3 spots
bash variable names disallow '-', so cache var
"CACHED_CHAIN_CONFIG_avalanche-c" hit "invalid variable name" and
caused exit 1 for chains whose names contain a hyphen.
Fix: ${blockchain_node_lower//-/_} for cache var name only — on-disk
file name and chain_type field unchanged. 4 chains affected:
avalanche-c, avalanche-x, cosmos-hub, zksync-era.
VERIFICATION:
L1 36-chain `source loader && generate_auto_config`:
baseline 8 chains: 8/8 unchanged (byte-equal to snapshot)
new 28 chains: 28/28 keys complete (7 required keys all present)
Dry-run preview before live run showed correct transformation for all
28 chains, 0 file errors.
FINDINGS DOCUMENTED:
* S0-inv naming mismatch — file is config/chains/cosmos-hub.json (1886B),
not cosmos.json. Wave-A entry check assumed `cosmos` and falsely
reported "0-byte missing". Future wave entry checks must list real
file names, not assume.
* 20/28 chains marked adapter_required (71%) — REST / mixed-protocol
chains will be normalized to baseline shape but mock route won't
handle HTTP-path methods. S3 adds adapter layer. NOT a defer — it's
the real boundary of "JSON-RPC over HTTP" framework.
REVERSAL:
git checkout 70e88ed -- config/chains/ config/config_loader.sh
rm tools/normalize_chain_templates.py
(normalizer is one-shot; safe to delete after merge if desired, but
kept in tree as documentation of the mapping rule.)
See analysis-notes/p2-exec/wave-S0.7-norm.md for full decision table,
finding details, and S2-A re-entry plan.
baseline=70e88ed1 parent 70e88ed commit 9e341b2
31 files changed
Lines changed: 1538 additions & 1037 deletions
File tree
- analysis-notes/p2-exec
- config
- chains
- tools
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
3 | | - | |
4 | | - | |
5 | | - | |
6 | | - | |
7 | | - | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | 2 | | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
| 3 | + | |
34 | 4 | | |
35 | 5 | | |
36 | 6 | | |
37 | 7 | | |
38 | 8 | | |
39 | 9 | | |
40 | 10 | | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
41 | 24 | | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
3 | | - | |
4 | | - | |
5 | | - | |
6 | | - | |
7 | | - | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | 2 | | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
| 3 | + | |
40 | 4 | | |
41 | 5 | | |
42 | 6 | | |
43 | 7 | | |
44 | 8 | | |
45 | 9 | | |
46 | 10 | | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
47 | 24 | | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
3 | | - | |
4 | | - | |
5 | | - | |
6 | | - | |
7 | | - | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | 2 | | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
| 3 | + | |
34 | 4 | | |
35 | 5 | | |
36 | 6 | | |
37 | 7 | | |
38 | 8 | | |
39 | 9 | | |
40 | 10 | | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
41 | 24 | | |
42 | 25 | | |
43 | 26 | | |
| |||
48 | 31 | | |
49 | 32 | | |
50 | 33 | | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
0 commit comments