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

Inline gas cost/instruction fetching #2865

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

arnetheduck
Copy link
Member

These make up 5:ish % of EVM execution time - even though they're trivial they end up not being inlined - this little change gives a practically free perf boost ;)

Also unify the style of creating the output to setLen..

@jangko
Copy link
Contributor

jangko commented Nov 22, 2024

need to fix test vector tools/t8n/testdata/00-519/exp.txt

diff --git a/tools/t8n/testdata/00-519/exp.txt b/tools/t8n/testdata/00-519/exp.txt
index d9509a336..253d4518b 100644
--- a/tools/t8n/testdata/00-519/exp.txt
+++ b/tools/t8n/testdata/00-519/exp.txt
@@ -1,2 +1,2 @@
 {"pc":0,"op":0,"gas":"0x0","gasCost":"0xfffffffffffecb68","memSize":0,"stack":[],"depth":1,"refund":0,"opName":"STOP","error":"PrcInvalidParam"}
-{"output":"","gasUsed":"0x13498","error":"PrcInvalidParam"}
+{"output":"0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000","gasUsed":"0x13498","error":"PrcInvalidParam"}

previous blake2f precompile produce no output when error. it doesn't matter if the precompiles produce output or not when error, because the output is not consumed if error happen.

@arnetheduck
Copy link
Member Author

it doesn't matter if the precompiles produce output or not when error, because the output is not consumed if error happen.

doesn't it then make more sense to exclude the output from the "correctness" comparison entirely?

@jangko
Copy link
Contributor

jangko commented Nov 22, 2024

? doesn't it then make more sense to exclude the output from the "correctness" comparison entirely?

No, the tracer not only produce output from precompiles, but from the EVM. The above case happen because the last thing executed by the EVM is the precompile with invalid params. It is correct to check the output of the EVM. Whay I try to say is the EVM still correct even though the blake2f precompile behavior now a bit different.

These make up 5:ish % of EVM execution time - even though they're
trivial they end up not being inlined - this little change gives a
practically free perf boost ;)

Also unify the style of creating the output to `setLen`..
@arnetheduck
Copy link
Member Author

abf3d73

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

Successfully merging this pull request may close these issues.

2 participants