-
Notifications
You must be signed in to change notification settings - Fork 83
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: optimize bitshifts by using a lookup table for powers of two #905
Comments
I am applying to this issue via OnlyDust platform. My background and how it can be leveragedHi, I am Cairo dev with lots of experience contributing to Cairo projects, my OD profile is a witness to this. This feat is right within my comfort zone. I have had experience working on projects were bitshift operations were implemented I can use those as a reference for implementing this. How I plan on tackling this issueAfter implementing this, I will write a robust unit test and ensure all test case are covered and the feat behaves as expected. |
I am applying to this issue via OnlyDust platform. My background and how it can be leveragedHello, I am Manuel, a process engineer and web3 developer. I have participated in Starknet Bootcamps, ETHGlobal and am an Elite winner of Speedrunstark. I have a high capacity to solve problems. I am a member of the DojoCoding community. How I plan on tackling this issueTo address the requirements of the issue, I will:
|
I am applying to this issue via OnlyDust platform. My background and how it can be leveragedI have been a rust and zk dev before and i have implemented lookup tables for zk cryptography . I think that will help me in this issue How I plan on tackling this issue
|
I am applying to this issue via OnlyDust platform. My background and how it can be leveragedI am a newcomer in the blockchain dev world, and I'd really like to be given a chance to complete my first OnlyDust contribution. I have experience with Node Guardians's brainfvck VM in Cairo, where I used bitshift operations a lot, as well as the cairo-profiler. Thank you How I plan on tackling this issueI would create a look up cable to store powers of two from w |
I am applying to this issue via OnlyDust platform. My background and how it can be leveragedI have some experience in Cairo, mostly porting Solidity ERCs to Cairo: How I plan on tackling this issueI will carefully implement the required optimization by leveraging a lookup table for powers of 2 <= 255. |
The maintainer enitrat has assigned augustin-v to this issue via OnlyDust Platform. |
for the powers of two up to 256, we can define a lookup table and use that lookup table to execute bitshift operations, instead of calling the expensive cairo function
pow
.POW_2
pow
.Hint: In a generic context, you can get the value
255
of type T by doingBitSize::<u256>::bits() - One::<T>::one()
- make sure you're using the right types for that.kakarot-ssj/crates/utils/src/math.cairo
Lines 195 to 212 in b1f7f8c
kakarot-ssj/crates/utils/src/math.cairo
Lines 242 to 255 in b1f7f8c
The text was updated successfully, but these errors were encountered: