Commit Graph

15785 Commits

Author SHA1 Message Date
Marius van der Wijden c015dc8b71 core/vm: fix regression 2025-02-22 22:30:08 +01:00
Marius van der Wijden 97bb2a5d5a cmd/evm/internal/t8ntool: fix eof checks 2025-02-21 09:37:29 +01:00
Marius van der Wijden a4c40781a8 core/vm: fix merge bug 2025-02-20 21:28:47 +01:00
Marius van der Wijden fa2f3f2819 Merge remote-tracking branch 'origin/master' into eof-opcodes 2025-02-20 21:08:16 +01:00
Martin HS 301a868d28
oss-fuzz: remove deprecated targets (#31224)
Fixes https://github.com/ethereum/go-ethereum/issues/31223

(sorry, I thought the fork fork would be created on my repo, not
upstream, when I used the GH editor)
2025-02-20 18:46:25 +01:00
Delweng dcc0b3704d
eth/tracers: refactor block context in test runner (#29450)
This commit contains a minor refactoring of the block context
used within the test runners.

---------

Signed-off-by: jsvisa <delweng@gmail.com>
2025-02-20 15:04:35 +01:00
nethoxa b1f88ef9bd
internal/ethapi: handle prague system calls in eth_simulate (#31176)
eth_simulate was not processing prague system calls for history contract and EL
requests resulting in inaccurate stateRoot and requestsRoot fields in the block.
2025-02-20 14:30:55 +01:00
Marius van der Wijden c8781be762
core/txpool/legacypool: add setCodeTx reorg test (#31206)
This PR adds a test that makes sure that a node can send multiple
transactions again once a authorization is removed
2025-02-20 20:11:48 +08:00
Sina M 67cd4cd5a1
.github: downgrade go for lint step (#31217) 2025-02-20 10:27:13 +01:00
Marius van der Wijden 6feef35191 core/tracing: go generate 2025-02-19 18:03:34 +01:00
Marius van der Wijden a03d1cdc1c core/tracing: add CodeSection and functionDepth to traces 2025-02-19 18:00:54 +01:00
Felix Lange aac621987e
core/asm: delete assembler/disassembler (#31211)
I maintain an improved version of the go-ethereum assembler at
https://github.com/fjl/geas. We don't really use core/asm in our tests,
and it has some bugs that prevent it from being useful, so I'm removing
the package.
2025-02-19 06:57:08 -07:00
levisyin 07d7fe2b33
build: upgrade -dlgo version to Go 1.24.0 (#31159)
Co-authored-by: Felix Lange <fjl@twurst.com>
2025-02-19 11:21:22 +01:00
Matthieu Vachon dab746b3ef
eth/catalyst: support earlier forks in SimulatedBeacon (#31084)
Co-authored-by: Marius van der Wijden <m.vanderwijden@live.de>
2025-02-18 21:08:43 +01:00
Marius van der Wijden ef00a6e9a2
params: add osaka blob schedule (#31174)
Prevents crashes when running execution spec tests for osaka
2025-02-18 15:03:48 +01:00
rjl493456442 32c6aa8a1a
core/vm: clean up EVM environmental structure (#31061)
This PR does a few things including:

- Remove `ContractRef` interface
- Remove `vm.AccountRef` which implements `ContractRef` interface
- Maintain the `jumpDests` struct in EVM for sharing between call frames
- Simplify the delegateCall context initialization
2025-02-18 21:53:33 +08:00
EdisonSR 7332a1bc0a
ethclient: add comment describing block number tags (#30984)
Adds a comment on how to use rpc.*BlockNumber and the explanation of the block number tags

---------

Co-authored-by: Gary Rong <garyrong0905@gmail.com>
2025-02-18 11:15:36 +01:00
piersy 68d477670c
utils: clarify description for history.state flag (#31164) 2025-02-18 13:50:19 +08:00
Marius van der Wijden 3adfa1fbeb
trie: do not expect ordering in stacktrie during fuzzing (#31170)
This PR removes the assumption of the stacktrie and trie to have the
same ordering. This was hit by the fuzzers on oss-fuzz

---------

Co-authored-by: Gary Rong <garyrong0905@gmail.com>
2025-02-18 10:48:42 +08:00
Felix Lange aec1964410 version: begin v1.15.3 release cycle 2025-02-17 12:01:20 +01:00
Felix Lange c8c62dafc7 version: release go-ethereum v1.15.2 stable 2025-02-17 11:59:48 +01:00
Felix Lange d37a0b8cd0
eth/protocols/eth: add discovery iterator to protocol (#31185)
We somehow forgot to add this in #30302, so discv5 and DNS have actually
been disabled since then.

Fixes #31168
2025-02-17 10:12:03 +01:00
Felix Lange c113e3b5b1
p2p: fix marshaling of NAT in TOML (#31192)
This fixes an issue where a nat.Interface unmarshaled from the TOML
config file could not be re-marshaled to TOML correctly.

Fixes #31183
2025-02-17 09:47:12 +01:00
Felix Lange e5bc789185
consensus/beacon: fix isPostMerge for mainnet (#31191)
This fixes a regression introduced in #31153 where we didn't consider
mainnet to be in PoS, causing #31190.
The problem is, `params.MainnetChainConfig` does not have a defined
`MergeNetsplitBlock`, so it isn't considered to be in PoS in
`CalcDifficulty`.
2025-02-17 07:30:06 +01:00
minh-bq 68de26e346
core/types: create block's bloom by merging receipts' bloom (#31129)
Currently, when calculating block's bloom, we loop through all the
receipt logs to calculate the hash value. However, normally, after going
through applyTransaction, the receipt's bloom is already calculated
based on the receipt log, so the block's bloom can be calculated by just
ORing these receipt's blooms.
```
goos: darwin
goarch: arm64
pkg: github.com/ethereum/go-ethereum/core/types
cpu: Apple M1 Pro
BenchmarkCreateBloom
BenchmarkCreateBloom/small
BenchmarkCreateBloom/small-10             810922              1481 ns/op             104 B/op          5 allocs/op
BenchmarkCreateBloom/large
BenchmarkCreateBloom/large-10               8173            143764 ns/op            9614 B/op        401 allocs/op
BenchmarkCreateBloom/small-mergebloom
BenchmarkCreateBloom/small-mergebloom-10                 5178918               232.0 ns/op             0 B/op          0 allocs/op
BenchmarkCreateBloom/large-mergebloom
BenchmarkCreateBloom/large-mergebloom-10                   54110             22207 ns/op               0 B/op          0 allocs/op
```

---------

Co-authored-by: Gary Rong <garyrong0905@gmail.com>
Co-authored-by: Zsolt Felfoldi <zsfelfoldi@gmail.com>
2025-02-13 18:05:58 +01:00
Marius van der Wijden 1bb727ba75 core/vm: copy container 2025-02-13 16:37:36 +01:00
Felix Lange 77762820c9 version: begin v1.15.2 release cycle 2025-02-13 16:26:36 +01:00
Felix Lange b027a90ac0 version: release go-ethereum v1.15.1 stable 2025-02-13 16:21:36 +01:00
Marius van der Wijden 0e4c4c21af Merge branch 'osaka-blobschedule' into eof-opcodes 2025-02-13 16:00:31 +01:00
rjl493456442 913fee4be9
core/rawdb: skip setting flushOffset in read-only mode (#31173)
This PR addresses a flaw in the freezer table upgrade path.

In v1.15.0, freezer table v2 was introduced, including an additional 
field (`flushOffset`) maintained in the metadata file. To ensure 
backward compatibility, an upgrade path was implemented for legacy
freezer tables by setting `flushOffset` to the size of the index file.

However, if the freezer table is opened in read-only mode, this file 
write operation is rejected, causing Geth to shut down entirely.

Given that invalid items in the freezer index file can be detected and 
truncated, all items in freezer v0 index files are guaranteed to be
complete. Therefore, when operating in read-only mode, it is safe to
use the  freezer data without performing an upgrade.
2025-02-13 14:48:03 +01:00
Marius van der Wijden d0e54f39f8 params: add osaka blob schedule 2025-02-13 14:32:48 +01:00
Felix Lange 8ec4a06b3f
core: sanity-check fork configuration in genesis (#31171)
This is to prevent a crash on startup with a custom genesis configuration.
With this change in place, upgrading a chain created by geth v1.14.x and
below will now print an error instead of crashing:

    Fatal: Failed to register the Ethereum service: invalid chain configuration: missing entry for fork "cancun" in blobSchedule

Arguably this is not great, and it should just auto-upgrade the config.
We'll address this in a follow-up PR for geth v1.15.2
2025-02-13 13:05:05 +01:00
Marius van der Wijden 02a16f1802 Merge remote-tracking branch 'origin/master' into eof-opcodes 2025-02-13 11:32:58 +01:00
Marius van der Wijden 545fcb144a core/vm: fix overflows in DATACOPY and DATALOAD opcodes 2025-02-13 11:05:09 +01:00
Marius van der Wijden b78b30717c
Merge pull request #61 from MariusVanDerWijden/shemnon-legacy-pc
Move EOF interpreter to use same PC semantics as legacy EVM
2025-02-13 10:43:08 +01:00
Marius van der Wijden 24ed0b5066
go.mod: update blst to v0.3.14 (#31165)
closes https://github.com/ethereum/go-ethereum/issues/31072

BLST released their newest version which includes a fix for go v.1.24:
https://github.com/supranational/blst/releases/tag/v0.3.14

I went through all commits between 0.3.14 and 0.3.13 for a sanity check
2025-02-13 09:45:27 +01:00
jwasinger 58f65c60c2
trie: copy preimage store pointer in StateTrie.Copy (#31158)
This fixes an error where executing `evm run --dump ...` omits preimages
from the dump (because the statedb used for execution is a copy of
another instance).
2025-02-12 09:55:00 +08:00
Sina M da71839a27
internal/ethapi: fix panic in debug methods (#31157)
Fixes an error when the block is not found in debug methods.
2025-02-11 16:02:30 +01:00
lightclient cdb66c89d6
core/txpool/legacypool: add support for SetCode transactions (#31073)
The new SetCode transaction type introduces some additional complexity
when handling the transaction pool.

This complexity stems from two new account behaviors:

1. The balance and nonce of an account can change during regular
   transaction execution *when they have a deployed delegation*.
2. The nonce and code of an account can change without any EVM execution
   at all. This is the "set code" mechanism introduced by EIP-7702.

The first issue has already been considered extensively during the design
of ERC-4337, and we're relatively confident in the solution of simply
limiting the number of in-flight pending transactions an account can have
to one. This puts a reasonable bound on transaction cancellation. Normally
to cancel, you would need to spend 21,000 gas. Now it's possible to cancel
for around the cost of warming the account and sending value
(`2,600+9,000=11,600`). So 50% cheaper.

The second issue is more novel and needs further consideration.
Since authorizations are not bound to a specific transaction, we
cannot drop transactions with conflicting authorizations. Otherwise,
it might be possible to cherry-pick authorizations from txs and front
run them with different txs at much lower fee amounts, effectively DoSing
the authority. Fortunately, conflicting authorizations do not affect the
underlying validity of the transaction so we can just accept both.

---------

Co-authored-by: Marius van der Wijden <m.vanderwijden@live.de>
Co-authored-by: Felix Lange <fjl@twurst.com>
2025-02-11 14:15:04 +01:00
Chen Kai 22b9354494
p2p/discover: make discv5 response timeout configurable (#31119) 2025-02-11 13:52:43 +01:00
Harry Ngo d2ca7cf9f1
p2p/discover: remove unused parameter in revalidationList.get (#31155) 2025-02-11 13:45:44 +01:00
Felix Lange 9064038a86
consensus/beacon: remove TestingTTDBlock (#31153)
This removes the method `TestingTTDBlock` introduced by #30744. It was
added to make the beacon consensus engine aware of the merge block in
tests without relying on the total difficulty. However, tracking the
merge block this way is very annoying. We usually configure forks in the
`ChainConfig`, but the method is on the consensus engine, which isn't
always created in the same place. By sidestepping the `ChainConfig` we
don't get the usual fork-order checking, so it's possible to enable the
merge before the London fork, for example. This in turn can lead to very
hard-to-debug outputs and validation errors.

So here I'm changing the consensus engine to check the
`MergeNetsplitBlock` instead. Alternatively, we assume a network is
merged if it has a `TerminalTotalDifficulty` of zero, which is a very
common configuration in tests.
2025-02-11 13:44:25 +01:00
lightclient 4cda8f06ea
params,core/forkid: enable prague on holesky and sepolia (#31139)
Agreed to the following fork dates for Holesky and Sepolia on ACDC 150

Holesky slot: 3710976	(Mon, Feb 24 at 21:55:12 UTC)
Sepolia slot: 7118848	(Wed, Mar 5 at 07:29:36 UTC)
2025-02-08 13:26:15 +01:00
Marius van der Wijden 8a84cd1b97 core/vm: fix off-by-one error 2025-02-07 14:15:20 +01:00
Marius van der Wijden 644823db48 core/vm: clean up code and containerOffset handling 2025-02-07 14:07:03 +01:00
Danno Ferrin 5bfacf4ba2 Move EOF interpreter to use same PC semantics as legacy EVM
Update the EOF container parsing to allow the PC to use the same semantics as the legacy EVM.
 Also, a new test container maker is necessary to handle the particulars of the unit tests, mostly unrelated to
2025-02-07 12:31:55 +01:00
Marius van der Wijden b0dedd720b tests: fixup 2025-02-07 09:32:52 +01:00
Marius van der Wijden 57f5e80603
Merge pull request #59 from shemnon/eof/osaka
Move EOF activation to Osaka
2025-02-07 09:31:29 +01:00
Marius van der Wijden 881e22d49c
Merge branch 'eof-opcodes' into eof/osaka 2025-02-07 09:31:17 +01:00
Marius van der Wijden 1846cc9ef4 core/tracing: add InvalidEoF hook 2025-02-07 09:28:50 +01:00