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

support SN_MAIN and SN_SEPOLIA #127

Closed
rkdud007 opened this issue Aug 29, 2024 · 0 comments · Fixed by #134
Closed

support SN_MAIN and SN_SEPOLIA #127

rkdud007 opened this issue Aug 29, 2024 · 0 comments · Fixed by #134

Comments

@rkdud007
Copy link
Member

rkdud007 commented Aug 29, 2024

currently indexer using this as chain id: 1, 11155111, 137, 280, MADARA_PRAGMA, STARKNET, SN_SEPOLIA, 300, 11155420, 421614

meaning, we have to change type u64 to string to be compatible.
I'd suggest we first reconsider if this the best way to go for chain_id (e.g can't we unify into integer for everything for intermediate representation? ) and if go for string approach like indexer, need to refactor these parts in our system :

  1. intermediate chain_id representation : ProviderConfig
  2. json file input/output as string representation : instead of 1 -> "1"
  3. dry run, fetch key chain_id representation: same context as above, dry_run_output.json should return string type

update actually we probably need to think of way to map somehow into integer. reasoning for this is, we using chain_id field also in datalake definition, which defined in solidity, cairo both.

idea : what if we keep integer, and instead of using STARKNET or SN_SEPOLIA, we turn into ascii -> hex represent -> integer e.g 0x534E5F5345504F4C4941 -> 393402133025997798000961 (SN_SEPOLIA) , 0x535441524B4E4554 -> 6004496024898258260 (STARKNET) as this all fit into u256 even 1felt (252)

note that above suggestion is about intemediate representation of chain id across solidity, cairo => and for UX perspective, we can allow user to request with raw string like STARKNET and SN_SEPOLIA.

update update SN_MAIN for mainnet staknet.

0x534E5F4D41494E
23448594291968334

@rkdud007 rkdud007 changed the title unify chain_id to support mutichain support SN_MAINNET and SN_SEPOLIA Aug 29, 2024
@rkdud007 rkdud007 linked a pull request Sep 2, 2024 that will close this issue
@rkdud007 rkdud007 changed the title support SN_MAINNET and SN_SEPOLIA support SN_MAIN and SN_SEPOLIA Sep 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant