Commit graph

16614 commits

Author SHA1 Message Date
Archkon
57f84866bc
params: fix wrong comment (#33503)
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
It seems that the comment for CopyGas was wrongly associated to
SloadGas.
2025-12-29 13:57:29 +01:00
oooLowNeoNooo
b9702ed27b
console/prompt: use PromptInput in PromptConfirm method (#33445)
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-12-29 16:23:51 +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
Csaba Kiraly
27b3a6087e
core/txpool/blobpool: fix slotter size limit (#33474)
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
Blobs are stored per transaction in the pool, so we need billy to handle
up to the per-tx limit, not to the per-block limit.

The per-block limit was larger than the per-tx limit, so it not a bug,
we just created and handled a few billy files for no reason.

Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
2025-12-24 09:44:17 +08:00
Rizky Ikwan
2e5cd21edf
graphql: add nil check in block resolver (#33225)
Some checks failed
/ Keeper Build (push) Has been cancelled
/ Windows Build (push) Has been cancelled
/ Docker Image (push) Has been cancelled
/ Linux Build (push) Has been cancelled
/ Linux Build (arm) (push) Has been cancelled
Add nil checks for header and block in Block resolver methods to prevent
panic when querying non-existent blocks.
2025-12-19 12:29:41 +01: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
0xFloki
5dfcffcf3c
tests/fuzzers: remove unused field from kv struct in rangeproof fuzzer (#33447)
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
Removes the unused `t bool` field from the `kv` struct in the rangeproof fuzzer.
2025-12-19 09:13:00 +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
rjl493456442
ffe9dc97e5
core: add code read statistics (#33442)
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-12-18 17:24:02 +08: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
Ng Wei Han
15f52a2937
core/state: fix code existence not marked correctly (#33415)
When iterating over a map with value types in Go, the loop variable is a
copy. In `markCodeExistence`, assigning to `code.exists` modified only
the local copy, not the actual map entry, causing the existence flag to
always remain false.

This resulted in overcounting contract codes in state size statistics,
as codes that already existed in the database were incorrectly counted
as new.

Fix by changing `codes` from `map[common.Address]contractCode` to
`map[common.Address]*contractCode`, so mutations apply directly to the
struct.
2025-12-15 13:54:26 +08:00
Galoretka
e20b05ec7f
core/overlay: fix incorrect debug log key/value in LoadTransitionState (#32637)
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
2025-12-14 21:51:13 +01:00
David Klank
a9eaf2ffd8
crypto/signify: fix fuzz test compilation (#33402)
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 fuzz test file has been broken for a while - it doesn't compile with
the `gofuzz` build tag.

Two issues:
- Line 59: called `SignifySignFile` which doesn't exist (should be
`SignFile`)
- Line 71: used `:=` instead of `=` for already declared `err` variable
2025-12-13 12:09:07 +08:00
Daniel Liu
3a5560fa98
core/state: make test output message readable (#33400) 2025-12-13 11:27:00 +08:00
Rizky Ikwan
16f50285b7
cmd/utils: fix DeveloperFlag handling when set to false (#33379)
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
geth --dev=false now correctly respects the false value, instead of
incorrectly enabling UseLightweightKDF.
2025-12-12 13:46:53 +08:00
yyhrnk
472e3a24ac
core/stateless: cap witness depth metrics buckets (#33389)
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-12-11 15:42:32 +08: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
Delweng
1b702f71d9
triedb/pathdb: use copy instead of append to reduce memory alloc (#33044)
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-12-11 09:37:16 +08:00
Bashmunta
b98b255449
core/rawdb: fix size counting in memory freezer (#33344)
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
2025-12-10 16:09:24 +08:00
kurahin
13a8798fa3
p2p/tracker: fix head detection in Fulfil to avoid unnecessary timer reschedules (#33370) 2025-12-10 16:09:07 +08:00
SashaMalysehko
1ce71a1895
eth/tracers/native: include SWAP16 in default ignored opcodes (#33381) 2025-12-10 15:13:47 +08:00
Fibonacci747
215ee6ac18
internal/ethapi: select precompiles using the simulated header (#33363)
The simulator computed active precompiles from the base header, which is
incorrect when simulations cross fork boundaries. This change selects
precompiles using the current simulated header so the precompile set
matches the block’s number/time. It brings simulate in line with doCall,
tracing, and mining, and keeps precompile state overrides applied on the
correct epoch set.
2025-12-10 14:56:56 +08:00
jwasinger
c21fe5475f
tests: integrate BlockTest.run into BlockTest.Run (#33383) 2025-12-10 14:26:27 +08:00
Ng Wei Han
9a346873b8
core/state: fix incorrect contract code state metrics (#33376)
## Description
This PR fixes incorrect contract code state metrics by ensuring
duplicate codes are not counted towards the reported results.

## Rationale
The contract code metrics don't consider database deduplication. The
current implementation assumes that the results are only **slightly
inaccurate**, but this is not true, especially for data collection
efforts that started from the genesis block.
2025-12-10 11:33:59 +08:00
wit liu
e58c785424
build: fix check_generate not printing changed files (#33299)
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
Fixes an issue where HashFolder skipped the root directory upon hitting
the first file in the excludes list. This happened because the walk function
returned SkipDir even for regular files.
2025-12-08 22:58:26 +01: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
Francisco Giordano
66134b35df
core/vm: fix PC increment for EIP-8024 opcodes (#33361)
The EIP says to increment PC by 2 _instead of_ the standard increment by
1. The opcode handlers added in #33095 result in incrementing PC by 3,
because they ignored the increment already present in `interpreter.go`.

Does this need to be better specified in the EIP? I've added a [new test
case](https://github.com/ethereum/EIPs/pull/10859) for it anyway.

Found by @0xriptide.
2025-12-08 17:45:40 +01:00
cui
31f9c9ff75
common/bitutil: deprecate XORBytes in favor of stdlib crypto/subtle (#33331)
XORBytes was added to package crypto/subtle in Go 1.20, and it's faster 
than our bitutil.XORBytes. There is only one use of this function
across go-ethereum so we can simply deprecate the custom implementation.

---------

Co-authored-by: Felix Lange <fjl@twurst.com>
2025-12-08 17:40:59 +01:00
Snezhkko
af47d9b472
p2p/nat: fix err shadowing in UPnP addAnyPortMapping (#33355)
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 random-port retry loop in addAnyPortMapping shadowed the err
variable, causing the function to return (0, nil) when all attempts
failed. This change removes the shadowing and preserves the last error
across both the fixed-port and random-port retries, ensuring failures
are reported to callers correctly.
2025-12-08 15:02:24 +01:00
rjl493456442
dbca85869f
ethdb/pebble: change the Pebble database configuration (#33353)
This PR changes the Pebble configurations as below:

- increase the MemTableStopWritesThreshold for handling temporary spike
- decrease the L0CompactionConcurrency and CompactionDebtConcurrency to
scale up compaction readily
2025-12-08 13:53:40 +01:00
David Klank
e63e37be5e
core/filtermaps: fix operator precedence in delete logging condition (#33280)
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 original condition `deleted && !logPrinted || time.Since(...)` was
incorrectly grouping due to operator precedence, causing logs to print
every 10 seconds even when no deletion was happening (deleted=false).

According to SafeDeleteRange documentation, the 'deleted' parameter is
"true if entries have actually been deleted already". The logging should
only happen when deletion is active.

Fixed by adding parentheses: `deleted && (!logPrinted ||
time.Since(...))`Now logs print only when items are being deleted AND
either it's the first log or 10+ seconds have passed since the last one.
2025-12-06 04:21:38 +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
Felix Lange
657c99f116
beacon/types: update for fulu (#33349)
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
Should fix decoding JSON blocks in the Fulu fork. This diff was missing
from https://github.com/ethereum/go-ethereum/pull/33349.
2025-12-03 23:17:19 +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
d3679c2f2e
core/state: export statistics to metrics (#33254)
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
This PR exposes the state size statistics to the metrics, making them
easier to demonstrate.

Note that the contract code included in the metrics is not
de-duplicated, so the reported size
will appear larger than the actual storage footprint.
2025-12-02 16:28:51 +01:00
rjl493456442
212967d0e1
ethdb/pebble: add configuration changes (#33315)
This introduces two main changes to Pebble's configuration:

(a) Remove the Bloom filter at Level 6

The Bloom filter is never used at the bottom-most level, so keeping it
serves no purpose. Removing it saves storage without affecting read
performance.

(b) Re-enable read-sampling compaction

Read-sampling compaction was previously disabled in the hash-based
scheme because all data was identified by hashes and basically no data
overwrite. Read sampling compaction makes no sense.

After switching to the path-based scheme, data overwrites are much more
common, making read-sampling compaction beneficial and reasonable to re-enable.
2025-12-02 16:19:20 +01:00
cui
be94ea1c40
cmd/utils: fix handling of boolean flags when they are set to false (#33338)
geth --nodiscover=false  
may result in ctx.IsSet(NoDiscoverFlag.Name) is true, but cfg.
NoDiscovery should be false, not true.
2025-12-02 07:11:56 -08: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
Fallengirl
da3822dcec
internal/debug: fix log memory limit format (#33336)
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
2025-12-01 21:50:03 +08:00
Forostovec
6f2cbb7a27
triedb/pathdb: allow single-element history ranges (#33329)
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-12-01 10:19:21 +08:00
cui
cd3f9b24e9
cmd/utils: fix disabling cache preimages through config file (#33330) 2025-12-01 10:12:59 +08: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
lightclient
f12f0ec0cd
cmd/utils: allow --networkid to override other config options (#32999)
Recently in #31630 we removed support for overriding the network id in
preset networks. While this feature is niche, it is useful for shadow
forks. This PR proposes we add the functionality back, but in a simpler
way.

Instead of checking whether the flag is set in each branch of the
network switch statement, simply apply the network flag after the switch
statement is complete. This retains the following behavior:

1. Auto network id based on chain id still works, because `IsSet` only
returns true if the flag is _actually_ set. Not if it just has a default
set.
2. The preset networks will set their network id directly and only if
the network id flag is set is it overridden. This, combined with the
override genesis flag is what allows the shadow forks.
3. Setting the network id to the same network id that the preset _would
have_ set causes no issues and simply emits the `WARN` that the flag is
being set explicitly. I don't think people explicitly set the network id
flag often.

```
WARN [10-22|09:36:15.052] Setting network id with flag             id=10
```

---------

Co-authored-by: Felix Lange <fjl@twurst.com>
2025-11-28 15:24:21 +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
Felix Lange
a122dbe459
internal/ethapi: return error code -32602 for invalid storage key (#33282)
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 was found because other clients are failing RPC tests generated by
Geth. Nethermind and Besu return the correct error code, -32602, in this
situation.
2025-11-28 11:28:31 +01:00
Bhargava Shastry
fed8e09ab0
cmd/evm: add stdin support to blocktest command (#32824)
Enable blocktest to read filenames from stdin when no path argument is
provided, matching the existing statetest behavior. This allows
efficient batch processing of blockchain tests.

Usage:
- Single file: evm blocktest <path>
- Batch mode: find tests/ -name "*.json" | evm blocktest

---------

Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: MariusVanDerWijden <m.vanderwijden@live.de>
Co-authored-by: Felix Lange <fjl@twurst.com>
2025-11-28 11:22:36 +01:00
cui
f691d661c4
cmd/utils: fix disabling discovery through config file (#33279)
No matter what value of P2P.DiscoveryV4 or DiscoveryV5 is set in config file,
it will be overwritten by the CLI flag, even if the flag is not set. This fixes it
to apply the flag only if set.
2025-11-28 10:52:21 +01:00