Commit graph

15988 commits

Author SHA1 Message Date
MariusVanDerWijden
e17f97a824 core/vm: increase cost when exp is > 32bit 2025-06-03 22:50:13 +02:00
MariusVanDerWijden
07321c6d9c core/vm: fix cherry-picking 2025-05-23 08:36:51 +02:00
MariusVanDerWijden
00f0d218d4 core/vm: fix cherry-picking 2025-05-22 16:50:39 +02:00
Jared Wasinger
c6d3851277 core/vm: implement EIP 7823 - Set upper bounds for MODEXP 2025-05-22 16:48:19 +02:00
Jared Wasinger
b857df1cb9 add scaffolding for Osaka precompiles. Make it more explicit when 7883 is/isn't enabled in tests. 2025-05-21 17:22:21 +02:00
Jared Wasinger
886186ac8b add test cases from the EIP 2025-05-21 17:22:21 +02:00
Jared Wasinger
f33415ec73 revert tests submodule change 2025-05-21 17:22:21 +02:00
Jared Wasinger
e8d13ca9fb core/vm: implement eip 7883 (modexp repricing) 2025-05-21 17:22:21 +02:00
Marius van der Wijden
6b3c85964e params: add bpo forks 2025-05-21 17:19:20 +02:00
Marius van der Wijden
c192c9dc08 eth/catalyst: implement getBlobsV2 2025-05-21 17:03:22 +02:00
Marius van der Wijden
42655146e0 eth/catalyst: allow cancun payloads 2025-05-21 16:57:17 +02:00
wellna
0287666b7d
eth/tracers: Improve test coverage for toWord (#31846)
Some checks are pending
i386 linux tests / Lint (push) Waiting to run
i386 linux tests / build (push) Waiting to run
2025-05-21 14:20:36 +02:00
Marius van der Wijden
a4959685a2
eth/catalyst: move witness methods from engine api (#31867)
No functional changes, just moves the witness methods into its own file
2025-05-21 11:53:29 +02:00
Marius van der Wijden
63740b7aca
core/state: reduce allocation in updateStateObject (#31861)
Some checks are pending
i386 linux tests / Lint (push) Waiting to run
i386 linux tests / build (push) Waiting to run
Optimize updateStateObject to reduce an allocation.
2025-05-20 18:31:01 +02:00
shahafn
62aa6b2621
eth/tracers/native: add erc7562 tracer (#31006)
Some checks are pending
i386 linux tests / Lint (push) Waiting to run
i386 linux tests / build (push) Waiting to run
This PR introduces a new native tracer for AA bundlers. Bundlers participating in the alternative
mempool will need to validate userops. This tracer will return sufficient information for them to
decide whether griefing is possible. Resolves #30546

---------

Co-authored-by: Sina M <1591639+s1na@users.noreply.github.com>
2025-05-20 15:38:33 +02:00
steven
e4a8ecb947
core/txpool/legacypool: fix flaky test TestAllowedTxSize #30975 (#31836)
Some tests involving transactions near the txMaxSize limit were flaky.
This was due to ECDSA signatures occasionally having leading zeros,
which are omitted during RLP encoding — making the final transaction
size 1 byte smaller than expected.

To address this, a new helper function pricedDataTransactionWithFixedSignature
was added. It ensures both r and s are exactly 32 bytes (i.e., no leading zeros),
producing transactions with deterministic size.
2025-05-20 14:57:01 +02:00
VolodymyrBg
24771fdba4
README: update broken JSON-RPC API documentation link (#31860)
I've updated the broken link to point to the current official Ethereum
JSON-RPC API documentation at
https://ethereum.org/en/developers/docs/apis/json-rpc/. This is the
correct and up-to-date location for the Ethereum Execution Layer APIs
documentation. The link should now work properly.
2025-05-20 16:04:37 +08:00
James Niken
a67ea0c57d
internal/reexec: fix broken link to Docker/Moby in comment (#31859)
Hey team—noticed a dead link, replaced it with a working URL

https://github.com/moby/moby/blob/master/pkg/reexec/reexec.go - old link

https://github.com/moby/moby/blob/master/pkg/reexec/reexec_deprecated.go
- new link
2025-05-20 15:58:00 +08:00
Zhou
33c5031a2e
internal: remove eth_{compile,getWork,submitWork} from console (#31856)
Some checks are pending
i386 linux tests / Lint (push) Waiting to run
i386 linux tests / build (push) Waiting to run
The `compile` and `eth_getWork` `eth_submitWork` apis were not available
anymore, so try to remove them
2025-05-19 15:55:17 +02:00
Csaba Kiraly
e79177d1bc
cmd/utils: remove duplicate code for influxDB tags (#31854)
Some checks are pending
i386 linux tests / Lint (push) Waiting to run
i386 linux tests / build (push) Waiting to run
remove duplicate code

Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
2025-05-19 12:56:12 +02:00
maskpp
0867c24662
trie: use common.Hash as the key in secKeyCache map (#31786)
Some checks are pending
i386 linux tests / Lint (push) Waiting to run
i386 linux tests / build (push) Waiting to run
2025-05-19 10:03:59 +08:00
Zhou
15057e7f7f
core: don't emit the warning of log indexing if the db was not initialized (#31845) 2025-05-19 09:59:35 +08:00
Felix Lange
85ae3e16f1
cmd/devp2p/internal/ethtest: tests for BlockRangeUpdate (#31843)
Some checks are pending
i386 linux tests / Lint (push) Waiting to run
i386 linux tests / build (push) Waiting to run
I added a test for BlockRangeUpdate in #29158 but forgot to enable it.
Here I'm adding two more tests for it. Also applied a small refactoring
to combine calls to `dial()` and `peer()` into a single function, since
these two calls are duplicated in each test.
2025-05-18 10:25:16 +02:00
maskpp
c8be0f9a74
eth: use headers in debug.GetModifiedAccountsBy* (#31765)
Small optimization in debug_getModifiedAccountsBy* to avoid fetching block body.
2025-05-16 19:35:17 +02:00
Marius van der Wijden
7e79254605
eth/protocols/eth: implement eth/69 (#29158)
This PR implements eth/69. This protocol version drops the bloom filter
from receipts messages, reducing the amount of data needed for a sync
by ~530GB (2.3B txs * 256 byte) uncompressed. Compressed this will
be reduced to ~100GB

The new version also changes the Status message and introduces the
BlockRangeUpdate message to relay information about the available history
range.

---------

Co-authored-by: Felix Lange <fjl@twurst.com>
2025-05-16 17:10:47 +02:00
rjl493456442
892a661ee2
core, triedb/pathdb: final integration (snapshot integration pt 5) (#30661)
In this pull request, snapshot generation in pathdb has been ported from 
the legacy state snapshot implementation. Additionally, when running in 
path mode, legacy state snapshot data is now managed by the pathdb
based snapshot logic.

Note: Existing snapshot data will be re-generated, regardless of whether 
it was previously fully constructed.
2025-05-16 18:29:38 +08:00
Sina M
57e985ecab
cmd/utils: remove deprecated LES flags (#31838)
They were not widely used in users setups.
2025-05-16 10:20:36 +02:00
Marius Kjærstad
1f175347c4
build: upgrade -dlgo version to Go 1.24.3 (#31774)
New security fix: https://groups.google.com/g/golang-announce/c/UZoIkUT367A
2025-05-15 22:54:18 +02:00
Felix Lange
3ceec0ea9b
cmd/geth, internal/era/eradl: add era1 downloader tool (#31823)
This adds a geth subcommand for downloading era1 files and placing them into
the correct location. The tool can be used even while geth is already running
on the datadir. Downloads are checked against a hard-coded list of checksums
for mainnet and sepolia.

```
./geth download-era --server $SERVER --block 333333
./geth download-era --server $SERVER --block 333333-444444
./geth download-era --server $SERVER --epoch 0-10
./geth download-era --server $SERVER --all
```

The implementation reuses the file downloader we already had for
fetching build tools. I've done some refactoring on it to make sure it
can support the new use case, and there are some changes to the build
here as well.
2025-05-15 22:53:26 +02:00
Charlotte
85b26f3d68
AUTHORS, .mailmap: update name and email attribution (#31624) 2025-05-15 21:55:38 +02:00
Guillaume Ballet
af9a3a1a03
core/state, core/vm: update stateless gas costs to follow the verkle-gen-7 testnet (#31014)
Adding values to the witness introduces a new class of issues for
computing gas: if there is not enough gas to cover adding an item to the
witness, then the item should not be added to the witness.

The problem happens when several items are added together, and that
process runs out of gas. The witness gas computation needs a way to
signal that not enough gas was provided. These values can not be
hardcoded, however, as they are context dependent, i.e. two calls to the
same function with the same parameters can give two different results.

The approach is to return both the gas that was actually consumed, and
the gas that was necessary. If the values don't match, then a witness
update OOG'd. The caller should then charge the `consumed` value
(remaining gas will be 0) and error out.

Why not return a boolean instead of the wanted value? Because when
several items are touched, we want to distinguish which item lacked gas.

---------

Signed-off-by: Guillaume Ballet <3272758+gballet@users.noreply.github.com>
2025-05-15 20:43:52 +08:00
Felix Lange
228803c1a2
p2p/enode: add support for naming iterator sources (#31779)
This adds support for naming the source iterators of FairMix, like so:

  mix.AddSource(enode.WithSourceName("mySource", iter))

The source that produced the latest node is returned by the new NodeSource method.
2025-05-15 14:17:58 +02:00
maskpp
52dbd206bb
cmd/utils: always record preimages in dev mode (#31821)
Fix a todo: force-enable this in --dev mode

---------

Co-authored-by: jwasinger <j-wasinger@hotmail.com>
2025-05-15 15:32:20 +08:00
Marius van der Wijden
16b0d9e982
eth/catalyst: refactor engine api checks (#31182)
This PR contains three refactors:
- refactor the latest fork check that we use quite extensively 
- refactor the nil checks in NewPayloads

---------

Co-authored-by: lightclient <lightclient@protonmail.com>
2025-05-14 08:50:02 -06:00
Delweng
88a7ef233a
core: use unix time to check fork readiness (#31800) 2025-05-14 09:26:08 +08:00
maskpp
c53db5e1f6
eth: fix returned blockContext for empty blocks in stateAtTransaction (#31768)
Co-authored-by: lightclient <lightclient@protonmail.com>
2025-05-13 15:28:16 +02:00
wellna
2cd5f22037
crypto/kzg4844: use package github.com/crate-crypto/go-eth-kzg (#31806)
I saw in https://github.com/ethereum/go-ethereum/pull/31378 introduced
github.com/crate-crypto/go-eth-kzg to calculate the kzg hash, and
github.com/crate-crypto/go-kzg-4844 was only used in the test files, so
propose to drop it with go-eth-kzg instead
2025-05-13 14:11:27 +02:00
SHADOW
c7bdf6b2fe
accounts/abi/abigen: remove unnecessary test files (#31804)
fix #31793: resolve conflict markers in structs-abi.go.txt
2025-05-12 11:31:48 +02:00
Klimov Sergey
d121c27ace
core/state: fix incorrect description of function behavior (#31809) 2025-05-12 15:41:24 +08:00
rjl493456442
098cc7e878
ethdb/pebble: expose stall counter of pebble (#31782)
This pull request adds a more Pebble metrics, tracking the amount of
write stalls with specific reasons
2025-05-12 14:37:01 +08:00
Marcel
fa86416ce9
metrics: add chain/mgasps to track gas usage rate (#31753)
This adds a metric called `chain/mgasps`, which records how many million
gas per second are being used during block insertion.

The value is calculated as `usedGas * 1000 / elapsed`, and it's updated
in the `insertStats.report` method. Also cleaned up the log output to
reuse the same value instead of recalculating it.

Useful for monitoring block processing throughput.

---------

Co-authored-by: Gary Rong <garyrong0905@gmail.com>
2025-05-10 08:27:27 +08:00
Satoshi Is Here
0db99f4e40
core/types: reduce allocations in tx.EffectiveGasTip (#31598)
This PR introduces an allocation-free version of the
Transaction.EffectiveGasTip method to improve performance by reducing
memory allocations.

## Changes
- Added a new `EffectiveGasTipInto` method that accepts a destination
parameter to avoid memory allocations
- Refactored the existing `EffectiveGasTip` method to use the new
allocation-free implementation
- Updated related methods (`EffectiveGasTipValue`, `EffectiveGasTipCmp`,
`EffectiveGasTipIntCmp`) to use the allocation-free approach
- Added tests and benchmarks to verify correctness and measure
performance improvements

## Motivation
In high-transaction-volume environments, the `EffectiveGasTip` method is
called frequently. Reducing memory allocations in this method decreases
garbage collection pressure and improves overall system performance.

## Benchmark Results

As-Is
BenchmarkEffectiveGasTip/Original-10 42089140 27.45 ns/op 8 B/op 1
allocs/op

To-Be
BenchmarkEffectiveGasTip/IntoMethod-10 72353263 16.73 ns/op 0 B/op 0
allocs/op


## Summary of Improvements
- **Performance**: ~39% faster execution (27.45 ns/op → 16.73 ns/op)
- **Memory**: Eliminated all allocations (8 B/op → 0 B/op)
- **Allocation count**: Reduced from 1 to 0 allocations per operation

This optimization follows the same pattern successfully applied to other
methods in the codebase, maintaining API compatibility while improving
performance.

## Safety & Compatibility
This optimization has no side effects or adverse impacts because:
- It maintains functional equivalence as confirmed by comprehensive
tests
- It preserves API compatibility with existing callers
- It follows clear memory ownership patterns with the destination
parameter
- It maintains thread safety by only modifying the caller-provided
destination parameter

This optimization follows the same pattern successfully applied to other
methods in the codebase, providing better performance without
compromising stability or correctness.

---------

Co-authored-by: lightclient <lightclient@protonmail.com>
2025-05-09 12:56:00 +02:00
Marius van der Wijden
0eb2eeea90
all: create global hasher pool (#31769)
This PR creates a global hasher pool that can be used by all packages.
It also removes a bunch of the package local pools.

It also updates a few locations to use available hashers or the global
hashing pool to reduce allocations all over the codebase.
This change should reduce global allocation count by ~1%

---------

Co-authored-by: Gary Rong <garyrong0905@gmail.com>
2025-05-09 13:52:40 +08:00
rjl493456442
485ff4bbff
core: implement in-block prefetcher (#31557)
This pull request enhances the block prefetcher by executing transactions 
in parallel to warm the cache alongside the main block processor.

Unlike the original prefetcher, which only executes the next block and
is limited to chain syncing, the new implementation can be applied to any 
block. This makes it useful not only during chain sync but also for regular 
block insertion after the initial sync.


---------

Co-authored-by: Marius van der Wijden <m.vanderwijden@live.de>
2025-05-08 22:28:16 +08:00
rjl493456442
0f48cbf017
core, triedb/pathdb: bail out error if write state history fails (#31781)
This PR fixes an issue that could lead to data corruption.

Writing the state history may fail due to insufficient disk space or
other potential errors. With this change, the entire state insertion 
will be aborted instead of silently ignoring the error.

Without this fix, state transitions would continue while the associated
state history is lost. After a restart, the resulting gap would be detected, 
making recovery impossible.
2025-05-08 22:27:01 +08:00
maskpp
6bc57579d1
core/types: delete unused test variable (#31776)
Delete the unused `Account.PrivateKey` variable.
2025-05-08 15:21:48 +02:00
rjl493456442
181dd2e660
cmd/geth, internal: fix flaky console tests (#31784)
This pull request bumps the timeout for flaky console tests on appveyor.
2025-05-08 15:15:36 +02:00
rjl493456442
10519768a2
core, ethdb: introduce database sync function (#31703)
This pull request introduces a SyncKeyValue function to the
ethdb.KeyValueStore
interface, providing the ability to forcibly flush all previous writes
to disk.

This functionality is critical for go-ethereum, which internally uses
two independent
database engines: a key-value store (such as Pebble, LevelDB, or
memoryDB for
testing) and a flat-file–based freezer. To ensure write-order
consistency between
these engines, the key-value store must be explicitly synced before
writing to the
freezer and vice versa.

Fixes 
- https://github.com/ethereum/go-ethereum/issues/31405
- https://github.com/ethereum/go-ethereum/issues/29819
2025-05-08 19:10:26 +08:00
JukLee0ira
07d073bc5a
internal/web3ext: remove the legacy backtraceAt method (#31783)
The function `BacktraceAt` has been removed in #28187 . But the API
end-point `debug_backtraceAt` is not removed from the file
`internal/web3ext/web3ext.go`.
2025-05-08 14:57:17 +08:00
Csaba Kiraly
0d5de826da
p2p: add metrics for inbound connection errors (#31652)
Add metics detailing reasons we reject inbound connections for, and
reasons these connections fail during the handshake.
2025-05-07 15:34:52 +02:00