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

Validity of jump destinations - exclude jumpdest found inside pushed values #41

Open
loredanacirstea opened this issue Jan 30, 2022 · 1 comment

Comments

@loredanacirstea
Copy link
Owner

Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf) says:

9.4.3. Jump Destination Validity. We previously used D
as the function to determine the set of valid jump destinations given the code that is being run. We define this
as any position in the code occupied by a JUMPDEST
instruction.
All such positions must be on valid instruction boundaries, rather than sitting in the data portion of PUSH
operations and must appear within the explicitly defined
portion of the code (rather than in the implicitly defined
STOP operations that trail it).

Clients implement this by creating a list a valid jumpdest list before even executing the code:
https://github.com/ethereumjs/ethereumjs-monorepo/blob/93c4c4ad182d4b4be54b6346aab70f615fb21bb8/packages/vm/src/evm/interpreter.ts#L263-L283

@loredanacirstea
Copy link
Owner Author

This was not obvious behavior. Opened ethereum/yellowpaper#840

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

No branches or pull requests

1 participant