-
-
Notifications
You must be signed in to change notification settings - Fork 814
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
[WIP] EOF support #3457
Draft
harkal
wants to merge
99
commits into
vyperlang:master
Choose a base branch
from
harkal:feature/eof-support
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
[WIP] EOF support #3457
Changes from 93 commits
Commits
Show all changes
99 commits
Select commit
Hold shift + click to select a range
7a62724
add RJUMP and RJUMPI instructions and create a new EVM version to rep…
harkal 43b969a
get_opcode() utility function to get the opcode for a mnemonic
harkal d4edd29
implement RJUMP
harkal 669d6f4
properly output RJUMP enabled opcode formating
harkal 2d53ed1
refactor symbol to be before RJUMP for consistency
harkal e369505
if supported emmit RJUMPI
harkal 819f337
fix pc progression for RJUMP RJUMPI
harkal 27afb04
emit RJUMP for if and repeat
harkal 85c6835
assert for very lange offsets
harkal 25897e2
enable RJUMP ineffiecient optimization
harkal 7db3f38
update evm version and proper checking
harkal 9cccc90
add CALLF, RETF, JUMPF definitions
harkal ea9a620
fix tests
harkal c57154e
rename EOF evm version to shanghai
harkal c755e09
add RJUMPV
harkal 1e55fd5
add output for new opcodes
harkal d5eec27
add CALLF emission and JUMPF CALLF handling
harkal cc067b5
add validate_eof.py cli util
harkal 4f6700a
update EOFv1 validation script
harkal 482bf87
track proper size
harkal e3de205
validate code
harkal af9ea71
EOFv1 enabled emits retf
harkal 0753717
refactor EOF_ENABLED to EOFv1_ENABLED
harkal ccba119
generate callf
harkal 82bb715
disable return rewrites and only handle gotos that are not simple jumps
harkal ac316a9
skip JUMPDESTs when EOFv1
harkal eb7ec67
exit_to wip
harkal adb5606
goto wip
harkal 124e1a7
fix ident
harkal 883b64d
eofv1 header output wip
harkal 05c0936
file should be handled higher
harkal a7d3624
eof handling code
harkal 3e7b717
function to get opcode's immediate size
harkal 6d94f01
eof reader class
harkal 03f867b
fix naming
harkal c347b2c
validator
harkal 4f994d6
create reverse mapping from opcode to mnemonic
harkal 7c34f9d
read code sections and validate wip
harkal a7c2a78
use class members
harkal 152a53e
update cli verification tool to use vyper
harkal f23cf30
remove size
harkal cddfea1
use eof constants
harkal e0148d9
remove double size
harkal 31bc229
remove JUMPF and PC for eof
harkal c4f01eb
convert callf offsets to function ids
harkal a0cca00
compute and emit code section sizes
harkal c73f44b
update type section
harkal 471ceb3
disable code validation for now
harkal e7febb0
emit types
harkal 1392120
wip
harkal da04e64
remove decorateEOFHeader
harkal 9141ba1
append headers at bytecode start for deploy and runtime
harkal 27ee59c
proper size for deploy code
harkal 3abb990
handle consecutive eofv1 containers
harkal 963e57a
eofv1 disassemble debuging support
harkal 385e8e5
temp
harkal c2119c5
print separators
harkal 22495b3
remove unused return value
harkal 870d028
output update
harkal 54db685
fix return opcodes
harkal 2aff266
convert revert jump to function call
harkal f4b5b92
enable code validation
harkal 5fb73d0
add ending new lines
harkal 6e6fab6
runnable
harkal 48dfb03
properly order functions breaks
harkal 4aff4fd
fix revert call
harkal e343a56
remove return pc from stack
harkal de18ce3
pop arg buffer address on retf
harkal 09b4e7b
outout 1 input for all functions exept main
harkal f5f26f0
refactoring, add eof enable parameter, proper output
harkal e9d70cf
add in old parameter for tests
harkal c929510
fix legacy case
harkal 2a87cfb
update readme
harkal b36f388
more detail in the exception
harkal 4f7e280
assert push size gt 0
harkal 76d37f4
update shanghai to cancun
harkal 9213915
shanghai -> cancun
harkal fa5c573
get opcode metadata helper
harkal 18d42f4
calculate_max_stack_height() implementation
harkal b7486cd
append proper max stack heights to eof header
harkal 7137cb4
leftout import
harkal bd00287
Add back rebase leftout
harkal 49a97c1
change default evm version back to shanghai
charles-cooper 12c20de
no longer assert for push0
harkal 3b054d9
revert changes to notes
harkal 856a2aa
remove old active version variable
harkal cebf70f
more upstream merges
harkal 210280c
more upstream merges
harkal 6a3fb55
black formatter fixes
harkal c81d391
isort fixes
harkal 1e5d4c4
fix flake8 reported issues
harkal 25b0cee
more blake8 reformatting
harkal d9a33ae
Merge branch 'master' into feature/eof-support
harkal e752a23
weekend eof stuff
harkal 4275e43
lint
harkal aa88fcc
Merge remote-tracking branch 'origin-vyper/master' into feature/eof-s…
harkal 50c732e
Merge branch 'master' into feature/eof-support
harkal 06fb2fa
no metadata at runtime
harkal da8d6c0
lint
harkal File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/usr/bin/env python3 | ||
import argparse | ||
import sys | ||
|
||
from vyper.evm.eof import EOFReader | ||
|
||
|
||
def _parse_args(argv): | ||
parser = argparse.ArgumentParser( | ||
description="Vyper EOFv1 validation utility", formatter_class=argparse.RawTextHelpFormatter | ||
) | ||
parser.add_argument( | ||
"input_file", help="Input file containing the EOFv1 formated bytecode", nargs="?" | ||
) | ||
|
||
args = parser.parse_args(argv) | ||
|
||
if args.input_file: | ||
with open(args.input_file, "r") as f: | ||
code = bytes.fromhex(f.read()) | ||
EOFReader(code) | ||
|
||
|
||
if __name__ == "__main__": | ||
_parse_args(sys.argv[1:]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Check notice
Code scanning / CodeQL
Commented-out code Note