-
Notifications
You must be signed in to change notification settings - Fork 4
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
withdrawals: return amount as little-endian #20
base: main
Are you sure you want to change the base?
Conversation
push 52 ;; [52, record_offset, pk2_am, i, ..] | ||
add ;; [record_offset+52, pk2_am, i, ..] | ||
mstore ;; [i, ..] | ||
;; Extract pk2 from pk2_am. |
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.
Could we mstore pk2_am
and then just overwrite the last 8 bytes of am
with little endian? This would save a few op calls
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.
Yeah, this step could be avoided. But removing would only save three instructions, and I think it's a bit safer to mask it explicitly.
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.
right, i am more in favour of less instructions than saving the cost. Fine with leaving it as is
This makes the return data encoding SSZ-compatible.