Skip to content
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
Eikix opened this issue Nov 21, 2024 · 4 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
@elielnfinic
Copy link
Contributor

I will be happy to work on this

@augustin-v
Copy link

Hello, I would love to work on this. I've just contributed to implementing a l1 gas prices sampling oracle in Katana so I think I can tackle this issue.
I'll make sure to communicate if I encounter any problem

@Eikix
Copy link
Member Author

Eikix commented Dec 10, 2024

Hi @augustin-v @elielnfinic
We're pausing commits to the RPC layer for now as we're restructuring the project!
Kindly expect opportunity to contribute to be paused for a few months.
Thanks:)

@elielnfinic
Copy link
Contributor

elielnfinic commented Dec 10, 2024

Good, any areas we can look at on kkrt?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement Enhancement of the code, not introducing new features.
Projects
No open projects
Status: 📅 Next sprint
Development

No branches or pull requests

3 participants