Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dev: query chain_id from Kakarot instead of computing it in the RPC to reduce probability of divergence #1543

Open
Eikix opened this issue Nov 21, 2024 · 0 comments
Labels
enhancement Enhancement of the code, not introducing new features.

Comments

@Eikix
Copy link
Member

Eikix commented Nov 21, 2024

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

@Eikix Eikix added the enhancement Enhancement of the code, not introducing new features. label Nov 21, 2024
@github-project-automation github-project-automation bot moved this to 🆕 Backlog in Kakarot on Starknet Nov 21, 2024
@Eikix Eikix moved this from 🆕 Backlog to 📅 Next sprint in Kakarot on Starknet Nov 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Enhancement of the code, not introducing new features.
Projects
No open projects
Status: 📅 Next sprint
Development

No branches or pull requests

1 participant