Commit graph

54 commits

Author SHA1 Message Date
Danno Ferrin
389edbdf22 EOFCREATE validation
Handle Aux Data in EOF Create w/o validation failures
2024-09-13 19:02:06 -06:00
Danno Ferrin
4a4d3b07e4 EXTCALL test fixes
* use corret stack heights for value and address in EXTCALL
* New extCallGas function that handles min retained and min callee gas
* Handle min gas failures via tempCallGas == 0
* remove stipend refund for EXT*CALL
* Call Stack too deep should return 1
2024-09-12 22:23:45 -06:00
Marius van der Wijden
ddb9907a7a core/vm: apply suggestions, make ReturnStack an object 2024-09-08 12:39:15 +02:00
Marius van der Wijden
6549a87202 core/vm: rebase 2024-09-08 12:39:15 +02:00
Marius van der Wijden
5d8df7b5a1 core/vm: add comments 2024-09-08 12:39:15 +02:00
Marius van der Wijden
a17f843f8f core: fix rebasing issues 2024-09-08 12:38:50 +02:00
Danno Ferrin
28db438a8e CALLF Stack validation height
CALLF should use the target function data when checking stack overflow.
2024-09-08 12:38:50 +02:00
Danno Ferrin
71528b30a4 Remove TXCREATE
TXCREATE was removed from mega-eof
and now causes validation tests to fail.
Remove it from go-ethereum.
2024-09-08 12:38:50 +02:00
Marius van der Wijden
a484bfacf0 core/vm: updated to v1.0.6, fix bugs 2024-09-08 12:38:50 +02:00
Danno Ferrin
e61f11a7a3 Fix EXTCALL Order
For EXTCALL, value trails offset and length.
2024-09-08 12:38:50 +02:00
Marius van der Wijden
f6d4997820 core/vm: fix opEOFCreate, forward calldata 2024-09-08 12:38:50 +02:00
Marius van der Wijden
e9ad878b90 core/vm: fix opEOFCreate, correct initcode stuff 2024-09-08 12:38:50 +02:00
Marius van der Wijden
abe9f28845 core/vm: fix opReturnContract, don't pay for mem copy 2024-09-08 12:38:50 +02:00
Marius van der Wijden
fbec4dca55 core/vm: fix opEOFCreate hashing charge 2024-09-08 12:38:50 +02:00
Marius van der Wijden
80da4fd2bb core/vm: fix opDataCopy 2024-09-08 12:38:49 +02:00
Marius van der Wijden
218c887878 core/vm: fix opExt{*}Call address space extension 2024-09-08 12:38:49 +02:00
Marius van der Wijden
03b75144b9 core/vm: fix opExt{*}Call return values 2024-09-08 12:38:49 +02:00
Marius van der Wijden
e0c3db0de4 core/vm: mark the correct address as touched 2024-09-08 12:38:49 +02:00
Marius van der Wijden
dc4d53b83c core/vm: turn return values around 2024-09-08 12:38:49 +02:00
Marius van der Wijden
b2ae97892d core/vm: check for returnStack overflow in opCallf 2024-09-08 12:38:49 +02:00
Marius van der Wijden
3d8ca3c526 core/vm: check for returnStack overflow in opCallf 2024-09-08 12:38:49 +02:00
Marius van der Wijden
e1b9f4a6f5 core/vm: only allow eof calls from opExtCall 2024-09-08 12:38:49 +02:00
Marius van der Wijden
aa8e431183 core/vm: fix opExtStaticCall 2024-09-08 12:38:49 +02:00
Marius van der Wijden
a1b359f310 core/vm: fix opReturnDataLoad 2024-09-08 12:38:49 +02:00
Marius van der Wijden
fa6b1b9fa1 core/vm: fix opRJumpV 2024-09-08 12:38:49 +02:00
Marius van der Wijden
19e296506a core/vm: fix opSwapN 2024-09-08 12:38:49 +02:00
Marius van der Wijden
b5af91a5c9 core/vm: fix opExchange 2024-09-08 12:38:49 +02:00
Marius van der Wijden
d1317f2f76 core/vm: fixed bugs, made basic blockchain tests pass 2024-09-08 12:38:48 +02:00
Marius van der Wijden
07db5b86b1 core/types: implement mega-eof spec 2024-09-08 12:37:14 +02:00
lightclient@protonmail.com
9354ef082b core/vm: add eof container 2024-09-08 12:37:12 +02:00
lightclient
9db178c799
all: impl eip-7702
Co-authored-by: lightclient <lightclient@protonmail.com>
Co-authored-by: Mario Vega <marioevz@gmail.com>
2024-09-06 19:25:25 +02:00
Guillaume Ballet
44a50c9f96
cmd, core, params, trie: add verkle access witness gas charging (#29338)
Implements some of the changes required to charge and do gas accounting in verkle testnet.
2024-05-10 20:13:11 +02:00
Martin HS
a5a4fa7032
all: use uint256 in state (#28598)
This change makes use of uin256 to represent balance in state. It touches primarily upon statedb, stateobject and state processing, trying to avoid changes in transaction pools, core types, rpc and tracers.
2024-01-23 14:51:58 +01:00
Marius van der Wijden
c39cbc1a78
core: implement BLOBBASEFEE opcode (0x4a) (#28098)
Implements "EIP-7516: BLOBBASEFEE opcode" for cancun, as per spec: https://eips.ethereum.org/EIPS/eip-7516
2023-10-02 05:49:29 -04:00
jwasinger
988d84aa7c
core/state, core/vm: implement EIP 6780 (#27189)
EIP-6780: SELFDESTRUCT only in same transaction

>     SELFDESTRUCT will recover all funds to the caller but not delete the account, except when called in the same transaction as creation

---------

Co-authored-by: Martin Holst Swende <martin@swende.se>
2023-07-17 13:02:18 -04:00
Charles Cooper
5c9cbc218a
core/vm: implement EIP-5656, mcopy instruction (#26181)
Implements [EIP 5656](https://eips.ethereum.org/EIPS/eip-5656), MCOPY instruction, and enables it for Cancun. 

---------

Co-authored-by: Martin Holst Swende <martin@swende.se>
2023-07-11 03:55:34 -04:00
Marius van der Wijden
c537ace249
core: 4844 opcode and precompile (#27356)
* core: crypto: implement BLOBHASH and pointEval precompile

* core: crypto: fixed nitpicks, moved precompile return value

* core/vm: fix review comments
2023-06-05 16:43:25 +03:00
Andrei Maiboroda
793f0f9ec8
core/vm: implement EIP-3860: Limit and meter initcode (#23847)
Implementation of https://eips.ethereum.org/EIPS/eip-3860, limit and meter initcode. This PR enables EIP-3860 as part of the Shanghai fork. 


Co-authored-by: lightclient@protonmail.com <lightclient@protonmail.com>
Co-authored-by: Martin Holst Swende <martin@swende.se>
Co-authored-by: Marius van der Wijden <m.vanderwijden@live.de>
2023-01-11 04:05:47 -05:00
Mark Tyneway
b4ea2bf7dd
all: implement EIP-1153 transient storage (#26003)
Implements TSTORE and TLOAD as specified by the following EIP:

https://eips.ethereum.org/EIPS/eip-1153
https://ethereum-magicians.org/t/eip-1153-transient-storage-opcodes/553


Co-authored-by: Sara Reynolds <snreynolds2506@gmail.com>
Co-authored-by: Martin Holst Swende <martin@swende.se>
Co-authored-by: Gary Rong <garyrong0905@gmail.com>
2022-11-16 10:18:52 +01:00
Alex Beregszaszi
3b967d16ca
core/vm: implement EIP-3855: PUSH0 instruction (#24039)
* core/vm: Implement PUSH0

* Move PUSH0 to enable3855

* Add method doc
2022-05-06 14:36:45 +02:00
Martin Holst Swende
94451c2788
all: implement EIP-1559 (#22837)
This is the initial implementation of EIP-1559 in packages core/types and core.
Mining, RPC, etc. will be added in subsequent commits.

Co-authored-by: Marius van der Wijden <m.vanderwijden@live.de>
Co-authored-by: lightclient@protonmail.com <lightclient@protonmail.com>
Co-authored-by: Felix Lange <fjl@twurst.com>
2021-05-17 15:13:22 +02:00
Martin Holst Swende
a5669ae292
core, params: implement EIP-3529 (#22733)
* core, params: implement EIP-3529

* core/vm: add london instructionset

* core/vm: add method doc for EIP enabler

Co-authored-by: Péter Szilágyi <peterke@gmail.com>
2021-05-07 09:25:32 +03:00
Martin Holst Swende
0fda25e471
eth/tracers, core: use scopecontext in tracers, provide statedb in capturestart (#22333)
Fixes the CaptureStart api to include the EVM, thus being able to set the statedb early on. This pr also exposes the struct we used internally in the interpreter to encapsulate the contract, mem, stack, rstack, so we pass it as a single struct to the tracer, and removes the error returns on the capture methods.
2021-03-25 10:13:14 +01:00
Péter Szilágyi
7834e4a278
core, eth: unship EIP 2315 2021-03-02 23:40:57 +02:00
Martin Holst Swende
6487c002f6
all: implement EIP-2929 (gas cost increases for state access opcodes) + yolo-v2 (#21509)
* core/vm, core/state: implement EIP-2929 + YOLOv2

* core/state, core/vm: fix some review concerns

* core/state, core/vm: address review concerns

* core/vm: address review concerns

* core/vm: better documentation

* core/vm: unify sload cost as fully dynamic

* core/vm: fix typo

* core/vm/runtime: fix compilation flaw

* core/vm/runtime: fix renaming-err leftovers

* core/vm: renaming

* params/config: use correct yolov2 chainid for config

* core, params: use a proper new genesis for yolov2

* core/state/tests: golinter nitpicks
2020-10-23 08:26:57 +02:00
Péter Szilágyi
508891e64b
core/vm: use pointers to operations vs. copy by value 2020-07-16 15:32:01 +03:00
Martin Holst Swende
e376d2fb31
cmd/evm: add state transition tool for testing (#20958)
This PR implements the EVM state transition tool, which is intended
to be the replacement for our retesteth client implementation.
Documentation is present in the cmd/evm/README.md file.

Co-authored-by: Felix Lange <fjl@twurst.com>
2020-06-30 10:12:51 +02:00
Paweł Bylica
cf6674539c
core/vm: use uint256 in EVM implementation (#20787)
* core/vm: use fixed uint256 library instead of big

* core/vm: remove intpools

* core/vm: upgrade uint256, fixes uint256.NewFromBig

* core/vm: use uint256.Int by value in Stack

* core/vm: upgrade uint256 to v1.0.0

* core/vm: don't preallocate space for 1024 stack items (only 16)

Co-authored-by: Martin Holst Swende <martin@swende.se>
2020-06-08 15:24:40 +03:00
Greg Colvin
cd57d5cd38
core/vm: EIP-2315, JUMPSUB for the EVM (#20619)
* core/vm: implement EIP 2315, subroutines for the EVM

* core/vm: eip 2315 - lintfix + check jump dest validity + check ret stack size constraints

  logger: markdown-friendly traces, validate jumpdest, more testcase, correct opcodes

* core/vm: update subroutines acc to eip: disallow walk-into

* core/vm/eips: gas cost changes for subroutines

* core/vm: update opcodes for EIP-2315

* core/vm: define RETURNSUB as a 'jumping' operation + review concerns

Co-authored-by: Martin Holst Swende <martin@swende.se>
2020-06-02 13:30:16 +03:00
Martin Holst Swende
8dc8941551
core/vm: use a callcontext struct (#20761)
* core/vm: use a callcontext struct

* core/vm: fix tests

* core/vm/runtime: benchmark

* core/vm: make intpool push inlineable, unexpose callcontext
2020-04-07 12:45:21 +03:00