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
EVM: bump opcode coverage + add performance tester #3198
base: master
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files
Flags with carried forward coverage won't be shown. Click here to find out more. |
This looks great but we should merge #3198 before merging this one. It's not obvious to me but are these opcode tests also run by CI? |
const code = makeLoopCode( | ||
createBytecode([createOpcodeTest(test.stack, opcodeName, 'none'), POP]) | ||
) | ||
const evm = new EVM({ common, profiler: { enabled: true } }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const evm = new EVM({ common, profiler: { enabled: true } }) | |
common.events.removeAllListeners() |
Since we're reusing the same common
each time, we should clear listeners because the evm
adds a new listener here and I see memory leak errors when I run the profiler script.
…reumjs-monorepo into evm-coverage-performance
…reumjs-monorepo into evm-coverage-performance
@jochem-brouwer What is the status of this PR? |
I intend to finish this one this month. The goal is to write basic tests for all opcodes and provide a test framework. |
The goal of this PR is to:
The goal of this PR is to create both simple opcode tests (compare stack/memory/storage output to expected code), with transparant bytecode generation. Some (all?) of these tests are also used in the profiler report, which tries edge cases (adding maximal numbers together, exponentation to the max, etc.) and reports MGas/S output of those. This can be used to spot slow/fast variants of certain opcodes, or identify which opcodes need some optimization.
Sample profile report output:
To run the tests, run
npm run profiler:report
. You need to havetsx
installed for this, sonpm i -g tsx
. Note: the default gas limit for each test is 30M, and currently all opcodes keep looping until this gas limit is reached (this is slow). There is a progress report though so one can track how much time it should take to finish.WIP