ethereum / evmone

Fast Ethereum Virtual Machine implementation
Apache License 2.0
865 stars 287 forks source link

precompiles: Add SHA256 implementation #924

Closed chfast closed 5 months ago

chfast commented 5 months ago

This adds the SHA256 implementation from Silkworm and removes the precompile stub.

codecov[bot] commented 5 months ago

Codecov Report

Attention: Patch coverage is 43.60000% with 141 lines in your changes missing coverage. Please review.

Project coverage is 94.29%. Comparing base (9be04a5) to head (b697c4f).

:exclamation: Current head b697c4f differs from pull request most recent head 66cb577

Please upload reports for the commit 66cb577 to get more accurate results.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #924 +/- ## ========================================== - Coverage 95.12% 94.29% -0.83% ========================================== Files 140 142 +2 Lines 15892 16102 +210 ========================================== + Hits 15117 15184 +67 - Misses 775 918 +143 ``` | [Flag](https://app.codecov.io/gh/ethereum/evmone/pull/924/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/924/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ethereum) | `16.26% <8.00%> (-0.34%)` | :arrow_down: | | [ethereum_tests](https://app.codecov.io/gh/ethereum/evmone/pull/924/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ethereum) | `26.96% <40.80%> (+0.05%)` | :arrow_up: | | [ethereum_tests_silkpre](https://app.codecov.io/gh/ethereum/evmone/pull/924/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ethereum) | `18.87% <88.00%> (+0.52%)` | :arrow_up: | | [execution_spec_tests](https://app.codecov.io/gh/ethereum/evmone/pull/924/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ethereum) | `18.00% <38.00%> (+0.17%)` | :arrow_up: | | [unittests](https://app.codecov.io/gh/ethereum/evmone/pull/924/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ethereum) | `89.68% <42.00%> (-0.60%)` | :arrow_down: | 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](https://app.codecov.io/gh/ethereum/evmone/pull/924?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ethereum) | Coverage Δ | | |---|---|---| | [test/state/precompiles.cpp](https://app.codecov.io/gh/ethereum/evmone/pull/924?src=pr&el=tree&filepath=test%2Fstate%2Fprecompiles.cpp&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ethereum#diff-dGVzdC9zdGF0ZS9wcmVjb21waWxlcy5jcHA=) | `100.00% <100.00%> (ø)` | | | [test/state/precompiles\_stubs.cpp](https://app.codecov.io/gh/ethereum/evmone/pull/924?src=pr&el=tree&filepath=test%2Fstate%2Fprecompiles_stubs.cpp&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ethereum#diff-dGVzdC9zdGF0ZS9wcmVjb21waWxlc19zdHVicy5jcHA=) | `100.00% <ø> (ø)` | | | [test/unittests/precompiles\_sha256\_test.cpp](https://app.codecov.io/gh/ethereum/evmone/pull/924?src=pr&el=tree&filepath=test%2Funittests%2Fprecompiles_sha256_test.cpp&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ethereum#diff-dGVzdC91bml0dGVzdHMvcHJlY29tcGlsZXNfc2hhMjU2X3Rlc3QuY3Bw) | `100.00% <100.00%> (ø)` | | | [lib/evmone\_precompiles/sha256.cpp](https://app.codecov.io/gh/ethereum/evmone/pull/924?src=pr&el=tree&filepath=lib%2Fevmone_precompiles%2Fsha256.cpp&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ethereum#diff-bGliL2V2bW9uZV9wcmVjb21waWxlcy9zaGEyNTYuY3Bw) | `41.25% <41.25%> (ø)` | | ... and [3 files with indirect coverage changes](https://app.codecov.io/gh/ethereum/evmone/pull/924/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ethereum)
chfast commented 5 months ago

I tested this additionally on AMD Zen2 CPU with sha_ni extension.