-
Notifications
You must be signed in to change notification settings - Fork 50
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
Optimize performance of bech32
encoding implementation
#74
Comments
@maciejka I would love to work on this |
Hi, @maciejka I would love to contribute to this task: starting to May 23, 2024, to Completion Date: June 1, 2024, I'm Juan Diego Carballo and I'm a full-stack developer with a software engineer degree, already contributed to other projects and creating an on-chain game. I have experience with Cairo and blockchain development, including implementing and optimizing encoding algorithms. Already follow Joyboy on twitter and joined the Telegram. |
Hi @maciejka, I recently participated in a gas golfing competition hosted by NodeGuardians and had a lot of fun optimizing contracts in Solidity. I'm familiar with Cairo and would love to try optimizing the current reference implementation to save some Cairo steps. |
Hey ODHackers! So many volunteers! Please send me your ideas for optimizations in pm on tg: @aundumla. I will assign the task based on quality of your proposals. |
@maciejka in which channel of the telegram? |
More than one can work on this issue if the ideas for optimizations are different. |
bech32
encoding implementationbech32
encoding implementation
@maciejka sorry, give the issue to someone else |
i would love to take part in the success of this issue @maciejka |
Please provide a pr. |
Out of curiosity (since I am still a beginner), what kind of optimizations are you typically looking for when developing in Cairo? Is it things like bit packing or more complex optimization concepts? |
In this case it would be about minimizing the number of steps and memory
usage.
czw., 4 lip 2024, 20:33 użytkownik Nicolas Sanchez ***@***.***>
napisał:
… Out of curiosity (since I am still a beginner), what kind of optimizations
are you typically looking for when developing in Cairo? Is it things like
bit packing or more complex optimization concepts?
—
Reply to this email directly, view it on GitHub
<#74 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABOTBZRVQXA3PRAPERB3GLZKWIQLAVCNFSM6AAAAABIEFP55WVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMBZGQ2DEOBTGI>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Hello, is this still an issue to tackle ? I would want to work on it |
Yes, please provide a pr.
pon., 22 lip 2024, 15:26 użytkownik quentin-abei ***@***.***>
napisał:
… Hello, is this still an issue to tackle ? I would want to work on it
—
Reply to this email directly, view it on GitHub
<#74 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABOTBYB7E32FVGXKVHLNQLZNUCAVAVCNFSM6AAAAABIEFP55WVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENBSHE2TSMZQG4>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Are there any available tool to measure cairo code optimization that one could use ? |
Check: https://foundry-rs.github.io/starknet-foundry/snforge-advanced-features/profiling.html |
Hi @maciejka ! I made some optimization on the bech32 encode function and if I compare gas consumption, I get an improvement of around 60%. I will continue in the following days if I find some new ideas ;-) But I would appreciate any feedback just to be sure it is what you expect. Note that it uses Cairo 2.7.0. |
It is super cool! Cairo 2.7.0 is the right choice. |
@maciejka can i be assigned to this issue |
Hey @Judacris32! |
Hi @maciejka ! I'm preparing a PR to bump joyboy to Cairo 2.7.0 but it requires an update from snfoundry. Then I will quickly prepare a PR for this optimization ;-) |
I've just created a new PR: #297 Note that this PR is based on my other PR to bump to Cairo 2.7.0 so just look at the Don't hesitate if you have any questions ;-) And if you want to see the gain in term of gas, you should have a look at the small project I mentioned before (https://github.com/remybar/bech32-optimization). |
Since this project is paused I am closing this issue in order not to confuse peaople. @remybar thanks for your work. |
OD Hack
This issue is part of ODHack 4.0:
Task
Here is a
bech32
encoding implementation in Cairo:joyboy/onchain/src/social/bech32.cairo
Line 164 in af4ff42
Your task is to optimize it.
You should provide measurements before and after the optimization.
References
Communication
https://t.me/JoyboyStarknet/949
May the Joy be with you!
The text was updated successfully, but these errors were encountered: