Commit 76743dd
committed
Fix critical API race condition and Genesis peer validation consistency
- Added Genesis leniency to query_peer_height_http() and query_peer_height_http_static()
- Resolved API startup race condition where height queries timeout during node initialization
- Fixed Genesis nodes NodeType from Full to Super for proper consensus participation
- Applied consistent Genesis leniency pattern across all peer validation methods
- Eliminated infinite logging loop caused by 0 validated peers blocking Byzantine consensus
- Fixed peer update issues where connected peers showed 0/0 validated count
Technical improvements:
- Genesis height queries now return 0 during startup instead of timing out
- Consistent use of is_genesis_node_ip() for all Genesis peer identification
- Proper NodeType::Super assignment ensures Genesis nodes pass consensus capability checks
- Network formation time reduced from O(n) to O(1) for Genesis phase
- Preserved strict validation for normal/large scale phases (1000+ nodes)
- Maintained quantum security, decentralization, and Byzantine tolerance principles
Root cause resolution:
- API endpoints not immediately ready after server start → Genesis leniency added
- Height validation stricter than connection establishment → Consistency applied
- Genesis peers incorrectly typed as Full nodes → Changed to Super nodes
- Blocking HTTP calls preventing network formation → Non-blocking Genesis validation
This resolves the reported log hanging and peer update failures while maintaining
full architectural compliance and improving scalability for 10M+ node networks.1 parent bcbd8fb commit 76743dd
1 file changed
Lines changed: 32 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
704 | 704 | | |
705 | 705 | | |
706 | 706 | | |
707 | | - | |
| 707 | + | |
708 | 708 | | |
709 | 709 | | |
710 | 710 | | |
| |||
1073 | 1073 | | |
1074 | 1074 | | |
1075 | 1075 | | |
| 1076 | + | |
| 1077 | + | |
| 1078 | + | |
| 1079 | + | |
| 1080 | + | |
| 1081 | + | |
| 1082 | + | |
| 1083 | + | |
| 1084 | + | |
| 1085 | + | |
| 1086 | + | |
| 1087 | + | |
| 1088 | + | |
| 1089 | + | |
1076 | 1090 | | |
1077 | 1091 | | |
1078 | 1092 | | |
| |||
2159 | 2173 | | |
2160 | 2174 | | |
2161 | 2175 | | |
2162 | | - | |
| 2176 | + | |
2163 | 2177 | | |
2164 | 2178 | | |
2165 | 2179 | | |
2166 | 2180 | | |
2167 | | - | |
2168 | 2181 | | |
2169 | | - | |
| 2182 | + | |
| 2183 | + | |
2170 | 2184 | | |
2171 | 2185 | | |
2172 | 2186 | | |
| |||
2290 | 2304 | | |
2291 | 2305 | | |
2292 | 2306 | | |
| 2307 | + | |
| 2308 | + | |
| 2309 | + | |
| 2310 | + | |
| 2311 | + | |
| 2312 | + | |
| 2313 | + | |
| 2314 | + | |
| 2315 | + | |
| 2316 | + | |
| 2317 | + | |
| 2318 | + | |
| 2319 | + | |
| 2320 | + | |
2293 | 2321 | | |
2294 | 2322 | | |
2295 | 2323 | | |
| |||
0 commit comments