ethereum / evmone

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

Extract `MAX_CODE_SIZE` constant #940

Closed chfast closed 5 months ago

chfast commented 5 months ago

Extract the MAX_CODE_SIZE and MAX_INITCODE_SIZE constants into common header.

chfast commented 5 months ago

Some EIPs calls these "parameters", any opinions?

codecov[bot] commented 5 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 94.29%. Comparing base (1835714) to head (48a4c0b).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #940 +/- ## ========================================== - Coverage 94.29% 94.29% -0.01% ========================================== Files 142 142 Lines 16120 16119 -1 ========================================== - Hits 15200 15199 -1 Misses 920 920 ``` | [Flag](https://app.codecov.io/gh/ethereum/evmone/pull/940/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/940/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ethereum) | `16.51% <33.33%> (+<0.01%)` | :arrow_up: | | [ethereum_tests](https://app.codecov.io/gh/ethereum/evmone/pull/940/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ethereum) | `26.99% <33.33%> (+<0.01%)` | :arrow_up: | | [ethereum_tests_silkpre](https://app.codecov.io/gh/ethereum/evmone/pull/940/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ethereum) | `18.85% <40.00%> (+<0.01%)` | :arrow_up: | | [execution_spec_tests](https://app.codecov.io/gh/ethereum/evmone/pull/940/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ethereum) | `17.98% <33.33%> (+<0.01%)` | :arrow_up: | | [unittests](https://app.codecov.io/gh/ethereum/evmone/pull/940/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ethereum) | `89.67% <100.00%> (-0.01%)` | :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/940?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/eof.cpp](https://app.codecov.io/gh/ethereum/evmone/pull/940?src=pr&el=tree&filepath=lib%2Fevmone%2Feof.cpp&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ethereum#diff-bGliL2V2bW9uZS9lb2YuY3Bw) | `85.68% <ø> (ø)` | | | [test/state/host.cpp](https://app.codecov.io/gh/ethereum/evmone/pull/940?src=pr&el=tree&filepath=test%2Fstate%2Fhost.cpp&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ethereum#diff-dGVzdC9zdGF0ZS9ob3N0LmNwcA==) | `100.00% <100.00%> (ø)` | | | [test/state/host.hpp](https://app.codecov.io/gh/ethereum/evmone/pull/940?src=pr&el=tree&filepath=test%2Fstate%2Fhost.hpp&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ethereum#diff-dGVzdC9zdGF0ZS9ob3N0LmhwcA==) | `100.00% <ø> (ø)` | | | [test/state/state.cpp](https://app.codecov.io/gh/ethereum/evmone/pull/940?src=pr&el=tree&filepath=test%2Fstate%2Fstate.cpp&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ethereum#diff-dGVzdC9zdGF0ZS9zdGF0ZS5jcHA=) | `90.47% <100.00%> (ø)` | | | [test/unittests/eof\_validation\_test.cpp](https://app.codecov.io/gh/ethereum/evmone/pull/940?src=pr&el=tree&filepath=test%2Funittests%2Feof_validation_test.cpp&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ethereum#diff-dGVzdC91bml0dGVzdHMvZW9mX3ZhbGlkYXRpb25fdGVzdC5jcHA=) | `99.33% <ø> (ø)` | | | [test/unittests/evm\_test.cpp](https://app.codecov.io/gh/ethereum/evmone/pull/940?src=pr&el=tree&filepath=test%2Funittests%2Fevm_test.cpp&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ethereum#diff-dGVzdC91bml0dGVzdHMvZXZtX3Rlc3QuY3Bw) | `100.00% <100.00%> (ø)` | |
chfast commented 5 months ago

constants is ok, could also be eip_params/parameters. Just parameters is a bit vague.

Ok, so let's keep the constants for now as I'm not sure this will be for EIP only.