Commit graph

16710 commits

Author SHA1 Message Date
MariusVanDerWijden
57c3ae1d25 eth/catalyst: temporary allow amsterdam in newPayload 2026-02-16 10:01:41 +01:00
MariusVanDerWijden
480343c0b2 eth/catalyst: temporary allow amsterdam in gpV5 2026-02-13 14:31:07 +01:00
Barnabas Busa
1f3041824f eth/catalyst: add Engine API stubs for Amsterdam fork
Add Engine API method stubs for the Amsterdam fork (Gloas on CL side):
- engine_newPayloadV5 for Amsterdam payloads
- engine_getPayloadV6 for Amsterdam payloads
- engine_newPayloadWithWitnessV5 for witness generation
- engine_executeStatelessPayloadV5 for stateless execution
- Update engine_forkchoiceUpdatedV3 to accept Amsterdam payloads
- Add PayloadV4 constant for ExecutionPayloadV4

This is a minimal implementation with method stubs only - no blockAccessList
(EIP-7928) integration yet.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-13 14:00:09 +01:00
vickkkkkyy
c12959dc8c
core/rawdb: fix incorrect tail value in unindexTransactions log output (#33796)
Some checks are pending
/ Keeper Build (push) Waiting to run
/ Linux Build (push) Waiting to run
/ Linux Build (arm) (push) Waiting to run
/ Windows Build (push) Waiting to run
/ Docker Image (push) Waiting to run
2026-02-09 15:49:53 +08:00
sashass1315
bc0db302ed
core/vm: add missing PUSH0 handler in EIP-8024 test mini-interpreter (#33785) 2026-02-09 15:39:55 +08:00
GarmashAlex
777265620d
core/rawdb: close freezer table in InspectFreezerTable (#33776)
Some checks failed
/ Linux Build (arm) (push) Has been cancelled
/ Keeper Build (push) Has been cancelled
/ Linux Build (push) Has been cancelled
/ Windows Build (push) Has been cancelled
/ Docker Image (push) Has been cancelled
2026-02-06 22:13:37 +08:00
Marius van der Wijden
ad459f4fac
metrics: reduce allocations for metrics (#33699)
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-02-06 20:26:31 +08:00
Forostovec
e64c8d8e26
core/rawdb: check pruning tail in HasBody and HasReceipts (#33747)
### Problem

`HasBody` and `HasReceipts` returned `true` for pruned blocks because
they only checked `isCanon()` which verifies the hash table — but
hash/header tables have `prunable: false` while body/receipt tables have
`prunable: true`.

After `TruncateTail()`, hashes still exist but bodies/receipts are gone.
This caused inconsistency: `HasBody()` returns `true`, but `ReadBody()`
returns `nil`.

### Changes

Both functions now check `db.Tail()` when the block is in ancient store.
If `number < tail`, the data has been pruned and the function correctly
returns `false`.

This aligns `HasBody`/`HasReceipts` behavior with
`ReadBody`/`ReadReceipts` and fixes potential issues in
`skeleton.linked()` which relies on these checks during sync.
2026-02-06 20:10:30 +08:00
vickkkkkyy
9967fb7c5c
metrics: add missing ResettingTimer case in GetAll() (#33749)
Follow-up to https://github.com/ethereum/go-ethereum/pull/33748

Same issue - ResettingTimer can be registered via loadOrRegister() but
GetAll() silently drops it during JSON export. The prometheus exporter
handles it fine (collector.go:70), so this is just an oversight in the
JSON path.

Note: ResettingTimer.Snapshot() resets the timer by design, which is
consistent with how the prometheus exporter uses it.
2026-02-06 20:07:55 +08:00
Csaba Kiraly
aa457eda4b
core/txpool/blobpool: reset counters and gapped on Clear (#33775)
Clear was only used in tests, but it was missing some of the cleanup.

Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
2026-02-06 19:48:09 +08:00
Sina M
14c2408957
internal/ethapi: fix error code for revert in eth_simulateV1 (#33007)
The error code for revert should be consistent with eth_call and be 3.
2026-02-06 07:57:41 +01:00
Felix Lange
7b7be249cb
rlp: add RawList for working with un-decoded lists (#33755)
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
This adds a new type wrapper that decodes as a list, but does not
actually decode the contents of the list. The type parameter exists as a
marker, and enables decoding the elements lazily. RawList can also be
used for building a list incrementally.
2026-02-04 20:16:24 +01:00
vickkkkkyy
6b82cef68f
metrics: add missing GaugeInfo case in GetAll() (#33748)
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
GetAll did not return GaugeInfo metrics, which affects "chain/info" and "geth/info".
2026-02-04 13:19:50 +01:00
Marius van der Wijden
bba41f8072
core/txpool/legacypool: reduce unnecessary allocations during add (#33701)
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
Not many allocs we save here, but it also cleans up the logic and should
speed up the process a tiny bit
2026-02-04 04:50:19 +01:00
Felix Lange
8e1de223ad
crypto/keccak: vendor in golang.org/x/crypto/sha3 (#33323)
The upstream libray has removed the assembly-based implementation of
keccak. We need to maintain our own library to avoid a peformance
regression.

---------

Co-authored-by: lightclient <lightclient@protonmail.com>
2026-02-03 14:55:27 -07:00
Lessa
54a91b3ad8
core/types, internal/ethapi, signer/core/apitypes: avoid copying 128KB blobs in range loops (#33717)
Some checks are pending
/ Linux Build (arm) (push) Waiting to run
/ Keeper Build (push) Waiting to run
/ Linux Build (push) Waiting to run
/ Windows Build (push) Waiting to run
/ Docker Image (push) Waiting to run
kzg4844.Blob is 131072 bytes. Using `for _, blob := range` copies the
entire blob on each iteration. With up to 6 blobs per transaction, this
wastes ~768KB of memory copies.

Switch to index-based iteration and pass pointers directly.
2026-02-03 21:36:59 +08:00
mmsqe
b9288765a3
accounts/usbwallet: add support for Ledger Nano Gen5 (#33297)
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
adds support for the 0x0008 / 0x8000 product ID (Ledger Apex | Nano
Gen5).
2026-02-03 13:11:47 +01:00
Guillaume Ballet
19f37003fb
trie/bintrie: fix debug_executionWitness for binary tree (#33739)
The `Witness` method was not implemented for the binary tree, which
caused `debug_excutionWitness` to panic. This PR fixes that.

Note that the `TransitionTrie` version isn't implemented, and that's on
purpose: more thought must be given to what should go in the global
witness.
2026-02-03 12:19:40 +01:00
Marius van der Wijden
16a6531ac2
core: miner: reduce allocations in block building (#33375)
I recently went on a longer flight and started profiling the geth block
production pipeline.
This PR contains a bunch of individual fixes split into separate
commits.
I can drop some if necessary.


Benchmarking is not super easy, the benchmark I wrote is a bit
non-deterministic.
I will try to write a better benchmark later
```
goos: linux
goarch: amd64
pkg: github.com/ethereum/go-ethereum/miner
cpu: Intel(R) Core(TM) Ultra 7 155U
                │ /tmp/old.txt │          /tmp/new.txt          │
                │    sec/op    │   sec/op     vs base           │
BuildPayload-14    141.5µ ± 3%   146.0µ ± 6%  ~ (p=0.346 n=200)

                │ /tmp/old.txt │             /tmp/new.txt             │
                │     B/op     │     B/op      vs base                │
BuildPayload-14   188.2Ki ± 4%   177.4Ki ± 4%  -5.71% (p=0.018 n=200)

                │ /tmp/old.txt │            /tmp/new.txt             │
                │  allocs/op   │  allocs/op   vs base                │
BuildPayload-14    2.703k ± 4%   2.453k ± 5%  -9.25% (p=0.000 n=200)
```
2026-02-03 08:19:16 +01:00
shhhh
6530945dcd
internal/ethapi: Add timestamp to eth_getTransactionByHash (#33709)
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/issues/729 and
fixes #33491. It adds blockTimestamp to transaction objects returned
by the RPC.
2026-02-02 12:20:16 +01:00
0xFloki
a951aacb70
triedb/pathdb: preallocate slices in encode methods (#33736)
Preallocates slices with known capacity in `stateSet.encode()` and
`StateSetWithOrigin.encode()` methods to eliminate redundant
reallocations during serialization.
2026-02-02 15:27:37 +08:00
Marius van der Wijden
a5e6a157e5
signer/core/apitypes: add cell proofs (#32910)
Adds support for cell proofs in blob transactions in the signer

---------

Co-authored-by: Gary Rong <garyrong0905@gmail.com>
2026-02-02 15:19:13 +08:00
alex017
cb97c48cb6
triedb/pathdb: preallocate slices in decodeRestartTrailer (#33715)
Some checks failed
/ Linux Build (arm) (push) Has been cancelled
/ Keeper Build (push) Has been cancelled
/ Windows Build (push) Has been cancelled
/ Linux Build (push) Has been cancelled
/ Docker Image (push) Has been cancelled
Preallocate capacity for `keyOffsets` and `valOffsets` slices in
`decodeRestartTrailer` since the exact size (`nRestarts`) is known
upfront.

---------

Co-authored-by: rjl493456442 <garyrong0905@gmail.com>
2026-01-30 21:14:15 +08:00
milan-cb
845009f684
ethclient: fix timeout param for eth_sendRawTransactionSync (#33693)
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
Fix timeout parameter in eth_sendRawTransactionSync
to be an integer instead of hex. The spec has now been
clarified on this point.
2026-01-29 21:41:18 +01:00
Noisy
a179ccf6f0
core/state: add bounds check in heap eviction loop (#33712)
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
core/state: add bounds check in heap eviction loop

Add len(h) > 0 check before accessing h[0] to prevent potential panic
and align with existing heap access patterns in txpool, p2p, and mclock
packages.
2026-01-29 21:08:04 +08:00
fengjian
c974722dc0
crypto/ecies: fix ECIES invalid-curve handling (#33669)
Some checks are pending
/ Docker Image (push) Waiting to run
/ 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
Fix ECIES invalid-curve handling in RLPx handshake (reject invalid
ephemeral pubkeys early)
- Add curve validation in crypto/ecies.GenerateShared to reject invalid
public keys before ECDH.
- Update RLPx PoC test to assert invalid curve points fail with
ErrInvalidPublicKey.
 
Motivation / Context
RLPx handshake uses ECIES decryption on unauthenticated network input.
Prior to this change, an invalid-curve ephemeral public key would
proceed into ECDH and only fail at MAC verification, returning
ErrInvalidMessage. This allows an oracle on decrypt success/failure and
leaves the code path vulnerable to invalid-curve/small-subgroup attacks.
The fix enforces IsOnCurve validation up front.
2026-01-29 10:56:12 +01:00
Csaba Kiraly
9a6905318a
core/txpool/legacypool: clarify and fix non-executable tx heartbeat (#33704)
Heartbeats are used to drop non-executable transactions from the queue.
The timeout mechanism was not clearly documented, and it was updates
also when not necessary.
2026-01-29 10:53:55 +01:00
rjl493456442
628ff79be3
ethdb/pebble: disable seek compaction for Pebble (#33697)
This PR restores the previous Pebble configuration, disabling seek compaction.

This feature is still needed by hash mode archive node, mitigating the
overhead of frequent compaction.
2026-01-29 10:48:34 +01:00
rjl493456442
7046e63244
trie: fix flaky test (#33711) 2026-01-29 17:22:15 +08:00
Lessa
2513feddf8
crypto/kzg4844: preallocate proof slice in ComputeCellProofs (#33703)
Preallocate the proof slice with the known size instead of growing it
via append in a loop. The length is already known from the source slice.
2026-01-29 15:49:10 +08:00
Marius van der Wijden
424bc22ab8
eth/gasprice: reduce allocations (#33698)
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
Recent pprof from our validator shows ~6% of all allocations because of
the gas price oracle. This PR reduces that.
2026-01-28 20:33:04 +01:00
CPerezz
1e9dfd5bb0
core: standardize slow block JSON output for cross-client metrics (#33655)
Some checks are pending
/ Docker Image (push) Waiting to run
/ 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
Implement standardized JSON format for slow block logging to enable
cross-client performance analysis and protocol research.

This change is part of the Cross-Client Execution Metrics initiative
proposed by Gary Rong: https://hackmd.io/dg7rizTyTXuCf2LSa2LsyQ

The standardized metrics enabled data-driven analysis like the EIP-7907
research: https://ethresear.ch/t/data-driven-analysis-on-eip-7907/23850

JSON format includes:
- block: number, hash, gas_used, tx_count
- timing: execution_ms, total_ms
- throughput: mgas_per_sec
- state_reads: accounts, storage_slots, bytecodes, code_bytes
- state_writes: accounts, storage_slots, bytecodes
- cache: account/storage/code hits, misses, hit_rate


This should come after merging #33522

---------

Co-authored-by: Gary Rong <garyrong0905@gmail.com>
2026-01-28 20:58:41 +08:00
Marius van der Wijden
0a8fd6841c
eth/tracers/native: add index to callTracer log (#33629)
closes https://github.com/ethereum/go-ethereum/issues/33566
2026-01-28 13:32:27 +01:00
Ng Wei Han
3d05284928
trie/bintrie: fix tree key hashing to match spec (#33694)
Based on [EIP-7864](https://eips.ethereum.org/EIPS/eip-7864), the tree
index should be 32 bytes instead of 31 bytes.
```
def get_tree_key(address: Address32, tree_index: int, sub_index: int):
    # Assumes STEM_SUBTREE_WIDTH = 256
    return tree_hash(address + tree_index.to_bytes(32, "little"))[:31] + bytes(
        [sub_index]
    )
```
2026-01-28 11:51:02 +01:00
Lessa
344d01e2be
core/rawdb: preallocate slice in iterateTransactions (#33690)
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
Preallocate hashes slice with known length instead of using append in a
loop. This avoids multiple reallocations during transaction indexing.
2026-01-28 09:51:15 +08:00
Guillaume Ballet
56be36f672
cmd/keeper: export getInput in wasm builds (#33686)
This is a tweak to the wasm build, that expects the `geth_io` namespace
to expect a `geth_io` module, providing a `len` and `read` methods. This
will be provided by the WASM interface in sp1. This forces an API change
on the OpenVM side, but the interface on their side is still being
designed, so we should proceed with this change, and we'll make a
different tag for OpenVM if this can't work for them.

Co-authored-by: wakabat <wakabat@protonmail.com>
2026-01-28 09:50:15 +08:00
rjl493456442
181a3ae9e0
triedb/pathdb: improve trienode reader for searching (#33681)
Some checks are pending
/ Docker Image (push) Waiting to run
/ 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
This PR optimizes the historical trie node reader by reworking how data
is accessed and memory is managed, reducing allocation overhead 
significantly.

Specifically:

- Instead of decoding an entire history object to locate a specific trie node, 
   the reader now searches directly within the history.

- Besides, slice pre-allocation can avoid unnecessary deep-copy significantly.
2026-01-27 20:05:35 +08:00
marukai67
e250836973
trie: preallocate slice capacity (#33689)
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 optimizes memory allocation in StateTrie.PrefetchAccount() and
StateTrie.PrefetchStorage() by preallocating slice capacity when the
final size is known.
2026-01-27 12:04:12 +08:00
rjl493456442
c2595381bf
core: extend the code reader statistics (#33659)
Some checks are pending
/ Windows Build (push) Waiting to run
/ Docker Image (push) Waiting to run
/ Keeper Build (push) Waiting to run
/ Linux Build (push) Waiting to run
/ Linux Build (arm) (push) Waiting to run
This PR extends the statistics of contract code read by adding these
fields:

- **CacheHitBytes**: the total number of bytes served by cache
- **CacheMissBytes**: the total number of bytes read on cache miss
- **CodeReadBytes**: the total number of bytes for contract code read
2026-01-26 11:25:53 +01:00
Csaba Kiraly
9a8e14e77e
core/txpool/legacypool: fix stale counter (#33653)
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
Calling `pool.priced.Removed` is needed to keep is sync with
`pool.all.Remove`.
It was called in other occurances, but not here.

The counter is used for internal heap management. It was working even without this, just not calling reheap at the intended frequency.

Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
2026-01-23 13:35:14 +01:00
Jonny Rhea
251b863107
core/vm: update EIP-8024 - Missing immediate byte is now treated as 0x00 (#33614)
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 updates the EIP-8024 implementation to match the latest spec
clarification.

---------

Co-authored-by: lightclient <lightclient@protonmail.com>
2026-01-22 12:16:02 -07:00
rjl493456442
1022c7637d
core, eth, internal, triedb/pathdb: enable eth_getProofs for history (#32727)
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 enables the `eth_getProofs ` endpoint against the historical states.
2026-01-22 09:19:27 +08:00
Csaba Kiraly
35922bcd33
core/txpool/legacypool: reset gauges on clear (#33654)
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
Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
Co-authored-by: rjl493456442 <garyrong0905@gmail.com>
2026-01-21 16:00:57 +08:00
DeFi Junkie
8fad02ac63
core/types: fix panic on invalid signature length (#33647)
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 panic with error return in decodeSignature to prevent crashes on
invalid inputs, and update callers to propagate the error.
2026-01-21 06:57:02 +01:00
Csaba Kiraly
54ab4e3c7d
core/txpool/legacypool: add metric for accounts in txpool (#33646)
This PR adds metrics that count the number of accounts having transactions 
in the txpool. Together with the transaction count this can be used as a 
simple indicator of the diversity of transactions in the pool.

Note: as an alternative implementation, we could use a periodic or event
driven update of these Gauges using len.

I've preferred this implementation to match what we have for the pool
sizes.

---------

Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
2026-01-21 09:23:03 +08:00
forkfury
2eb1ccc6c4
core/state: ensure deterministic hook emission order in Finalise (#33644)
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 #33630

Sort self-destructed addresses before emitting hooks in Finalise() to
ensure deterministic ordering and fix flaky test
TestHooks_OnCodeChangeV2.

---------

Co-authored-by: jwasinger <j-wasinger@hotmail.com>
2026-01-20 20:36:07 +08:00
DeFi Junkie
46d804776b
accounts/scwallet: fix panic in decryptAPDU (#33606)
Validate ciphertext length in decryptAPDU, preventing runtime panics on
invalid input.
2026-01-20 12:04:23 +01:00
Felix Lange
d58f6291a2
internal/debug: add integration with Grafana Pyroscope (#33623)
This adds support for Grafana Pyroscope, a continuous profiling solution. 
The client is configured similarly to metrics, i.e. run 

     geth --pyroscope --pyroscope.server=https://...

This commit is a resubmit of #33261 with some changes.

---------

Co-authored-by: Carlos Bermudez Porto <cbermudez.dev@gmail.com>
2026-01-20 10:33:09 +01:00
cui
d0af257aa2
triedb/pathdb: double check the list availability before regeneration (#33622)
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: rjl493456442 <garyrong0905@gmail.com>
2026-01-19 20:45:31 +08:00
rjl493456442
500931bc82
core/vm: add read only protection for opcodes (#33637)
This PR reverts a part of changes brought by https://github.com/ethereum/go-ethereum/pull/33281/changes

Specifically, read-only protection should always be enforced at the opcode level, 
regardless of whether the check has already been performed during gas metering.

It should act as a gatekeeper, otherwise, it is easy to introduce errors by adding
new gas measurement logic without consistently applying the read-only protection.
2026-01-19 20:43:14 +08:00