Conversation
Fixes genlayerlabs#486. MetaMask's "Add network" validates via net_version, which the GenLayer RPC (rpc-bradbury.genlayer.com / rpc-asimov.genlayer.com) does not implement - only eth_chainId. The GenLayer Chain RPC (rpc.testnet-chain.genlayer.com) does implement it and works. Verified live today against both: rpc-bradbury.genlayer.com net_version -> {"error":{"code":-32601,"message":"method not found: net_version"}} rpc.testnet-chain.genlayer.com net_version -> {"result":"0x107d"} Both report chain id 4221 (0x107d) via eth_chainId, and Bradbury/Asimov share the exact same GenLayer Chain RPC URL - so switching which endpoint the wallet buttons use doesn't change which chain a reader ends up on, it just changes whether "Add network" actually succeeds. Changes: - Reworded the intro paragraph: the "use either endpoint for standard wallet operations" line was the actual source of the bug reports - replaced with "use GenLayer Chain RPC for wallets, GenLayer RPC for CLI/SDKs/gen_* tooling". - Bradbury's and Asimov's <AddToWallet> buttons now point rpcUrls at rpc.testnet-chain.genlayer.com instead of their respective rpc-bradbury/rpc-asimov URLs. These buttons call MetaMask's wallet_addEthereumChain directly, so they were previously live, clickable, broken UI on this page - not just misleading prose. (Left Studionet's button alone; no evidence yet its RPC has the same gap, and its rpcUrl is also its only real API endpoint, unlike Bradbury/Asimov which have a separate reachable Chain RPC to point wallets at instead.) - Updated the GenLayer Chain (L2) section's intro to match, since it previously said "you typically don't need this directly" while now being the one endpoint the wallet setup above actually depends on. Out of scope (needs genlayer-node access, not something I can fix here): implementing net_version on the GenLayer RPC itself, and the Chain RPC's net_version currently returning the hex form ("0x107d") rather than the JSON-RPC spec's decimal string ("4221") - MetaMask tolerates the hex today per the issue, but it's worth flagging for whoever eventually touches that RPC method. Verified the file compiles with the real @mdx-js/mdx compiler.
✅ Deploy Preview for genlayer-docs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughThe network documentation now separates wallet and tooling RPC usage. Bradbury and Asimov “Add to wallet” buttons now use the GenLayer Chain RPC, which supports ChangesWallet RPC documentation
Priority: ➖ Normal Estimated code review effort: 1 (Trivial) | ~5 minutes Change: Bug fix · Severity of issue fixed: Medium Suggested reviewers: Merge Risk: ⚪ Minimal · up to The updated wallet guidance and buttons should direct users to the compatible GenLayer Chain RPC without introducing runtime changes. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Linked Issues checkExplanation Issue
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
Fixes #486 — MetaMask's "Add network" flow validates via
net_version, which the GenLayer RPC (rpc-bradbury.genlayer.com/rpc-asimov.genlayer.com) doesn't implement, onlyeth_chainId. The GenLayer Chain RPC (rpc.testnet-chain.genlayer.com) does implementnet_versionand works.Verified live today against both, before making this change:
Both report chain id
4221(0x107d) viaeth_chainId, and Bradbury/Asimov share the exact same GenLayer Chain RPC URL — so switching which endpoint the wallet buttons point at doesn't change which chain a reader ends up on, it only changes whether "Add network" actually succeeds.Change
gen_*tooling.<AddToWallet>buttons now pointrpcUrlsatrpc.testnet-chain.genlayer.cominstead of their respectiverpc-bradbury/rpc-asimovURLs. These buttons call MetaMask'swallet_addEthereumChaindirectly, so this was live, clickable, broken UI on the page, not just misleading prose.<AddToWallet>button alone — no evidence yet its RPC has the samenet_versiongap, and itsrpcUrlis also its only real API endpoint (unlike Bradbury/Asimov, which have a separate Chain RPC to point wallets at instead).Out of scope
Fixing
net_versionon the GenLayer RPC itself needsgenlayer-nodeaccess, which I don't have. Also worth flagging for whoever does: the Chain RPC'snet_versioncurrently returns the hex form ("0x107d") rather than the JSON-RPC spec's decimal string ("4221") — MetaMask tolerates the hex today per the issue, but other tooling may not.Testing
Verified the file compiles with the real
@mdx-js/mdxcompiler.Summary by CodeRabbit