This repository has been archived by the owner on Jan 8, 2025. It is now read-only.
dev: query chain_id from Kakarot instead of computing it in the RPC to reduce probability of divergence #1543
Open
Description
Describe the enhancement request
in the RPC, we currently use the following formula to compute the kakarot chain id:
- get connected starknet chain's chain id
- do chain id modulo MAX_SAFE_CHAIN_ID
- store this value in the context of RPC
while this is currently valid, a new PR from kakarot sets the chain id of future kakarot deployments as <LEDGER_MAX_CHAIN_ID
Describe Preferred Solution
to limit chances of divergence between rpc code and kakarot code, RPC should query kakarot for its chain id with the eth_chain_id view entrypoint from kakarot at startup