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

withdrawals: return amount as little-endian #20

Open
wants to merge 14 commits into
base: main
Choose a base branch
from

Conversation

fjl
Copy link
Contributor

@fjl fjl commented Sep 5, 2024

This makes the return data encoding SSZ-compatible.

@fjl fjl changed the title WIP withdrawals little-endian withdrawals: return amount as little-endian Sep 5, 2024
push 52 ;; [52, record_offset, pk2_am, i, ..]
add ;; [record_offset+52, pk2_am, i, ..]
mstore ;; [i, ..]
;; Extract pk2 from pk2_am.
Copy link
Contributor

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

Copy link
Contributor Author

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.

Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants