Commit Graph

15714 Commits

Author SHA1 Message Date
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
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
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
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 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
Marcin Sobczak d11e9c0b51
cmd/devp2p/internal/ethtest: remove TD from status validation (#31137)
After recent changes in Geth (removing TD):

39638c81c5 (diff-d70a44d4b7a0e84fe9dcca25d368f626ae6c9bc0b8fe9690074ba92d298bcc0d)

Non-Geth clients are failing many devp2p tests with an error:
`peering failed: status exchange failed: wrong TD in status: have 1 want 0`

Right now only Geth is passing it - all other clients are affected by
this change. I think there should be no validation of TD when checking `Status`
message in hive tests. Now Geth has 0 (and hive tests requires 0) and
all other clients have actual TD. And on real networks there is no validation
of TD when peering
2025-02-07 09:59:12 +08:00
Felix Lange d74c47f8db version: begin v1.15.1 release cycle 2025-02-06 15:06:46 +01:00
Felix Lange 756cca7c6f version: release go-ethereum v1.15.0 2025-02-06 15:05:59 +01:00
Sina M 1847b5f635
build: update EEST fixtures to prague devnet-6 (#31088)
Co-authored-by: lightclient <lightclient@protonmail.com>
2025-02-06 12:33:40 +01:00
ericxtheodore 9e33b29c74
build: update to Go 1.23.6 (#31130)
Co-authored-by: Felix Lange <fjl@twurst.com>
2025-02-05 23:19:09 +01:00
Felix Lange 5d97db8d03
all: update license comments and AUTHORS (#31133) 2025-02-05 23:01:17 +01:00
Sina M aaaf01d712
core/tracing: state journal wrapper (#30441)
Here we add some more changes for live tracing API v1.1:

- Hook `OnSystemCallStartV2` was introduced with `VMContext` as parameter.
- Hook `OnBlockHashRead` was introduced.
- `GetCodeHash` was added to the state interface
- The new `WrapWithJournal` construction helps with tracking EVM reverts in the tracer.

---------

Co-authored-by: Felix Lange <fjl@twurst.com>
2025-02-05 13:58:25 +01:00
Felix Lange ed1d46b3d3
consensus/misc/eip4844: more changes for blob gas calculation (#31128)
This PR changes the signature of `CalcExcessBlobGas` to take in just
the header timestamp instead of the whole object. It also adds a sanity
check for the parent->child block order to `VerifyEIP4844Header`.
2025-02-05 10:35:03 +01:00
lightclient c4ad459bd2
consensus/misc/eip4844: use head's target blobs, not parent (#31101)
A clarification was made to EIP-7691 stating that at the fork boundary
it is required to use the target blob count associated with the head
block, rather than the parent as implemented here.

See for more: https://github.com/ethereum/EIPs/pull/9249
2025-02-04 21:43:18 +01:00
Marius van der Wijden 59d2eec9fc
core/txpool/blobpool: fix incorrect arguments in test (#31127)
Fixes the linter on master which was broken by
https://github.com/ethereum/go-ethereum/pull/30559
2025-02-04 18:10:40 +01:00
Martin HS 7c7b7f6ab1
core/txpool: remove locals-tracking from txpools (#30559)
Replaces  #29297, descendant from #27535

---------

This PR removes `locals` as a concept from transaction pools. Therefore,
the pool now acts as very a good simulation/approximation of how our
peers' pools behave. What this PR does instead, is implement a
locals-tracker, which basically is a little thing which, from time to
time, asks the pool "did you forget this transaction?". If it did, the
tracker resubmits it.

If the txpool _had_ forgotten it, chances are that the peers had also
forgotten it. It will be propagated again.

Doing this change means that we can simplify the pool internals, quite a
lot.

### The semantics of `local` 

Historically, there has been two features, or usecases, that has been
combined into the concept of `locals`.

1. "I want my local node to remember this transaction indefinitely, and
resubmit to the network occasionally"
2. "I want this (valid) transaction included to be top-prio for my
miner"


This PR splits these features up, let's call it `1: local` and `2:
prio`. The `prio` is not actually individual transaction, but rather a
set of `address`es to prioritize.
The attribute `local` means it will be tracked, and `prio` means it will
be prioritized by miner.

For `local`: anything transaction received via the RPC is marked as
`local`, and tracked by the tracker.
For `prio`: any transactions from this sender is included first, when
building a block. The existing commandline-flag `--txpool.locals` sets
the set of `prio` addresses.

---------

Co-authored-by: Gary Rong <garyrong0905@gmail.com>
2025-02-04 17:23:01 +01:00
Felix Lange e332431cb2
core: assign default difficulty to zero for chain without ethash (#31067)
I hit this case while trying something with the simulated backend. The
EVM only enables instruction set forks after the merge when 'Random' is
set. In the simulated backend, the random value will be set via the
engine API for all blocks after genesis. But for the genesis block
itself, the random value will not be assigned in the vm.BlockContext
because the genesis has a non-zero difficulty. For my case, this meant
that estimateGas did not work for the first transaction sent on the
simulated chain, since the contract contained a PUSH0 instruction.

This could also be fixed by explicitly configuring a zero difficulty in
the simulated backend. However, I think that zero difficulty is a better
default these days.

---------

Co-authored-by: lightclient <lightclient@protonmail.com>
2025-02-04 17:16:26 +01:00
lightclient e6f3ce7b16
params,core: add max and target value to chain config (#31002)
Implements [EIP-7840](https://github.com/ethereum/EIPs/pull/9129) and
[EIP-7691](d96625a4dc/EIPS/eip-7691.md).

---------

Co-authored-by: Marius van der Wijden <m.vanderwijden@live.de>
Co-authored-by: Felix Lange <fjl@twurst.com>
2025-02-04 15:43:18 +01:00
Marius van der Wijden eee868226a
params: start osaka fork (#31125)
This PR defines the Osaka fork. An easy first step to start our work on
the next hardfork

(This is needed for EOF testing as well)

---------

Co-authored-by: lightclient <14004106+lightclient@users.noreply.github.com>
2025-02-04 15:29:51 +01:00
Marius van der Wijden 665c8512f3
core: copy genesis before modifying (#31097)
This PR fixes a data race in SetupGenesisWithOverride.
2025-02-04 14:22:30 +01:00
rjl493456442 0ad0966cec
core/rawdb: introduce flush offset in freezer (#30392)
This is a follow-up PR to #29792 to get rid of the data file sync.

**This is a non-backward compatible change, which increments the
database version from 8 to 9**.

We introduce a flushOffset for each freezer table, which tracks the position
of the most recently fsync’d item in the index file. When this offset moves
forward, it indicates that all index entries below it, along with their corresponding
data items, have been properly persisted to disk. The offset can also be moved
backward when truncating from either the head or tail of the file.

Previously, the data file required an explicit fsync after every mutation, which
was highly inefficient. With the introduction of the flush offset, the synchronization
strategy becomes more flexible, allowing the freezer to sync every 30 seconds
instead.

The data items above the flush offset are regarded volatile and callers must ensure
they are recoverable after the unclean shutdown, or explicitly sync the freezer
before any proceeding operations.

---------

Co-authored-by: Felix Lange <fjl@twurst.com>
2025-02-04 11:45:45 +01:00
kazak e26dd774a9
tests/fuzzers/bls12381: fix error message in fuzzCrossG2Add (#31113)
Fixes a typo in the error message within the `fuzzCrossG2Add`
function. The panic message incorrectly references "G1 point addition
mismatch" when it should be "G2 point addition mismatch," as the
function deals with G2 points.

This doesn't affect functionality but could cause confusion during
debugging. I've updated the message to reflect the correct curve.
2025-02-04 07:09:06 +01:00
jwasinger 55a18616b1
core/vm: simplify tracer hook invocation in interpreter loop (#31074)
Removes duplicate code in the interpreter loop.
2025-02-03 18:44:26 +01:00
Sina M fc12dbe40b
eth/catalyst: fix validation of type 0 request (#31103)
I caught this error on Hive. It was introduced by
https://github.com/ethereum/go-ethereum/pull/31071 because after adding
the equality check the request type 0 will be rejected.
2025-01-31 18:34:22 +01:00
lightclient 8daefeb890
params: update system contract addresses for devnet-6 (#31102)
Finalize Prague system contract addresses. Reference:

* https://github.com/ethereum/EIPs/pull/9287
* https://github.com/ethereum/EIPs/pull/9288
* https://github.com/ethereum/EIPs/pull/9289
2025-01-31 10:36:49 +01:00
Sina M a50cac5bbe
core/vm: EXTCODE* return delegation designator for 7702 (#31089)
Implements https://github.com/ethereum/EIPs/pull/9248
2025-01-30 09:08:42 -07:00
Sina M 0e1a19da76
core: implement eip-7623 floor data gas (#30946)
This PR builds on #29040 and updates it to the new version of the spec.
I filled the EEST tests and they pass.

Link to spec: https://eips.ethereum.org/EIPS/eip-7623

---------

Co-authored-by: Marius van der Wijden <m.vanderwijden@live.de>
Co-authored-by: lightclient <14004106+lightclient@users.noreply.github.com>
Co-authored-by: lightclient <lightclient@protonmail.com>
2025-01-30 09:07:45 -07:00
Ryan Tinianov 9b9e7ccacf
all: add build tags for wasip1 (#31090) 2025-01-30 16:58:53 +01:00
Felix Lange 9bc8256a09 version: begin v1.15.0 release cycle 2025-01-30 15:01:00 +01:00
Felix Lange b3833e5d98
build: provide a flag to disable publishing in dockerx build (#31098)
This changes the `-upload` flag to just toggle the upload. The remote
image name is now configured using the `-hub` flag.
2025-01-30 14:52:02 +01:00
Felix Lange fa9a2ff868
crypto: add IsOnCurve check (#31100) 2025-01-30 14:10:36 +01:00
Felix Lange 7d0e197def
build: retry PPA upload up to three times (#31099) 2025-01-30 14:06:50 +01:00
Felix Lange d80da7c3b4 Revert ".travis.yml: change arch for Docker build to arm64 (#31096)"
This reverts commit 7b96ec4dae.
2025-01-30 11:21:23 +01:00
Felix Lange 7b96ec4dae
.travis.yml: change arch for Docker build to arm64 (#31096)
This is an attempt to work around a gcc issue in the Docker build.
2025-01-30 11:10:45 +01:00
Sina M 11e841e599
build: bump test timeout (#31095)
Travis often fails because the test times out.
2025-01-30 10:58:44 +01:00
Guillaume Ballet 52766bedb9
core/{.,state,vm},miner,eth/tracers,tests: implement 7709 with a syscall flag (#31036)
Same as #31015 but requires the contract to exist. Not compatible with
any verkle testnet up to now.

This adds a `isSytemCall` flag so that it is possible to detect when a
system call is executed, so that the code execution and other locations
are not added to the witness.

---------

Signed-off-by: Guillaume Ballet <3272758+gballet@users.noreply.github.com>
Co-authored-by: Ignacio Hagopian <jsign.uy@gmail.com>
Co-authored-by: Felix Lange <fjl@twurst.com>
2025-01-29 14:31:25 +01:00
Sina M 3fcbb6735e
.github: add lint step (#31068) 2025-01-28 18:56:20 +01:00