kkrt-labs / kakarot-rpc

Kakarot ZK EVM Ethereum RPC adapter
MIT License
134 stars 89 forks source link

dev: improve modulo for chain #1408

Open greged93 opened 2 days ago

greged93 commented 2 days ago

Describe the enhancement request

Clean up the code for the chain id modulo taken a few times across the code base (search for "1 << 53" to find them all). https://github.com/kkrt-labs/kakarot-rpc/pull/1381#discussion_r1778210901

raizo07 commented 2 days ago

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

Hello, I'll like to be assigned to work on this.

I'm a software Dev with over four years experience and have worked on a couple of projects here. Here's a link to my profile https://app.onlydust.com/u/raizo07

od-hunter commented 2 days ago

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

Please can I be assigned this issue? This would be my first time contributing to this ecosystem and I’d love to be given the opportunity. I am a blockchain Developer, and my experience includes html, css, react, JavaScript,TypeScript and solidity, python, Cairo and Rust.

How I plan on tackling this issue

To solve this issue, I'd take the following steps:

  1. I'll search for all instances of "1 << 53" across the code.
  2. Extract this value into a constant (e.g., MAX_SAFE_CHAIN_ID) to avoid magic numbers.
  3. I'll then create a utility function for the chain ID modulo logic to ensure consistent usage throughout the codebase.
  4. Then I'll replace existing usages with the new constant and function.
  5. Lastly, I'll now test the changes to ensure everything works as expected after refactoring.

This is the link to my profile: https://app.onlydust.com/u/od-hunter

Please assign me.

ShantelPeters commented 2 days ago

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

Hi , i am a blockchain developer , with experience in languages like , javascript, cario, typescript ,html,css, etc . This would be my first time contributing to this ecosystem and i am exicted about it ,please i will like to work on this issue . i am ready to work.

How I plan on tackling this issue

To approach this issue, i will begin by searching the codebase for instances where "1 << 53" is used, as this represents the chain ID modulo being applied multiple times. Then refactor the code to centralize this logic into a single, reusable function or utility, which can be called wherever the chain ID modulo operation is needed. This will improve code maintainability and reduce duplication. After refactoring, i will then ensure to update all instances across the codebase to use the new centralized function, and thoroughly test to confirm the logic behaves as expected.

varun-doshi commented 2 days ago

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

I've previously contributed to Shinigami and Btczee...both Starknet projects. I'm a Rust developer by profession

raizo07 commented 2 days ago

@greged93 acknowledged.