ethereum / evmone

Fast Ethereum Virtual Machine implementation
Apache License 2.0
864 stars 286 forks source link

baseline: VM-level execution states #1005

Closed chfast closed 2 months ago

chfast commented 2 months ago

This adds an array of ExecutionState objects to the VM instance. They are used internally in the Baseline interpreter instead of passing one via API. This removes the need of maintaining object pool for execution states.

However, this also makes the VM non-thread safe, but it is fine for current users. We can improve on this in the future by spiting the the VM into two parts: non-thread safe opaque execution context and a thread-safe VM with user configuration.

codecov[bot] commented 2 months ago

Codecov Report

Attention: Patch coverage is 81.25000% with 3 lines in your changes missing coverage. Please review.

Project coverage is 93.98%. Comparing base (1358b17) to head (112ff3c). Report is 3 commits behind head on master.

Files with missing lines Patch % Lines
test/bench/helpers.hpp 0.00% 3 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #1005 +/- ## ======================================= Coverage 93.97% 93.98% ======================================= Files 147 147 Lines 15580 15586 +6 ======================================= + Hits 14642 14649 +7 + Misses 938 937 -1 ``` | [Flag](https://app.codecov.io/gh/ethereum/evmone/pull/1005/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ethereum) | Coverage Δ | | |---|---|---| | [eof_execution_spec_tests](https://app.codecov.io/gh/ethereum/evmone/pull/1005/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ethereum) | `17.54% <81.25%> (+0.12%)` | :arrow_up: | | [ethereum_tests](https://app.codecov.io/gh/ethereum/evmone/pull/1005/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ethereum) | `27.72% <81.25%> (+0.12%)` | :arrow_up: | | [ethereum_tests_silkpre](https://app.codecov.io/gh/ethereum/evmone/pull/1005/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ethereum) | `19.46% <86.66%> (+0.13%)` | :arrow_up: | | [execution_spec_tests](https://app.codecov.io/gh/ethereum/evmone/pull/1005/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ethereum) | `19.43% <81.25%> (+0.12%)` | :arrow_up: | | [unittests](https://app.codecov.io/gh/ethereum/evmone/pull/1005/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ethereum) | `88.96% <81.25%> (+0.01%)` | :arrow_up: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ethereum#carryforward-flags-in-the-pull-request-comment) to find out more. | [Files with missing lines](https://app.codecov.io/gh/ethereum/evmone/pull/1005?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ethereum) | Coverage Δ | | |---|---|---| | [lib/evmone/baseline.hpp](https://app.codecov.io/gh/ethereum/evmone/pull/1005?src=pr&el=tree&filepath=lib%2Fevmone%2Fbaseline.hpp&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ethereum#diff-bGliL2V2bW9uZS9iYXNlbGluZS5ocHA=) | `100.00% <ø> (ø)` | | | [lib/evmone/baseline\_execution.cpp](https://app.codecov.io/gh/ethereum/evmone/pull/1005?src=pr&el=tree&filepath=lib%2Fevmone%2Fbaseline_execution.cpp&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ethereum#diff-bGliL2V2bW9uZS9iYXNlbGluZV9leGVjdXRpb24uY3Bw) | `100.00% <100.00%> (ø)` | | | [lib/evmone/vm.cpp](https://app.codecov.io/gh/ethereum/evmone/pull/1005?src=pr&el=tree&filepath=lib%2Fevmone%2Fvm.cpp&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ethereum#diff-bGliL2V2bW9uZS92bS5jcHA=) | `100.00% <100.00%> (ø)` | | | [lib/evmone/vm.hpp](https://app.codecov.io/gh/ethereum/evmone/pull/1005?src=pr&el=tree&filepath=lib%2Fevmone%2Fvm.hpp&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ethereum#diff-bGliL2V2bW9uZS92bS5ocHA=) | `100.00% <ø> (ø)` | | | [test/bench/helpers.hpp](https://app.codecov.io/gh/ethereum/evmone/pull/1005?src=pr&el=tree&filepath=test%2Fbench%2Fhelpers.hpp&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ethereum#diff-dGVzdC9iZW5jaC9oZWxwZXJzLmhwcA==) | `0.00% <0.00%> (ø)` | |