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

EVMScriptRunner: handle no return data from executors #508

Merged
merged 1 commit into from Apr 14, 2019

Conversation

Projects
None yet
4 participants
@sohkai
Copy link
Member

sohkai commented Apr 12, 2019

EVMScriptRunner was previously assuming its executor would always return correctly ABI-encoded data of type bytes, which are at least 64 bytes in length (32 bytes for position and 32 bytes for actual data).

Although an underflow here would've simply caused an out-of-gas error on trying to copy too much memory, reverting with an error message is much more friendly.

With help from @wadeAlexC.

Bytecode diff (means that it's ~20k more gas than before if you use runScript()):

                         CODE DEPOSIT COST    DEPLOYED BYTES     INITIALIZATION BYTES
AppStubScriptRunner.json 21600 more gas       +108               0

@sohkai sohkai force-pushed the evmscriptrunner-check-return-length branch from cef7cf6 to 3b2aeed Apr 12, 2019

@coveralls

This comment has been minimized.

Copy link

coveralls commented Apr 12, 2019

Coverage Status

Coverage remained the same at 99.54% when pulling 3b2aeed on evmscriptrunner-check-return-length into 28ad69d on dev.

@facuspagnuolo
Copy link
Contributor

facuspagnuolo left a comment

Nice catch! LGTM! 👏

@izqui

izqui approved these changes Apr 12, 2019

Copy link
Member

izqui left a comment

🙌

@sohkai sohkai merged commit 009e0f5 into dev Apr 14, 2019

5 checks passed

License Compliance All checks passed.
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
coverage/coveralls Coverage remained the same at 99.54%
Details
license/cla Contributor License Agreement is signed.
Details

@sohkai sohkai deleted the evmscriptrunner-check-return-length branch Apr 14, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.