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: prefer from_be_bytes to load_word #906

Closed
enitrat opened this issue Sep 5, 2024 · 5 comments · Fixed by #988
Closed

dev: prefer from_be_bytes to load_word #906

enitrat opened this issue Sep 5, 2024 · 5 comments · Fixed by #988
Assignees
Labels
enhancement New feature or request ODHack8

Comments

@enitrat
Copy link
Collaborator

enitrat commented Sep 5, 2024

from_be_bytes is a generic implementation that tries converting a collection of bytes to a type T.

Refactor the codebase to use from_be_bytes and from_be_bytes_partial instead of load_word for better maintainability.

@enitrat enitrat added the enhancement New feature or request label Sep 5, 2024
@enitrat enitrat assigned enitrat and unassigned enitrat Sep 5, 2024
@enitrat
Copy link
Collaborator Author

enitrat commented Sep 5, 2024

image image

by converting each individual byte / intermediate result to felt252, we could avoid step overhead related to u256 checks. Although, it's unclear whether this should be done with STWO in mind.

@mubarak23
Copy link

mubarak23 commented Sep 26, 2024

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

I am a Experience Cairo smart contract developer with experience working on projects such as Just Art Peace, Dojo, Kart, TBA, and Shinigami. Before transitioning to Cairo development, I was a backend developer specializing in Rust.

My recent work with cairo starknet

My recent work with rust

How I plan on tackling this issue

I estimate this will take 16hrs to complete.

This is how I would tackle this issue:

  • Refactor the codebase to use from_be_bytes and from_be_bytes_partial instead of load_word for better maintainability.

@guha-rahul
Copy link

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

Being a cairo dev and a newcomer to the kakarot codebase , i think this will be a good issue to get familiar with the codebase.

How I plan on tackling this issue

  1. Go through the entire codebase
    2.locate where from_be_bytes is located and replace that with from_be_bytes_partial along with other changes that are required!

@lordshashank
Copy link
Contributor

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

Hi, I have been contributing in odhacks for quite some time now and have expertise in rust and blockchain specs , few of them are

  • Contributed to Floresta as Summer of Bitcoin 2024 fellow
  • contributed to RUst lang's codegen GCC and implemented new traits and tests.
  • Contributed to starknet rust devnet in odhack

How I plan on tackling this issue

I will search for possible usecases of from_be_bytes and from_be_bytes_partial in codebase and replace load_word with them for better practices and maintainability
I will ensure all the tests pass without breaking anything.

Copy link

onlydustapp bot commented Sep 26, 2024

The maintainer enitrat has assigned lordshashank to this issue via OnlyDust Platform.
Good luck!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request ODHack8
Projects
Status: ✅ Done
Development

Successfully merging a pull request may close this issue.

4 participants