mirror of
https://github.com/luxfi/chains.git
synced 2026-09-24 00:26:00 +00:00
Ported onto the current tree from work stranded on a copy a hundred commits behind it. The dial-time check asked endpoints[0] for its chain id and trusted the rest; every endpoint answers for itself now, and one that disagrees with the configuration or cannot answer refuses the client by name. A chain id is not an identity: a fork inherits the id of the chain it left, so a forked endpoint answers eth_chainId correctly and the id check cannot see it. ExternalChainConfig gains Genesis, the hash of block 0, and when it is set every endpoint must produce it — the same commitment platformvm's adopt record calls Identity. A malformed hash is refused at startup rather than folded into one that can never match. Left unset, the question is unanswered and startup says so. The confirmation read stays the least advanced answer of every endpoint, as it already was here; the port re-applies it over the older file it arrived in. The wrong-network test now asserts the claim in the refusal rather than the words around it, since the refusal names the endpoint. (cherry picked from commit 678800144052032009a58472b61873aa4b20a52c) Co-authored-by: Hanzo Dev <[email protected]>