-
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
feat: A0-A4 - LOG0-4 Opcode #322
Conversation
I made an early push to talk about a gas issue I have been facing. TL;DR : load_n() use a lot of gaz even for small byte size. I have confronted 2 solutions against my tests, here is the one using load_n() to retrieve the datas:
And here is the test output :
The other solution is the one in the pushed file.
It seems that loading the memory by 32 bytes chunk multiple times is more efficient than load N bytes in once. EDIT : I just noticed log2 fails for what appear to be an infinite loop although it only needs to read 5 bytes. |
Ok my bad I didn't see the comment you added on the VSCode UI 😛 If |
What you're trying to do is to load felts from memory, right? |
Yes, I need to fill a data of felt252. |
tbh I think rebase is better than merge when bringing remote changes into a PR |
some merge are merge.rebase afaik, idk how gh handles those |
Hey @Quentash sorry for the big rebase, we brought a lot of changes to the internal structure. When you have time you can rebase and then we'll merge your PR 💪 |
Updated the code to fit the new rebase. |
|
I don't think so. but what you can do is something like fn add(a: Option<i32>, b: Option<i32>) -> i32 {
a.unwrap_or(1) + b.unwrap_or(2)
} which is equivalent to fn add(a: int = 1, b: int = 2) { a + b } on a side note unwrap_or is not implemented in |
Opened a feature request for Cairo corelib |
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm 🔥
9f3b6c9
to
e2844c0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
Implementation of the LOG0, LOG1, LOG2, LOG3, LOG4 opcode.
Pull Request type
Please check the type of change your PR introduces:
What is the current behavior?
Resolves: #296 #297 #298 #299 #300
What is the new behavior?
Does this introduce a breaking change?