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

src/beacon_root: gas optimization #21

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

Conversation

lmittmann
Copy link

This PR is a small gas optimization for the beacon_root-contract.

  • dropped stop at the end of the contract: the execution stops, if the end of the contract is reached. an explicit stop at the end is not required.
  • dropped iszero: jumpi jumps, if the condition is non-zero. thus, the input_timestamp can be used as the condition directly. This reduces the gas consumption of the execution with valid input data by 2 (-3 for dropping the iszero, +1 for an extra jumpdest)

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.

1 participant