fix(rpc): self-describe reads chain name from genesis#567
Merged
Conversation
Closes the deferred TODO from PR #560 (genesis [chain].name + METAMASK doc alignment). The / RPC root handler hardcoded "name": "Sentrix" on every network — testnet binaries pretended to be mainnet for any caller probing the self-describe endpoint. Now Blockchain holds chain_name (sourced from genesis.chain.name in new_with_genesis) and the route reads it. Mainnet returns "Sentrix Chain", testnet returns "Sentrix Testnet" — matches the canonical chainlist registry submission. The chain_name field carries a serde default ("Sentrix Chain") to keep pre-this-commit state-blob deserialisations working; real boot always overwrites via new_with_genesis. Field impact is purely cosmetic — wallets / chainid registry use chain_id (eth_chainId) for identity, not the / endpoint. But honest self-describe is the right thing for any future tooling that probes it (block-explorer auto-config, dApp-ops dashboards, status pages).
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
The original commit relied on new_with_genesis to set chain_name, but that path only runs on a fresh init. Existing chain.dbs (mainnet + testnet today) come up via load_blockchain, which deserialises an old blob without the chain_name field — serde defaults silently fired and testnet would still self-describe as "Sentrix Chain". Override from the canonical chain_id mapping right after the blob deserialises. First save_blockchain after this fix-up persists the corrected name so subsequent boots find it already right. Custom chain_ids (third-party deployments) fall through to whatever genesis set; we only normalise the two we ship.
github-actions Bot
pushed a commit
that referenced
this pull request
May 11, 2026
Captures the post-#564 stack as a distinct version label: - #564 BFT votes over gossipsub (wire SENTRIX_PROTOCOL 2.0.0 -> 2.1.0) - #565 Fix A: async chain.db save off BFT critical path - #566 Fix C: speculative pre-build of next proposal - #567 self-describe chain_name from genesis + load-fixup - #568 remove inbound-silence watchdog Multiple distinct binaries shipped under 2.1.91 today during the mainnet stall recovery cycle. Bumping so the next build maps 1:1 to a single sha + version label. Going forward: every chain-touching PR bumps in the same commit set (see operator memory feedback_bump_version_per_fix.md).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes the deferred TODO from PR #560 (genesis `[chain].name` + METAMASK doc alignment). The `/` RPC root handler hardcoded `"name": "Sentrix"` on every network — testnet binaries pretended to be mainnet for any caller probing the self-describe endpoint.
What lands
Impact
Mainnet `/` returns `"name": "Sentrix Chain"`; testnet returns `"Sentrix Testnet"`. Matches the canonical chainlist registry submission (ethereum-lists/chains#8266) + the genesis name-string field already aligned in PR #560.
Cosmetic only — wallets / chainid.network use `eth_chainId` (7119/7120) for identity, not the `/` endpoint. But honest self-describe is the right thing for any future tooling that probes it (block-explorer auto-config, dApp-ops dashboards, status pages).
Test plan