Implement get_chain_family RPC
What
This Merge Request introduces a new JSON RPC method to retrieve the chain family of a node. It replaces the current approach of reading the state in /evm/chain_configurations/[chain_id]/chain_family with a more robust and future-proof approach.
Why
-
Future-proofing: We plan to migrate Michelson RPCs to RESTO services. Using the
state_valueRPC to read/evm/chain_configurations/[chain_id]/chain_familywill no longer work, so we need a standardized way to obtain thechain_familywithout relying on that direct lookup. - Unified retrieval: If we are reading the family of chain, then it must be unknown. Thus, we want a single, consistent method to retrieve it.
How
-
Durable Storage: New functions were added to retrieve the
chain_familyfrom durable storage by chain ID. - New JSON RPC: A JSON RPC endpoint now provides external access to that information. This abstracts away storage details and centralizes the chain family lookup.
Testing
-
test_make_l2_kernel_installer_configtest modification: This test has been updated to call the new RPC and verify that it correctly returns thechain_family.
Edited by Luciano Freitas