Commit Graph

72 Commits

Author SHA1 Message Date
Alex Beregszaszi
eb8af2caec Add basic support for the EVM version Paris
This mostly means testing with evmone, but instruction renaming of difficulty->prevrandao is omitted.
2022-11-21 14:56:46 +01:00
Alex Beregszaszi
b49008af9e Support EVMC_PARIS with randao from merge block 2022-11-09 21:27:40 +01:00
Alex Beregszaszi
5df92a374b Update EVMHost to match EVMC10 changes 2022-11-09 21:27:40 +01:00
Paweł Bylica
199f36585a
test: Improve precision of SSTORE cost in EVMHost
Add "original" field to storage_value to precise track "dirty" state of
a storage slot as defined in EIP-2200. In case a current storage value
is restored to original (after multiple modifications in a single
transaction), the storage slot is not considered "dirty" any more.
Previously, we only had a bool dirty flag to model this and a storage
slot was always considered "dirty" after first modification.
2022-11-09 10:15:14 +01:00
Daniel
9a60c06335
Merge pull request #11087 from ethereum/precompile-prices
EVMHost: charge gas for precompiles
2022-11-08 19:56:42 +01:00
Paweł Bylica
c4b6f5f00b
test: Properly clear storage dirty flag
Clear storage dirty flag between transactions in EVMHost. The EIP-2200
dirty flag should be persisted only in a single transaction.
2022-11-08 18:13:17 +01:00
Alex Beregszaszi
18a5aee38c EVMHost: Introduce gas metering for precompiles 2022-11-03 22:18:34 +01:00
Alex Beregszaszi
24946ec318 EVMHost: implement selfdestruct better 2022-10-20 15:35:41 +02:00
Alex Beregszaszi
9aa304d43a EVMHost: Calculate address for CREATE properly 2022-09-27 22:31:45 +02:00
Alex Beregszaszi
5f8b48793c
Merge pull request #13571 from ethereum/explicit-fixedhash
Drop implicit alignment argument from FixedHash (and improve FunctionSelector helpers)
2022-09-27 22:30:34 +02:00
Alex Beregszaszi
2a41295d03 Drop implicit alignment argument from FixedHash 2022-09-27 17:58:32 +02:00
Alex Beregszaszi
50182d7ee0 EVMHost: replace precompileALTBN128PairingProduct with mapping 2022-09-26 21:39:18 +02:00
Alex Beregszaszi
f40d1d654d EVMHost: Add size%192 check to bn128pairing
And also refactor resultWithFailure
2022-09-26 21:06:33 +02:00
Alex Beregszaszi
c967a621eb EVMHost: Reduce code duplication in precompiles 2022-09-26 15:38:55 +02:00
Alex Beregszaszi
a260000a16 EVMHost: Make it clear which MockedHost helpers are used
And also remove unused helpers.
2022-09-26 02:05:40 +02:00
Alex Beregszaszi
e3c7369413 EVMHost: Simplify some code and dcoument functions 2022-09-26 01:59:52 +02:00
Marenz
f7cc29bec1 Add std:: qualifier to move() calls 2022-08-30 11:12:15 +02:00
benldrmn
58e4cc62e0 Increase use of C++ constexpr constant expressions in code base as described in issue #7720 2021-08-31 15:03:59 +02:00
hrkrshnn
af1dabb555 Added EVMVersion london.
Also set the value of `block_base_fee` for testing to 7 wei.
2021-08-09 16:18:08 +02:00
hrkrshnn
1839d195be Clears EIP-2929 account and storage access indicator on new blocks.
For semantic tests each test (in the same test file) happens on a new block, however the storage and
account access indicators were not reset.
2021-05-25 12:32:59 +02:00
Alex Beregszaszi
a54699f452 EVMHost: Fix selfdestruct with non-zero value at beneficiary and value-transfers with insufficient funds
Create a helper for transfering balance between two accounts. Check sufficient funds are available during a call-with-value.
2021-05-14 00:10:49 +01:00
Alex Beregszaszi
c66c5c9f1d EVMHost: properly populate implicit access list for Berlin 2021-05-12 16:49:04 +02:00
Alex Beregszaszi
5bfd26287c Upgrade to EVMC 8.0.0 2021-05-12 16:49:04 +02:00
Daniel Kirchner
06a9199967 Change loading of VMs and error messages during test. 2021-05-12 14:48:37 +02:00
Alex Beregszaszi
f1aaae36ee Upgrade to EVMC 7.5.0
One important change: MockedAccount.storage is a map and not unordered_map
2021-04-21 21:05:40 +01:00
Bhargava Shastry
033ee0e2bc Permit Yul interpreter vs Evmone storage comparison. 2021-04-12 10:39:23 +02:00
Bhargava Shastry
788eb02825 EVMHost: Use std::map for storage so that slots are stored in some order. 2021-03-12 09:39:15 +01:00
Bhargava Shastry
a30b071a5d Update test/EVMHost.cpp
Co-authored-by: Daniel Kirchner <daniel@ekpyron.org>
2021-03-10 18:10:20 +01:00
Bhargava Shastry
8023fdb537 Extract state printing to a separate class. 2021-03-10 17:41:03 +01:00
Bhargava Shastry
24f42c5541 Filter false positives due to EVM errors.
Co-authored-by: Daniel Kirchner <daniel@ekpyron.org>
2021-03-10 17:41:03 +01:00
Bhargava Shastry
34c08ea2c6 EVMHost: Add tracing features needed for fuzzing. 2021-03-10 17:41:03 +01:00
Daniel Kirchner
acd3084076 Fuzzer for stack optimiser/code generator. 2021-03-04 17:35:56 +01:00
Bhargava Shastry
e96a3e01f8 EVMHost: Add function to print storage at all addresses in the host. 2021-03-01 20:00:55 +01:00
Alexander Arlt
c44bb7e7ef Replace raw throw with BOOST_THROW_EXCEPTION. 2021-02-18 20:23:59 -05:00
Alex Beregszaszi
7e88ba8da0 Enable the -Wconversion warning 2020-12-08 16:45:24 +00:00
Alex Beregszaszi
a8197788d0 Replace the inconsistent use of u160/Address/h160 with h160 only 2020-12-07 16:44:59 +01:00
Alex Beregszaszi
6479138dd4 EVMHost: keep precompile balance/settings across resets
Also set proper codehash for precompiles.
2020-09-24 18:51:39 +01:00
Alexander Arlt
23d9b1567e Add support for ewasm evmc vm. 2020-09-08 12:41:42 -05:00
Sachin Grover
b7adb2aa42 Add SPDX license identifier if not present already in source file
Fixes: #9220
2020-07-17 20:24:12 +05:30
Djordje Mijovic
4b6c322279 Fixing various signedness warnings 2020-06-03 10:37:18 +02:00
Alex Beregszaszi
c9745ea101 EVMHost: enable support for Berlin 2020-05-13 22:56:11 +01:00
Alex Beregszaszi
7353804252 EVMHost: simplify code using new evmc features 2020-05-13 22:56:11 +01:00
chriseth
679f729f2f Implement create2 for evmhost. 2020-01-23 21:20:01 +01:00
Christian Parpart
345f9928ab Library libdevcore renamed to libsolutil. 2020-01-07 15:51:50 +01:00
Christian Parpart
ed45b000d1 Adapt tests directory to C++ namespace changes. 2020-01-07 15:51:50 +01:00
Christian Parpart
6b23412fae C++ namespace cleanup (except tests). 2020-01-07 15:51:50 +01:00
Paweł Bylica
cdcfea73ab EVMHost: Remove unneeded methods 2019-12-02 23:22:27 +01:00
Paweł Bylica
eacc1753fd EVMHost: Remove unnecessary State struct 2019-12-02 23:22:27 +01:00
Paweł Bylica
7a0f311032 EVMHost: Use evmc::MockedAccount 2019-12-02 23:22:10 +01:00
Paweł Bylica
635e2fc9d3 EVMHost: Reuse tx_context from MockedHost 2019-12-02 23:04:02 +01:00