Home of the "Mega EOF Endgame" Specification (EOFv1).
See Readiness matrix for an overview of progress on EOF specification and implementation.
This repository contains older validation implementations (NOTE some may be out-of-date) for:
Validation code for the EOF specification
License: Apache License 2.0
Home of the "Mega EOF Endgame" Specification (EOFv1).
See Readiness matrix for an overview of progress on EOF specification and implementation.
This repository contains older validation implementations (NOTE some may be out-of-date) for:
CALLF
/JUMPF
max_stack_height
(type section)inputs
(type section)The EIP-2935: Serve historical block hashes from state possibly modified the BLOCKHASH
instruction and provides enhanced alternative in form of a system contract.
Considering there is going to be better way for accessing block hashes the BLOCKHASH
instruction should be rejected in EOF.
BLOCKHASH
instruction is weirdBLOCKHASH
instruction provides uniform way of accessing this information across EVM chains (not every chain may have the system contract, or have it before EOF)BLOCKHASH
is cheaper (at least before Verkles)BLOCKHASH
is smaller codeModify the specification so that functions don't specify their max_stack_height
but instead there is a single constant FUNC_STACK_LIMIT
defined by the spec. The validation condition is: compute max stack height of a function must be within the limit
assert(max_stack_height(code_section) <= FUNC_STACK_LIMIT)
max_stack_height
of a function is not needed to be stored in the type section. This saves 2 bytes per function (i.e. it shrinks the type section by half).CALLF
/JUMPF
implementations don't need to read the callee's max_stack_height
from the type section. And combined with #134 all need by the interpreter to access the type section is gone.max_stack_height
of an assembly snippet).1024 - FUNC_STACK_LIMIT
even if in the reality the callee uses much less of the operand stack than FUNC_STACK_LIMIT
.256
: this plays nicely with SWAPN
, DUPN
limitations and still leaves significant "recursion" stack of 768
operands.I want to have 1024 operands on the stack as in legacy EVM.
For this we can allow code section 0 to have 1024 limit but we also need to forbid calling this section.
Instead of the full deployment of the feature we can space for it and reconsider it in a future upgrade. The "space" is to limit max_stack_height
to 256 (1 byte).
Show that any CFG can be linearized to the basic block order required by the EOF stack validation.
It is relatively easy to inspect all Mainnet deployed codes. See scripts for EOF prefix search https://github.com/ipsilon/eof/tree/main/code_prefixes.
Below is an example script that analyze static jump offsets in bytecode.
Decide what statistics we want about jumps and collect the numbers.
UNISWAP = '60a0604081815260049081361015610022575b505050361561002057600080fd5b005b600092833560e01c90816301ffc9a71461093d57508063150b7a02146108af57806324856bc3146107e85780633593564c146106b1578063709a1cc21461044f578063bc197c811461038a578063f23a6e61146102f95763fa461e330361001257346102f55760607ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126102f557813590602435926044359067ffffffffffffffff918281116102f1576100db9036908301610a97565b919092878613908115806102e7575b6102bf5783850186868203126102bb5785359182116102bb5761010e9186016136d0565b5060208401359373ffffffffffffffffffffffffffffffffffffffff938486168096036102bb5761013e9161415a565b959097602b89106102935786359260178460601c98019561016d62ffffff883560601c9660481c16868b614365565b3391160361026b571561026157508186105b15610197575050505061019493503391613ac2565b80f35b9395945091929091906042871061021b5750505083601711610217577f8000000000000000000000000000000000000000000000000000000000000000821015610217577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe961021194019161020c33916141b5565b6141e2565b50505080f35b8480fd5b91969550929391508454841161023957506101949394503391613ac2565b8590517f739dbe52000000000000000000000000000000000000000000000000000000008152fd5b965085821061017f565b8483517f32b13d91000000000000000000000000000000000000000000000000000000008152fd5b8382517f3b99b53d000000000000000000000000000000000000000000000000000000008152fd5b8980fd5b8286517f316cf0eb000000000000000000000000000000000000000000000000000000008152fd5b50888813156100ea565b8680fd5b8280fd5b5082346103875760a07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261038757610332610a2b565b5061033b610a53565b506084359067ffffffffffffffff8211610387575060209261035f91369101610a97565b5050517ff23a6e61000000000000000000000000000000000000000000000000000000008152f35b80fd5b5082346103875760a07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610387576103c3610a2b565b506103cc610a53565b5067ffffffffffffffff9060443582811161044b576103ee9036908601610ac5565b505060643582811161044b576104079036908601610ac5565b5050608435918211610387575060209261042391369101610a97565b5050517fbc197c81000000000000000000000000000000000000000000000000000000008152f35b5080fd5b50346102f557602090817ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126106ad5783833567ffffffffffffffff811161044b576104a1829136908701610a97565b90818551928392833781018381520390827f0000000000000000000000000554f068365ed43dcc98dcd7fd7a8208a5638c725af16104dd613675565b50156106855780517f70a082310000000000000000000000000000000000000000000000000000000081523084820152907f000000000000000000000000f4d2888d29d722226fafa5d9b24f9164c092421e73ffffffffffffffffffffffffffffffffffffffff168383602481845afa92831561067b578693610646575b5081517fa9059cbb00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000ea37093ce161f090e443f304e1bf3a8f14d7bb40169581019586526020860184905294849186918290899082906040015b03925af193841561063c577f1e8f03f716bc104bf7d728131967a0c771e85ab54d09c1e2d6ed9e0bc4e2a16c9461060f575b5051908152a180f35b61062e90843d8611610635575b61062681836135fa565b81019061388d565b5038610606565b503d61061c565b81513d87823e3d90fd5b9092508381813d8311610674575b61065e81836135fa565b810103126106705751916105d461055b565b8580fd5b503d610654565b82513d88823e3d90fd5b9050517f7d529919000000000000000000000000000000000000000000000000000000008152fd5b8380fd5b5060607ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126102f55767ffffffffffffffff8235818111610217576106fb9036908501610a97565b91602435908111610670576107139036908601610ac5565b92909160443542116107c0573330146107b1576001958654958773ffffffffffffffffffffffffffffffffffffffff88160361078b5750509185949391610782937fffffffffffffffffffffffff00000000000000000000000000000000000000009586339116178755610b54565b81541617905580f35b517f6f5ffb7e000000000000000000000000000000000000000000000000000000008152fd5b90919293506101949450610b54565b8585517f5bf6f916000000000000000000000000000000000000000000000000000000008152fd5b50807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126102f55767ffffffffffffffff8235818111610217576108319036908501610a97565b91602435908111610670576108499036908601610ac5565b9290913330146107b1576001958654958773ffffffffffffffffffffffffffffffffffffffff88160361078b5750509185949391610782937fffffffffffffffffffffffff00000000000000000000000000000000000000009586339116178755610b54565b5082346103875760807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610387576108e8610a2b565b506108f1610a53565b506064359067ffffffffffffffff8211610387575060209261091591369101610a97565b5050517f150b7a02000000000000000000000000000000000000000000000000000000008152f35b849084346102f55760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126102f557357fffffffff0000000000000000000000000000000000000000000000000000000081168091036102f557602092507f4e2312e0000000000000000000000000000000000000000000000000000000008114908115610a01575b81156109d7575b5015158152f35b7f01ffc9a700000000000000000000000000000000000000000000000000000000915014836109d0565b7f150b7a0200000000000000000000000000000000000000000000000000000000811491506109c9565b6004359073ffffffffffffffffffffffffffffffffffffffff82168203610a4e57565b600080fd5b6024359073ffffffffffffffffffffffffffffffffffffffff82168203610a4e57565b359073ffffffffffffffffffffffffffffffffffffffff82168203610a4e57565b9181601f84011215610a4e5782359167ffffffffffffffff8311610a4e5760208381860195010111610a4e57565b9181601f84011215610a4e5782359167ffffffffffffffff8311610a4e576020808501948460051b010111610a4e57565b919082519283825260005b848110610b405750507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8460006020809697860101520116010190565b602081830181015184830182015201610b01565b9192909260805282810361350d5791906000905b828210610b755750505050565b8382959394951015611b4c5760059282841b60805101357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe19182608051360301821215610a4e578160805101359767ffffffffffffffff8911610a4e576020836080510101988036038a13610a4e57606097603f90818989013560f81c166001976020821060001461317157506010808210156127b4575060088082101561187e57508061109157505050610c2a908a614198565b92909860a08560805101013560001461108757610c6173ffffffffffffffffffffffffffffffffffffffff600154169b5b35613854565b9960408660805101013585829d927f80000000000000000000000000000000000000000000000000000000000000008314610fcf575b50959c95505b7f8000000000000000000000000000000000000000000000000000000000000000811015610a4e5760428610610fc85730915b86602b11610a4e578d91601783013560601c9083359462ffffff8660601c96610d1573ffffffffffffffffffffffffffffffffffffffff92839260481c16868a614365565b169084881015610fac57806401000276a4965b602b60405199604060208c01528160608c015260808b0137600060ab8a015216604088015260a0875260c087019587871067ffffffffffffffff881117610f7d576040948288958688527f128acb080000000000000000000000000000000000000000000000000000000087521660c48a0152868a1060e48a01526101048901521661012487015260a06101448701528160007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff4088610deb610164820182610af6565b0301925af1928315610f71576000928394610f2f575b5050610e159310600014610f2857506141b5565b9a60428510610e5657309085601711610a4e5760177fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe991019501949b610c9d565b50985098606091969597949392509160805101013511610efe575b1580610ed1575b610e8a57506001019291929092610b68565b90610ecd60409283519384937f2c4029e9000000000000000000000000000000000000000000000000000000008552600485015260248401526044830190610af6565b0390fd5b507f8000000000000000000000000000000000000000000000000000000000000000828501351615610e78565b60046040517f39d35496000000000000000000000000000000000000000000000000000000008152fd5b90506141b5565b91929093506040843d604011610f69575b81610f4d604093866135fa565b8101031261038757505160e092909201519190610e1538610e01565b3d9150610f40565b6040513d6000823e3d90fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b8073fffd8963efd1fc6a506488495d951d5263988d2596610d28565b8b91610cd0565b60149192501061105d576020602491604051928380927f70a082310000000000000000000000000000000000000000000000000000000082523060048301523560601c5afa908115610f715760009161102b575b503880610c97565b906020823d602011611055575b81611045602093836135fa565b8101031261038757505138611023565b3d9150611038565b60046040517f3b99b53d000000000000000000000000000000000000000000000000000000008152fd5b610c61309b610c5b565b6001819d969d9b989794959a999b146000146111b7575050506040926110bf84836080510101359382614198565b608051840160a00135156111ab5760606110f273ffffffffffffffffffffffffffffffffffffffff600154169435613854565b946080510101356000557f8000000000000000000000000000000000000000000000000000000000000000851015610a4e576111319361020c866141b5565b9091901561119c5750611143906141b5565b0361117357507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6000555b610e71565b600490517fd4e0248e000000000000000000000000000000000000000000000000000000008152fd5b6111a691506141b5565b611143565b60606110f23094610c5b565b9194929391600281036112065750505061116e925073ffffffffffffffffffffffffffffffffffffffff600154166111ff604060608560805101013594608051010135613854565b91356139d0565b9193916003810361157857505060805181018084019390604090850312610a4e57823567ffffffffffffffff8111610a4e5782608051010192606084860312610a4e57604051946060860186811067ffffffffffffffff821117610f7d57604052602085013567ffffffffffffffff8111610a4e57850160208201809882011215610a4e5760208101359061129a826136a5565b926112a860405194856135fa565b8284526040602085019360071b830101918a8311610a4e57604001925b828410611513575050505085526112de60408501610a76565b956020860196875260606040870195013585526040846080510101359067ffffffffffffffff8211610a4e57602061131f92611325966080510101016136d0565b5061417b565b909173ffffffffffffffffffffffffffffffffffffffff600154169473ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000022d473030f116ddee9f6b43ac78ba3163b15610a4e5794929391906040519586947f2a2d80d100000000000000000000000000000000000000000000000000000000865260048601526060602486015260c48501935193606060648701528451809152602060e487019501906000905b80821061149a575050509461143e9285949273ffffffffffffffffffffffffffffffffffffffff600098511660848701525160a48601527ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc858403016044860152613537565b03818373ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000022d473030f116ddee9f6b43ac78ba3165af18015610f715761148b575b50610e71565b61149490613576565b38611485565b9197965091929394602060806001928a5173ffffffffffffffffffffffffffffffffffffffff815116825273ffffffffffffffffffffffffffffffffffffffff848201511684830152606065ffffffffffff918260408201511660408501520151166060820152019801920188969795949392916113d8565b608060208584030112610a4e5760206080916040516115318161358a565b61153a87610a76565b8152611547838801610a76565b83820152611557604088016136bd565b6040820152611568606088016136bd565b60608201528152019301926112c5565b600495509193508482036116e757505090916040606061159e8286608051010135613854565b608051909501013573ffffffffffffffffffffffffffffffffffffffff908116933516806116145750479283106115ee575050806115de575b5050610e71565b6115e7916144d1565b38806115d7565b517f6a12f104000000000000000000000000000000000000000000000000000000008152fd5b9391908051937f70a082310000000000000000000000000000000000000000000000000000000085523083860152602085602481895afa9485156116dc576000956116a8575b50841061168257505081611671575b505050610e71565b61167a9261453f565b388080611669565b517f675cae38000000000000000000000000000000000000000000000000000000008152fd5b90946020823d6020116116d4575b816116c3602093836135fa565b81010312610387575051933861165a565b3d91506116b6565b82513d6000823e3d90fd5b8103611714575061116e925061170d604060608460805101013593608051010135613854565b90356138a5565b9091906006810361184e57506080510160608101359060409061173990820135613854565b9282158015611843575b61181b573573ffffffffffffffffffffffffffffffffffffffff16938461177f57505061116e92506117786127109147613984565b04906144d1565b8151907f70a082310000000000000000000000000000000000000000000000000000000082523090820152602081602481885afa91821561181157506000916117dd575b506117d661116e94939261271092613984565b049161453f565b906020823d602011611809575b816117f7602093836135fa565b810103126103875750516117d66117c3565b3d91506117ea565b513d6000823e3d90fd5b8482517fdeaa01e6000000000000000000000000000000000000000000000000000000008152fd5b506127108311611743565b83602491604051917fd76a1e9e000000000000000000000000000000000000000000000000000000008352820152fd5b819d969d9b989794959a999b93929314600014611b85575050506040916118ad83836080510101359185614198565b92909460a082608051010135600014611b7b576118e373ffffffffffffffffffffffffffffffffffffffff600154169135613854565b908615611b4c576118f385613a94565b8760011015611b4c5761191561195d9161190f60208901613a94565b90613c34565b907f96e8ac4277198ff8b6f785478aa9a39f403cb768dd02cbee326c3e7da348845f7f0000000000000000000000005c69bee701ef814a2b6a3edd4b1652cb9cc5aa6f613b2c565b938481611b32575b5050507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff860193868511611b03576119b9946119be73ffffffffffffffffffffffffffffffffffffffff9687928a85613a84565b613a94565b16948651947f70a082310000000000000000000000000000000000000000000000000000000091828752841693600499858b89015260249460208987818d5afa988915611af857600099611ac3575b509160209695949391611a1f93613cad565b8751968793849283528a8301525afa928315611ab857600093611a83575b50906060611a519260805101013592613ab5565b10611a5d575050610e71565b517f849eaf98000000000000000000000000000000000000000000000000000000008152fd5b90926020823d602011611ab0575b81611a9e602093836135fa565b81010312610387575051916060611a3d565b3d9150611a91565b84513d6000823e3d90fd5b90986020823d602011611af0575b81611ade602093836135fa565b81010312610387575051976020611a0d565b3d9150611ad1565b8b513d6000823e3d90fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b611b4492611b3f88613a94565b613ac2565b388084611965565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6118e33091610c5b565b919492939160098103611f66575050611b9e9082614198565b608051840160a0013515611f5c57611bcf73ffffffffffffffffffffffffffffffffffffffff600154169335613854565b92611bd9836136a5565b95611be760405197886135fa565b83875283901b820160208701368211610a4e5783905b828210611f44575050506000946002875110611f1a576040816080510101359680517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8101908111611b035790815b611ca757505060805101606001358611611c7d578215611b4c5761116e9585611c7892611b3f85613a94565b613cad565b60046040517f8ab0bc16000000000000000000000000000000000000000000000000000000008152fd5b90977fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff89019750888811611b035773ffffffffffffffffffffffffffffffffffffffff611cf7611d6d9984613a70565b5116611d2373ffffffffffffffffffffffffffffffffffffffff611d1b8c86613a70565b511682613c34565b819a917f96e8ac4277198ff8b6f785478aa9a39f403cb768dd02cbee326c3e7da348845f7f0000000000000000000000005c69bee701ef814a2b6a3edd4b1652cb9cc5aa6f613b2c565b90604051907f0902f1ac00000000000000000000000000000000000000000000000000000000825260608260048173ffffffffffffffffffffffffffffffffffffffff87165afa9a8b15610f7157600092839c611ed1575b5073ffffffffffffffffffffffffffffffffffffffff1603611eb7576dffffffffffffffffffffffffffff8091169916905b9880158015611eaf575b611e855782611e0f91613984565b916103e892838102938185041490151715611b0357611e2d91613ab5565b6103e590818102918183041490151715611b0357611e4a91613997565b60018101809111611b0357978015611b03577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff019081611c4c565b60046040517f7b9c8916000000000000000000000000000000000000000000000000000000008152fd5b508115611e01565b6dffffffffffffffffffffffffffff998a16991690611df7565b611f0a919c5073ffffffffffffffffffffffffffffffffffffffff935060603d8111611f13575b611f0281836135fa565b810190613c77565b509b9092611dc5565b503d611ef8565b60046040517f20db8267000000000000000000000000000000000000000000000000000000008152fd5b60208091611f5184610a76565b815201910190611bfd565b611bcf3093610c5b565b92945091600a81036120cc5750608051830160e08101358101946020808701359450909291611f9991908703018461414d565b1161105d5773ffffffffffffffffffffffffffffffffffffffff93847f000000000000000000000000000000000022d473030f116ddee9f6b43ac78ba31692856001541691843b15610a4e5760409587875198899687967f2b67b570000000000000000000000000000000000000000000000000000000008852600488015261202190610a76565b166024860152808883608051010161203890610a76565b16604486015265ffffffffffff808360805101606001612057906136bd565b166064870152826080510160800161206e906136bd565b166084860152816080510160a00161208590610a76565b1660a48501526080510160c0013560c484015261010060e48401526120b1916101048401918701613537565b03815a6000948591f1908115611811575061148b5750610e71565b600b8103612296575050506120eb604080926080510101359235613854565b91807f80000000000000000000000000000000000000000000000000000000000000008103612266575050475b8061212557505050610e71565b73ffffffffffffffffffffffffffffffffffffffff90817f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc216803b15610a4e578351927fd0e30db0000000000000000000000000000000000000000000000000000000008452600493600081868187875af1801561225b5761224c575b5030908616036121b4575b5050611669565b6122139460006020948651978895869485937fa9059cbb00000000000000000000000000000000000000000000000000000000855284016020909392919373ffffffffffffffffffffffffffffffffffffffff60408201951681520152565b03925af1908115611811575061222d575b808080806121ad565b6122459060203d6020116106355761062681836135fa565b5038612224565b61225590613576565b386121a2565b86513d6000823e3d90fd5b47101561211857600482517f6a12f104000000000000000000000000000000000000000000000000000000008152fd5b600c810361242657505050906122ac9035613854565b9073ffffffffffffffffffffffffffffffffffffffff807f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc21660408051937f70a08231000000000000000000000000000000000000000000000000000000008552600430818701526024916020878481885afa968715611ab8576000976123f2575b506080510183013586106123cb578561234e575b50505050505050610e71565b833b15610a4e57600091869183855196879485937f2e1a7d4d0000000000000000000000000000000000000000000000000000000085528401525af190811561181157506123bc575b5030908316036123ac575b8080808080612342565b6123b5916144d1565b38806123a2565b6123c590613576565b38612397565b82517f6a12f104000000000000000000000000000000000000000000000000000000008152fd5b90966020823d60201161241e575b8161240d602093836135fa565b81010312610387575051958361232e565b3d9150612400565b600d8103612681575082608051010191602083019360208260805101850312610a4e573567ffffffffffffffff8111610a4e57849160805101019182011215610a4e57602081013590612478826136a5565b93604093612488855196876135fa565b838652602086019285849560071b820101928311610a4e578501925b82841061261f575050505073ffffffffffffffffffffffffffffffffffffffff90816001541684519060005b8281106125b357505050817f000000000000000000000000000000000022d473030f116ddee9f6b43ac78ba31691823b15610a4e5783517f0d58b1db000000000000000000000000000000000000000000000000000000008152602060048201529451602486018190528592604484019290916000915b81831061256f57505050509181600081819503925af1908115611811575061148b5750610e71565b91938395506080602091846060600195975182815116845282868201511686850152828d820151168d85015201511660608201520195019301909187949392612547565b81856125bf838a613a70565b515116036125f6577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8114611b03576001016124d0565b600486517fe7002877000000000000000000000000000000000000000000000000000000008152fd5b608060208584030112610a4e576020608091875161263c8161358a565b61264587610a76565b8152612652838801610a76565b83820152612661898801610a76565b8982015261267160608801610a76565b60608201528152019301926124a4565b9294505050600e810361278357506040918251907f70a0823100000000000000000000000000000000000000000000000000000000825260208260248173ffffffffffffffffffffffffffffffffffffffff806004983516888301528886608051010135165afa918215611ab85760009261274e575b5060805101606001351180159290612710575050610e71565b517fa3281672000000000000000000000000000000000000000000000000000000006020820152908152909150612746816135c2565b9038806115d7565b90916020823d60201161277b575b81612769602093836135fa565b810103126103875750519060606126f7565b3d915061275c565b602490604051907fd76a1e9e0000000000000000000000000000000000000000000000000000000082526004820152fd5b9150915060189b95939897999692949b808310600014612d435750810361282a5750505060009250906127e883928261417b565b81604051928392833781018481520391357f00000000000000000000000000000000000000adc04c56bf30ac9d3c0aaf14dc5af1612824613675565b90610e71565b6011810361288157505050600092509061284583928261417b565b81604051928392833781018481520391357f0000000000000000000000000000000000e655fae4d56241588680f86e3b23775af1612824613675565b601281036128d857505050600092509061289c83928261417b565b81604051928392833781018481520391357f000000000000000000000000941a6d105802cccaa06de58a13a6f49ebdcd481c5af1612824613675565b919392509060138103612a3e575050909150357f000000000000000000000000b47e3cd837ddf8e4c57f05d70ab865de6e193bbb916040600080825160208101907f8264fe9800000000000000000000000000000000000000000000000000000000825260248781830152815261294e816135de565b5190606086608051010135885af192612965613675565b948415612a04578273ffffffffffffffffffffffffffffffffffffffff612993921694608051010135613854565b90833b15610a4e5782517f8b72a2ec00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9290921660048301526024820152916000908390604490829084905af1908115611811575061148b5750610e71565b505091925050517fae9bdf0000000000000000000000000000000000000000000000000000000000602082015260048152612824816135c2565b60158103612b4f57505090604091828051917f6352211e0000000000000000000000000000000000000000000000000000000083526020836024816004976060816080510101358983015273ffffffffffffffffffffffffffffffffffffffff968791608051010135165afa928315612b4457600093612b05575b5081903516911614918215612acf575050610e71565b517f7dbe7e89000000000000000000000000000000000000000000000000000000006020820152908152909150612746816135c2565b6020939193813d602011612b3c575b81612b21602093836135fa565b8101031261044b575190828216820361038757509181612ab9565b3d9150612b14565b85513d6000823e3d90fd5b60168103612c765750506040918251907efdd58e00000000000000000000000000000000000000000000000000000000825260208280612bc160049660608660805101013590358884016020909392919373ffffffffffffffffffffffffffffffffffffffff60408201951681520152565b038173ffffffffffffffffffffffffffffffffffffffff8886608051010135165afa918215611ab857600092612c41575b5060809081510101351191821592612c0b575050610e71565b517f483a6929000000000000000000000000000000000000000000000000000000006020820152908152909150612746816135c2565b90916020823d602011612c6e575b81612c5c602093836135fa565b81010312610387575051906080612bf2565b3d9150612c4f565b909290601714612c87575050610e71565b60409073ffffffffffffffffffffffffffffffffffffffff612caf8383608051010135613854565b93351692833b15610a4e5782517f42842e0e00000000000000000000000000000000000000000000000000000000815260805130600483015273ffffffffffffffffffffffffffffffffffffffff909216602482015291016060013560448201529160009083908183816064810103925af19081156118115750612d34575b806115d7565b612d3d90613576565b38612d2e565b9396938214159050612d7e5750505061282492507f00000000000000000000000074312363e45dcaba76c59ec49a7aa8a65a67eed391613717565b60198103612dd5575050506000925090612d9983928261417b565b81604051928392833781018481520391357f0000000000000000000000002b2e8cda09bba9660dca5cb6233787738ad683295af1612824613675565b601a8103612e2c575050506000925090612df083928261417b565b81604051928392833781018481520391357f000000000000000000000000a42f6cada809bcf417deefbdd69c5c5a909249c05af1612824613675565b601b8103612f53575050506000612e4481928461417b565b9390604094818651928392833781018481520391357f00000000000000000000000074312363e45dcaba76c59ec49a7aa8a65a67eed35af1918291612e87613675565b92612e95575b505090610e71565b73ffffffffffffffffffffffffffffffffffffffff608083815101013516612ec4606084608051010135613854565b90825190612ed1826135a6565b60008252803b15610a4e57612f2d94600080948651978895869485937ff242432a00000000000000000000000000000000000000000000000000000000855260a060c0836080510101359260805101013590306004870161380f565b03925af19081156118115750612f44575b80612e8d565b612f4d90613576565b38612f3e565b91949091601c8103612f8e5750505061282492507f000000000000000000000000cda72070e455bb31c7690a170224ce43623d0b6f91613717565b9193929091601d81036131175750506060816080510101359060409173ffffffffffffffffffffffffffffffffffffffff612fcf8484608051010135613854565b9435168351947efdd58e0000000000000000000000000000000000000000000000000000000086526004936020878061302e87308a84016020909392919373ffffffffffffffffffffffffffffffffffffffff60408201951681520152565b0381865afa96871561225b576000976130e2575b50608090815101013586106130ba57845161305c816135a6565b60008152823b15610a4e576000946130a486928851998a97889687957ff242432a0000000000000000000000000000000000000000000000000000000087523090870161380f565b03925af1908115611811575061148b5750610e71565b8385517f675cae38000000000000000000000000000000000000000000000000000000008152fd5b90966020823d60201161310f575b816130fd602093836135fa565b81010312610387575051956080613042565b3d91506130f0565b929450925050601e810361278357508161313560009392849361417b565b81604051928392833781018481520391357f00000000000000000000000020f780a973856b93f63670377900c1d2a50a77c45af1612824613675565b9499989a92506020819d9792969d989498146000146131da575050505050508061319e600093849361417b565b81604051928392833781018481520391357f00000000000000000000000000000000000001ad428e4906ae43d8f9852d0dd65af1612824613675565b602190808203613351575050505090916131ff6131f7868661415a565b96909561417b565b929061324160409788519760208901997f24856bc3000000000000000000000000000000000000000000000000000000008b5260248a01526064890191613537565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffdc878203016044880152818152602082818301951b82010195856000915b8483106132d357505050505050505091816132c5600094938594037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081018352826135fa565b519082305af1612824613675565b90919293949596977fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe085820301885288358284360301811215610a4e578301906020823592019167ffffffffffffffff8111610a4e578036038313610a4e5761334160209283928b95613537565b9a0198019695949301919061327f565b929750929593509350602281146000146127835750604080936080510101359060009060028310156134e1575050808491156000146134895750506000907f0000000000000000000000001e0049783f008a0085193e00003d00cd54003c71925b6020838251937f095ea7b3000000000000000000000000000000000000000000000000000000008552600496878601526024947fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff868201526044968792355af13d15601f3d1187600051141617161561342e5750505050610e71565b91600e7f415050524f56455f4641494c45440000000000000000000000000000000000009260206064969551957f08c379a0000000000000000000000000000000000000000000000000000000008752860152840152820152fd5b036134b8576000907f0000000000000000000000002b2e8cda09bba9660dca5cb6233787738ad68329926133b2565b600482517f5461585f000000000000000000000000000000000000000000000000000000008152fd5b602492507f4e487b71000000000000000000000000000000000000000000000000000000008252600452fd5b60046040517fff633a38000000000000000000000000000000000000000000000000000000008152fd5b601f82602094937fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0938186528686013760008582860101520116010190565b67ffffffffffffffff8111610f7d57604052565b6080810190811067ffffffffffffffff821117610f7d57604052565b6020810190811067ffffffffffffffff821117610f7d57604052565b6040810190811067ffffffffffffffff821117610f7d57604052565b6060810190811067ffffffffffffffff821117610f7d57604052565b90601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0910116810190811067ffffffffffffffff821117610f7d57604052565b67ffffffffffffffff8111610f7d57601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01660200190565b3d156136a0573d906136868261363b565b9161369460405193846135fa565b82523d6000602084013e565b606090565b67ffffffffffffffff8111610f7d5760051b60200190565b359065ffffffffffff82168203610a4e57565b81601f82011215610a4e578035906136e78261363b565b926136f560405194856135fa565b82845260208383010111610a4e57816000926020809301838601378301015290565b919290613724908361417b565b90938460405195869384378201906000958693838580955203918635905af19261374c613675565b9284613756575050565b73ffffffffffffffffffffffffffffffffffffffff60608201351661377e6040830135613854565b91813b156106ad576040517f42842e0e00000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff93909316602484015260800135604483015290919081908390606490829084905af190811561380357506137f85750565b61380190613576565b565b604051903d90823e3d90fd5b919261385195949160a09473ffffffffffffffffffffffffffffffffffffffff8092168552166020840152604083015260608201528160808201520190610af6565b90565b73ffffffffffffffffffffffffffffffffffffffff908082166001810361387e5750506001541690565b90915060020361385157503090565b90816020910312610a4e57518015158103610a4e5790565b9092919073ffffffffffffffffffffffffffffffffffffffff16806138cf575061380191926144d1565b7f80000000000000000000000000000000000000000000000000000000000000008214613902575b92613801929361453f565b9050604051927f70a08231000000000000000000000000000000000000000000000000000000008452306004850152602084602481855afa938415610f7157600094613951575b5092906138f7565b6020813d821161397c575b81613969602093836135fa565b8101031261021757519350613801613949565b3d915061395c565b81810292918115918404141715611b0357565b81156139a1570490565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b919273ffffffffffffffffffffffffffffffffffffffff91827f000000000000000000000000000000000022d473030f116ddee9f6b43ac78ba31693843b15610a4e5760009484869281608496816040519b8c9a8b997f36c78516000000000000000000000000000000000000000000000000000000008b521660048a01521660248801521660448601521660648401525af18015610f71576137f85750565b8051821015611b4c5760209160051b010190565b9190811015611b4c5760051b0190565b3573ffffffffffffffffffffffffffffffffffffffff81168103610a4e5790565b91908203918211611b0357565b92919073ffffffffffffffffffffffffffffffffffffffff8082163003613aee575050613801926138a5565b8084959411613b02576138019416926139d0565b60046040517fc4bd89a9000000000000000000000000000000000000000000000000000000008152fd5b9173ffffffffffffffffffffffffffffffffffffffff93613c2d916040519060208201927fffffffffffffffffffffffffffffffffffffffff000000000000000000000000809260601b16845260601b16603482015260288152613b8f816135de565b519020613c01604051938492602084019687917fffffffffffffffffffffffffffffffffffffffff000000000000000000000000605594927fff00000000000000000000000000000000000000000000000000000000000000855260601b166001840152601583015260358201520190565b037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081018352826135fa565b5190201690565b73ffffffffffffffffffffffffffffffffffffffff8281169082161015613c585791565b9091565b51906dffffffffffffffffffffffffffff82168203610a4e57565b90816060910312610a4e57613c8b81613c5c565b916040613c9a60208401613c5c565b92015163ffffffff81168103610a4e5790565b9260028210614123578115611b4c57613cc584613a94565b9160019481861015611b4c5791613ce360209461190f868601613a94565b50926000935b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff84018510613d1c575050505050505050565b613d2a6119b9868685613a84565b92613d3b6119b98a88018786613a84565b936040908151957f0902f1ac00000000000000000000000000000000000000000000000000000000875273ffffffffffffffffffffffffffffffffffffffff80941694606092600493808a86818b5afa998a1561225b57908d9594939291600091829c6140fd575b50508780916dffffffffffffffffffffffffffff8091169c16921692168214998a6000146140f7575b8651958680947f70a082310000000000000000000000000000000000000000000000000000000082528b8883015260249889915afa9283156140ec578e6000946140bb575b5050808303918115938480156140b3575b61408b57826103e5808602958604149114171561405e57613e439083613984565b926103e880830292830414171561403157613e689291613e629161414d565b90613997565b971561402957600097905b898b7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe820181101561401d579161190f6119b9613eb9936002613f039c9601908d613a84565b8198917f96e8ac4277198ff8b6f785478aa9a39f403cb768dd02cbee326c3e7da348845f7f0000000000000000000000005c69bee701ef814a2b6a3edd4b1652cb9cc5aa6f613b2c565b965b988551918d83019367ffffffffffffffff9484811086821117613ff057885260008452813b15610a4e5760008a93613f8382968b519c8d97889687957f022c0d9f0000000000000000000000000000000000000000000000000000000087528d8701528d860152166044840152608060648401526084830190610af6565b03925af18015611ab857908d969594939291613fa8575b505050505094019391613ce9565b909192938095965011613fc45750505287903880808080613f9a565b6041907f4e487b7100000000000000000000000000000000000000000000000000000000600052526000fd5b876041887f4e487b7100000000000000000000000000000000000000000000000000000000600052526000fd5b5050508b956000613f05565b600090613e73565b856011867f4e487b7100000000000000000000000000000000000000000000000000000000600052526000fd5b866011877f4e487b7100000000000000000000000000000000000000000000000000000000600052526000fd5b8689517f7b9c8916000000000000000000000000000000000000000000000000000000008152fd5b508115613e22565b8181959293953d83116140e5575b6140d381836135fa565b8101031261038757505191388e613e11565b503d6140c9565b87513d6000823e3d90fd5b90613dcc565b899c50899250908161411a92903d10611f1357611f0281836135fa565b509b9091613da3565b60046040517fae52ad0c000000000000000000000000000000000000000000000000000000008152fd5b91908201809211611b0357565b91823583019161417460208435958186019503018561414d565b1161105d57565b91602083013583019161417460208435958186019503018561414d565b91606083013583019161417460208435958186019503018561414d565b7f80000000000000000000000000000000000000000000000000000000000000008114611b035760000390565b939193602b841061105d578462ffffff6000614267946142ee6142999935988960601c9a8b9a61423b601789013560601c9d8e109c73ffffffffffffffffffffffffffffffffffffffff9e8f998a9460481c1691614365565b16968b861461434a576401000276a49a5b60409d8e9b8c93845196879560208701526060860191613537565b91168b830152037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081018352826135fa565b848851998a98899788967f128acb080000000000000000000000000000000000000000000000000000000088521660048701528c6024870152604486015216606484015260a0608484015260a4830190610af6565b03925af190811561433f576000938492614309575b50509192565b9080949250813d8311614338575b61432181836135fa565b810103126103875750602082519201513880614303565b503d614317565b83513d6000823e3d90fd5b73fffd8963efd1fc6a506488495d951d5263988d259a61424c565b73ffffffffffffffffffffffffffffffffffffffff92838316848316116144c9575b62ffffff90846040519481602087019516855216604085015216606083015260608252608082019082821067ffffffffffffffff831117610f7d577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff80613c2d9183604052845190209361449c60a08201957fe34f199b19b2b4f47f68442619d555527d244f78a3297ea89325f843f87b8b54907f0000000000000000000000001f98431c8ad98523631ae4a59f267346ea31f98488917fffffffffffffffffffffffffffffffffffffffff000000000000000000000000605594927fff00000000000000000000000000000000000000000000000000000000000000855260601b166001840152601583015260358201520190565b037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff608101845201826135fa565b909190614387565b600080809381935af1156144e157565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f4554485f5452414e534645525f4641494c4544000000000000000000000000006044820152fd5b60009182604492602095604051937fa9059cbb000000000000000000000000000000000000000000000000000000008552600485015260248401525af13d15601f3d116001600051141617161561459257565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600f60248201527f5452414e534645525f4641494c454400000000000000000000000000000000006044820152fdfea2646970667358221220b2d6a39827110492aaa15cba3556e23894a51f2f635dc99ae66d21764ad4d90b64736f6c63430008110033'
TETHER = '606060405260043610610196576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde031461019b5780630753c30c14610229578063095ea7b3146102625780630e136b19146102a45780630ecb93c0146102d157806318160ddd1461030a57806323b872dd1461033357806326976e3f1461039457806327e235e3146103e9578063313ce56714610436578063353907141461045f5780633eaaf86b146104885780633f4ba83a146104b157806359bf1abe146104c65780635c658165146105175780635c975abb1461058357806370a08231146105b05780638456cb59146105fd578063893d20e8146106125780638da5cb5b1461066757806395d89b41146106bc578063a9059cbb1461074a578063c0324c771461078c578063cc872b66146107b8578063db006a75146107db578063dd62ed3e146107fe578063dd644f721461086a578063e47d606014610893578063e4997dc5146108e4578063e5b5019a1461091d578063f2fde38b14610946578063f3bdc2281461097f575b600080fd5b34156101a657600080fd5b6101ae6109b8565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101ee5780820151818401526020810190506101d3565b50505050905090810190601f16801561021b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561023457600080fd5b610260600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610a56565b005b341561026d57600080fd5b6102a2600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610b73565b005b34156102af57600080fd5b6102b7610cc1565b604051808215151515815260200191505060405180910390f35b34156102dc57600080fd5b610308600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610cd4565b005b341561031557600080fd5b61031d610ded565b6040518082815260200191505060405180910390f35b341561033e57600080fd5b610392600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610ebd565b005b341561039f57600080fd5b6103a761109d565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156103f457600080fd5b610420600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506110c3565b6040518082815260200191505060405180910390f35b341561044157600080fd5b6104496110db565b6040518082815260200191505060405180910390f35b341561046a57600080fd5b6104726110e1565b6040518082815260200191505060405180910390f35b341561049357600080fd5b61049b6110e7565b6040518082815260200191505060405180910390f35b34156104bc57600080fd5b6104c46110ed565b005b34156104d157600080fd5b6104fd600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506111ab565b604051808215151515815260200191505060405180910390f35b341561052257600080fd5b61056d600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611201565b6040518082815260200191505060405180910390f35b341561058e57600080fd5b610596611226565b604051808215151515815260200191505060405180910390f35b34156105bb57600080fd5b6105e7600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611239565b6040518082815260200191505060405180910390f35b341561060857600080fd5b610610611348565b005b341561061d57600080fd5b610625611408565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561067257600080fd5b61067a611431565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156106c757600080fd5b6106cf611456565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561070f5780820151818401526020810190506106f4565b50505050905090810190601f16801561073c5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561075557600080fd5b61078a600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506114f4565b005b341561079757600080fd5b6107b6600480803590602001909190803590602001909190505061169e565b005b34156107c357600080fd5b6107d96004808035906020019091905050611783565b005b34156107e657600080fd5b6107fc600480803590602001909190505061197a565b005b341561080957600080fd5b610854600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611b0d565b6040518082815260200191505060405180910390f35b341561087557600080fd5b61087d611c52565b6040518082815260200191505060405180910390f35b341561089e57600080fd5b6108ca600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611c58565b604051808215151515815260200191505060405180910390f35b34156108ef57600080fd5b61091b600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611c78565b005b341561092857600080fd5b610930611d91565b6040518082815260200191505060405180910390f35b341561095157600080fd5b61097d600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611db5565b005b341561098a57600080fd5b6109b6600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611e8a565b005b60078054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610a4e5780601f10610a2357610100808354040283529160200191610a4e565b820191906000526020600020905b815481529060010190602001808311610a3157829003601f168201915b505050505081565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610ab157600080fd5b6001600a60146101000a81548160ff02191690831515021790555080600a60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507fcc358699805e9a8b7f77b522628c7cb9abd07d9efb86b6fb616af1609036a99e81604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a150565b604060048101600036905010151515610b8b57600080fd5b600a60149054906101000a900460ff1615610cb157600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663aee92d333385856040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050600060405180830381600087803b1515610c9857600080fd5b6102c65a03f11515610ca957600080fd5b505050610cbc565b610cbb838361200e565b5b505050565b600a60149054906101000a900460ff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610d2f57600080fd5b6001600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055507f42e160154868087d6bfdc0ca23d96a1c1cfa32f1b72ba9ba27b69b98a0d819dc81604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a150565b6000600a60149054906101000a900460ff1615610eb457600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166318160ddd6000604051602001526040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b1515610e9257600080fd5b6102c65a03f11515610ea357600080fd5b505050604051805190509050610eba565b60015490505b90565b600060149054906101000a900460ff16151515610ed957600080fd5b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151515610f3257600080fd5b600a60149054906101000a900460ff161561108c57600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16638b477adb338585856040518563ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001828152602001945050505050600060405180830381600087803b151561107357600080fd5b6102c65a03f1151561108457600080fd5b505050611098565b6110978383836121ab565b5b505050565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60026020528060005260406000206000915090505481565b60095481565b60045481565b60015481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561114857600080fd5b600060149054906101000a900460ff16151561116357600080fd5b60008060146101000a81548160ff0219169083151502179055507f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3360405160405180910390a1565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b6005602052816000526040600020602052806000526040600020600091509150505481565b600060149054906101000a900460ff1681565b6000600a60149054906101000a900460ff161561133757600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231836000604051602001526040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b151561131557600080fd5b6102c65a03f1151561132657600080fd5b505050604051805190509050611343565b61134082612652565b90505b919050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156113a357600080fd5b600060149054906101000a900460ff161515156113bf57600080fd5b6001600060146101000a81548160ff0219169083151502179055507f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62560405160405180910390a1565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60088054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156114ec5780601f106114c1576101008083540402835291602001916114ec565b820191906000526020600020905b8154815290600101906020018083116114cf57829003601f168201915b505050505081565b600060149054906101000a900460ff1615151561151057600080fd5b600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151561156957600080fd5b600a60149054906101000a900460ff161561168f57600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16636e18980a3384846040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050600060405180830381600087803b151561167657600080fd5b6102c65a03f1151561168757600080fd5b50505061169a565b611699828261269b565b5b5050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156116f957600080fd5b60148210151561170857600080fd5b60328110151561171757600080fd5b81600381905550611736600954600a0a82612a0390919063ffffffff16565b6004819055507fb044a1e409eac5c48e5af22d4af52670dd1a99059537a78b31b48c6500a6354e600354600454604051808381526020018281526020019250505060405180910390a15050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156117de57600080fd5b60015481600154011115156117f257600080fd5b600260008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205481600260008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054011115156118c257600080fd5b80600260008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540192505081905550806001600082825401925050819055507fcb8241adb0c3fdb35b70c24ce35c5eb0c17af7431c99f827d44a445ca624176a816040518082815260200191505060405180910390a150565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156119d557600080fd5b80600154101515156119e657600080fd5b80600260008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410151515611a5557600080fd5b8060016000828254039250508190555080600260008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825403925050819055507f702d5967f45f6513a38ffc42d6ba9bf230bd40e8f53b16363c7eb4fd2deb9a44816040518082815260200191505060405180910390a150565b6000600a60149054906101000a900460ff1615611c3f57600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663dd62ed3e84846000604051602001526040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200192505050602060405180830381600087803b1515611c1d57600080fd5b6102c65a03f11515611c2e57600080fd5b505050604051805190509050611c4c565b611c498383612a3e565b90505b92915050565b60035481565b60066020528060005260406000206000915054906101000a900460ff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611cd357600080fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055507fd7e9ec6e6ecd65492dce6bf513cd6867560d49544421d0783ddf06e76c24470c81604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a150565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611e1057600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141515611e8757806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b50565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611ee757600080fd5b600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515611f3f57600080fd5b611f4882611239565b90506000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550806001600082825403925050819055507f61e6e66b0d6339b2980aecc6ccc0039736791f0ccde9ed512e789a7fbdd698c68282604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a15050565b60406004810160003690501015151561202657600080fd5b600082141580156120b457506000600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414155b1515156120c057600080fd5b81600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a3505050565b60008060006060600481016000369050101515156121c857600080fd5b600560008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054935061227061271061226260035488612a0390919063ffffffff16565b612ac590919063ffffffff16565b92506004548311156122825760045492505b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff84101561233e576122bd8585612ae090919063ffffffff16565b600560008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6123518386612ae090919063ffffffff16565b91506123a585600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612ae090919063ffffffff16565b600260008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061243a82600260008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612af990919063ffffffff16565b600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555060008311156125e4576124f983600260008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612af990919063ffffffff16565b600260008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a35b8573ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a350505050505050565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000806040600481016000369050101515156126b657600080fd5b6126df6127106126d160035487612a0390919063ffffffff16565b612ac590919063ffffffff16565b92506004548311156126f15760045492505b6127048385612ae090919063ffffffff16565b915061275884600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612ae090919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506127ed82600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612af990919063ffffffff16565b600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506000831115612997576128ac83600260008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612af990919063ffffffff16565b600260008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a35b8473ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a35050505050565b6000806000841415612a185760009150612a37565b8284029050828482811515612a2957fe5b04141515612a3357fe5b8091505b5092915050565b6000600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6000808284811515612ad357fe5b0490508091505092915050565b6000828211151515612aee57fe5b818303905092915050565b6000808284019050838110151515612b0d57fe5b80915050929150505600a165627a7a72305820645ee12d73db47fd78ba77fa1f824c3c8f9184061b3b10386beb4dc9236abb280029'
ARBITRUM = '60806040526004361061004e5760003560e01c80633659cfe6146100655780634f1ef286146100855780635c60da1b146100985780638f283970146100c9578063f851a440146100e95761005d565b3661005d5761005b6100fe565b005b61005b6100fe565b34801561007157600080fd5b5061005b6100803660046106ed565b610118565b61005b610093366004610708565b61015f565b3480156100a457600080fd5b506100ad6101d0565b6040516001600160a01b03909116815260200160405180910390f35b3480156100d557600080fd5b5061005b6100e43660046106ed565b61020b565b3480156100f557600080fd5b506100ad610235565b61010661029b565b61011661011161033a565b610344565b565b610120610368565b6001600160a01b0316336001600160a01b03161415610157576101548160405180602001604052806000815250600061039b565b50565b6101546100fe565b610167610368565b6001600160a01b0316336001600160a01b031614156101c8576101c38383838080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506001925061039b915050565b505050565b6101c36100fe565b60006101da610368565b6001600160a01b0316336001600160a01b03161415610200576101fb61033a565b905090565b6102086100fe565b90565b610213610368565b6001600160a01b0316336001600160a01b0316141561015757610154816103c6565b600061023f610368565b6001600160a01b0316336001600160a01b03161415610200576101fb610368565b606061028583836040518060600160405280602781526020016108076027913961041a565b9392505050565b6001600160a01b03163b151590565b6102a3610368565b6001600160a01b0316336001600160a01b031614156101165760405162461bcd60e51b815260206004820152604260248201527f5472616e73706172656e745570677261646561626c6550726f78793a2061646d60448201527f696e2063616e6e6f742066616c6c6261636b20746f2070726f78792074617267606482015261195d60f21b608482015260a4015b60405180910390fd5b60006101fb6104f5565b3660008037600080366000845af43d6000803e808015610363573d6000f35b3d6000fd5b60007fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b546001600160a01b0316919050565b6103a48361051d565b6000825111806103b15750805b156101c3576103c08383610260565b50505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6103ef610368565b604080516001600160a01b03928316815291841660208301520160405180910390a16101548161055d565b60606104258461028c565b6104805760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b6064820152608401610331565b600080856001600160a01b03168560405161049b91906107b7565b600060405180830381855af49150503d80600081146104d6576040519150601f19603f3d011682016040523d82523d6000602084013e6104db565b606091505b50915091506104eb828286610606565b9695505050505050565b60007f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc61038c565b6105268161063f565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6001600160a01b0381166105c25760405162461bcd60e51b815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201526564647265737360d01b6064820152608401610331565b807fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b80546001600160a01b0319166001600160a01b039290921691909117905550565b60608315610615575081610285565b8251156106255782518084602001fd5b8160405162461bcd60e51b815260040161033191906107d3565b6106488161028c565b6106aa5760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b6064820152608401610331565b807f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc6105e5565b80356001600160a01b03811681146106e857600080fd5b919050565b6000602082840312156106ff57600080fd5b610285826106d1565b60008060006040848603121561071d57600080fd5b610726846106d1565b9250602084013567ffffffffffffffff8082111561074357600080fd5b818601915086601f83011261075757600080fd5b81358181111561076657600080fd5b87602082850101111561077857600080fd5b6020830194508093505050509250925092565b60005b838110156107a657818101518382015260200161078e565b838111156103c05750506000910152565b600082516107c981846020870161078b565b9190910192915050565b60208152600082518060208401526107f281604085016020870161078b565b601f01601f1916919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a2646970667358221220fb0d75414bd881ce16381528bf0b9b2c1bea4c3e27069fcb6981b67d1535643064736f6c63430008090033'
code_hex = ARBITRUM
code = bytes.fromhex(code_hex)
PUSH1 = 0x60
PUSH32 = 0x7f
INVALID = 0xfe
JUMP = 0x56
JUMPI = 0x57
JUMPDEST = 0x5b
L = len(code)
adj_push_v = None
num_jumpdests = 0
num_jumps = 0
num_jumpis = 0
jump_offsets = []
jumpi_offsets = []
i = 0
while i < L:
op = code[i]
if PUSH1 <= op <= PUSH32:
data_len = op - PUSH1 + 1
data = code[i + 1:i + data_len + 1]
i += data_len + 1
adj_push_v = int.from_bytes(data, "big")
# print(f"{data.hex()} {adj_push_v:x}")
continue
if op == INVALID:
print(f"code end at {i} ({i / L})")
break
if op == JUMPDEST:
num_jumpdests += 1
elif op == JUMP:
num_jumps += 1
if adj_push_v is not None:
jump_offsets.append(adj_push_v - i)
elif op == JUMPI:
num_jumpis += 1
if adj_push_v is not None:
jumpi_offsets.append(adj_push_v - i)
adj_push_v = None
i += 1
print(f"jumpdests: {num_jumpdests} {num_jumpdests / len(code)}")
print(f"jumps: {num_jumps} {len(jump_offsets)}")
print(f"jumpis: {num_jumpis} {len(jumpi_offsets)}")
print(f"jump offsets: {sorted(jump_offsets)}")
print(f"jumpi offsets: {sorted(jumpi_offsets)}")
should CREATE4 opcode verify it is being called from within the new Deployment TxType? as the initcodes will only be available within those special transactions
There is the table comparing the gas and costs of all legacy and EOF calls.
Cost (burned) | Callee min | Callee max | Min retained | |
---|---|---|---|---|
CALL V=0 | 100 | 0 | g - g/64 | g/64 |
CALL Vā 0 | 100+6700 | 2300 | g - g/64 | g/64 |
DELEGATECALL | 100 | 0 | g - g/64 | g/64 |
STATICCALL | 100 | 0 | g - g/64 | g/64 |
EXTCALL V=0 | 100 | 2300 | g - max(g/64, 5000) | 5000 |
EXTCALL Vā 0 | 100+9000 | 2300 | g - max(g/64, 5000) | 5000 |
EXTDELEGATECALL | 100 | 2300 | g - max(g/64, 5000) | 5000 |
EXTSTATICCALL | 100 | 2300 | g - max(g/64, 5000) | 5000 |
Note that in legacy the additional value transfer cost in CALL
is 6700 while in EXTCALL
this is 9000.
This is because of how stipend is applied in legacy and how we do it in EXTCALL
. I think it is just a coincidence and we should fix it.
I.e. in legacy CALL
the stipend gas (2300) is added from nowhere so the actual value transfer is 6700 not 9000. Try sending a value to an empty contract, you will get the 2300 back.
In EOF we kinda implemented it properly so the cost is actually 9000.
code validation of RETURNCONTRACT requires that we check if the immediate is within the correct range [0, containers.Count[ in the bytecode, but in the case of CREATE4 the initcodes are bundled in the transaction not in the bytecode, or am I missing something from how Create4/ReturnContract work?
This was discussed in the past (first year), but we haven't actually recorded any proposal.
Goal: store debugging information as a section(s) in EOF.
This information is not acceptable on-chain, and so must be stripped prior to deployment, but EOF could allow carrying this information from the compiler to frameworks/tooling, and getting removed prior to the deployment process.
Since we have individual sections for functions, we should first of all store a "names section", which defines the function names and inputs and output for each function. The names section in WebAssembly is a good inspiration. It should be also possible to further introduce the storage of variable level information, based on the work done by the ethdebug workgroup.
EOF validation fuzzing issues / missing test cases found by fuzzers.
First question: I see that we dont reset the successor_stack_height
after termination opcode, this would mean that we would increment its max value. Not sure if this is correct?
Second question: I see in spec that "no instruction may be unreachable", do we validate if opcodes are accessible after RJUMP or termination opcode. i dont see that part in the code, is it maybe covered by code below by making StackHeightRange::max initialise to a big number:
https://github.com/ethereum/evmone/blob/master/lib/evmone/eof.cpp#L520-L521|
Third one: I see that in MegaEOF spec: "Code basic blocks must be ordered in a way that every block is reachable either by a forward jump or sequential flow of instructions. In other words, there is no basic block reachable only by a backward jump." https://notes.ethereum.org/@ipsilon/mega-eof-specification i can't find this check in code.
validate_rjump_destinations
checks validity of jumps but not if it is touching every instruction only with a forward jump.
The currently proposed value of MIN_RETAINED_GAS
is 5000
. This is exactly the cost of updating a "fresh" storage slot (so it cannot be done) but one can update a storage slot that is worm or has been updated/added before the call.
I think we should increase MIN_RETAINED_GAS
to the value always allowing updating a storage slot. Also consider adding a new storage value (20000).
the spec defines the same value for both opcodes EXCHANGE
and DATALOAD
(0xe8)
***
DATALOAD (0xe8) instruction
deduct 4 gas
...
EXCHANGE (0xe8) instruction
deduct 3 gas
**
Implement accordingly to not merged yet PR.
ethereum/EIPs#8385
"RJUMP/RJUMPI/RJUMPV as a final instruction in code section" should be removed from https://eips.ethereum.org/EIPS/eip-4200.
I'm getting empty contract results from all EXTCODE*
opcodes when called to a EOF container mid-creation, which I guess makes sense because the container is not there yet so technically it should still return empty.
Maybe only this should be explicitly specified? @shemnon @chfast @gumb0
Originally posted by @marioevz in ethereum/execution-spec-tests#601 (comment)
Main use case for JUMPF
was being able to call a non-returning helper without the requirement to have equal stack height at each call site and without the need to POP
extra items before calling.
In the current spec:
If such helper is implemented inside caller section (without CALLF
/JUMPF
), it is allowed to call it from different stack heights.
If such helper is in a separate section, we can make it work without the need for non-returning flag and JUMPF
: non-returning functions are declared with 0 outputs, and the requirement to not POP
extra items is achieved with CALLF STOP
or CALLF INVALID
sequence.
The difference with JUMPF
would be 4 bytes of code instead of 3 bytes and an item pushed into call stack at run-time.
This is currently not part of the spec. The spec says:
Fail with status code 1 returned on stack if any of the following is true (only gas charged until this point is consumed):
- Gas available to callee at this point is less than MIN_CALLEE_GAS.
- Balance of the current account is less than value.
- Current call stack depth equals 1024.
Point 2. and 3. are also present by default in CALL situations, so if one would take a CALL and then convert it to whatever the EXT*CALL variant maps to, it likely will be fine. However, for point 1. this might not be clear and one might need to find a workaround to ensure that 1
is put onto stack. It should then also be clear that (for all these 3 situations) the return buffer should obviously also be cleared.
Requested in discord.
I think 4-5 example containers demonstrating various combinations of format features, each with some kind of anatomy diagram - what is what.
CALLF
/JUMPF
requires number of target inputs for stack overflow check, becausemax_stack_height
definition includes function inputs, and we need to subtract them not to double count.
Originally posted by @gumb0 in #39 (comment)
The third value of the type section entry (after number of inputs, number of outputs) should be "max stack height above the inputs". This eliminates "double counting" as you can notice in the current spec that the max_stack_height >= num_inputs
. This also simplifies the runtime stack overflow check at CALLF
/JUMPF
: it only needs to access the new value.
Erigon+Silkworm (a.k.a. Erigon++) can surely be a good p2p peer if you enable only historical block execution, because it is plain vanilla Erigon in all other parts except that one. In terms of snapshots, Erigon++ is compatible with the latest format (i.e. it is able to read also recsplit indices with less false-positives feature, if even it does not use the feature yet)
If you are interested only in block execution as I suppose, you just add --silkworm.exec
on your Erigon command-line and that's all
If you need to execute with your custom Silkworm version, there's some documentation in the contribution guide. Let me find it: https://github.com/erigontech/silkworm/blob/master/docs/CONTRIBUTING.md#development-and-testing.
The mega-spec eof.md explains successor instructions as follows:
- Determine the list of successor instructions that can follow the current instructions:
- The next instruction for all instructions other than terminating instructions and
RJUMP
.- All targets of a
RJUMPI
orRJUMPV
.
There RJUMP
is unspecified.
The EIP-5450 is better, but unconditional jump is actually never defined (neither in EIP-4200).
- Determine the list of successor instructions that can follow the current instructions:
- The next instruction for all instructions other than terminating instructions and unconditional jump.
- All targets of a conditional or unconditional jump.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
š Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ššš
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ā¤ļø Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.