Commit graph

15433 commits

Author SHA1 Message Date
Danno Ferrin
9edd35cefe Apply new container mode validations
Apply new rules
prohibiting STOP/RETURN in initcode and RETURNCONTRACT in runtime mode.
For fuzzing, consider all input data to be runtime code.
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
1a9855486f core/vm: fix create, reject EOF deployment from legacy contracts 2024-09-08 12:38:50 +02:00
Marius van der Wijden
3f038776b6 core/vm: fix opCreate, reject eof contracts 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
dff080904b core/vm: added comments 2024-09-08 12:38:49 +02:00
Marius van der Wijden
6c97819d94 core/vm: fix opExtCode{Size,Hash,Copy} 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
Marius van der Wijden
1dccd90224 core/vm: add optional containerSections 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
183e7b702a
core: force add new delegation to accesslist 2024-09-07 09:50:54 -06:00
lightclient
75a43aed6c
add delegation designator to witness 2024-09-07 09:12:20 -06: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
Mario Vega
9d87ac7c12
all: implement eip-7251 consolidation requests
Co-authored-by: Mario Vega <marioevz@gmail.com>
Co-authored-by: lightclient <lightclient@protonmail.com>
2024-09-06 19:23:32 +02:00
lightclient
cc3e859d41
all: implement eip-7002 EL triggered withdrawal requests 2024-09-06 19:23:21 +02:00
Martin HS
c3f13b2a1c
node: fix flaky jwt-test (#30388)
This PR fixes a flaky jwt-test. 

The test is a jwt "from one second in the future". The test passes; the
reason for this is that the CI-system is slow, and by the time the jwt
is actually evaluated, that second has passed, and it's no longer
future.

Alternative to #30380
2024-09-04 16:15:41 +02:00
lightclient
7ef49e350b
all: remove funding verifier (#30391)
Now that verification is done, we can remove the funding information.
2024-09-04 15:19:18 +02:00
Martin HS
fdb84993d8
core: fix compilation error (#30394)
un-borks a compilation error from a recent merge to master
2024-09-04 15:13:20 +02:00
Marius van der Wijden
b0b67be0a2
all: remove forkchoicer and reorgNeeded (#29179)
This PR changes how sidechains are handled. 

Before the merge, it was possible to import a chain with lower td and not set it as canonical. After the merge, we expect every chain that we get via InsertChain to be canonical. Non-canonical blocks can still be inserted
with InsertBlockWIthoutSetHead.

If during the InsertChain, the existing chain is not canonical anymore, we mark it as a sidechain and send the SideChainEvents normally.
2024-09-04 15:03:06 +02:00
lightclient
dfd33c7792
all: implement EIP-6110, execution layer triggered deposits (#29431)
This PR implements EIP-6110: Supply validator deposits on chain. It also sketches
out the base for Prague in the engine API types.
2024-09-04 14:33:51 +02:00
lightclient
de597af9c5
funding.json: add funding information file (#30385)
Adds a list of funding identifiers.
2024-09-03 16:22:32 +02:00
rjl493456442
922eb033d3
core/state: pull the verkle trie from prefetcher for empty storage root (#30369)
This pull request fixes a flaw in prefetcher.

In verkle tree world, both accounts and storage slots are committed into
a single tree instance for state hashing. If the prefetcher is activated, we will
try to pull the trie for the prefetcher for performance speedup. 

However, we had a special logic to skip pulling storage trie if the
storage root is empty. While it's true for merkle as we have nothing to
do with an empty storage trie, it's totally wrong for verkle. The consequences
for skipping pulling is the storage changes are committed into trie A, while the
account changes are committed into trie B (pulled from the prefetcher), boom.
2024-09-02 10:41:44 +02:00
Karl Bartel
36a7134367
Include tracerConfig in created tracing test (#30364)
Fixes the tracer test filler for when there is tracerConfig.
2024-09-02 10:30:33 +02:00
Ignacio Hagopian
ab3ee99ca9
trie, core/state: Nyota EIP-6800 & EIP-4762 spec updates (#30357)
This PR implements changes related to
[EIP-6800](https://eips.ethereum.org/EIPS/eip-6800) and
[EIP-4762](https://eips.ethereum.org/EIPS/eip-4762) spec updates.

A TL;DR of the changes is that `Version`, `Balance`, `Nonce` and
`CodeSize` are encoded in a single leaf named `BasicData`. For more
details, see the [_Header Values_ table in
EIP-6800](https://eips.ethereum.org/EIPS/eip-6800#header-values).

The motivation for this was simplifying access event patterns, reducing
code complexity, and, as a side effect, saving gas since fewer leaf
nodes must be accessed.

---------

Co-authored-by: Guillaume Ballet <3272758+gballet@users.noreply.github.com>
Co-authored-by: Felix Lange <fjl@twurst.com>
2024-08-30 14:13:02 +02:00
Guillaume Ballet
e9467eec1c
consensus/beacon, core/types: add verkle witness builder (#30129)
This PR adds the bulk verkle witness+proof production at the end of block
production. It reads all data from the tree in one swoop and produces
a verkle proof.

Co-authored-by: Felix Lange <fjl@twurst.com>
2024-08-29 14:50:27 +02:00
markus
ea3b5095f4
signer/core/apitypes: support fixed size arrays for EIP-712 typed data (#30175)
When attempting to hash a typed data struct that includes a type
reference with a fixed-size array, the validation process fails.
According to EIP-712, arrays can be either fixed-size or dynamic,
denoted by `Type[n]` or `Type[]` respectively, although it appears this
currently isn't supported.

This change modifies  the validation logic to accommodate types
containing fixed-size arrays.
2024-08-28 14:12:09 +02:00
Martin HS
0e5546f032
core/state: semantic journalling (part 1) (#28880)
This is a follow-up to #29520, and a preparatory PR to a more thorough
change in the journalling system.

### API methods instead of `append` operations

This PR hides the journal-implementation details away, so that the
statedb invokes methods like `JournalCreate`, instead of explicitly
appending journal-events in a list. This means that it's up to the
journal whether to implement it as a sequence of events or
aggregate/merge events.

### Snapshot-management inside the journal 

This PR also makes it so that management of valid snapshots is moved
inside the journal, exposed via the methods `Snapshot() int` and
`RevertToSnapshot(revid int, s *StateDB)`.


### SetCode

JournalSetCode journals the setting of code: it is implicit that the
previous values were "no code" and emptyCodeHash. Therefore, we can
simplify the setCode journal.

### Selfdestruct

The self-destruct journalling is a bit strange: we allow the
selfdestruct operation to be journalled several times. This makes it so
that we also are forced to store whether the account was already
destructed.

What we can do instead, is to only journal the first destruction, and
after that only journal balance-changes, but not journal the
selfdestruct itself.

This simplifies the journalling, so that internals about state
management does not leak into the journal-API.

### Preimages

Preimages were, for some reason, integrated into the journal management,
despite not being a consensus-critical data structure. This PR undoes
that.

---------

Co-authored-by: Gary Rong <garyrong0905@gmail.com>
2024-08-28 08:18:23 +02:00
Ceyhun Onur
9eb91542de
accounts/abi/bind, ethclient/simulated: check SendTransaction error in tests (#30349)
In few tests the returned error from `SendTransaction` is not being
checked. This PR checks the returned err in tests.

Returning errors also revealed tx in `TestCommitReturnValue` is not
actually being sent, and returns err ` only replay-protected (EIP-155)
transactions allowed over RPC`. Fixed the transaction by using the
`testTx` function.
2024-08-27 17:11:50 +02:00
Nicolas Gotchac
87377c58bc
p2p/discover: fix Write method in metered connection (#30355)
`WriteToUDP` was never called, since `meteredUdpConn` exposed directly
all the methods from the underlying `UDPConn` interface.

This fixes the `discover/egress` metric never being updated.
2024-08-27 14:10:32 +02:00
rjl493456442
9b5d1412cc
core/state: fix trie prefetcher for verkle (#30354)
This pull request fixes the panic issue in prefetcher once the verkle is
activated.
2024-08-26 22:18:47 +08:00