Skip to content
This repository has been archived by the owner on Jan 9, 2025. It is now read-only.

feat: chain_id storage var #1571

Merged
merged 5 commits into from
Nov 6, 2024

Conversation

obatirou
Copy link
Collaborator

@obatirou obatirou commented Nov 4, 2024

Time spent on this PR:

Pull request type

Please check the type of change your PR introduces:

  • Bugfix
  • Feature
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Documentation content changes
  • Other (please describe):

What is the current behavior?

Resolves #1530

What is the new behavior?

Chain id is set in constructor and stored in storage


This change is Reviewable

@obatirou obatirou force-pushed the chain-id-storage-var branch 2 times, most recently from cda8f4f to 87d44ca Compare November 4, 2024 16:53
@obatirou
Copy link
Collaborator Author

obatirou commented Nov 4, 2024

Waiting on ef tests change to take into account chain id var

ClementWalter
ClementWalter previously approved these changes Nov 5, 2024
@obatirou obatirou force-pushed the chain-id-storage-var branch from 87d44ca to 95c191b Compare November 5, 2024 12:47
@obatirou obatirou marked this pull request as ready for review November 5, 2024 12:47
Copy link
Collaborator

@enitrat enitrat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably need to add getters and setters as well?

cairo_zero/kakarot/library.cairo Outdated Show resolved Hide resolved
tests/utils/constants.py Outdated Show resolved Hide resolved
@obatirou
Copy link
Collaborator Author

obatirou commented Nov 5, 2024

Probably need to add getters and setters as well?

I do not think this is necessary for the setter: once a chain_id is set this should not change

Maybe a getter indeed

@obatirou
Copy link
Collaborator Author

obatirou commented Nov 6, 2024

let (_, chain_id) = unsigned_div_rem(chain_id, Constants.MAX_SAFE_CHAIN_ID);

The getter is already here with eth_chain_id

@ClementWalter ClementWalter merged commit d4ae7b7 into kkrt-labs:main Nov 6, 2024
13 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
3 participants