Commit graph

2230 commits

Author SHA1 Message Date
Ng Wei Han
01b39c96bf
core/state, core/tracing: new state update hook (#33490)
### Description
Add a new `OnStateUpdate` hook which gets invoked after state is
committed.

### Rationale
For our particular use case, we need to obtain the state size metrics at
every single block when fuly syncing from genesis. With the current
state sizer, whenever the node is stopped, the background process must
be freshly initialized. During this re-initialization, it can skip some
blocks while the node continues executing blocks, causing gaps in the
recorded metrics.

Using this state update hook allows us to customize our own data
persistence logic, and we would never skip blocks upon node restart.

---------

Co-authored-by: Gary Rong <garyrong0905@gmail.com>
2026-01-08 11:07:19 +08:00
Csaba Kiraly
710008450f
eth: txs fetch/send log at trace level only (#33541)
This logging was too intensive at debug level, it is better to have it
at trace level only.

Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
2026-01-07 09:52:50 +08:00
Andrew Davis
a8a4804895
ethstats: report newPayload processing time to stats server (#33395)
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
Add NewPayloadEvent to track engine API newPayload block processing
times and report them to ethstats. This enables monitoring of block
processing performance.

https://notes.ethereum.org/@savid/block-observability

related: https://github.com/ethereum/go-ethereum/pull/33231

---------

Co-authored-by: MariusVanDerWijden <m.vanderwijden@live.de>
2026-01-05 17:49:30 +01:00
rjl493456442
b635e0632c
eth/fetcher: improve the condition to stall peer in tx fetcher (#32725)
Some checks failed
/ Keeper Build (push) Has been cancelled
/ Linux Build (push) Has been cancelled
/ Linux Build (arm) (push) Has been cancelled
/ Windows Build (push) Has been cancelled
/ Docker Image (push) Has been cancelled
Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
Co-authored-by: Csaba Kiraly <csaba.kiraly@gmail.com>
2025-12-31 19:52:25 +01:00
Marco Munizaga
b2843a11d6
eth/catalyst: implement getBlobsV3 (#33404)
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
This is used by cell-level dissemination (aka partial messages) to give
the CL all blobs the EL knows about and let CL communicate efficiently
about any other missing blobs. In other words, partial responses from
the EL is useful now.

See the related (closed) PR:
https://github.com/ethereum/execution-apis/pull/674 and the new PR:
https://github.com/ethereum/execution-apis/pull/719
2025-12-31 09:48:50 +08:00
rjl493456442
4531bfebec
eth/downloader: fix stale beacon header deletion (#33481)
In this PR, two things have been fixed:

--- 

(a) truncate the stale beacon headers with latest snap block

Originally, b.filled is used as the indicator for deleting stale beacon headers. 
This field is set only after synchronization has been scheduled, under the 
assumption that the skeleton chain is already linked to the local chain.

However, the local chain can be mutated via `debug_setHead`, which may
cause `b.filled` outdated. For instance, `b.filled` refers to the last head snap block 
in the last sync cycle while after `debug_setHead`, the head snap block has been 
rewounded to 1.

As a result, Geth can enter an unintended loop: it repeatedly downloads
the missing beacon headers for the skeleton chain and attempts to schedule the 
actual synchronization, but in the final step, all recently fetched headers are removed 
by `cleanStales` due to the stale `b.filled` value.

This issue is addressed by always using the latest snap block as the indicator, 
without relying on any cached value. However, note that before the skeleton
chain is linked to the local chain, the latest snap block will always be below
skeleton.tail, and this condition should not be treated as an error.

--- 

(b) merge the subchains once the skeleton chain links to local chain

Once the skeleton chain links with local one, it will try to schedule the 
synchronization by fetching the missing blocks and import them then. 
It's possible the last subchain already overwrites the previous subchain and 
results in having two subchains leftover. As a result, an error log will printed
https://github.com/ethereum/go-ethereum/blob/master/eth/downloader/skeleton.go#L1074
2025-12-29 16:13:30 +08:00
rjl493456442
bf141fbfb1
core, eth: add lock protection in snap sync (#33428)
Fixes #33396, #33397, #33398
2025-12-19 09:36:48 +01:00
Jeevan
dd7daace9d
eth/catalyst: return empty response for GetBlobsV2 before Osaka (#33444)
Fix #33420
2025-12-19 14:42:51 +08:00
rjl493456442
bd77b77ede
core/txpool/blobpool: remove legacy sidecar conversion (#33352)
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 removes the legacy sidecar conversion logic.

After the Osaka fork, the blobpool will accept only blob sidecar version
1.
Any remaining version 0 blob transactions, if they still exist, will no
longer
be eligible for inclusion.

Note that conversion at the RPC layer is still supported, and version 0
blob
transactions will be automatically converted to version 1 there.
2025-12-18 12:33:07 -07:00
Jonny Rhea
7aae33eacf
eth/catalyst: fix invalid timestamp log message (#33440)
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 a typo in the NewPayload invalid timestamp warning where the
parent timestamp was incorrectly logged as the block timestamp.
2025-12-17 16:24:10 -07:00
rjl493456442
6978ab48aa
cmd/workload, eth/tracers/native: introduce state proof tests (#32247)
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 pull request introduces a new workload command, providing the
features
for `eth_getProof` endpoint test generation and execution.
2025-12-15 08:35:02 +01:00
Bosul Mun
56d201b0fe
eth/fetcher: add metadata validation in tx announcement (#33378)
This PR fixes the bug reported in #33365.

The impact of the bug is not catastrophic. After a transaction is
ultimately fetched, validation and propagation will be performed based
on the fetched body, and any response with a mismatched type is treated
as a protocol violation. An attacker could only waste the limited
portion of victim’s bandwidth at most.

However, the reasons for submitting this PR are as follows

1. Fetching a transaction announced with an arbitrary type is a weird
behavior.

2. It aligns with efforts such as EIP-8077 and #33119 to make the
fetcher smarter and reduce bandwidth waste.

Regarding the `FilterType` function, it could potentially be implemented
by modifying the Filter function's parameter itself, but I wasn’t sure
whether changing that function is acceptable, so I left it as is.
2025-12-11 12:11:52 +08:00
SashaMalysehko
1ce71a1895
eth/tracers/native: include SWAP16 in default ignored opcodes (#33381) 2025-12-10 15:13:47 +08:00
rjl493456442
228933a660
eth/downloader: keep current syncmode in downloader only (#33157)
This moves the tracking of the current syncmode into the downloader, fixing an
issue where the syncmode being requested through the engine API could go
out-of-sync with the actual mode being performed by downloader.

Fixes #32629

---------

Co-authored-by: Felix Lange <fjl@twurst.com>
2025-12-08 22:49:57 +01:00
Felix Lange
73a2df2b0a
eth/filters: change error code for invalid parameter errors (#33320)
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 improves the error code for cases where invalid query parameters
are submitted to `eth_getLogs`. I also improved the error message that
is emitted when querying into the future.
2025-12-04 11:02:42 +01:00
Csaba Kiraly
129c562900
eth/catalyst: benchmark GetBlobsV2 at API level (#33196)
This is to benchmark how much the internal parts of GetBlobsV2 take. 
This is not an RPC-level benchmark, so JSON-RPC overhead is not
included.

Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
2025-12-03 22:35:00 +01:00
rjl493456442
042c47ce1a
core: log detailed statistics for slow block (#32812)
This PR introduces a new debug feature, logging the slow blocks with
detailed performance statistics, such as state read, EVM execution and
so on.

Notably, the detailed performance statistics of slow blocks won't be
logged during the sync to not overwhelm users. Specifically, the statistics
are only logged if there is a single block processed.

Example output

```
########## SLOW BLOCK #########
Block: 23537063 (0xa7f878611c2dd27f245fc41107d12ebcf06b4e289f1d6acf44d49a169554ee09) txs: 248, mgasps: 202.99

EVM execution: 63.295ms
Validation: 1.130ms
Account read: 6.634ms(648)
Storage read: 17.391ms(1434)
State hash: 6.722ms
DB commit: 3.260ms
Block write: 1.954ms
Total: 99.094ms

State read cache: account (hit: 622, miss: 26), storage (hit: 1325, miss: 109)
##############################
```
2025-12-02 14:43:51 +01:00
Sina M
5d51208334
internal/ethapi: change default tx type to 0x2 (#33058)
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
We still default to legacy txes for methods like eth_sendTransaction,
eth_signTransaction. We can default to 0x2 and if someone would like to
stay on legacy they can do so by setting the `gasPrice` field.

cc @deffrian
2025-11-28 15:32:40 +01:00
Felix Lange
fbbaa3c849
eth/catalyst: fix tests for getPayload change (#33322)
Fixes a test/lint regression introduced by #32754
2025-11-28 15:06:11 +01:00
lightclient
28376aea78
eth/catalyst: check fork timestamps during engine_getPayload (#32754)
This adds checks into getPayload to ensure the correct version is called
for the fork which applies to the payload.

---------

Co-authored-by: jsvisa <delweng@gmail.com>
2025-11-28 14:02:24 +01:00
ANtutov
b3b46ce435
eth/downloader: remove dead proc counter (#33309)
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
2025-11-28 10:42:22 +08:00
David Klank
6426257c0f
eth/tracers/logger: rename WriteTo to Write (#33227)
Some checks are pending
/ Windows Build (push) Waiting to run
/ 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
2025-11-27 16:05:24 +08:00
georgehao
b5c3b32eeb
eth/catalyst: remove the outdated comments of ForkchoiceUpdatedV1 (#33251) 2025-11-24 22:02:13 +08:00
maradini77
e0d81d1e99
eth: fix panic in randomDuration when min equals max (#33193)
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 a potential panic in `randomDuration` when `min == max` by
handling the edge case explicitly.
2025-11-19 01:54:53 +08:00
Delweng
f23d506b7d
eth/syncer: advance safe and finalized block (#33038) 2025-11-13 15:06:27 +08:00
Marcel
48d708a194
eth/filters: further optimize tx hash map in #32965 (#33108) 2025-11-13 14:48:26 +08:00
Matthieu Vachon
5f4cc3f57d
core/state: fixed hooked StateDB handling of OnCodeChangeV2 (#33148)
While updating to latest Geth, I noticed `OnCodeChangeV2` was not
properly handled in `SelfDestruct/6780`, this PR fixes this and bring a
unit test. Let me know if it's deemed more approriate to merge the tests
with the other one.
2025-11-11 14:57:52 +08:00
sashass1315
fbd89be047
eth/catalyst: always reset timer after sealing error (#33146)
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 periodic sealing loop failed to reset its timer when sealBlock
returned an error, causing the timer to never fire again and effectively
halting block production in developer periodic mode after the first
failure. This is a bug because the loop relies on the timer to trigger
subsequent sealing attempts, and transient errors (e.g., pool races or
chain rewinds) should not permanently stop the loop. The change moves
timer.Reset after the sealing attempt unconditionally, ensuring the loop
continues ticking and retrying even when sealing fails, which matches
how other periodic timers in the codebase behave and preserves forward
progress.
2025-11-10 18:44:31 +01:00
hero5512
e6d34c1fee
eth/tracers: fix prestateTracer for EIP-6780 SELFDESTRUCT (#33050)
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 https://github.com/ethereum/go-ethereum/issues/33049
2025-10-31 18:14:52 +01:00
wit liu
243407a3aa
eth/downloader: fix incorrect waitgroup in test XTestDelivery (#33047)
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
2025-10-30 15:39:02 +08:00
hero5512
53c85da796
eth/tracers: fix crasher in TraceCall with BlockOverrides (#33015)
fix https://github.com/ethereum/go-ethereum/issues/33014

---------

Co-authored-by: lightclient <lightclient@protonmail.com>
2025-10-24 17:04:09 +02:00
maskpp
cfb311148c
eth/filters: avoid rebuild the hash map multi times (#32965)
Some checks are pending
/ 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
2025-10-20 16:18:17 +08:00
Bosul Mun
88576c52e2
eth/fetcher: remove dangling peers from alternates (#32947)
This PR removes dangling peers in `alternates` map

In the current code, a dropped peer is removed from alternates for only
the specific transaction hash it was requesting. If that peer is listed
as an alternate for other transaction hashes, those entries still stick
around in alternates/announced even though that peer already got
dropped.
2025-10-20 10:26:55 +08:00
Bosul Mun
a9e66262af
eth/fetcher: add metrics for tracking slow peers (#32964)
This PR introduces two new metrics to monitor slow peers
- One tracks the number of slow peers.
- The other measures the time it takes for those peers to become
"unfrozen"

These metrics help with monitoring and evaluating the need for future
optimization of the transaction fetcher and peer management, for example i
n peer scoring and prioritization.

Additionally, this PR moves the fetcher metrics into a separate file, 
`eth/fetcher/metrics.go`.
2025-10-20 10:10:58 +08:00
ucwong
0a2c21acd5
eth/ethconfig : fix eth generate config (#32929) 2025-10-17 10:35:44 +08:00
aodhgan
ff54ca02de
internal/ethapi: add eth_SendRawTransactionSync (#32830)
New RPC method eth_sendRawTransactionSync(rawTx, timeoutMs?) that
submits a signed tx and blocks until a receipt is available or a timeout
elapses.

Two CLI flags to tune server-side limits:

--rpc.txsync.defaulttimeout (default wait window)

--rpc.txsync.maxtimeout (upper bound; requests are clamped)

closes https://github.com/ethereum/go-ethereum/issues/32094

---------

Co-authored-by: aodhgan <gawnieg@gmail.com>
Co-authored-by: Sina Mahmoodi <itz.s1na@gmail.com>
2025-10-16 17:34:47 +02:00
Delweng
40505a9bc0
eth/protocols/eth: reject message containing duplicated txs and drop peer (#32728)
Drop peer if sending the same transaction multiple times in a single message.

Fixes https://github.com/ethereum/go-ethereum/issues/32724


---------

Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
Co-authored-by: Gary Rong <garyrong0905@gmail.com>
Co-authored-by: Csaba Kiraly <csaba.kiraly@gmail.com>
2025-10-15 10:24:48 +02:00
Csaba Kiraly
fb8d2298b6
eth: do not warn on switching from snap sync to full sync (#32900)
Some checks are pending
/ 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
This happens normally after a restart, so it is better to use Info level
here.

Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
2025-10-14 11:03:31 +08:00
Csaba Kiraly
00f6f2b32f
eth/catalyst: remove useless log on enabling Engine API (#32901) 2025-10-14 11:01:43 +08:00
Lewis
bc0a21a1d5
eth/filters: uninstall subscription in filter apis on error (#32894)
Fix https://github.com/ethereum/go-ethereum/issues/32893.

In the previous https://github.com/ethereum/go-ethereum/pull/32794, it
only handles the pending tx filter, while there are also head and log
filters. This PR applies the patch to all filter APIs and uses `defer`
to maintain code consistency.
2025-10-13 13:10:44 +02:00
10gic
659342a523
ethclient: add SubscribeTransactionReceipts (#32869)
Some checks failed
/ Linux Build (push) Has been cancelled
/ Linux Build (arm) (push) Has been cancelled
/ Windows Build (push) Has been cancelled
/ Docker Image (push) Has been cancelled
Add `SubscribeTransactionReceipts` for ethclient. This is a complement
to https://github.com/ethereum/go-ethereum/pull/32697.
2025-10-10 11:47:33 +02:00
cui
ed264a1f19
eth/protocols/snap: optimize incHash (#32748) 2025-10-10 13:48:25 +08:00
10gic
11208553dd
eth/filters: add transactionReceipts subscription (#32697)
Some checks are pending
/ 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
- Introduce a new subscription kind `transactionReceipts` to allow clients to
  receive transaction receipts over WebSocket as soon as they are available.
- Accept optional `transactionHashes` filter to subscribe to receipts for specific
  transactions; an empty or omitted filter subscribes to all receipts.
- Preserve the same receipt format as returned by `eth_getTransactionReceipt`.
- Avoid additional HTTP polling, reducing RPC load and latency.

---------

Co-authored-by: Sina Mahmoodi <itz.s1na@gmail.com>
2025-10-09 14:14:53 +02:00
CertiK
a1b8e4880d
eth/filters: terminate pending tx subscription on error (#32794)
Some checks are pending
/ 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
Fixes issue #32793. When the pending tx subscription ends, the filter
is removed from `api.filters`, but it is not terminated. There is no other 
way to terminate it, so the subscription will leak, and potentially block
the producer side.
2025-10-09 11:34:30 +02:00
Nicolas Gotchac
064ab701ea
eth/protocols/eth: use BlockChain interface in Handshake (#32847) 2025-10-08 12:50:03 +02:00
hero5512
fc8c8c1314
core: refactor StateProcessor to accept ChainContext interface (#32739)
This pr implements https://github.com/ethereum/go-ethereum/issues/32733
to make StateProcessor more customisable.

## Compatibility notes

This introduces a breaking change to users using geth EVM as a library.
The `NewStateProcessor` function now takes one parameter which has the
chainConfig embedded instead of 2 parameters.
2025-10-02 14:34:06 +02:00
Yuan-Yao Sung
9986270fbf
eth/catalyst: extend payloadVersion support to osaka/post-osaka forks (#32800)
This PR updates the `payloadVersion` function in `simulated_beacon.go`
to handle additional following forks used during development and testing
phases after Osaka.

This change ensures that the simulated beacon correctly resolves the
payload version for these forks, enabling consistent and valid execution
payload handling during local testing or simulation.
2025-09-30 19:30:10 +08:00
Delweng
265db06242
eth/catalyst: check osaka in engine_getBlobsV1 (#32731)
ref
https://github.com/ethereum/execution-apis/blob/main/src/engine/osaka.md#cancun-api

> Client software MUST return -38005: Unsupported fork error if the
Osaka fork has been activated.

---------

Signed-off-by: Delweng <delweng@gmail.com>
Co-authored-by: rjl493456442 <garyrong0905@gmail.com>
2025-09-29 11:56:39 +02:00
Dragan Milic
c984d9086e
eth/tracers/native: add keccak256preimage tracer (#32569)
Some checks are pending
/ 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
Introduces a new tracer which returns the preimages
of evm KECCAK256 hashes.

See #32570.

---------

Co-authored-by: Sina M <1591639+s1na@users.noreply.github.com>
Co-authored-by: Sina Mahmoodi <itz.s1na@gmail.com>
2025-09-26 18:05:27 +02:00
Delweng
bacc1504ba
core/txpool: add eip2681 check for incoming transactions (#32726)
Some checks are pending
/ 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
2025-09-25 13:15:12 +02:00