Commit graph

16989 commits

Author SHA1 Message Date
rjl493456442
117e067f0f
version: release go-ethereum v1.17.3 stable (#34937) 2026-05-11 17:19:24 +02:00
Marius van der Wijden
e1047b9c84
core: use uint256 in core.Message (#34934)
Changes core.Message to use Uint256 which is faster

---------

Co-authored-by: Gary Rong <garyrong0905@gmail.com>
2026-05-11 22:25:57 +08:00
Richard Creighton
2f11dccca0
cmd/geth: respect --dev=false (#34920)
Passing `--dev=false` currently still enters the dev-mode startup path
because a couple of branches check whether the flag was set, not its
boolean value.

This switches those branches to use `ctx.Bool`, so explicit false does
not start dev mode or emit a dev genesis, while `--dev` keeps its
existing behavior.
2026-05-11 22:08:55 +08:00
rayoo
934a0091fa
triedb/pathdb: fix layer 5 key range in storage iterator traversal test (#34883)
Some checks are pending
/ Linux Build (push) Waiting to run
/ Linux Build (arm) (push) Waiting to run
/ Keeper Build (push) Waiting to run
/ Windows Build (push) Waiting to run
/ Docker Image (push) Waiting to run
2026-05-11 10:23:58 +08:00
Marius van der Wijden
18becee8cb
appveyor.yml: remove appveyor configuration (#34720)
Removes the appveyor.yml since we moved to github runners.

---------

Co-authored-by: Sina Mahmoodi <itz.s1na@gmail.com>
Co-authored-by: Felix Lange <fjl@twurst.com>
2026-05-10 22:54:57 +02:00
rayoo
f63c265092
internal/download: close dst on io.Copy error (#34910)
Some checks are pending
/ Linux Build (push) Waiting to run
/ Linux Build (arm) (push) Waiting to run
/ Keeper Build (push) Waiting to run
/ Windows Build (push) Waiting to run
/ Docker Image (push) Waiting to run
2026-05-10 13:43:40 +02:00
cui
7facf9c129
core/txpool: use cmp.Compare instead of subtraction (#34918)
This fixes a theoretical overflow condition if an account has an impossibly high nonce.
2026-05-10 13:03:57 +02:00
cui
bcb68d23b3
p2p: handle return false from TCPEndpoint (#34916) 2026-05-10 13:02:46 +02:00
vickkkkkyy
8581125a21
crypto: add hash length check in nocgo VerifySignature (#33839)
Some checks are pending
/ Linux Build (push) Waiting to run
/ Linux Build (arm) (push) Waiting to run
/ Keeper Build (push) Waiting to run
/ Windows Build (push) Waiting to run
/ Docker Image (push) Waiting to run
I was tracing a signature verification issue in a nocgo build and found
that `VerifySignature` doesn't validate hash length. #33104 added the
check to `Sign` and `sigToPub` but missed this one. The cgo path in
`secp256k1/secp256.go` already rejects non-32-byte hashes, so the nocgo
path should do the same — otherwise a wrong-length hash gets passed to
decred's `Verify` and silently gives a bogus result.
2026-05-10 11:49:17 +02:00
Marius Kjærstad
2ba9be9c0e
build: upgrade -dlgo version to Go 1.25.10 (#34911)
New security fix:
https://groups.google.com/g/golang-announce/c/qcCIEXso47M
2026-05-10 11:45:23 +02:00
Richard Creighton
2ca3a6447d
cmd/geth: respect --graphql=false (#34914)
Some checks are pending
/ Linux Build (push) Waiting to run
/ Linux Build (arm) (push) Waiting to run
/ Keeper Build (push) Waiting to run
/ Windows Build (push) Waiting to run
/ Docker Image (push) Waiting to run
Passing `--graphql=false` currently still registers the GraphQL handler
because the startup path checks whether the flag was set, not its
boolean value.

This switches the registration condition to use `ctx.Bool`, so explicit
false disables GraphQL while the default behavior remains unchanged.
2026-05-09 16:07:12 +02:00
cui
b927ff8b53
cmd/devp2p: fix typo in ENR IP printing code (#34909) 2026-05-09 15:59:03 +02:00
cui
1f3989dc70
signer/core: avoid mutating the input (#34908)
Some checks are pending
/ Linux Build (push) Waiting to run
/ Linux Build (arm) (push) Waiting to run
/ Keeper Build (push) Waiting to run
/ Windows Build (push) Waiting to run
/ Docker Image (push) Waiting to run
2026-05-09 08:51:12 +08:00
Sina M
592209c0ee
.gitea, build: cross-compile windows binaries (#34889)
Some checks are pending
/ Linux Build (push) Waiting to run
/ Linux Build (arm) (push) Waiting to run
/ Keeper Build (push) Waiting to run
/ Windows Build (push) Waiting to run
/ Docker Image (push) Waiting to run
2026-05-08 15:18:24 +02:00
Miki Noir
0ad890e3af
core/txpool/blobpool: continue on cell proof error in GetBlobs (#34891)
`GetBlobs` returned early when `CellProofsAt` reported
corrupted/out-of-bounds proofs, dropping every blob already collected
and aborting the remaining hashes — a single bad sidecar killed the
whole Engine API batch for consensus clients. Replaced the `return nil,
nil, nil, err` with `log.Error + continue` so the slot stays `nil` per
the sparse-array contract, matching the store/RLP/nil-sidecar branches a
few lines above.
2026-05-08 12:43:31 +02:00
Felix Lange
281dc4c209
p2p/discover: decouple nodeFeed from Table mutex in waitForNodes (#34898)
Fixes #34881

This fixes a hang in `Table.waitForNodes`. It is a replacement for PRs
#34890, #33665 which tried to fix the same issue in a different way.

- #34890 doesn't really fix the issue, just makes it less likely
- #33665 tries to fix it by moving the feed send outside of the lock

I created this PR because I want to keep the synchronous node feed
sending in `Table.nodeAdded`.

---------

Co-authored-by: Csaba Kiraly <csaba.kiraly@gmail.com>
2026-05-08 11:33:19 +02:00
Delweng
1abbae239d
eth,node: replace the deprecated TypeMux with Feed (#32585)
Some checks are pending
/ Linux Build (push) Waiting to run
/ Linux Build (arm) (push) Waiting to run
/ Keeper Build (push) Waiting to run
/ Windows Build (push) Waiting to run
/ Docker Image (push) Waiting to run
replace the not used event.Typemux to event.Feed

---------

Co-authored-by: Felix Lange <fjl@twurst.com>
2026-05-08 10:12:46 +08:00
cui
e71098ba4e
core/state: fix StateDB Reader Error Discard After Commit (#34899)
Some checks are pending
/ Linux Build (push) Waiting to run
/ Linux Build (arm) (push) Waiting to run
/ Keeper Build (push) Waiting to run
/ Windows Build (push) Waiting to run
/ Docker Image (push) Waiting to run
2026-05-07 18:40:26 -04:00
cui
e1e3eaa381
p2p/discover: copy buffer before sending read errors to unhandled (#34888)
Some checks are pending
/ Linux Build (push) Waiting to run
/ Linux Build (arm) (push) Waiting to run
/ Keeper Build (push) Waiting to run
/ Windows Build (push) Waiting to run
/ Docker Image (push) Waiting to run
This fixes an issue where packets send to the `Unhandled` channel
configured on discv4 could be corrupted when the packet buffer gets
reused.

---------

Co-authored-by: Felix Lange <fjl@twurst.com>
2026-05-07 15:18:04 +02:00
cui
f7b7d4c7e5
eth/tracers/logger: fix exclude address list (#34887)
Fixes the exclusion list of the accessListTracer.

---------

Co-authored-by: Sina M <1591639+s1na@users.noreply.github.com>
2026-05-07 14:03:32 +02:00
Roshan
c5598fe958
core/txpool: change lock in Pending method of legacy pool to read lock (#32924)
This PR makes a small update to the `Pending()` method in the legacy
pool. By changing the lock from exclusive to read-only, it aims to
improve concurrency performance.

---------

Co-authored-by: rjl493456442 <garyrong0905@gmail.com>
2026-05-07 10:44:26 +02:00
Bosul Mun
ea1cf7bf5e
eth/protocols/eth: stop serving on unavailable responses (#34787)
Some checks are pending
/ Linux Build (push) Waiting to run
/ Linux Build (arm) (push) Waiting to run
/ Keeper Build (push) Waiting to run
/ Windows Build (push) Waiting to run
/ Docker Image (push) Waiting to run
This is an alternative PR for
https://github.com/ethereum/go-ethereum/pull/34746.
This PR implements the second approach among the two possible solutions
mentioned in the above PR.

Requests for unavailable items are possible when the peer is following a
different fork from us. However this is not expected to happen
frequently. Considering the amount of complexity added to the codebase,
the simpler approach (this PR) can be preferred.
2026-05-06 15:36:54 +02:00
Jonny Rhea
06c30cc7e1
triedb/pathdb: add AdoptSyncedState for snap/2 completion path (#34874)
This PR adds `AdoptSyncedState()` alongside `Enable()`. It does the same
pathdb bookkeeping (now factored into a shared `resetForReactivation()`
helper), but skips the regeneration. The wiring/calling code lands in
#34626

---------

Co-authored-by: Gary Rong <garyrong0905@gmail.com>
2026-05-06 21:08:15 +08:00
Rahman
b92c86deb7
internal/download: don't discard dst.Close error (#34866)
When `io.Copy` succeeds but the buffered `Close` fails (e.g. disk full
on `Flush`), the error was swallowed and verification reported a
misleading hash mismatch instead of the real I/O failure. Keep the
`Close` error when `io.Copy` didn't already produce one.

---------

Co-authored-by: Jared Wasinger <j-wasinger@hotmail.com>
2026-05-06 15:02:03 +02:00
Marius van der Wijden
aaa2b66285
core: implement eip-7981: Increase Access List Cost (#34755)
based on: https://github.com/ethereum/go-ethereum/pull/34748

spec: https://eips.ethereum.org/EIPS/eip-7981
2026-05-06 12:03:11 +02:00
Marius van der Wijden
4d2af275e1
eth/catalyst: allow reorging the head block to a parent (#34767)
Some checks are pending
/ Linux Build (push) Waiting to run
/ Linux Build (arm) (push) Waiting to run
/ Keeper Build (push) Waiting to run
/ Windows Build (push) Waiting to run
/ Docker Image (push) Waiting to run
Implements https://github.com/ethereum/execution-apis/pull/786/changes
as discussed on standup today

---------

Co-authored-by: Gary Rong <garyrong0905@gmail.com>
2026-05-06 09:59:51 +02:00
cui
84949107ce
beacon/engine: fix wrong presize bound (#34860) 2026-05-06 15:18:12 +08:00
Andrii Furmanets
4ff33ba1b6
internal/download: only report stale existing downloads (#34849)
Some checks are pending
/ Linux Build (push) Waiting to run
/ Linux Build (arm) (push) Waiting to run
/ Keeper Build (push) Waiting to run
/ Windows Build (push) Waiting to run
/ Docker Image (push) Waiting to run
## Summary

Fixes #31917.

`geth era-download` now only prints `is stale` when an existing
downloaded file fails checksum verification. Missing files are still
downloaded normally, but no longer get mislabeled as stale.

## Why

`DownloadFile` used `verifyHash` for both missing files and checksum
mismatches, then printed `is stale` for any error. This made first-time
downloads look like corrupt or outdated files.

## Validation

- `make all`
- `go run ./build/ci.go test`
- `go run ./build/ci.go lint`
- `go run ./build/ci.go check_generate`
- `go run ./build/ci.go check_baddeps`

---------

Co-authored-by: Felix Lange <fjl@twurst.com>
2026-05-05 22:17:09 +02:00
rayoo
60db25b070
p2p/discover: restore nextTimeout update in UDPv4 resetTimeout loop (#34878)
Some checks are pending
/ Linux Build (push) Waiting to run
/ Linux Build (arm) (push) Waiting to run
/ Keeper Build (push) Waiting to run
/ Windows Build (push) Waiting to run
/ Docker Image (push) Waiting to run
The refactor from `for el := plist.Front(); ...; el = el.Next()` to the
new `iterList` iterator in #34743 silently dropped two things needed by
resetTimeout:

1. `nextTimeout = el.Value.(*replyMatcher)` at the top of the loop. This
assignment is what gives `nextTimeout` its documented meaning ("head of
plist when timeout was last reset"), and what makes the early-return
optimization at the top of resetTimeout work. Without it, nextTimeout is
only ever written to nil, so `nextTimeout == plist.Front().Value` is
always false and the optimization is dead.

2. `nextTimeout.errc <- errClockWarp` in the clock-warp branch now reads
a stale or nil pointer. Prior to the refactor, the inner assignment kept
nextTimeout pointing at the current matcher so its errc was the right
channel to receive the errClockWarp signal. After the refactor, on first
entry into the clock-warp branch nextTimeout is nil, which panics the
UDPv4 loop goroutine with a nil pointer deref and takes discv4 down.

Re-assign `nextTimeout = p` at the head of the loop (restoring the
documented invariant) and send the clock-warp error on `p.errc` rather
than the now-stale `nextTimeout.errc`.

The clock-warp branch triggers only when the system clock jumps backward
after a deadline is assigned (deadline - time.Now() >= 2*respTimeout,
i.e. at least ~500ms backward jump), which is why this regression
slipped past CI - it is not exercised by any existing unit test, and
writing one would require plumbing a clock through the loop.
2026-05-05 15:28:28 +02:00
cui
5b837e5786
eth/downloader: use batch index in deliver reconstruct (#34870)
The reconstruct callback indexes parallel response slices (bodies,
receipts). Passing the accept counter used the wrong element when an
earlier header in the same batch hit a stale slot.
2026-05-05 12:41:22 +02:00
TenderDeve
d5edb80438
accounts/abi/bind: re-export event signature errors (#34868)
Re-exports errors in bind package.
---------

Co-authored-by: Marius van der Wijden <m.vanderwijden@live.de>
2026-05-05 11:29:26 +02:00
rayoo
efd6cdcff1
eth/tracers: forward V2 state hooks through mux tracer (#34869)
Some checks are pending
/ Linux Build (push) Waiting to run
/ Linux Build (arm) (push) Waiting to run
/ Keeper Build (push) Waiting to run
/ Windows Build (push) Waiting to run
/ Docker Image (push) Waiting to run
Fixes the muxTracer to correctly forward events to v2 state
hooks, i.e. `OnCodeChangeV2` and `OnNonceChangeV2`.
2026-05-04 21:36:26 +02:00
Rahman
f0b21fa110
core/txpool/blobpool: fix gapped queue size cap (#34831)
Some checks failed
/ Linux Build (push) Has been cancelled
/ Linux Build (arm) (push) Has been cancelled
/ Keeper Build (push) Has been cancelled
/ Windows Build (push) Has been cancelled
/ Docker Image (push) Has been cancelled
the gapped queue cap was effectively per-sender rather than total — a
sender pool spread across enough distinct addresses could grow
`p.gapped` well past `maxGapped`, defeating the resource bound.

`maxGapped` was being compared against `len(p.gapped)`, which is a
`map[address][]tx` and counts unique senders, not queued txs. Switched
the check to `len(p.gappedSource)` (keyed by tx hash, so its length is
the real total). Also wired up a `blobpool/gapped/count` gauge plus
`promoted`, `evicted`, and `gappedfull` meters so queue size and churn
are actually observable in prod.
2026-05-02 13:29:21 +02:00
rayoo
7155c65abb
internal/ethapi: apply block overrides to header in eth_call (#34842)
Some checks are pending
/ Linux Build (push) Waiting to run
/ Linux Build (arm) (push) Waiting to run
/ Keeper Build (push) Waiting to run
/ Windows Build (push) Waiting to run
/ Docker Image (push) Waiting to run
Apply block overrides to header in eth_call so EIP-1559 fee fields
use the correct overridden basefee.
2026-05-01 20:32:49 +02:00
hero5512
8656efcf5b
ethclient/simulated: disable log indexing by default (#32594)
Disables the recently added log indexer from a simulated backend.
In most cases the log indexer is not required and unindexed search
should be fast enough.
Fixes https://github.com/ethereum/go-ethereum/issues/32552.
2026-05-01 20:27:57 +02:00
cui
d270e211d1
core/state/snapshot: fix condition in iterator traversal test (#34638)
Fixes a condition in a snapshot-related test.
2026-05-01 20:22:48 +02:00
Richard Creighton
41b856d472
ethclient: add maxUsedGas to simulate call results (#34820)
This updates the typed `ethclient` model for `eth_simulateV1` call
results to include `maxUsedGas`, matching the field already returned by
the server-side RPC response.

Follow-up to #32789.
2026-05-01 20:18:14 +02:00
felipe
b9c5fe6d26
eth/tracers: fix evm trace for t8n (#34862)
The mux tracer fanned out every standard hook to its children but never
forwarded OnSystemCall{Start,End}. Tracers that rely on these - like
`logger.jsonLogger`, which uses the start hook to silence its opcode
hook for the duration of a system call - never got the signal when
wrapped behind a mux.

In evm t8n, combining `--trace` with `--opcode-count` (default for geth
with exec specs) produces exactly that wrapping. The first system call
(e.g. `ProcessBeaconBlockRoot`) then fires `OnOpcode` on the json logger
before any `OnTxStart` has run, dereferencing a nil env and crashing
t8n.

Forward both hooks through the mux. The V2 fan-out falls back to V1 for
children that only implement the legacy hook, mirroring the precedence
already used in `core/state_processor.go`.
2026-05-01 16:38:33 +02:00
Guillaume Ballet
a15778c52f
trie: group 2^N binary trie nodes in serialization (#34794)
Some checks are pending
/ Linux Build (push) Waiting to run
/ Linux Build (arm) (push) Waiting to run
/ Keeper Build (push) Waiting to run
/ Windows Build (push) Waiting to run
/ Docker Image (push) Waiting to run
This PR addresses one of the biggest performance issue with binary
tries: storing each internal node individually bloats the index, the
disk, and triggers a lot of write amplifications. To fix this issue,
this PR serializes groups of nodes together.

Because we are still looking for the ideal group size, the "depth" of
the group tree is made a parameter, but that will be removed in the
future, once the perfect size is known.


This is a rebase of #33658

---------

Co-authored-by: Copilot <copilot@github.com>
2026-05-01 15:28:19 +02:00
cui
68646229a0
internal/era/onedb: return false if err (#34816)
Next() function in RawIterator returned true on decompression errors.Now it
returns false on those cases. Redundant error check on cmd/era/main.go is also
removed.

---------

Co-authored-by: Bosul Mun <bsbs8645@snu.ac.kr>
2026-05-01 14:10:41 +02:00
cui
19dc690af8
triedb/pathdb: fix layer 5 key range in account iterator traversal test (#34639)
Some checks are pending
/ Linux Build (push) Waiting to run
/ Linux Build (arm) (push) Waiting to run
/ Keeper Build (push) Waiting to run
/ Windows Build (push) Waiting to run
/ Docker Image (push) Waiting to run
The layer-5 diff condition used `i > 50 || i < 85`, which is true for
almost all keys in the 0..255 loop. Use `i > 50 && i < 85` so layer 5
only covers the intended band (51..84), consistent with the snapshot
iterator test fix.
2026-05-01 00:24:22 +08:00
Bosul Mun
75a64ee341
eth/downloader: drop peers sending invalid bodies or receipts (#34745)
- Fixes an error shadowing issue in the deliver() function, where a
stale result from GetDeliverySlot caused the original failure to be
overwritten by errStaleDelivery.
- Adds errInvalidBody and errInvalidReceipt to the downloader error
checks to properly drop peers who sent invalid responses.

---------

Co-authored-by: Felix Lange <fjl@twurst.com>
2026-04-30 17:55:26 +02:00
Giulio rebuffo
01036bed83
core: skip tx gas cap after Amsterdam (#34841)
Some checks failed
/ Linux Build (push) Has been cancelled
/ Linux Build (arm) (push) Has been cancelled
/ Keeper Build (push) Has been cancelled
/ Windows Build (push) Has been cancelled
/ Docker Image (push) Has been cancelled
EIP-7825 caps the transaction gas limit at `MaxTxGas`, but after
Amsterdam/EIP-8037 the transaction gas limit can include state gas
reservoir in addition to the regular gas dimension. Applying the Osaka
cap to the full `tx.Gas()` rejects otherwise valid Amsterdam
transactions that need more than `MaxTxGas` total gas because of state
gas, while their regular gas use remains within the intended limit.

This changes geth to stop applying the full transaction gas cap once
Amsterdam is active:

- txpool stateless validation no longer rejects `tx.Gas() > MaxTxGas`
under Amsterdam
- legacy pool reorg cleanup does not purge high-total-gas transactions
at the Osaka transition if Amsterdam is also active
- execution precheck mirrors the txpool behavior and does not reject
high-total-gas messages under Amsterdam

The block gas limit check remains in place, so transactions still cannot
request more total gas than the current block gas limit.

Validation run:

```
go test ./core/txpool ./core/txpool/legacypool
go test ./core -run TestStateProcessorErrors
```

---------

Co-authored-by: Gary Rong <garyrong0905@gmail.com>
2026-04-28 17:25:16 +02:00
Miki Noir
db8d6abced
accounts/keystore: enable fsnotify watcher on linux/arm64 (#34834) 2026-04-28 15:36:01 +02:00
cui
0c0d299c52
core/state: opt stateObject.GetState (#34825) 2026-04-28 20:33:40 +08:00
rjl493456442
b5d9c8d1c2
core: implement BAL reader for prefetching (#33737)
Some checks are pending
/ Linux Build (push) Waiting to run
/ Linux Build (arm) (push) Waiting to run
/ Keeper Build (push) Waiting to run
/ Windows Build (push) Waiting to run
/ Docker Image (push) Waiting to run
2026-04-28 13:10:15 +02:00
Guillaume Ballet
4dc7d46155
core/vm: implement stack arena (#33960)
Here, we change the EVM stack implementation to use an 'arena', i.e.
a shared allocation pool for sub-call stacks. The stack is now more
GC-friendly, since it is a slice of uint256 values instead of a slice of pointers.

Code that pushes an item to the stack has been changed to get() the top
item, then overwrite it.

The PR is a rewrite/rebase of #30362.

---------

Co-authored-by: Martin Holst Swende <martin@swende.se>
Co-authored-by: Marius van der Wijden <m.vanderwijden@live.de>
2026-04-28 11:10:44 +02:00
Rahman
51c97216c5
p2p/discover: fix timeout loop early exit when removing expired matchers (#34743)
Save `el.Next()` before calling `plist.Remove(el)` so iteration
continues correctly. Previously the loop exited after removing the first
expired matcher because `Remove` invalidates the element's links.

---------

Co-authored-by: Felix Lange <fjl@twurst.com>
2026-04-28 10:57:58 +02:00
cui
822e7c6486
accounts/scwallet: truncate before write (#34815)
Some checks are pending
/ Linux Build (push) Waiting to run
/ Linux Build (arm) (push) Waiting to run
/ Keeper Build (push) Waiting to run
/ Windows Build (push) Waiting to run
/ Docker Image (push) Waiting to run
Co-authored-by: Guillaume Ballet <3272758+gballet@users.noreply.github.com>
2026-04-27 16:13:42 +02:00
felipe
442bd28b0b
cmd/evm/internal/t8ntool: stream t8n alloc to ease heavy memory cases (#34785) 2026-04-27 20:35:49 +08:00