Skip to content

Commit b096dbd

Browse files
add cbor length metadata (#3010)
add binary encoded length to the end of the CBOR metadata so disassemblers can reliably detect where code ends and metadata starts
1 parent 7180ddd commit b096dbd

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

vyper/ir/compile_ir.py

+1
Original file line numberDiff line numberDiff line change
@@ -994,6 +994,7 @@ def assembly_to_evm(assembly, pc_ofst=0, insert_vyper_signature=False):
994994
if insert_vyper_signature:
995995
# CBOR encoded: {"vyper": [major,minor,patch]}
996996
bytecode_suffix += b"\xa1\x65vyper\x83" + bytes(list(version_tuple))
997+
bytecode_suffix += len(bytecode_suffix).to_bytes(2, "big")
997998

998999
CODE_OFST_SIZE = 2 # size of a PUSH instruction for a code symbol
9991000

0 commit comments

Comments
 (0)