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

Optimise read_exits #6

Merged
merged 1 commit into from
Apr 8, 2024
Merged

Optimise read_exits #6

merged 1 commit into from
Apr 8, 2024

Conversation

mkalinin
Copy link
Contributor

Implements the following simplification of the original algorithm that packs exits into memory:

  1. shl_addr_96 = shl(addr, 96)
  2. mstore(shl_addr_96, RECORD_OFFSET)
  3. mstore(pubkey[0:32], RECORD_OFFSET + 20)
  4. mstore(pubkey[32:48], RECORD_OFFSET + 52)

@mkalinin mkalinin mentioned this pull request Apr 4, 2024
Copy link
Owner

@lightclient lightclient left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great optimization, I completely overlooked that mstore operates on bytes instead of words.

@lightclient lightclient merged commit a5d9c7d into lightclient:main Apr 8, 2024
1 check passed
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