Conversation
ff6e518 to
c192c9d
Compare
| log.Warn("Encountered Version 0 transaction post-Osaka, recompute proofs", "hash", ltx.Hash) | ||
| sidecar.Proofs = make([]kzg4844.Proof, 0) | ||
| for _, blob := range sidecar.Blobs { | ||
| cellProofs, err := kzg4844.ComputeCells(&blob) |
There was a problem hiding this comment.
When we pass the fork, as long as the prioritized blob transactions are v0, we will be computing cell proofs for each bob they contain.
I've benchmarked this and it's pretty slow: 200-300ms depending on the machine (i've tested my m2 mbp and a server machine I'm using to run a perfnet node).
Might be safer to just disallow mining v0 transactions after we've passed the fork , and also purge them from the blobpool.
There was a problem hiding this comment.
Yes that is kinda expected. Other clients are just dropping the transactions, but I think we should recompute the proofs. Its still within the limits that we can do it for a bit and only the block producing machine will have to do it. I think we should take the high route and not invalidate the valid transactions at the fork point
There was a problem hiding this comment.
As part of this PR, we will need to update the billy shelf "slotter" to consider the size of cell proofs after the fork. I'm not sure how complex it would be to accommodate both v0/v1 transactions, but IMO it helps support the case for purging v0 transactions at the fork block.
There was a problem hiding this comment.
Yep you're right. The current slotter will create shelves of the following sizes:
| level | size |
|---|---|
| 0 | 4096 |
| 1 | 135168 |
| 2 | 266240 |
| 3 | 397312 |
| 4 | 528384 |
| 5 | 659456 |
| 6 | 790528 |
| 7 | 921600 |
| 8 | 1052672 |
| 9 | 1183744 |
| 10 | 1314816 |
| 11 | 1445888 |
| 12 | 1576960 |
| 13 | 1708032 |
| 14 | 1839104 |
RLP encoding a blob transaction with 300 byte of calldata will result in the following sizes:
| NumBlobs | pre | post |
|---|---|---|
| 0 | 372 | 372 |
| 1 | 131584 | 133105 |
| 2 | 262794 | 265833 |
| 3 | 394001 | 398559 |
| 4 | 525208 | 531285 |
| 5 | 656415 | 664011 |
| 6 | 787624 | 796738 |
| 10 | 1312453 | 1327643 |
| 14 | 1837281 | 1858547 |
| 20 | 2624523 | 2654903 |
So the size will not match up for transactions containing 4 blobs already.
There was a problem hiding this comment.
I added a change now to address this, it will result in the following level sizes for the slotter:
[4096 137216 270336 403456 536576 669696 802816 935936 1069056 1202176 1335296 1468416 1601536 1734656 1867776] Which at level 14 is ~8kb bigger than the encoded transaction with 300 byte of calldata. Since I expect bigger blob transactions to contain more calldata, I think thats the right way to go
There was a problem hiding this comment.
I need to test though whether we can easily change the slot size for existing nodes
There was a problem hiding this comment.
Turns out the shelves are named after their size, so we will just open new shelves and just not have the old transactions anymore
There was a problem hiding this comment.
Solution: just open a second v2 billy instance and migrate txs from the old one on startup. The txs will have an overhead with just empty space but it's OK.
There was a problem hiding this comment.
I've decided to remove the commits addressing this and do the slotter migration in a follow-up PR here: #31966
2842c13 to
3da6246
Compare
3da6246 to
79385a4
Compare
|
This might have broken getBlobsV1? seems like |
Fixes a regression introduced in #31791, see #31791 (comment)
|
Regression was fixed by #31992 |
This fixes a regression in the state tests where we always initialized the KZG library. This was added to test some stuff in #31791
Implements `engine_getBlobsV2` which is needed for PeerDAS. --------- Co-authored-by: Felix Lange <fjl@twurst.com>
Fixes a regression introduced in ethereum#31791, see ethereum#31791 (comment)
This fixes a regression in the state tests where we always initialized the KZG library. This was added to test some stuff in ethereum#31791
Implements `engine_getBlobsV2` which is needed for PeerDAS. --------- Co-authored-by: Felix Lange <fjl@twurst.com>
Fixes a regression introduced in ethereum#31791, see ethereum#31791 (comment)
This fixes a regression in the state tests where we always initialized the KZG library. This was added to test some stuff in ethereum#31791
As a consequence of moving blob sidecar version migration code around, we ended up building blocks with a mix of v0 and v1 blob transactions (different proof encoding in the sidecar). This PR makes sure we are not building illegal blocks after Osaka. Blob migration is left for another PR. Related issues and PRs: - #31791 - #32347 - #31966 - #32235 --------- Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
…32577) As a consequence of moving blob sidecar version migration code around, we ended up building blocks with a mix of v0 and v1 blob transactions (different proof encoding in the sidecar). This PR makes sure we are not building illegal blocks after Osaka. Blob migration is left for another PR. Related issues and PRs: - ethereum#31791 - ethereum#32347 - ethereum#31966 - ethereum#32235 --------- Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
* version: begin v1.15.12 release cycle
* go.mod: update pebble to v1.1.5 to reduce clutter in go.sum (#31541)
```
go get github.com/cockroachdb/pebble@v1.1.5
go mod tidy
```
Co-authored-by: lightclient <lightclient@protonmail.com>
* cmd/utils: don't allow network ID override if a preset network is specified (#31630)
* beacon/blsync: fix requests encoding in engine_newPayloadV4 (#31775)
This fixes an issue where blocks containing CL requests triggered an
error in the engine API. The encoding of requests used base64 instead of
hex.
* 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.
* 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`.
* 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
* cmd/geth, internal: fix flaky console tests (#31784)
This pull request bumps the timeout for flaky console tests on appveyor.
* core/types: delete unused test variable (#31776)
Delete the unused `Account.PrivateKey` variable.
* 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.
* 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>
* 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>
* 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>
* 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>
* 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
* core/state: fix incorrect description of function behavior (#31809)
* accounts/abi/abigen: remove unnecessary test files (#31804)
fix #31793: resolve conflict markers in structs-abi.go.txt
* 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
* eth: fix returned blockContext for empty blocks in stateAtTransaction (#31768)
Co-authored-by: lightclient <lightclient@protonmail.com>
* core: use unix time to check fork readiness (#31800)
* 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>
* 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>
* 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.
* 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>
* AUTHORS, .mailmap: update name and email attribution (#31624)
* 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.
* build: upgrade -dlgo version to Go 1.24.3 (#31774)
New security fix: https://groups.google.com/g/golang-announce/c/UZoIkUT367A
* cmd/utils: remove deprecated LES flags (#31838)
They were not widely used in users setups.
* 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.
* 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>
* eth: use headers in debug.GetModifiedAccountsBy* (#31765)
Small optimization in debug_getModifiedAccountsBy* to avoid fetching block body.
* cmd/devp2p/internal/ethtest: tests for BlockRangeUpdate (#31843)
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.
* core: don't emit the warning of log indexing if the db was not initialized (#31845)
* trie: use common.Hash as the key in secKeyCache map (#31786)
* cmd/utils: remove duplicate code for influxDB tags (#31854)
remove duplicate code
Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
* internal: remove eth_{compile,getWork,submitWork} from console (#31856)
The `compile` and `eth_getWork` `eth_submitWork` apis were not available
anymore, so try to remove them
* 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
* 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.
* 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.
* eth/tracers/native: add erc7562 tracer (#31006)
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>
* core/state: reduce allocation in updateStateObject (#31861)
Optimize updateStateObject to reduce an allocation.
* eth/catalyst: move witness methods from engine api (#31867)
No functional changes, just moves the witness methods into its own file
* eth/tracers: Improve test coverage for toWord (#31846)
* core/txpool: add explicit max blob count limit (#31837)
Fixes #31792.
---------
Co-authored-by: lightclient <lightclient@protonmail.com>
* build: Update EEST to v4.5.0 (#31880)
We deleted outdated pectra-devnet-6@v1.0.0 release by mistake, so this
PR updates the referenced EEST release to the correct latest version.
@s1na I removed the TODO comment because I think this solves it, unless
it meant something else.
---------
Co-authored-by: MariusVanDerWijden <m.vanderwijden@live.de>
* internal/era: update link to documentation (#31879)
Updated reference URL in accumulator.go comment to point to the correct
location of the historical-hashes-accumulator documentation in the
Ethereum portal network specs
* crypto: use pure Go signature implementation in tinygo (#31878)
tinygo is having problems compiling the C implementation
* consensus: remove clique RPC APIs (#31875)
* .gitea: add initial workflow file (#31885)
* .gitea: update release build actions (#31886)
Trying to make the docker build work.
* core/state: fix copy of storageChange (#31874)
Missing field origvalue when copying storageChange.
* .gitea: add cron build script (#31890)
Also swaps the push build scripts and adds environment output.
* internal/build: add support for Github Actions CI environment (#31891)
This adds support for the Github actions environment in the build tool.
Information from environment variables, like the build number and
branch/tag name, is used to make decisions about uploads and package
filenames.
* core: remove unused queued import status (#31870)
* core/vm: fix bls benchmark (#31896)
Fixes #31893
* triedb/pathdb: introduce lookup structure to optimize state access (#30971)
This pull request introduces a mechanism to improve state lookup
efficiency in pathdb by maintaining a lookup structure that eliminates
unnecessary iteration over diff layers.
The core idea is to track a mutation history for each dirty state entry
residing in the diff layers. This history records the state roots of all layers
in which the entry was modified, sorted from oldest to newest.
During state lookup, this mutation history is queried to find the most
recent layer whose state root either matches the target root or is a
descendant of it. This allows us to quickly identify the layer containing
the relevant data, avoiding the need to iterate through all diff layers from
top to bottom.
Besides, the overhead for state lookup is constant, no matter how many
diff layers are retained in the pathdb, which unlocks the potential to hold
more diff layers.
Of course, maintaining this lookup structure introduces some overhead.
For each state transition, we need to:
(a) update the mutation records for the modified state entries, and
(b) remove stale mutation records associated with outdated layers.
On our benchmark machine, it will introduce around 1ms overhead which is
acceptable.
* .gitea: adjust cron schedule (#31915)
This should make the scheduled build actually run.
* .gitea: add env to scheduled builds (#31918)
* .gitea: port more builds from travis and fix PPA env (#31919)
* .gitea: fix secrets passing (#31920)
* .gitea: fix apt update (#31921)
* .gitea: fix archive uploads and run PPA upload on release push (#31922)
* .gitea: fix arm64 build (#31923)
* .gitea: run release build on tag push (#31924)
* cmd/geth, cmd/utils: log prefunded account/key in ephemeral development mode (#31898)
This PR modifies the disclaimer/banner that is printed when starting up
Geth in dev mode:
* if the client is spun up in ephemeral dev mode with a keystore
override, the address of the first (prefunded) account is printed.
* if the client is spun up in ephemeral mode without a keystore
override, the genesis allocation contains a single static prefunded EOA
account. It's address and private key are logged.
* the banner is printed at the end of client initialization to make it
more prominent. Previously, it was logged towards the beginning of
client initialization and subsequent logging from startup filled the
terminal, pushing it out of view of the user.
Other change is that we now use a static prefunded dev account instead
of generating a random one when instantiating a new dev mode chain.
This is an example of what the banner looks like:
```
WARN [05-28|23:05:16.475] You are running Geth in --dev mode. Please note the following:
WARN [05-28|23:05:16.475]
WARN [05-28|23:05:16.475] 1. This mode is only intended for fast, iterative development without assumptions on
WARN [05-28|23:05:16.475] security or persistence.
WARN [05-28|23:05:16.475] 2. The database is created in memory unless specified otherwise. Therefore, shutting down
WARN [05-28|23:05:16.475] your computer or losing power will wipe your entire block data and chain state for
WARN [05-28|23:05:16.475] your dev environment.
WARN [05-28|23:05:16.475] 3. A random, pre-allocated developer account will be available and unlocked as
WARN [05-28|23:05:16.475] eth.coinbase, which can be used for testing. The random dev account is temporary,
WARN [05-28|23:05:16.475] stored on a ramdisk, and will be lost if your machine is restarted.
WARN [05-28|23:05:16.475] 4. Mining is enabled by default. However, the client will only seal blocks if transactions
WARN [05-28|23:05:16.475] are pending in the mempool. The miner's minimum accepted gas price is 1.
WARN [05-28|23:05:16.475] 5. Networking is disabled; there is no listen-address, the maximum number of peers is set
WARN [05-28|23:05:16.475] to 0, and discovery is disabled.
WARN [05-28|23:05:16.475]
WARN [05-28|23:05:16.475]
WARN [05-28|23:05:16.475] Running in ephemeral mode. The following account has been prefunded in the genesis:
WARN [05-28|23:05:16.475]
WARN [05-28|23:05:16.475] Account
WARN [05-28|23:05:16.475] ------------------
WARN [05-28|23:05:16.475] 0x71562b71999873db5b286df957af199ec94617f7 (10^49 ETH)
WARN [05-28|23:05:16.475]
WARN [05-28|23:05:16.475] Private Key
WARN [05-28|23:05:16.475] ------------------
WARN [05-28|23:05:16.475] 0xb71c71a67e1177ad4e901695e1b4b9ee17ae16c6668d313eac2f96dbcda3f291
WARN [05-28|23:05:16.475]
```
closes #31796
---------
Co-authored-by: jwasinger <j-wasinger@hotmail.com>
* .travis.yml: remove master branch push builds (#31927)
Release artefact building has been migrated to another system (Gitea),
so we can finally stop using Travis CI. However, in order to have a
fail-safe for the release, I'm leaving the config in and it will still
trigger builds on Travis for tagged releases. That way, if our new
system fails to work for the next release, we will still have the option
of using Travis.
* go.mod: bump flock package version (#31909)
The newer version has a stub implementation for unsupported targets,
which allows us to compile to more exotic targets.
* .gitea: modify scheduled workflow times (#31946)
* eth: return null for not-found in BlockByNumberOrHash (#31949)
This changes the API backend to return null for not-found blocks. This behavior
is required by the RPC When `BlockByNumberOrHash` always returned an error
for this case ever since being added in https://github.com/ethereum/go-ethereum/pull/19491.
The backend method has a couple of call sites, and all of them handle a `nil`
block result because `BlockByNumber` returns `nil` for not-found.
The only case where this makes a real difference is for `eth_getBlockReceipts`,
which was changed in #31361 to actually forward the error from `BlockByNumberOrHash`
to the caller.
* core/rawdb: integrate eradb backend for RPC (#31604)
This implements a backing store for chain history based on era1 files.
The new store is integrated with the freezer. Queries for blocks and receipts
below the current freezer tail are handled by the era store.
---------
Co-authored-by: Gary Rong <garyrong0905@gmail.com>
Co-authored-by: Felix Lange <fjl@twurst.com>
Co-authored-by: lightclient <lightclient@protonmail.com>
* core/filtermaps: remove filter base row cache, add group read (#31852)
This PR changes the database access of the base part of filter rows that
are stored in groups of 32 adjacent maps for improved database storage
size and data access efficiency.
Before this grouped storage was introduced, filter rows were not cached
because the access pattern of either the index rendering or the search
does not really benefit from caching. Also no mutex was necessary for
filter row access. Storing adjacent rows in groups complicated the
situation as a search typically required reading all or most of adjacent
rows of a group, so in order to implement the single row read operation
without having to read the entire group up to 32 times, a cache for the
base row groups was added. This also introduced data race issues for
concurrenct read/write in the same group which was avoided by locking
the `indexLock` mutex. Unfortunately this also led to slowed down or
temporarily blocked search operations when indexing was in progress.
This PR returns to the original concept of uncached, no-mutex filter map
access by increasing read efficiency in a better way; similiarly to
write operations that already operate on groups of filter maps, now
`getFilterMapRow` is also replaced by `getFilterMapRows` that accepts a
single `rowIndex` and a list of `mapIndices`. It slightly complicates
`singleMatcherInstance.getMatchesForLayer` which now has to collect
groups of map indices accessed in the same row, but in exchange it
guarantees maximum read efficiency while avoiding read/write mutex
interference.
Note: a follow-up refactoring is WIP that further changes the database
access scheme by prodiving an immutable index view to the matcher, makes
the whole indexer more straightforward with no callbacks, and entirely
removes the concept of matcher syncing with `validBlocks` and the
resulting multiple retry logic in `eth/filters/filter.go`. This might
take a bit longer to finish though and in the meantime this change could
hopefully already solve the blocked request issues.
* eth/catalyst: change warning to error for 'too many bad block attempts' (#31940)
This situation was failing quietly for me recently when I had a partial
data corruption issue. Changing the log level to Error would increase
visibility for me.
* eth/filters: fix pruned history error for genesis block (#31941)
Fixes an issue where querying logs for block ranges starting from 0 would fail with an irrelevant
error on a pruned node. Now the correct "history is pruned" error will be returned.
* metrics: disable CPU metrics on tinygo (#31953)
* eth/catalyst: use atomics instead of locks (#31955)
* accounts/abi: error when packing negative values in unsigned types (#31790)
This is an alternative approach to
https://github.com/ethereum/go-ethereum/pull/31607 , that doesn't break
backwards-compatibility with abigen.
Note that this does change the behavior of `Argument.Pack`: previously,
packing negative values for a `uint` parameter would cause them to be
represented in signed binary representation via two's complement. Now,
it will fail explicitly in this case.
However, I don't see a reason to support this functionality. The ABI
already explicitly supports signed integers. There's no reason that a
smart contract author would choose to store signed values in a `uint`
afaict.
---------
Co-authored-by: MariusVanDerWijden <m.vanderwijden@live.de>
* cmd/utils: update SepoliaFlag usage (#31961)
The Sepolia testnet has transitioned to pos following The Merge.
* eth/downloader: fix missing receipt (#31952)
This fixes a regression introduced by #29158 where receipts of empty blocks
were stored into the database as an empty byte array, instead of an RLP empty list.
Fixes #31938
---------
Co-authored-by: Felix Lange <fjl@twurst.com>
* core/vm: implement EIP 7823 - Set upper bounds for MODEXP (#31818)
* crypto/kzg4844: avoid copying blobs for marshaling (#31911)
LLVM is not able to handle large arrays on stack
* eth, p2p: improve dial speed by pre-fetching dial candidates (#31944)
This PR improves the speed of Disc/v4 and Disc/v5 based discovery by
adding a prefetch buffer to discovery sources, eliminating slowdowns
due to timeouts and rate mismatch between the two processes.
Since we now want to filter the discv4 nodes iterator, it is being removed
from the default discovery mix in p2p.Server. To keep backwards-compatibility,
the default unfiltered discovery iterator will be utilized by the server when
no protocol-specific discovery is configured.
---------
Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
Co-authored-by: Felix Lange <fjl@twurst.com>
* cmd/geth: fix era1 download location to match store (#31951)
This changes the era1 downloader to place the files into the correct
location where geth will actually use them. Also adds integration with
the new --datadir.era flag.
* core/vm: implement EIP 7883 - ModExp Gas Cost Increase (#31606)
https://eips.ethereum.org/EIPS/eip-7883
---------
Co-authored-by: MariusVanDerWijden <m.vanderwijden@live.de>
Co-authored-by: Felix Lange <fjl@twurst.com>
* eth/catalyst: implement getBlobsV2 (#31791)
Implements `engine_getBlobsV2` which is needed for PeerDAS.
---------
Co-authored-by: Felix Lange <fjl@twurst.com>
* ethdb/pebble: adjust the number of memory tables (#31970)
This pull request adjusts the number of allowed memory tables in Pebble.
Pebble allows configuring an arbitrary number of memory tables to hold
unflushed data. When the current memtable becomes full, it is scheduled
for flushing, and a new memtable is allocated to accept subsequent
writes. However, if too many memtables accumulate and are waiting to be
flushed, subsequent writes will stall.
Originally, only two memtables were configured, each with a size of 512
MB for Ethereum mainnet. While this setup works well under normal
conditions, it becomes problematic under heavy write loads. In such scenarios,
flushing is only triggered when more than 512 MB of data is pending, which may
not be responsive enough. Even worse, if compactions are running
concurrently, flushing memtables can become slow due to the heavy IO
overhead, leading to write stalls across the system.
This pull request tries to mitigate the performance degradation by having
more memory tables but with a smaller size. In this case, the pending
writes can be flushed more smoothly and responsively.
* eth: initialize blobTxPool (#31992)
Fixes a regression introduced in #31791, see
https://github.com/ethereum/go-ethereum/pull/31791#issuecomment-2955554641
* cmd/workload: introduce transaction-trace test (#31288)
This pull request introduces a new test suite in workload framework, for
transaction tracing.
**test generation**
`go run . tracegen --trace-tests trace-test.json http://host:8545`
and you can choose to store the trace result in a specific folder
`go run . tracegen --trace-tests trace-test.json --trace-output
./trace-result http://host:8545`
**test run**
`./workload test -run Trace/Transaction --trace-invalid ./trace-invalid
http://host:8545`
The mismatched trace result will be saved in the specific folder for
further investigation.
* params: enable osaka fork in MergedTestChainConfig (#31993)
* eth/filters: add timestamp to derived logs (#31887)
The block timestamp field is now added to the logs returned
by eth_getLogs.
* core/vm, cmd/evm: remove EOF (#32000)
With EOF removed from the Osaka fork, and no longer being tested, the
implementation will now just be bitrotting. I'm opting to remove it so
it doesn't get in the way of other changes.
* crypto/kzg4844: remove kzg initialization (#32017)
This fixes a regression in the state tests where we always initialized
the KZG library. This was added to test some stuff in #31791
* metrics: add chain/gas for cumulative gas usage (#32004)
This is a followup to #31753.
A cumulative counter is more useful when we need to measure / aggregate
the metric over a longer period of time. It also means we won't miss data,
e.g. our prometheus scrapes every 30 seconds, and so may miss a transient
spike in the pre-aggregated mgas/s.
---------
Co-authored-by: Gary Rong <garyrong0905@gmail.com>
* trie: no need to store preimage if not enabled (#32012)
As the preimage will only be stored if `t.preimages != nil`, so no need
to save them into local cache if not enabled. This will reduce the memory
wasted to copy the bytes
---------
Signed-off-by: jsvisa <delweng@gmail.com>
* metrics: remove use of reflect in metrics registration code (#31962)
Co-authored-by: Marius van der Wijden <m.vanderwijden@live.de>
* core/vm: implement updates to modexp gas cost changes in EIP-7883 (#32015)
Implements the updated gas cost changes introduced in
https://github.com/ethereum/EIPs/commit/5cdd75157d78522bde8dc58977717c14cd7f2789
* Makefile: add make evm (#32029)
* eth/tracers: flag for empty acounts in prestateTracer (#31855)
This PR introduces a flag that enables returning of newly created state
objects in the prestateTracer.
**Rationale**
Having this information is useful because local execution can more
easily distinguish between newly created objects and system contracts.
---------
Co-authored-by: Sina Mahmoodi <itz.s1na@gmail.com>
* crypto/bn256: default to gnark (#32024)
* go.mod: update gnark-crypto to v0.18.0 (#32034)
mainly to pull in https://github.com/Consensys/gnark-crypto/pull/693
* tracers/prestate: always remove empty accounts from pre-state (#31427)
The prestateTracer had the intention of excluding accounts that were
empty prior to execution from the prestate. This was being done only for
created contracts. This PR makes it so all such empty accounts are
excluded. This behavior is configurable using the `includeEmpty: true`
flag introduced in #31855.
---------
Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>
Co-authored-by: Sina Mahmoodi <itz.s1na@gmail.com>
* node: fix data race on httpConfig.prefix (#32047)
This fixes a data race when accessing the `httpConfig.prefix` field.
This field can be modified while the server is running through
`enableRPC`. The fix is storing the prefix in the handler, which is
accessed through the atomic pointer.
alternative to #32035
fixes https://github.com/ethereum/go-ethereum/issues/32019
* Revert "crypto/bn256: default to gnark (#32024)"
This reverts commit e0cf89ecfaa29b40dc548eec16e071242b40eedd.
* fix: skip storage entries with missing preimage keys (#32051)
When `GetKey` is called, a missing preimage can cause the function to return a `nil`
key. This, in turn, makes `account.Storage` persist an incorrect value.
* ethdb/pebble: lower the compaction debt (#31988)
This pull request reduces the threshold for triggering compaction at
level0, leading to less compaction debt. This change is helpful in the
case of heavy write-load, mitigating the case of heavy write stalls
caused by compaction.
closes https://github.com/ethereum/go-ethereum/issues/31830
* accounts: fix data race when closing manager (#31982)
Fixes a data race on the `wallets` slice when closing account Manager.
At the moment, there is a data race between a go-routine calling the
Manager's `Close` function and the background go-routine handling most
operations on the `Manager`. The `Manager`'s `wallets` field is accessed
without proper synchronization.
By moving the closing of wallets from the `Close()` function into the
background thread, this issue can be resolved.
* go.mod: bump golang.org/x/net from 0.36.0 to 0.38.0 (#31658)
* crypto/bn256: fix gnark deserialisation (#32055)
fixes the gnark deserialisation
---------
Co-authored-by: Felix Lange <fjl@twurst.com>
* tests/fuzzers: added bn marshaling fuzzers (#32053)
Adds marshaling fuzzing for G1 and G2 to oss-fuzz.
Also aligns the behavior of the google library to that of gnark and
cloudflare, which only ever read the first 64 / 128 bytes of the input,
regardless of how long the input is
* build: upgrade -dlgo version to Go 1.24.4 (#31978)
* eth/catalyst: fetch header on forkchoiceUpdated (#31928)
closes https://github.com/ethereum/go-ethereum/issues/31254
---------
Co-authored-by: Gary Rong <garyrong0905@gmail.com>
* all: reuse the global hash buffer (#31839)
As https://github.com/ethereum/go-ethereum/pull/31769 defined a global
hash pool, so we can reuse it, and also remove the unnecessary
KeccakState buffering
---------
Co-authored-by: Gary Rong <garyrong0905@gmail.com>
* crypto/bn256/cloudflare: pull in upstream fix for R27 and R29 usage (#32057)
Pulls in https://github.com/cloudflare/bn256/pull/48 to remove usage of
R27 and R29 [which are reserved](https://go.dev/doc/asm#arm64).
* eth,core: terminate the downloader immediately when shutdown signal is received (#32062)
Closes https://github.com/ethereum/go-ethereum/issues/32058
* core/rawdb: don't decode the full block body in ReadTransaction (#32027)
Reading a single transaction out of a block shouldn't need decoding the
entire body
---------
Co-authored-by: Felix Lange <fjl@twurst.com>
Co-authored-by: Gary Rong <garyrong0905@gmail.com>
* core: simplify effectiveTip calculation (#31771)
Since we have the effective gas price in the message, we can compute tip by
simply subtracting the basefee. No need to recompute the effective price.
---------
Co-authored-by: Felix Lange <fjl@twurst.com>
* core: consolidate BlockChain constructor options (#31925)
In this pull request, the original `CacheConfig` has been renamed to `BlockChainConfig`.
Over time, more fields have been added to `CacheConfig` to support
blockchain configuration. Such as `ChainHistoryMode`, which clearly extends
beyond just caching concerns.
Additionally, adding new parameters to the blockchain constructor has
become increasingly complicated, since it’s initialized across multiple
places in the codebase. A natural solution is to consolidate these arguments
into a dedicated configuration struct.
As a result, the existing `CacheConfig` has been redefined as `BlockChainConfig`.
Some parameters, such as `VmConfig`, `TxLookupLimit`, and `ChainOverrides`
have been moved into `BlockChainConfig`. Besides, a few fields in `BlockChainConfig`
were renamed, specifically:
- `TrieCleanNoPrefetch` -> `NoPrefetch`
- `TrieDirtyDisabled` -> `ArchiveMode`
Notably, this change won't affect the command line flags or the toml
configuration file. It's just an internal refactoring and fully backward-compatible.
---------
Co-authored-by: Felix Lange <fjl@twurst.com>
* .gitea: touch cron workflow files
* trie: delete secKeyCacheOwner (#31785)
The optimization tried to defer allocating the cache map until it was used for the
first time. It's a relic from earlier times, when tries were copied often. This seems
unnecessary now, so we can just create the map when the trie is created.
---------
Co-authored-by: Felix Lange <fjl@twurst.com>
* .gitea: show environment in release-ppa.yml
* crypto/bn256/gnark: align marshaling behavior (#32065)
Aligns the marshaling behavior of gnark to google and cloudflare
Co-authored-by: kevaundray <kevtheappdev@gmail.com>
* crypto/bn256: add documentation on subgroup checks for G2 (#32066)
This PR improves the IsOnCurve methods for BN254 G2 points by:
* Clarifying its behavior the docstring, making it explicit that it
verifies both the point being on the curve and in the correct subgroup.
* Adding an in-line comment explaining the subgroup membership check
(c.Mul(Order)).
* Minor wording adjustments for readability and consistency.
* ethdb: Implement DeleteRange in batch (#31947)
implement #31945
---------
Co-authored-by: prpeh <prpeh@proton.me>
Co-authored-by: Gary Rong <garyrong0905@gmail.com>
* core/state: expose the state reader stats (#31998)
This pull request introduces a mechanism to expose statistics from the
state reader, specifically related to cache utilization during state prefetching.
To improve state access performance, a pair of state readers is constructed
with a shared local cache. One reader to execute transactions ahead of time
to warm up the cache. The other reader is used by the actual chain processing
logic, which can benefit from the prefetched states.
This PR adds visibility into how effective the cache is by exposing relevant
usage statistics.
---------
Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
Co-authored-by: Csaba Kiraly <csaba.kiraly@gmail.com>
* core/state: improve the prefetcher concurrency allowance (#32071)
Improve the prefetcher concurrency allowance.
* core/state: fix prefetch on single core CPU (#32075)
We need at least one prefetch goroutine. SetLimit(0) would block
prefetch.
Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
* triedb/pathdb, eth: use double-buffer mechanism in pathdb (#30464)
Previously, PathDB used a single buffer to aggregate database writes,
which needed to be flushed atomically. However, flushing large amounts
of data (e.g., 256MB) caused significant overhead, often blocking the
system for around 3 seconds during the flush.
To mitigate this overhead and reduce performance spikes, a double-buffer
mechanism is introduced. When the active buffer fills up, it is marked
as frozen and a background flushing process is triggered. Meanwhile, a
new buffer is allocated for incoming writes, allowing operations to
continue uninterrupted.
This approach reduces system blocking times and provides flexibility in
adjusting buffer parameters for improved performance.
* eth: quick canceling block inserting when debug_setHead is invoked (#32067)
If Geth is engaged in a long-run block synchronization, such as a full
syncing over a large number of blocks, invoking `debug_setHead` will
cause `downloader.Cancel` to wait for all fetchers to stop first.
This can be time-consuming, particularly for the block processing
thread.
To address this, we manually call `blockchain.StopInsert` to interrupt
the blocking processing thread and allow it to exit immediately, and
after that call `blockchain.ResumeInsert` to resume the block
downloading process.
Additionally, we add a sanity check for the input block number of
`debug_setHead` to ensure its validity.
---------
Signed-off-by: jsvisa <delweng@gmail.com>
Co-authored-by: Gary Rong <garyrong0905@gmail.com>
* cmd/clef: update readme (#32070)
Replaced the outdated and broken link to the Web3 Secret Storage
Definition with the current official URL from ethereum.org in the Clef
README. This ensures users have access to up-to-date and accurate
documentation for the keystore file format.
* eth/tracers: prestate lookup EIP7702 delegation account (#32080)
Implement https://github.com/ethereum/go-ethereum/issues/32078
Parse and lookup the delegation account if EIP7702 is enabled.
---------
Signed-off-by: jsvisa <delweng@gmail.com>
* cmd/geth: era-download logic fix (#32081)
Downloading from a range was failing because it would return and error
early with an error misinterpreting "start-end".
---------
Co-authored-by: shantichanal <158101918+shantichanal@users.noreply.github.com>
Co-authored-by: Gary Rong <garyrong0905@gmail.com>
* miner: default gaslimit 45M (#32087)
We believe it is safe to raise the gaslimit to 45M before the Fusaka
fork. So this PR changes the default to 45M.
* core/rawdb, triedb/pathdb: implement history indexer (#31156)
This pull request is part-1 for shipping the core part of archive node
in PBSS mode.
* cmd/geth, triedb: add pathdb state verification (#32086)
This pull request ports the snapshot iteration logic from the legacy
implementation.
* core, consensus/beacon: defer trie resolution (#31725)
Previously, the account trie for a given state root was resolved immediately
when the stateDB was created, implying that the trie was always required
by the stateDB.
However, this assumption no longer holds, especially for path archive nodes,
where historical states can be accessed even if the corresponding trie data
does not exist.
* cmd/utils: fix formatting for beacon flag errors to fit Fatalf form (#32090)
Noticed that the errors for the blsync flags were not formatted
correctly for `Fatalf(..)`.
* eth, triedb/pathdb: permit write buffer allowance in PBSS archive mode (#32091)
This pull request fixes a flaw in PBSS archive mode that significantly
degrades performance when the mode is enabled.
Originally, in hash mode, the dirty trie cache is completely disabled
when archive mode is active, in order to disable the in-memory garbage
collection mechanism. However, the internal logic in path mode differs
significantly, and the dirty trie node cache is essential for maintaining
chain insertion performance. Therefore, the cache is now retained in
path mode.
* core, eth, triedb: serve historical states over RPC (#31161)
This is the part-2 for archive node over path mode, which ultimately
ships the functionality to serve the historical states
* triedb/pathdb: fix journal resolution in pathdb (#32097)
This pull request fixes a flaw in the PBSS state iterator, which
could return empty account or storage data.
In PBSS, multiple in-memory diff layers and a write buffer are
maintained. These layers are persisted to the database and reloaded after
node restarts. However, since the state data is encoded using RLP, the
distinction between nil and an empty byte slice is lost during the encode/decode
process. As a result, invalid state values such as `[]byte{}` can appear in PBSS
and ultimately be returned by the state iterator.
Checkout
https://github.com/ethereum/go-ethereum/blob/master/triedb/pathdb/iterator_fast.go#L270
for more iterator details.
It's a long-term existent issue and now be activated since the snapshot
integration.
The error `err="range contains deletion"` will occur when Geth tries to
serve other
peers with SNAP protocol request.
---------
Co-authored-by: Felix Lange <fjl@twurst.com>
* all: incorporate state history indexing status into eth_syncing response (#32099)
This pull request tracks the state indexing progress in eth_syncing
RPC response, i.e. we will return non-null syncing status until indexing
has finished.
* version: release go-ethereum v1.16.0 stable
* version: begin v1.16.1 release cycle
* .gitea: trigger PPA upload on tag
* .travis.yml: remove travis configuration
* all: replace override.prague with osaka (#32093)
replace `--override.prague` with `--override.osaka`
Signed-off-by: jsvisa <delweng@gmail.com>
* node: do not double-wrap KV stores (#32089)
For no apparent reason, KV stores were getting wrapped in `nofreezedb`
first and then in `freezerdb`.
* eth: correct tracer initialization in BlockchainConfig (#32107)
core.BlockChainConfig.VmConfig is not a pointer, so setting the Tracer
on the `vmConfig` object after it was passed to options does *not* apply
it to options.VmConfig
This fixes the issue by setting the value directly inside the `options`
object and removing the confusing `vmConfig` variable to prevent further
mistakes.
* .gitea: switch release builds to static linking (#32118)
This is to avoid compatibility issues with mismatched glibc versions
between the builder and deployment target.
Fixes #32102
* .gitea: fix 386 upload
* .gitea: disable cron schedule
* triedb: reset state indexer after snap synced (#32104)
Fix the issue after initial snap sync with `gcmode=archive` enabled.
```
NewPayload: inserting block failed error="history indexing is out of order, last: null, requested: 1"
```
---------
Signed-off-by: Delweng <delweng@gmail.com>
Co-authored-by: Gary Rong <garyrong0905@gmail.com>
* eth/filters: add address limit to filters (#31876)
The address filter was never checked against a maximum limit, which can
be somewhat abusive for API nodes. This PR adds a limit similar to
topics
## Description (AI generated)
This pull request introduces a new validation to enforce a maximum limit
on the number of addresses allowed in filter criteria for Ethereum logs.
It includes updates to the `FilterAPI` and `EventSystem` logic, as well
as corresponding test cases to ensure the new constraint is properly
enforced.
### Core functionality changes:
* **Validation for maximum addresses in filter criteria**:
- Added a new constant, `maxAddresses`, set to 100, to define the
maximum allowable addresses in a filter.
- Introduced a new error, `errExceedMaxAddresses`, to handle cases where
the number of addresses exceeds the limit.
- Updated the `GetLogs` method in `FilterAPI` to validate the number of
addresses against `maxAddresses`.
- Modified the `UnmarshalJSON` method to return an error if the number
of addresses in the input JSON exceeds `maxAddresses`.
- Added similar validation to the `SubscribeLogs` method in
`EventSystem`.
### Test updates:
* **New test cases for address limit validation**:
- Added a test in `TestUnmarshalJSONNewFilterArgs` to verify that
exceeding the maximum number of addresses triggers the
`errExceedMaxAddresses` error.
- Updated `TestInvalidLogFilterCreation` to include a test case for an
invalid filter with more than `maxAddresses` addresses.
- Updated `TestInvalidGetLogsRequest` to test for invalid log requests
with excessive addresses.
These changes ensure that the system enforces a reasonable limit on the
number of addresses in filter criteria, improving robustness and
preventing potential performance issues.
---------
Co-authored-by: zsfelfoldi <zsfelfoldi@gmail.com>
* Fix log indexer noise after debug_setHead operations (#31934)
## Summary
This PR resolves Issue #31929 by reducing log noise generated by the log
indexer after `debug_setHead` operations.
## Problem Description
When `debug_setHead` is called to rewind the blockchain, blocks are
removed from the database. However, the log indexer's `ChainView`
objects may still hold references to these deleted blocks. When
`extendNonCanonical()` attempts to access these missing headers, it
results in:
1. **Repeated ERROR logs**: `Header not found number=X hash=0x...`
2. **Log noise** that can mask other important errors
3. **User confusion** about whether this indicates a real problem
## Root Cause Analysis
The issue occurs because:
- `debug_setHead` removes blocks from the blockchain database
- Log indexer's `ChainView` may still reference deleted block hashes
- `extendNonCanonical()` in `core/filtermaps/chain_view.go` tries to
fetch these missing headers
- The existing `return false` logic properly handles the error, but logs
at ERROR level
## Solution
This is a **logging improvement only** - no functional logic changes:
### Changes Made
1. **Log level**: Changed from `ERROR` to `DEBUG`
2. **Log message**: Enhanced with descriptive context about chain view
extension
3. **Comments**: Added explanation for when this situation occurs
4. **Behavior**: Maintains existing error handling (`return false` was
already present)
### Code Changes
```go
// Before
log.Error("Header not found", "number", number, "hash", hash)
return false
// After
// Header not found - this can happen after debug_setHead operations
// where blocks have been deleted. Return false to indicate the chain view
// is no longer valid rather than logging repeated errors.
log.Debug("Header not found during chain view extension", "number", number, "hash", hash)
return false
```
## Testing
### Automated Tests
- ✅ All existing filtermaps tests pass: `go test ./core/filtermaps -v`
- ✅ No regressions in related functionality
### Manual Verification
1. **Before fix**: Started geth in dev mode, generated blocks, called
`debug_setHead(3)` → **5 repeated ERROR logs**
2. **After fix**: Same scenario → **4 DEBUG logs, no ERROR noise**
### Test Environment
```bash
# Setup test environment
rm -rf ./dev-test-data
./build/bin/geth --dev --datadir ./dev-test-data --http --http.api debug,eth,net,web3 --verbosity 4
# Generate test blocks and trigger issue
curl -X POST -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"debug_setHead","params":["0x3"],"id":1}' http://localhost:8545
```
## Related Issues
- Fixes #31929
## Additional Context
This issue was reported as spurious error messages appearing after
`debug_setHead` operations. The investigation revealed that while the
error handling was functionally correct, the ERROR log level was
inappropriate for this expected scenario in development/debugging
workflows.
The fix maintains full compatibility while significantly improving the
debugging experience for developers using `debug_setHead`.
---------
Co-authored-by: Sun Tae, Kim <38067691+humblefirm@users.noreply.github.com>
Co-authored-by: zsfelfoldi <zsfelfoldi@gmail.com>
* core/filtermaps: clean up log format of unindexing message (#32123)
Sorry for not fully fixed in https://github.com/ethereum/go-ethereum/pull/31761, now the log
format of unindexing message is cleaned up, to make it consistent with the indexing message.
* eth/catalyst: fix the log message in newPayloadV4 (#32125)
It should be `newPayloadV4 must only be called for prague payloads` for
the V4 payload error
* internal/ethapi: prealloc map for the txpool api (#32110)
use `make(map, len(txpool))` to prealloc the map for the txpool content,
to avoid the map growing in the loop.
* ethapi: reduce some of the wasted effort in GetTransactionReceipt (#32021)
Towards https://github.com/ethereum/go-ethereum/issues/26974
---------
Co-authored-by: Gary Rong <garyrong0905@gmail.com>
* internal: remove unused shh and swarm modules from console (#32073)
Similar to https://github.com/ethereum/go-ethereum/pull/31856, remove
the not availabe shh, swarm modules in the console.
---------
Co-authored-by: Gary Rong <garyrong0905@gmail.com>
* core/filtermaps: define APIs for map, epoch calculation (#31659)
This pull request refines the filtermap implementation, defining key
APIs for map and
epoch calculations to improve readability.
This pull request doesn't change any logic, it's a pure cleanup.
---------
Co-authored-by: zsfelfoldi <zsfelfoldi@gmail.com>
* core/types: blockTimestamp in logs is hex-encoded (#32129)
closes #32120
* core/rawdb, triedb/pathdb: fix two inaccurate comments (#32130)
* eth/catalyst: fix edge case in simulated backend (#31871)
geth cmd: `geth --dev --dev.period 5`
call: `debug.setHead` to rollback several blocks.
If the `debug.setHead` call is delayed, it will trigger a panic with a
small probability, due to using the null point of
`fcResponse.PayloadID`.
---------
Co-authored-by: Marius van der Wijden <m.vanderwijden@live.de>
* accounts/abi: generate TryPack* methods for abigen v2 bindings (#31692)
1. Fix the error return format.
**todo**: ~~`bindtype` needs more complex logic to fix it.~~
`
if err != nil {
return nil, err
}
if err == nil {
return obj, nil
}
`
2. ~~Return pointer type object to avoid copying the whole struct
content.~~
3. Give the panic decision to the user.
4. Fix empty line at the end of function.
**TODO**: ~~fix some related test cases.~~
---------
Co-authored-by: Jared Wasinger <j-wasinger@hotmail.com>
* version: release go-ethereum v1.16.1 stable
* Fix build issues
* Fix tests
* Fixed tests
* Fix CI
* core: Fix tests
* eth: Fix tests
* internal: Fix tests
* devp2p: Set LatestBlock and LatestBlockHash in test
* integration tests: Refactor NewBlockChain init
* eth/filters: Add blockTimestamp to test expected logs
* eth/filters: Update MockDatabase impl according to the new interface
* integration tests: Refactor NewBlockchain init
* eth/protocols: Update tests to support protocol 69
* tracers: Fix genesis for erc7562 tracer tests
* eth/tracers: Remove duplicated ApplyTransactionWithEVM call
* p2p: Remove remaining protocol 67 definitions
* p2p: Fix eth/69 handshake in tests
* eth/tracers: Set proper genesis for 7702/delegate test
* fix upstream merge tests (#1707)
* core: add get all receipts by hash helper
* chore: bump cosmos-sdk (#1704)
* eth/protocols/eth: include state-sync tx receipt in eth/69 response
* core: remove GetAllReceiptsByHash function
* core/rawdb: remove GetAllReceiptsByHash
* core: track cache hit/miss for bor receipts
* eth/protocols/eth: exclude state-sync in receipt root calculations
* eth/protocols/eth: club bor receipt with all tx receipts for a block
* eth/protocols/eth: exclude state-sync receipts in root hash calculation
* core: extract and save bor receipts during sync
* fix TestPrestateTracer and skip TestBroadcastMalformedBlock69
* fix TestGetModifiedAccounts
* fix lint
* feat: bump kurtosis and migrate to pos-workflows (#1706)
* remove unused lint annotation
* core: assign empty values for missing state-sync receipts
* core: write bor receipts in kv db
* core: check for empty receipts while writing in kv db
* internal, eth: disable snap sync momentarily (#1696)
* eth/core: add logs for debugging
* params: version bump to v2.2.10-beta
* disable snapsync on default eth configs
* feat: remove matic-cli e2e-tests (#1709)
* fix filter tests / temp disable TestValidatorsBlockProduction
* temp disable TestMiningAfterLocking
* core: Key-Value Priority Read on BorReceipts (#1699)
* Key Value Read Priority on BorReceipts
* simplify code
* Revert "internal, eth: disable snap sync momentarily (#1696)"
This reverts commit f3844811cda1c9c4c23f3e167f0f6a5e78742963.
* eth: syncmode default to snap
* Revert "eth: syncmode default to snap"
This reverts commit 2c735b22b27c8436f8c9b070ed44a2c63f0f83db.
* params: version bump to v2.2.10-beta2
* chore: make function comments match function names (#1650)
Signed-off-by: stellrust <gohunter@foxmail.com>
* eth/protocols: add nil check for tx before calling GetOptions (#1656)
* chore: make function comments match function names (#1658)
Signed-off-by: jishudashu <979260390@qq.com>
* core/state: use mutex for access list r/w operations
* core: catch panic in block-stm processing
* use mutex for access list r/w operations
* consistent comment for skipped tests
* params: version bump to v2.2.10
* Improving fail handling from reorgs (#1677)
* proper error handling for blockchain instantiation
* nil check on ethstats
* nil check over ourTD
* fix: dbcmd (#1714)
* return if etherbase is empty
* chore: set disableFreeze to true
---------
Signed-off-by: stellrust <gohunter@foxmail.com>
Signed-off-by: jishudashu <979260390@qq.com>
Co-authored-by: Manav Darji <manavdarji.india@gmail.com>
Co-authored-by: Krishang Shah <109511742+kamuikatsurgi@users.noreply.github.com>
Co-authored-by: Pratik Patil <pratikspatil024@gmail.com>
Co-authored-by: Lucca Martins <lucca_martins30@yahoo.com.br>
Co-authored-by: stellrust <gohunter@foxmail.com>
Co-authored-by: Yuan-Yao Sung <sungyuanyao@gmail.com>
Co-authored-by: jishudashu <979260390@qq.com>
* BlockByNumberOrHash return error if block not found
* downloader: Change test to use protocol 69
* p2p: Add block propagation handlers for eth/69
* tests: Enable TestMiningAfterLocking
* tests: Enable TestBroadcastMalformedBlock69
* Revert "fix upstream merge tests (#1707)" (#1725)
This reverts commit 9b117f35050138fad21ad713db61b43a5476e86d.
* fix filter tests / temp disable TestValidatorsBlockProduction
* tests: Enable TestValidatorsBlockProduction
* disable snapsync on default eth configs
* remove unused lint annotation
* fix lint
* fix TestGetModifiedAccounts
* fix TestPrestateTracer and skip TestBroadcastMalformedBlock69
* Enable TestBroadcastMalformedBlock69
* Fix tests
* Fix tests
* Fix tests
* Disable snap sync tests temporarily
* Disable snap sync tests temporarily
* Prefetch witness
* Fix parallel execution
* Up depndencies
* Fix tests
* fix: TestSimulateV1 basefee-non-validation case (#1789)
* fix(eth/downloader/whitelist): decrement chain meter on failure (#1771)
* Decrement chain meter instead of peer meter
* Decrement chain meter instead of peer meter
* chore: bump kurtosis-pos (#1805)
* chore: bump kurtosis-pos
* chore: bump to 1.1.16
* core, internal/ethapi: derive cumulative gas for bor receipts (#1806)
* core/types: derive cumulative gas for bor receipt
* internal/ethapi: update testdata with non empty cumulative gas
* core/types: small fix
* core: derive cumulative gas used and persist in db for bor receipts
* Remove TODOs
* eth, core: handle state-sync data in eth/69 messages
This PR adds the ability to send state-sync transaction receipts (or bor receipts in short) in eth/69 protocol (which is newly added from upstream). This will allow nodes using snap sync to persist the state-sync transaction receipts (as there's no execution involved in snap sync and hence they're not generated locally).
This PR changes the implementation of 2 p2p messages:
- GetReceiptsMsg (code: 0x0f): Fetches bor receipts for requested blocks and include them in the final encoded message
- ReceiptsMsg (code: 0x10): Accepts the bor receipts from incoming p2p packet. They are excluded from receipt root (in header) and hence this needs to be taken care of while handling incoming receipts.
* eth: handle integer underflow for reporting total delay in block tracking
Avoid wraparound of total delay values when logging due to integer underflow. Switch to using int64 instead of uint64. The log initially assumed that current time would always be ahead of header's block time which is not true anymore (as blocks can be announced early) breaking this assumption.
* remove bloom filter from bor logs (#1811)
* Disabling mine for stateless client (#1814)
* disabling mine
* disable pip-66 integration test
* fix message
* Enable custom HTTP Modules in dev-mode (#1589)
* cli: Don't force HTTP modules in dev-mode
The HTTP modules were forced to a specific list in dev mode, thus
disabling the user's choice of active modules.
* state: Don't log prefetcher error when terminated
This is useless, it's not an actual error.
* Fix selfdestruct for parallel execution
* Added unit test for parallel evm selfdestruct
* Merge pull request #1823 from 0xPolygon/lmartins/kv-check-on-write
Backfill StateSync Command Improvements
* core: Use `TriesInMemory` from config (#1590)
* core: Use `TriesInMemory` from config
The config setting got mistakenly removed in this PR https://github.com/maticnetwork/bor/pull/1300/files
* eth/fetcher: Fix race condition in tests
The `tester.fetcher` is already started in `newTester`
* eth/fetcher: Fix race condition in test
The bool was modified in a goroutine, read in another.
* bump version
* Port mining optimizations for veblop (#1783)
* feat: disabling gogc override
* internal/cli: add GC variables in config
* core,eth,internal/cli,triedb/pathdb: add maxdifflayers to config
* consensus/bor: fix header timestamp when time is in the past
When the calculated header timestamp based on parent time and producer delay
falls in the past, ensure we add the full producer delay to the current time
rather than just setting it to current time. This prevents immediate timeout
issues in the commit interrupt mechanism where blocks would be interrupted
immediately due to negative time delays.
Previously, when header.Time < now, we would set header.Time = now, which
could still result in timing issues during block building. Now we properly
calculate header.Time = now + CalcProducerDelay() to ensure adequate time
for block building operations.
* consensus/bor,internal/cli,params: add header timestamp fix when in past
* perf(core/blockstm): optimize HasReadDep for small input sizes
Add performance optimization to HasReadDep function based on production metrics
showing ~3M calls with median size of 15. For small inputs (<=512 elements),
use direct nested loop comparison instead of map allocation to improve performance
due to better cache locality and avoiding allocation overhead.
Additionally:
- Replace map[Key]bool with map[Key]struct{} to reduce memory usage
- Add Prometheus metrics to track function calls and input sizes
- Add detailed comments explaining the optimization rationale
The cutoff of 512 was determined through benchmarking and captures >50% of
production calls, providing significant performance improvement for the
common case while maintaining O(n+m) complexity for larger inputs.
* core: add hasReadDepCallCounter and readsMapSizeHist metrics
* eth.internal/cli,triedb: fix lint
* core,eth,internal/cli,triedb/pathdb: rm maxdifflayers config
* core: add dagBuildTimer
* Revert "consensus/bor,internal/cli,params: add header timestamp fix when in past"
This reverts commit 76f6ac5afef4309ec18184cf07618fc25cefff55.
* triedb/pathdb: rm invalid comment
* internal/cli: rm unused function
---------
Co-authored-by: John Hilliard <praetoriansentry@gmail.com>
* fix txs count in segment import report (#1831)
* Remove incorrect modification to `prepare()` (#1832)
* fix receipts and logs on stateless node (#1833)
* Cutomizable block time in block producer (#1817)
* Cutomizable block time in block producer
* minor fix
* Fix test
* Refactor
* Add tests
* Stateless Pruning (#1828)
* pruning refactor and freeze disable
* block pruner
* lint
* minor fixes
* update pruner
* include witness producers on pruning
* Info logs
* improve logs
* increase block prune interval
* fix receipts and logs on stateless node
* genesis protection
* remove genesis from tests
* meaningful info logs
* fix block pruner cursor key
---------
Signed-off-by: Guillaume Ballet <3272758+gballet@users.noreply.github.com>
Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
Signed-off-by: jsvisa <delweng@gmail.com>
Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>
Signed-off-by: Delweng <delweng@gmail.com>
Signed-off-by: stellrust <gohunter@foxmail.com>
Signed-off-by: jishudashu <979260390@qq.com>
Co-authored-by: Felix Lange <fjl@twurst.com>
Co-authored-by: Alex Zaytsev <hazzik@gmail.com>
Co-authored-by: lightclient <lightclient@protonmail.com>
Co-authored-by: jwasinger <j-wasinger@hotmail.com>
Co-authored-by: Csaba Kiraly <cskiraly@users.noreply.github.com>
Co-authored-by: JukLee0ira <meebookmonkey@163.com>
Co-authored-by: rjl493456442 <garyrong0905@gmail.com>
Co-authored-by: maskpp <maskpp266@gmail.com>
Co-authored-by: Marius van der Wijden <m.vanderwijden@live.de>
Co-authored-by: Satoshi Is Here <39875249+SatoshiIsHere@users.noreply.github.com>
Co-authored-by: Marcel <153717436+MonkeyMarcel@users.noreply.github.com>
Co-authored-by: Klimov Sergey <klmff@proton.me>
Co-authored-by: SHADOW <g1siddharthr@gmail.com>
Co-authored-by: wellna <wellnanasa@gmail.com>
Co-authored-by: Delweng <delweng@gmail.com>
Co-authored-by: Guillaume Ballet <3272758+gballet@users.noreply.github.com>
Co-authored-by: Charlotte <69423184+tqpcharlie@users.noreply.github.com>
Co-authored-by: Marius Kjærstad <sandakersmann@users.noreply.github.com>
Co-authored-by: Sina M <1591639+s1na@users.noreply.github.com>
Co-authored-by: Zhou <DanialZhouMAX@gmail.com>
Co-authored-by: James Niken <danylonepritvoreniy@gmail.com>
Co-authored-by: VolodymyrBg <aqdrgg19@gmail.com>
Co-authored-by: steven <wangpeculiar@gmail.com>
Co-authored-by: shahafn <shahaflol@gmail.com>
Co-authored-by: Péter Garamvölgyi <th307q@gmail.com>
Co-authored-by: Mario Vega <marioevz@gmail.com>
Co-authored-by: Merkel Tranjes <140164174+rnkrtt@users.noreply.github.com>
Co-authored-by: Ömer Faruk Irmak <omerfirmak@gmail.com>
Co-authored-by: buddho <galaxystroller@gmail.com>
Co-authored-by: Arya Nair <aryaajitnair@gmail.com>
Co-authored-by: Felföldi Zsolt <zsfelfoldi@gmail.com>
Co-authored-by: William Morriss <wjmelements@gmail.com>
Co-authored-by: Lunor <73783151+lunargon@users.noreply.github.com>
Co-authored-by: Joe Chen <jiajuncjoe@gmail.com>
Co-authored-by: Sean Liao <sean.liao@circle.com>
Co-authored-by: shazam8253 <54690736+shazam8253@users.noreply.github.com>
Co-authored-by: Nebojsa Urosevic <nebojsa94@users.noreply.github.com>
Co-authored-by: Sina Mahmoodi <itz.s1na@gmail.com>
Co-authored-by: kevaundray <kevtheappdev@gmail.com>
Co-authored-by: Ignacio Hagopian <jsign.uy@gmail.com>
Co-authored-by: cz <wylbzc4928@gmail.com>
Co-authored-by: Herbert …
Fixes a regression introduced in #31791, see ethereum/go-ethereum#31791 (comment)
* core/overlay: copy BaseRoot in TransitionState.Copy (#32613)
This change ensures TransitionState.Copy preserves BaseRoot. During a
Verkle transition, ts.BaseRoot is required to construct the overlay MPT
when ts.InTransition() is true. Previously, copies dropped BaseRoot,
risking an invalid zero-hash base trie and inconsistent behavior.
* core/txpool/blobpool: filter blob txs with sidecar version (#32577)
As a consequence of moving blob sidecar version migration code around,
we ended up building blocks with a mix of v0 and v1 blob transactions
(different proof encoding in the sidecar).
This PR makes sure we are not building illegal blocks after Osaka. Blob
migration is left for another PR.
Related issues and PRs:
- https://github.com/ethereum/go-ethereum/pull/31791
- https://github.com/ethereum/go-ethereum/pull/32347
- https://github.com/ethereum/go-ethereum/pull/31966
- https://github.com/ethereum/go-ethereum/issues/32235
---------
Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
* core/txpool/blobpool: migrate billy to new slot size (#31966)
Implements a migration path for the blobpool slotter
---------
Co-authored-by: lightclient <lightclient@protonmail.com>
Co-authored-by: lightclient <14004106+lightclient@users.noreply.github.com>
Co-authored-by: Gary Rong <garyrong0905@gmail.com>
* rlp: remove duplicate optionalAndTailField test case (#32614)
* eth/catalyst: allow fcuV3 for BPO forks (#32615)
This fixes an issue with the engine API after BPO forks have passed.
* go.mod: add tool section in module file (#32598)
This removes the tools.go workaround in favor of the official
tool management infrastructure, which was added in Go 1.24.
* cmd/keeper: add the keeper zkvm guest program (#32543)
Keeper is a zmvm guest program that runs the block transition.
It relies on the zkvm maker implementing `getInput`. For now, we only
provide a single implementation for the 'ziren' VM.
Why keeper?
In the _Mass Effect_ lore, the keepers are animals (?) who maintain the
citadel. Nothing is known from them, and attempts at tampering with them
have failed, as they self-destruct upon inquiry. They have a secret,
nefarious purpose that is only revealed later in the game series, don't
want any spoilers so I didn't dig deeper. All in all, a good metaphor
for zkvms.
---------
Co-authored-by: weilzkm <140377101+weilzkm@users.noreply.github.com>
Co-authored-by: Felix Lange <fjl@twurst.com>
* cmd/evm/internal/t8ntool: use ApplyTransaction instead of ApplyMessage (#32618)
ApplyTransaction calls the hooks and builds the receipt, so some
duplicated code can be removed from t8ntool. Test cases have been
changed to add the `blockNumber` and `blockHash` in receipts, since
they were previously not filled in.
* chore(superchain-registry): bump version for addresses cleanup (#672)
* eth/downloader: Fix deposit receipt correction (#680)
* core/tracing: remove unnecessary 'copy' field skip in TestAllHooksCalled (#32622)
This test iterated over Hooks fields and skipped a field named copy. The
Hooks struct has no such field, making the condition dead code.
* p2p/discover: expose timeout in lookupFailed
Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
# Conflicts:
# p2p/discover/lookup.go
* core/rawdb: fix typo in TestWriteAncientHeaderChain (#32587)
* core/stateless: API methods to get execution witness of block
This PR adds a new RPC call, which re-executes a block with stateless
mode activated, so that the witness data are collected and returned.
They are `debug_executionWitnessByHash` which takes in a block hash
and `debug_executionWitness` which takes in a block number.
---------
Signed-off-by: Guillaume Ballet <3272758+gballet@users.noreply.github.com>
* core/vm: use go-bigmodexpfix for modexp (#32576)
This changes the modexp precompile to use a fork of math/big with some
patches by @GottfriedHerold to improve worst-case performance.
* revert to using table parameter
using it.lookup.tab inside is unsafe
Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
* go.mod: update c-kzg (#32639)
Updates c-kzg to the latest release:
https://github.com/ethereum/c-kzg-4844/releases/tag/v2.1.3
* go.mod: update go-eth-kzg (#32640)
Updates go-eth-kzg:
https://github.com/crate-crypto/go-eth-kzg/releases/tag/v1.4.0
* core/stateless: add vmwitnessstats cli flag to report leaf stats + log to console (#32619)
The format that is currently reported by the chain isn't very useful, as
it gives an average for ALL the nodes, and not only the leaves, which
skews the results.
Also, until now there was no way to activate the reporting of errors.
We also decided that metrics weren't the right tool to report this data,
so we decided to dump it to the console if the flag is enabled. A better
system should be built, but for now, printing to the logs does the job.
* triedb/pathdb: generalize the history indexer (#32523)
This pull request is based on #32306 , is the second part for shipping
trienode history.
Specifically, this pull request generalize the existing index mechanism,
making is usable
by both state history and trienode history in the near future.
* trie: add sub-trie iterator support (#32520)
- Adds `NodeIteratorWithPrefix()` method to support iterating only nodes
within a specific key prefix
- Adds `NodeIteratorWithRange()` method to support iterating only nodes
within a specific key range
Current `NodeIterator` always traverses the entire remaining trie from a
start position. For non-ethereum applications using the trie implementation,
there's no way to limit iteration to just a subtree with a specific prefix.
**Usage:**
```go
// Only iterate nodes with prefix "key1"
iter, err := trie.NodeIteratorWithPrefix([]byte("key1"))
```
Testing: Comprehensive test suite covering edge cases and boundary conditions.
Closes #32484
---------
Co-authored-by: gballet <guillaume.ballet@gmail.com>
Co-authored-by: Gary Rong <garyrong0905@gmail.com>
* cmd/keeper: disable GC for zkvm execution (#32638)
ZKVMs are constrained environments that liberally allocate memory and
never release it. In this context, using the GC is only going to cause
issues down the road, and slow things down in any case.
* all: Introduce feature toggles for Jovian (#677)
* introduce IsMinBaseFee feature toggle
Allows feature to be easily removed from Jovian hardfork.
When the hardfork scope is locked, this commit can be reverted.
* decouple features
* add isOperatorFeeFix toggle
* Remove approval hold job from release workflow (#683)
Removed approval hold job from release process in CircleCI config.
* core: fix fork readiness log (#32623)
When I implemented in #31340 I didn't expect multiple forks to be
configured at once, but this is exactly how BPOs are defined. This
updates the method to determine the next scheduled fork rather than the
last fork.
* core/rawdb: report truncateErr in concurrent truncate failure (#32651)
* build: update to execution-spec-tests v5.0.0 (#32592)
https://github.com/ethereum/execution-spec-tests/releases/tag/v5.0.0
As of this release, execution-spec-tests also contains all state tests
that were previously in ethereum/tests. We can probably remove the tests
submodule now. However, this would mean we are missing the pre-cancun
tests. Still need to figure out how to resolve this.
---------
Co-authored-by: MariusVanDerWijden <m.vanderwijden@live.de>
* eth/catalyst, beacon/engine: enable BPO and Osaka on stateless APIs (#32636)
Addresses https://github.com/ethereum/go-ethereum/issues/32630
This pull request enables the stateless engine APIs for Osaka and the
following BPOs. Apart from that, a few more descriptions have been added
in the engine APIs, making it easier to follow the spec change.
* eth/filters, cmd: add config of eth_getLogs address limit (#32327)
Add cli configurable limit for the number of addresses allowed in
eth_getLogs filter criteria:
https://github.com/ethereum/go-ethereum/issues/32264
Key changes:
- Added --rpc.getlogmaxaddrs CLI flag (default: 1000) to configure the
maximum number of addresses
- Updated ethconfig.Config with FilterMaxAddresses field for
configuration management
- Modified filter system to use the configurable limit instead of the
hardcoded maxAddresses constant
- Enhanced test coverage with new test cases for address limit
validation
- Removed hardcoded validation from JSON unmarshaling, moving it to
runtime validation
Please notice that I remove the check at FilterCriteria UnmarshalJSON
because the runtime config can not pass into this validation.
Please help review this change!
---------
Co-authored-by: zsfelfoldi <zsfelfoldi@gmail.com>
Co-authored-by: rjl493456442 <garyrong0905@gmail.com>
* beacon/config: fix LoadForks with non-string values (#32609)
Fixes a crash when loading the beacon chain config if new fields like
`BLOB_SCHEDULE: []` are present.
Previously, the config loader assumed all values were strings, causing
errors such as:
```
Fatal: Could not load beacon chain config '/network-configs/config.yaml': failed to parse beacon chain config file: yaml: unmarshal errors:
line 242: cannot unmarshal !!seq into string
```
This PR updates the parsing logic to handle non-string values correctly
and adds explicit validation for fork fields.
* internal/ethapi: skip tx gas limit check for calls (#32641)
This disables the tx gaslimit cap for eth_call and related RPC operations.
I don't like how this fix works. Ideally we'd be checking the tx
gaslimit somewhere else, like in the block validator, or any other place
that considers block transactions. Doing the check in StateTransition
means it affects all possible ways of executing a message.
The challenge is finding a place for this check that also triggers
correctly in tests where it is wanted. So for now, we are just combining
this with the EOA sender check for transactions. Both are disabled for
call-type messages.
* beacon/blsync: test validated finality (#32633)
This PR improves `TestBlockSync` so that it also tests the finality
update validation.
Note: to this date four long and complex (at least partly AI generated)
PRs arrived that did something related to testing finality but honestly
we do not need a bloated "comprehensive" test to test a trivial feature
because maintaining these tests can also be a pain over the long term.
This PR adds some sufficient sanity checks to detect if finality ever
gets broken by a future change.
* core/state: add missing address key in state_object log (#32676)
* crypto/bn256: switch to gnark again (#32659)
We recently update our default implementation to gnark in
https://github.com/ethereum/go-ethereum/pull/32024
Then we found a consensus issue and reverted it in
https://github.com/ethereum/go-ethereum/commit/65d77c51295c3b5c237a082af856a6926766a51c
We fixed the consensus issue and have been fuzzing it more since then in
https://github.com/ethereum/go-ethereum/pull/32055/files
https://github.com/ethereum/go-ethereum/pull/32065
https://github.com/ethereum/go-ethereum/pull/32055/files
So I think now is the time to update it back to gnark
* core/txpool/blobpool: remove conversion in GetBlobs (#32578)
This disables blob proof conversion in `GetBlobs` by default, making it
conditional.
---------
Co-authored-by: Felix Lange <fjl@twurst.com>
* p2p: using testing.B.Loop (#32664)
* core/state: using testing.B.Loop (#32658)
before:
go test -run=^$ -bench=. ./core/state/... 120.85s user 7.96s system 129%
cpu 1:39.13 tota
after:
go test -run=^$ -bench=. ./core/state/... 21.32s user 2.12s system 97%
cpu 24.006 total
* eth: using testing.B.Loop (#32657)
before:
go test -run=^$ -bench=. ./eth/... 827.57s user 23.80s system 361% cpu
3:55.49 total
after:
go test -run=^$ -bench=. ./eth/... 281.62s user 13.62s system 245% cpu
2:00.49 total
* log: using testing.B.Loop (#32663)
before:
go test -run=^$ -bench=. ./log -timeout=1h 12.19s user 2.19s system 89%
cpu 16.025 total
after:
go test -run=^$ -bench=. ./log -timeout=1h 10.64s user 1.53s system 89%
cpu 13.607 total
---------
Co-authored-by: lightclient <lightclient@protonmail.com>
* core: using testing.B.Loop (#32662)
Co-authored-by: lightclient <lightclient@protonmail.com>
* core/vm: using testing.B.Loop (#32660)
before:
go test -run=^$ -bench=. ./core/vm/... -timeout=1h 1841.87s user 40.96s
system 124% cpu 25:15.76 total
after:
go test -run=^$ -bench=. ./core/vm/... -timeout=1h 1588.65s user 33.79s
system 123% cpu 21:53.25 total
---------
Co-authored-by: lightclient <lightclient@protonmail.com>
* core/types: using testing.B.Loop (#32643)
before:
go test -run=^$ -bench=. ./core/types 47.80s user 2.18s system 102% cpu
48.936 tota
after:
go test -run=^$ -bench=. ./core/types 42.42s user 2.27s system 112% cpu
39.593 total
* crypto: using testing.B.Loop (#32645)
before:
go test -run=^$ -bench=. ./crypto/... 94.83s user 2.68s system 138% cpu
1:10.55 tota
after:
go test -run=^$ -bench=. ./crypto/... 75.43s user 2.58s system 123% cpu
1:03.01 total
* fix: correct typo in TestMustParseUint64Panic error message (#32648)
Fix typo in test error message where "MustParseBig" was incorrectly
used instead of "MustParseUint64" in the TestMustParseUint64Panic
function.
The test still functions correctly, but now the error message
accurately reflects the function being tested.
* common, eth: remove duplicate test cases (#32624)
Remove redundant duplicate test vectors. The two entries were identical
and back-to-back, providing no additional coverage while adding noise.
Keeping a single instance maintains test intent and clarity without
altering behavior.
* core/rawdb: fix bad blocks sorted failure message to map index→number correctly (#32627)
Fix the t.Fatalf format arguments in TestBadBlockStorage to match the
intended #index output. Previously, the left number used i+1 and the
right index used the block number, producing misleading diagnostics.
Correct mapping improves test failure clarity and debuggability.
* params: update config description links to new format (#32681)
A PR in the specs repo broke our existing links:
https://github.com/ethereum/execution-specs/pull/1416
This PR fixes it and adds the Prague and Osaka specs.
* core/txpool/blobpool: introduce sidecar conversion for legacy blob transactions (#32656)
This pull request introduces a queue for legacy sidecar conversion to
handle transactions that persist after the Osaka fork. Simply dropping
these transactions would significantly harm the user experience.
To balance usability with system complexity, we have introduced a
conversion time window of two hours post Osaka fork. During this period,
the system will accept legacy blob transactions and convert them in a
background process.
After the window, all legacy transactions will be rejected. Notably, all
the blob transactions will be validated statically before the conversion,
and also all conversion are performed in a single thread, minimize the risk
of being DoS.
We believe this two hour window provides sufficient time to process
in-flight legacy transactions and allows submitters to migrate to the
new format.
---------
Co-authored-by: Felix Lange <fjl@twurst.com>
* go.work.sum: add to repo (#32677)
* core/state: fix committed-state expectations in StateDB tests (#32678)
* triedb/pathdb: move head truncation log (#32649)
Print the `Truncating from head` log only if head truncation is needed.
* cmd, tests: fix snapshot dump and export-preimages (#32650)
Address #32646
* go.work, build: remove workspace file (#32699)
https://go.dev/ref/mod#go-work-file advises against checking `go.work`
files because they can interfere with local development. We added the
workspace file in order to make `go test` and other tools work across
multiple modules. But it seems to cause weird issues with the
`go.work.sum` file being modified, etc.
So with this PR, we instead run all the `ci.go` commands for all modules
in the workspace manually.
* cmd/era: fix iterator error source handling in checkAccumulator (#32698)
This change replaces wrapping a stale outer err with the iterator’s own
error after Next(), and switches the post-BlockAndReceipts() check to
use the returned err. According to internal/era iterator contract,
Error() should be consulted immediately after Next() to surface
iteration errors, while decoding errors from Block/Receipts are returned
directly. The previous code could hide the real failure (using nil or
unrelated err), leading to misleading diagnostics and missed iteration
errors.
---------
Co-authored-by: lightclient <lightclient@protonmail.com>
* cmd/evm/internal/t8ntool: fix nil pointer dereference in Osaka blob gas calculation (#32714)
The parent header was missing the BaseFee field when calculating the
reserve price for EIP-7918 in the Osaka fork, causing a nil pointer
dereference. This fix ensures BaseFee is properly set from ParentBaseFee
in the environment.
Added regression test case 34 to verify Osaka fork blob gas calculation
works correctly with parent base fee.
* core/txpool/blobpool: add legacy sidecar conversion in reinject (#32688)
This adds the conversion for the legacy sidecar if these
transactions are reorged out after the osaka.
* accounts/keystore: use runtime.AddCleanup (#32610)
* internal/ethapi: fix merge transition in eth_simulate (#32616)
This PR fixes the fork detection of `eth_simulateV1`, particularly
for networks that are post-merge since genesis, like Hoodi.
* trie: align AllFFPrefix test assertion and message (#32719)
* build: module-aware FindMainPackages (#32736)
This fixes `go run build/ci.go install`. It was failing because we
resolved all main packages by parsing sources, which fails when the
source directory contains multiple modules.
* miner: default gaslimit 60M (#32734)
* core/txpool/blobpool: fork boundary conversion 3 (#32716)
This implements the conversion of existing blob transactions to the new proof
version. Conversion is triggered at the Osaka fork boundary. The conversion is
designed to be idempotent, and may be triggered multiple times in case of a reorg
around the fork boundary.
This change is the last missing piece that completes our strategy for the blobpool
conversion. After the Osaka fork,
- new transactions will be converted on-the-fly upon entry to the pool
- reorged transactions will be converted while being reinjected
- (this change) existing transactions will be converted in the background
---------
Co-authored-by: Gary Rong <garyrong0905@gmail.com>
Co-authored-by: lightclient <lightclient@protonmail.com>
* trie: fix TestOneElementProof expected value message (#32738)
- Correct the error message in TestOneElementProof to expect 'v' instead
of 'k'.
- The trie is updated with key "k" and value "v"; on mismatch the
expected value must be 'v'.
- Aligns the message with the actual test logic and other similar checks
in this file, reducing confusion during test failures. No behavioral
changes.
* accounts/keystore: use ticker to avoid timer allocations (#32732)
Replace time.After with a long‑lived time.Ticker in KeyStore.updater, preventing per‑iteration timer allocations and potential timer buildup.
Co-authored-by: lightclient <lightclient@protonmail.com>
* accounts/abi/bind: fix data race in TestWaitDeployedCornerCases (#32740)
Fixes race in WaitDeploy test where the backend is closed before goroutine using it wraps up.
---------
Co-authored-by: lightclient <lightclient@protonmail.com>
* all: add bpo1 and bpo2 overrides (#32737)
This adds overrides to the cli for BPO1 and BPO2.
---------
Co-authored-by: Gary Rong <garyrong0905@gmail.com>
* core/txpool/blobpool: convert and add one-by-one (#32718)
This is a small improvement on #32656 in case Add was called with
multiple type 3 transactions, adding transactions to the pool one-by-one
as they are converted.
Announcement to peers is still done in a batch.
Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
* build: upgrade to execution-spec-tests v5.1.0 (#32742)
https://github.com/ethereum/execution-spec-tests/releases/tag/v5.1.0
* core/txpool: add eip2681 check for incoming transactions (#32726)
* all: refactor to use builtin max/min (#32694)
Replaces the last few instances of `math.Max` and `math.Min` with go builtins.
* params: schedule Osaka/BPO1/BPO2 for testnets (#32735)
Timestamps taken from:
- Holesky:
https://github.com/eth-clients/holesky/blob/main/metadata/genesis.json
- Sepolia:
https://github.com/eth-clients/sepolia/blob/main/metadata/genesis.json
- Hoodi:
https://github.com/eth-clients/hoodi/blob/main/metadata/genesis.json
* version: release go-ethereum v1.16.4 stable
* version: begin v1.16.5 release cycle
* internal/ethapi: fix outdated comments (#32751)
Fix outdated comments
* ethapi: reject oversize storage keys before hex decode (#32750)
Bail out of decodeHash when the raw hex string is longer than 32 byte before actually decoding.
---------
Co-authored-by: lightclient <lightclient@protonmail.com>
* signer/core: fix TestSignTx to decode res2 (#32749)
Decode the modified transaction and verify the value differs from original.
---------
Co-authored-by: lightclient <lightclient@protonmail.com>
* trie: correct error messages for UpdateStorage operations (#32746)
Fix incorrect error messages in TestVerkleTreeReadWrite and TestVerkleRollBack functions.
* eth/tracers/native: add keccak256preimage tracer (#32569)
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>
* params: add amsterdam fork config (#32687)
Adds Amsterdam as fork config option.
Co-authored-by: lightclient <lightclient@protonmail.com>
* build: remove duplicated func FileExist (#32768)
* 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>
* trie: fix error message in test (#32772)
Fixes an error message in TestReplication
* internal/ethapi: remove redundant check in test (#32760)
Removes a redundant check in TestCreateAccessListWithStateOverrides
* cmd/evm/internal/t8ntool: panic on database corruption (#32776)
These functions were previously ignoring the error returned by both
`statedb.Commit()` and the subsequent `state.New()`,
which could silently fail and cause panics later when the `statedb` is
used.
This change adds proper error checking and panics with a descriptive
error
message if state creation fails.
While unlikely in normal operation, this can occur if there are database
corruption issues or if invalid root hashes are provided, making
debugging
significantly easier when such issues do occur.
This issue was encountered and fixed in
https://github.com/gballet/go-ethereum/pull/552
where the error handling proved essential for debugging
cc: @gballet as this was discussed in a call already.
* params: fix bpo config comments (#32755)
Looks like we forgot to update names when copying.
* core/rawdb: update comments (#32668)
- Replace outdated NewFreezer doc that referenced map[string]bool/snappy
toggle with accurate description of -map[string]freezerTableConfig
(noSnappy, prunable).
- Fix misleading field comment on freezerTable.config that spoke as if
it were a boolean (“if true”), clarifying it’s a struct and noting
compression is non-retroactive.
* params: implement String() method for ChainConfig (#32766)
Fixes issue #32762 where ChainConfig logging displays pointer addresses
instead of actual timestamp values for fork activation times.
Before: ShanghaiTime:(*uint64)(0xc000373fb0),
CancunTime:(*uint64)(0xc000373fb8)
After: ShanghaiTime: 1681338455, CancunTime: 1710338135, VerkleTime: nil
The String() method properly dereferences timestamp pointers and handles
nil values for unset fork times, making logs more readable and useful
for debugging chain configuration issues.
---------
Co-authored-by: rjl493456442 <garyrong0905@gmail.com>
* params: add blob config information in the banner (#32771)
Extend the chain banner with blob config information.
Co-authored-by: Felix Lange <fjl@twurst.com>
* core/txpool: remove unused signer field from TxPool (#32787)
The TxPool.signer field was never read and each subpool (legacy/blob)
maintains its own signer instance. This field remained after txpool
refactoring into subpools and is dead code. Removing it reduces
confusion and simplifies the constructor.
* core/state: correct expected value in TestMessageCallGas (#32780)
* go.mod, cmd/keeper/go.mod: upgrade victoria metrics dependency (#32720)
This is required for geth to compile to WASM.
* params: add bpo forks to eth_config (#32579)
BPO forks should also be included in eth_config response.
* params: schedule Osaka/BPO1/BPO2 for testnets (#32735)
Timestamps taken from:
- Holesky:
https://github.com/eth-clients/holesky/blob/main/metadata/genesis.json
- Sepolia:
https://github.com/eth-clients/sepolia/blob/main/metadata/genesis.json
- Hoodi:
https://github.com/eth-clients/hoodi/blob/main/metadata/genesis.json
* 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.
* p2p: fix error message in test (#32804)
* signer/core: fix error message in test (#32807)
* params: fix banner message (#32796)
* core/types, trie: reduce allocations in derivesha (#30747)
Alternative to #30746, potential follow-up to #30743 . This PR makes the
stacktrie always copy incoming value buffers, and reuse them internally.
Improvement in #30743:
```
goos: linux
goarch: amd64
pkg: github.com/ethereum/go-ethereum/core/types
cpu: 12th Gen Intel(R) Core(TM) i7-1270P
│ derivesha.1 │ derivesha.2 │
│ sec/op │ sec/op vs base │
DeriveSha200/stack_trie-8 477.8µ ± 2% 430.0µ ± 12% -10.00% (p=0.000 n=10)
│ derivesha.1 │ derivesha.2 │
│ B/op │ B/op vs base │
DeriveSha200/stack_trie-8 45.17Ki ± 0% 25.65Ki ± 0% -43.21% (p=0.000 n=10)
│ derivesha.1 │ derivesha.2 │
│ allocs/op │ allocs/op vs base │
DeriveSha200/stack_trie-8 1259.0 ± 0% 232.0 ± 0% -81.57% (p=0.000 n=10)
```
This PR further enhances that:
```
goos: linux
goarch: amd64
pkg: github.com/ethereum/go-ethereum/core/types
cpu: 12th Gen Intel(R) Core(TM) i7-1270P
│ derivesha.2 │ derivesha.3 │
│ sec/op │ sec/op vs base │
DeriveSha200/stack_trie-8 430.0µ ± 12% 423.6µ ± 13% ~ (p=0.739 n=10)
│ derivesha.2 │ derivesha.3 │
│ B/op │ B/op vs base │
DeriveSha200/stack_trie-8 25.654Ki ± 0% 4.960Ki ± 0% -80.67% (p=0.000 n=10)
│ derivesha.2 │ derivesha.3 │
│ allocs/op │ allocs/op vs base │
DeriveSha200/stack_trie-8 232.00 ± 0% 37.00 ± 0% -84.05% (p=0.000 n=10)
```
So the total derivesha-improvement over *both PRS* is:
```
goos: linux
goarch: amd64
pkg: github.com/ethereum/go-ethereum/core/types
cpu: 12th Gen Intel(R) Core(TM) i7-1270P
│ derivesha.1 │ derivesha.3 │
│ sec/op │ sec/op vs base │
DeriveSha200/stack_trie-8 477.8µ ± 2% 423.6µ ± 13% -11.33% (p=0.015 n=10)
│ derivesha.1 │ derivesha.3 │
│ B/op │ B/op vs base │
DeriveSha200/stack_trie-8 45.171Ki ± 0% 4.960Ki ± 0% -89.02% (p=0.000 n=10)
│ derivesha.1 │ derivesha.3 │
│ allocs/op │ allocs/op vs base │
DeriveSha200/stack_trie-8 1259.00 ± 0% 37.00 ± 0% -97.06% (p=0.000 n=10)
```
Since this PR always copies the incoming value, it adds a little bit of
a penalty on the previous insert-benchmark, which copied nothing (always
passed the same empty slice as input) :
```
goos: linux
goarch: amd64
pkg: github.com/ethereum/go-ethereum/trie
cpu: 12th Gen Intel(R) Core(TM) i7-1270P
│ stacktrie.7 │ stacktrie.10 │
│ sec/op │ sec/op vs base │
Insert100K-8 88.21m ± 34% 92.37m ± 31% ~ (p=0.280 n=10)
│ stacktrie.7 │ stacktrie.10 │
│ B/op │ B/op vs base │
Insert100K-8 3.424Ki ± 3% 4.581Ki ± 3% +33.80% (p=0.000 n=10)
│ stacktrie.7 │ stacktrie.10 │
│ allocs/op │ allocs/op vs base │
Insert100K-8 22.00 ± 5% 26.00 ± 4% +18.18% (p=0.000 n=10)
```
---------
Co-authored-by: Gary Rong <garyrong0905@gmail.com>
Co-authored-by: Felix Lange <fjl@twurst.com>
* p2p/enode: fix discovery AyncFilter deadlock on shutdown (#32572)
Description:
We found a occasionally node hang issue on BSC, I think Geth may
also have the issue, so pick the fix patch here.
The fix on BSC repo: https://github.com/bnb-chain/bsc/pull/3347
When the hang occurs, there are two routines stuck.
- routine 1: AsyncFilter(...)
On node start, it will run part of the DiscoveryV4 protocol, which could
take considerable time, here is its hang callstack:
```
goroutine 9711 [chan receive]: // this routine was stuck on read channel: `<-f.slots`
github.com/ethereum/go-ethereum/p2p/enode.AsyncFilter.func1()
github.com/ethereum/go-ethereum/p2p/enode/iter.go:206 +0x125
created by github.com/ethereum/go-ethereum/p2p/enode.AsyncFilter in goroutine 1
github.com/ethereum/go-ethereum/p2p/enode/iter.go:192 +0x205
```
- Routine 2: Node Stop
It is the main routine to shutdown the process, but it got stuck when it
tries to shutdown the discovery components, as it tries to drain the
channel of `<-f.slots`, but the extra 1 slot will never have chance to
be resumed.
```
goroutine 11796 [chan receive]:
github.com/ethereum/go-ethereum/p2p/enode.(*asyncFilterIter).Close.func1()
github.com/ethereum/go-ethereum/p2p/enode/iter.go:248 +0x5c
sync.(*Once).doSlow(0xc032a97cb8?, 0xc032a97d18?)
sync/once.go:78 +0xab
sync.(*Once).Do(...)
sync/once.go:69
github.com/ethereum/go-ethereum/p2p/enode.(*asyncFilterIter).Close(0xc092ff8d00?)
github.com/ethereum/go-ethereum/p2p/enode/iter.go:244 +0x36
github.com/ethereum/go-ethereum/p2p/enode.(*bufferIter).Close.func1()
github.com/ethereum/go-ethereum/p2p/enode/iter.go:299 +0x24
sync.(*Once).doSlow(0x11a175f?, 0x2bfe63e?)
sync/once.go:78 +0xab
sync.(*Once).Do(...)
sync/once.go:69
github.com/ethereum/go-ethereum/p2p/enode.(*bufferIter).Close(0x30?)
github.com/ethereum/go-ethereum/p2p/enode/iter.go:298 +0x36
github.com/ethereum/go-ethereum/p2p/enode.(*FairMix).Close(0xc0004bfea0)
github.com/ethereum/go-ethereum/p2p/enode/iter.go:379 +0xb7
github.com/ethereum/go-ethereum/eth.(*Ethereum).Stop(0xc000997b00)
github.com/ethereum/go-ethereum/eth/backend.go:960 +0x4a
github.com/ethereum/go-ethereum/node.(*Node).stopServices(0xc0001362a0, {0xc012e16330, 0x1, 0xc000111410?})
github.com/ethereum/go-ethereum/node/node.go:333 +0xb3
github.com/ethereum/go-ethereum/node.(*Node).Close(0xc0001362a0)
github.com/ethereum/go-ethereum/node/node.go:263 +0x167
created by github.com/ethereum/go-ethereum/cmd/utils.StartNode.func1.1 in goroutine 9729
github.com/ethereum/go-ethereum/cmd/utils/cmd.go:101 +0x78
```
The rootcause of the hang is caused by the extra 1 slot, which was
designed to make sure the routines in `AsyncFilter(...)` can be
finished. This PR fixes it by making sure the extra 1 shot can always be
resumed when node shutdown.
* 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.
* p2p/enode: fix asyncfilter comment (#32823)
just finisher the sentence
Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
* trie: cleaner array concatenation (#32756)
It uses the slices.Concat and slices.Clone methods available now in Go.
* internal/ethapi: add timestamp to logs in eth_simulate (#32831)
Adds blockTimestamp to the logs in response of eth_simulateV1.
---------
Co-authored-by: Sina Mahmoodi <itz.s1na@gmail.com>
* build: faster gh actions workflow, no ubuntu on appveyor (#32829)
This PR does a few things:
- Sets the gh actions runner sizes for lint (s) and test (l) workflows
- Runs the tests on gh actions in parallel
- Skips fetching the spec tests when unnecessary (on windows in
appveyor)
- Removes ubuntu appveyor runner since it's essentially duplicate of the
gh action workflow now
The gh test seems to go down from ~35min to ~13min.
* cmd/devp2p/internal/ethtest: update to PoS-only test chain (#32850)
* core/rawdb: remove duplicated type storedReceiptRLP (#32820)
Co-authored-by: Felix Lange <fjl@twurst.com>
* eth/protocols/eth: use BlockChain interface in Handshake (#32847)
* cmd/devp2p/internal/ethtest: accept responses in any order (#32834)
In both `TestSimultaneousRequests` and `TestSameRequestID`, we send two
concurrent requests. The client under test is free to respond in either
order, so we need to handle responses both ways.
Also fixes an issue where some generated blob transactions didn't have
any blobs.
---------
Co-authored-by: Felix Lange <fjl@twurst.com>
* core/rawdb: correct misleading comments for state history accessors (#32783)
* eth/filters: terminate pending tx subscription on error (#32794)
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.
* eth/filters: add `transactionReceipts` subscription (#32697)
- 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>
* core/txpool/legacypool: fix validTxMeter to count transactions (#32845)
invalidTxMeter was counting txs, while validTxMeter was counting
accounts. Better make the two comparable.
---------
Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
* eth/protocols/snap: optimize incHash (#32748)
* core/rawdb, triedb/pathdb: introduce trienode history (#32596)
It's a pull request based on the #32523 , implementing the structure of
trienode history.
* ethclient: add SubscribeTransactionReceipts (#32869)
Add `SubscribeTransactionReceipts` for ethclient. This is a complement
to https://github.com/ethereum/go-ethereum/pull/32697.
* node: fix error condition in gzipResponseWriter.init() (#32896)
* core/types: optimize MergeBloom by using bitutil (#32882)
```
goos: darwin
goarch: amd64
pkg: github.com/ethereum/go-ethereum/core/types
cpu: VirtualApple @ 2.50GHz
│ old.txt │ new.txt │
│ sec/op │ sec/op vs base │
CreateBloom/small-createbloom-10 1.676µ ± 4% 1.646µ ± 1% -1.76% (p=0.000 n=10)
CreateBloom/large-createbloom-10 164.8µ ± 3% 164.3µ ± 0% ~ (p=0.247 n=10)
CreateBloom/small-mergebloom-10 231.60n ± 0% 68.00n ± 0% -70.64% (p=0.000 n=10)
CreateBloom/large-mergebloom-10 21.803µ ± 3% 5.107µ ± 1% -76.58% (p=0.000 n=10)
geomean 6.111µ 3.113µ -49.06%
│ old.txt │ new.txt │
│ B/op │ B/op vs base │
CreateBloom/small-createbloom-10 112.0 ± 0% 112.0 ± 0% ~ (p=1.000 n=10) ¹
CreateBloom/large-createbloom-10 10.94Ki ± 0% 10.94Ki ± 0% ~ (p=0.474 n=10)
CreateBloom/small-mergebloom-10 0.000 ± 0% 0.000 ± 0% ~ (p=1.000 n=10) ¹
CreateBloom/large-mergebloom-10 0.000 ± 0% 0.000 ± 0% ~ (p=1.000 n=10) ¹
geomean ² +0.00% ²
¹ all samples are equal
² summaries must be >0 to compute geomean
│ old.txt │ new.txt │
│ allocs/op │ allocs/op vs base │
CreateBloom/small-createbloom-10 6.000 ± 0% 6.000 ± 0% ~ (p=1.000 n=10) ¹
CreateBloom/large-createbloom-10 600.0 ± 0% 600.0 ± 0% ~ (p=1.000 n=10) ¹
CreateBloom/small-mergebloom-10 0.000 ± 0% 0.000 ± 0% ~ (p=1.000 n=10) ¹
CreateBloom/large-mergebloom-10 0.000 ± 0% 0.000 ± 0% ~ (p=1.000 n=10) ¹
geomean ² +0.00% ²
¹ all samples are equal
² summaries must be >0 to compute geomean
```
* p2p: rm unused var seedMinTableTime (#32876)
* 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.
* triedb, core/rawdb: implement the partial read in freezer (#32132)
This PR implements the partial read functionalities in the freezer, optimizing
the state history reader by resolving less data from freezer.
---------
Signed-off-by: jsvisa <delweng@gmail.com>
Co-authored-by: Gary Rong <garyrong0905@gmail.com>
* p2p/enode: optimize LogDist (#32887)
This speeds up LogDist by 75% using 64-bit operations instead
of byte-wise XOR.
---------
Co-authored-by: Felix Lange <fjl@twurst.com>
* p2p/enode: optimize DistCmp (#32888)
This speeds up DistCmp by 75% through using 64-bit operations instead of
byte-wise XOR.
* core/txpool/legacypool: move queue out of main txpool (#32270)
This PR move the queue out of the main transaction pool.
For now there should be no functional changes.
I see this as a first step to refactor the legacypool and make the queue
a fully separate concept from the main pending pool.
---------
Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
Co-authored-by: Csaba Kiraly <csaba.kiraly@gmail.com>
* cmd/workload: filter fuzzer test (#31613)
This PR adds a `filterfuzz` subcommand to the workload tester that
generates requests similarly to `filtergen` (though with a much smaller
block length limit) and also verifies the results by retrieving all
block receipts in the range and locally filtering out relevant results.
Unlike `filtergen` that operates on the finalized chain range only,
`filterfuzz` does check the head region, actually it seeds a new query
at every new chain head.
* p2p/discover: wait for bootstrap to be done (#32881)
This ensures the node is ready to accept other nodes into the
table before it is used in a test.
Closes #32863
* triedb/pathdb: catch int conversion overflow in 32-bit (#32899)
The limit check for `MaxUint32` is done after the cast to `int`. On 64
bits machines, that will work without a problem. On 32 bits machines,
that will always fail. The compiler catches it and refuses to build.
Note that this only fixes the compiler build. ~~If the limit is above
`MaxInt32` but strictly below `MaxUint32` then this will fail at runtime
and we have another issue.~~ I checked and this should not happen during
regular execution, although it might happen in tests.
* eth/catalyst: remove useless log on enabling Engine API (#32901)
* eth: do not warn on switching from snap sync to full sync (#32900)
This happens normally after a restart, so it is better to use Info level
here.
Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
* core/txpool/legacypool: fix pricedList updates (#32906)
This pr addresses a few issues brought by the #32270
- Add updates to pricedList after dropping transactions.
- Remove redundant deletions in queue.evictList, since
pool.removeTx(hash, true, true) already performs the removal.
- Prevent duplicate addresses during promotion when Reset is not nil.
* accounts/abi: check presence of payable fallback or receive before proceeding with transfer (#32374)
remove todo
* internal/ethapi: convert legacy blobtx proofs in sendRawTransaction (#32849)
This adds a temporary conversion path for blob transactions with legacy
proof sidecar. This feature will activate after Fusaka. We will phase
this out when the fork has sufficiently settled and client side
libraries have been upgraded to send the new proofs.
* core,miner,parms: DA footprint block limit (constant gas scalar) (#655)
* all: Make DA footprint gas scalar configurable (#675)
Co-authored-by: Sebastian Stammler <seb@oplabs.co>
* rpc: fix flaky test TestServerWebsocketReadLimit (#32889)
* 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>
* p2p/discover: remove hot-spin in table refresh trigger (#32912)
This fixes a regression introduced in #32518. In that PR, we removed the
slowdown logic that would throttle lookups when the table runs empty.
Said logic was originally added in #20389.
Usually it's fine, but there exist pathological cases, such as hive
tests, where the node can only discover one other node, so it can only
ever query that node and won't get any results. In cases like these, we
need to throttle the creation of lookups to avoid crazy CPU usage.
* version: release go-ethereum v1.16.5 stable
* version: begin v1.16.6 release cycle
* core/types: implement operator fee fix (Jovian) (#696)
* fix!: multiply operatorFeeScalar by 100 instead of dividing by 1e6
* apply comments
* apply comments
* remove dup IsOperatorFeeFix
---------
Co-authored-by: fakedev9999 <taehoon@succinct.xyz>
* cmd/geth: log current key in expandVerkle instead of keylist[0] (#32689)
Fix logging in the verkle dump path to report the actual key being
processed.
Previously, the loop always logged keylist[0], which misled users when
expanding multiple keys and made debugging harder. This change aligns
the
log with the key passed to root.Get, improving traceability and
diagnostics.
* consensus/beacon: Fix OP Legacy header verification dispatch (#697)
* ethclient: add support for eth_simulateV1 (#32856)
Adds ethclient support for the eth_simulateV1 RPC method, which allows
simulating transactions on top of a base state without making changes to
the blockchain.
---------
Co-authored-by: Sina Mahmoodi <itz.s1na@gmail.com>
* 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>
* core/state: state copy bugfixes with Verkle Trees (#31696)
This change addresses critical issues in the state object duplication
process specific to Verkle trie implementations. Without these
modifications, updates to state objects fail to propagate correctly
through the trie structure after a statedb copy operation, leading to
inaccuracies in the computation of the state root hash.
---------
Co-authored-by: Guillaume Ballet <3272758+gballet@users.noreply.github.com>
* eth/ethconfig : fix eth generate config (#32929)
* eth, internal: add blob conversion for SendRawTransactionSync (#32930)
* all: Store DA footprint in blob gas used header field (#694)
* cmd/utils: use maximum uint64 value for receipt chain insertion (#32934)
* 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`.
* 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.
* triedb/pathdb: fix index out of range panic in decodeSingle (#32937)
Fixes TestCorruptedKeySection flaky test failure.
https://github.com/ethereum/go-ethereum/actions/runs/18600235182/job/53037084761?pr=32920
* core/types: prealloc map in HashDifference as in TxDifference (#32946)
* eth/filters: avoid rebuild the hash map multi times (#32965)
* core/vm: don't call SetCode after contract creation if initcode didn't return anything (#32916)
The code change is a noop here, and the tracing hook shouldn't be
invoked if the account code doesn't actually change.
* cmd/keeper: use the ziren keccak precompile (#32816)
Uses the go module's `replace` directive to delegate keccak computation
to precompiles.
This is still in draft because it needs more testing. Also, it relies on
a PR that I created, that hasn't been merged yet.
_Note that this PR doesn't implement the stateful keccak state
structure, and it reverts to the current behavior. This is a bit silly
since this is what is used in the tree root computation. The runtime
doesn't currently export the sponge. I will see if I can fix that in a
further PR, but it is going to take more time. In the meantime, this is
a useful first step_
* params: enable osaka on dev mode (#32917)
enables the osaka fork on dev mode
---------
Co-authored-by: Sina Mahmoodi <itz.s1na@gmail.com>
* core/txpool: Initialize journal writer for tx tracker (#32921)
Previously, the journal writer is nil until the first time rejournal
(default 1h), which means during this period, txs submitted to this node
are not written into journal file (transactions.rlp). If this node is
shutdown before the first time rejournal, then txs in pending or queue
will get lost.
Here, this PR initializes the journal writer soon after launch to solve
this issue.
---------
Co-authored-by: Gary Rong <garyrong0905@gmail.com>
* core/state: prevent SetCode hook if contract code is not changed (#32980)
This PR prevents the SetCode hook from being called when the contract
code
remains unchanged.
This situation can occur in the following cases:
- The deployed runtime code has zero length
- An EIP-7702 authorization attempt tries to unset a non-delegated
account
- An EIP-7702 authorization attempt tries to delegate to the same
account
* triedb/pathdb: make batch with pre-allocated size (#32914)
In this PR, the database batch for writing the history index data is
pre-allocated.
It's observed that database batch repeatedly grows the size of the
mega-batch,
causing significant memory allocation pressure. This approach can
effectively
mitigate the overhead.
* cmd/geth: add flag to set genesis (#32844)
This PR is an alternative to #32556.
Instead of trying to be smart and reuse `geth init`, we can introduce a
new flag `--genesis` that loads the `genesis.json` from file into the
`Genesis` object in the same path that the other network flags currently
work in.
Question: is something like `--genesis` enough to start deprecating
`geth init`?
--
```console
$ geth --datadir data --hoodi
..
INFO [10-06|22:37:11.202] - BPO2: @1762955544
..
$ geth --datadir data --genesis genesis.json
..
INFO [10-06|22:37:27.988] - BPO2: @1862955544
..
```
Pull the genesis [from the
specs](https://raw.githubusercontent.com/eth-clients/hoodi/refs/heads/main/metadata/genesis.json)
and modify one of the BPO timestamps to simulate a shadow fork.
---------
Co-authored-by: rjl493456442 <garyrong0905@gmail.com>
* core/types: remove unused `ErrInvalidTxType` var (#32989)
The var `ErrInvalidTxType` is never used in the code base.
* core/state: fix the flaky TestSizeTracker (#32993)
* cmd/devp2p: distinguish the jwt in devp2p and geth (#32972)
This PR fixes some docs for the devp2p suite and uses the CLI library's required value instead of manually checking if required flags are passed.
* all: update c-kzg-4844 to 2.1.5 (#702)
* superchain: update scr import to include worldchain-sepolia isthmus time (#704)
* p2p: silence on listener shutdown (#33001)
Co-authored-by: Felix Lange <fjl@twurst.com>
* cmd/utils: use IsHexAddress method (#32997)
Using the `IsHexAddress` method will result in no gaps in the
verification logic, making it simpler.
* crypto: implement ziren keccak state (#32996)
The #32816 was only using the keccak precompile for some minor task.
This PR implements a keccak state, which is what is used for hashing the
tree.
* rpc: fix a flaky test of the websocket (#33002)
Found in
https://github.com/ethereum/go-ethereum/actions/runs/17803828253/job/50611300621?pr=32585
```
--- FAIL: TestClientCancelWebsocket (0.33s)
panic: read tcp 127.0.0.1:36048->127.0.0.1:38643: read: connection reset by peer [recovered, repanicked]
goroutine 15 [running]:
testing.tRunner.func1.2({0x98dd20, 0xc0005b0100})
/opt/actions-runner/_work/_tool/go/1.25.1/x64/src/testing/testing.go:1872 +0x237
testing.tRunner.func1()
/opt/actions-runner/_work/_tool/go/1.25.1/x64/src/testing/testing.go:1875 +0x35b
panic({0x98dd20?, 0xc0005b0100?})
/opt/actions-runner/_work/_tool/go/1.25.1/x64/src/runtime/panic.go:783 +0x132
github.com/ethereum/go-ethereum/rpc.httpTestClient(0xc0001dc1c0?, {0x9d5e40, 0x2}, 0xc0002bc1c0)
/opt/actions-runner/_work/go-ethereum/go-ethereum/rpc/client_test.go:932 +0x2b1
github.com/ethereum/go-ethereum/rpc.testClientCancel({0x9d5e40, 0x2}, 0xc0001dc1c0)
/opt/actions-runner/_work/go-ethereum/go-ethereum/rpc/client_test.go:356 +0x15f
github.com/ethereum/go-ethereum/rpc.TestClientCancelWebsocket(0xc0001dc1c0?)
/opt/actions-runner/_work/go-ethereum/go-ethereum/rpc/client_test.go:319 +0x25
testing.tRunner(0xc0001dc1c0, 0xa07370)
/opt/actions-runner/_work/_tool/go/1.25.1/x64/src/testing/testing.go:1934 +0xea
created by testing.(*T).Run in goroutine 1
/opt/actions-runner/_work/_tool/go/1.25.1/x64/src/testing/testing.go:1997 +0x465
FAIL github.com/ethereum/go-ethereum/rpc 0.371s
```
In `testClientCancel` we wrap the server listener in `flakeyListener`,
which schedules an unconditional close of every accepted connection
after a random delay, if the random delay is zero then the timer fires
immediately, and then the http client paniced of connection reset by
peer.
Here we add a minimum 10ms to ensure the timeout won't fire immediately.
Signed-off-by: jsvisa <delweng@gmail.com>
* core: add gauge metrics + histograms for block gas used and blob gas used (#705)
* core: add gauge metric for block gas used and blob gas used
This can be used to track the DA footprint per block
* encapsulate OPStack additions into new file and function
* add histogram metrics for (blob)GasUsed
* update fork.yaml
* typos
* 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>
* .gitea/workflows, build: add release build for keeper (#32632)
* build: fix keeper build (#33018)
At the time keeper support was added into ci.go, we were using a go.work
file to make ./cmd/keeper accessible from within the main go-ethereum
module. The workspace file has since been removed, so we need to build
keeper from within its own module instead.
* superchain: update scr import to include jovian activation timestamp (#707)
* core/rawdb, triedb/pathdb: re-structure the trienode history header (#32907)
In this PR, several changes have been made:
(a) restructure the trienode history header section
Previously, the offsets of the key and value sections were recorded before
encoding data into these sections. As a result, these offsets referred to the
start position of each chunk rather than the end position.
This caused an issue where the end position of the last chunk was
unknown, making it incompatible with the freezer partial-read APIs.
With this update, all offsets now refer to the end position, and the
start position of the first chunk is always 0.
(b) Enable partial freezer read for trienode data retrieval
The partial freezer read feature is now utilized in trienode data
retrieval, improving efficiency.
* rpc: remove unused vars (#33012)
* core/state: improve accessList copy (#33024)
* core: don't modify the shared chainId between tests (#33020)
* core/types: optimize modernSigner.Equal (#32971)
Equal is called every time the transaction sender is accessed,
even when the sender is cached, so it is worth optimizing.
---------
Co-authored-by: Felix Lange <fjl@twurst.com>
* Add new precompile limits for Jovian (#709)
This introduces more realistic limits on accelerated precompiles for the Jovian hard fork.
* core: refine condition for using legacy chain freezer directory (#33032)
* internal/jsre: pass correct args to setTimeout/setInterval callbacks (#32936)
## Description
- Summary: Correct the JS timer callback argument forwarding to match
standard JS semantics.
- What changed: In `internal/jsre/jsre.go`, the callback is now invoked
with only the arguments after the callback and delay.
- Why: Previously, the callback received the function and delay as
parameters, causing unexpected behavior and logic bugs for consumers.
* .github: add 32-bit CI targets (#32911)
This adds two new CI targets. One is for building all supported keeper
executables, the other is for running unit tests on 32-bit Linux.
---------
Co-authored-by: Felix Lange <fjl@twurst.com>
* superchain: Update for new Jovian timestamps (#712)
* core/types: Populate Jovian receipt fields (#710)
* core/types: Move receipt tests OP diff to separate file
* core/types: Populate Jovian receipt fields
* accounts/abi/bind/v2: fix error assertion in test (#33041)
* p2p: cleanup v4 if v5 failed (#33005)
Clean the previous resource (v4) if the latter (v5) failed.
* common: simplify FileExist helper (#32969)
* eth/downloader: fix incorrect waitgroup in test `XTestDelivery` (#33047)
* eth/tracers: fix prestateTracer for EIP-6780 SELFDESTRUCT (#33050)
fix https://github.com/ethereum/go-ethereum/issues/33049
* common: fix duration comparison in PrettyAge (#33064)
This pull request updates `PrettyAge.String` so that the age formatter
now treats exact unit boundaries (like a full day or week) as that unit
instead of spilling into smaller components, keeping duration output
aligned with human expectations.
* core/rawdb: fix db inspector by supporting trienode history (#33087)
* params: set osaka and BPO1 & BPO2 mainnet dates (#33063)
Sets the fusaka, bpo1, bpo2 timestamps for mainnet
see: https://notes.ethereum.org/@bbusa/fusaka-bpo-timeline
* version: release go-ethereum v1.16.6
* version: begin v1.16.7 release cycle
* core/txpool/blobpool: migrate billy to new slot size (#31966)
Implements a migration path for the blobpool slotter
---------
Co-authored-by: lightclient <lightclient@protonmail.com>
Co-authored-by: lightclient <14004106+lightclient@users.noreply.github.com>
Co-authored-by: Gary Rong <garyrong0905@gmail.com>
* params: set osaka and BPO1 & BPO2 mainnet dates (#33063)
Sets the fusaka, bpo1, bpo2 timestamps for mainnet
see: https://notes.ethereum.org/@bbusa/fusaka-bpo-timeline
* superchain: update for new Jovian timestamps (#716)
* go.mod: update to c-kzg v2.1.5 (#33093)
We unfortunately missed this update for the Geth v1.16.6 release, but it is critical.
* version: release go-ethereum v1.16.7 stable
* triedb/pathdb: sync ancient store before journal (#32557) (#718)
This pull request addresses the corrupted path database with log
indicating:
`history head truncation out of range, tail: 122557, head: 212208,
target: 212557`
This is a rare edge case where the in-memory layers, including the write
buffer
in the disk layer, are fully persisted (e.g., written to file), but the
state history
freezer is not properly closed (e.g., Geth is terminated after
journaling but
before freezer.Close). In this situation, the recent state history
writes will be
truncated on the next startup, while the in-memory layers resolve
correctly.
As a result, the state history falls behind the disk layer (including
the write buffer).
In this pull request, the state history freezer is always synced before
journal,
ensuring the state history writes are always persisted before the
others.
Edit:
It's confirmed that devops team has 10s container termination setting.
It
explains why Geth didn't finish the entire termination without state
history
being closed.
https://github.com/ethpandaops/fusaka-devnets/pull/63/files
Co-authored-by: rjl493456442 <garyrong0905@gmail.com>
* ci: add GitHub Actions workflow to build, attest and sign op-geth docker image (#720)
Signed-off-by: falcorocks <14293929+falcorocks@users.noreply.github.com>
* eth, cmd: add RollupNetrestrictTxPoolGossipFlag and RollupTxPoolTrustedPeersOnlyFlag (#706)
* eth, cmd: add RollupNetrestrictTxPoolGossipFlag
* fork.yaml: description of fork changes for tx gossip netrestrict
* eth: h.syncTransactions behind check for netrestrict for txpool gossip
* eth, eth/protocols: propagate netrestrict to Peer and limit incoming/outgoing message.
* eth, cmd: add RollupNetrestrictTxPoolGossipFlag PoC using `NilPool` (#713)
* Make peer struct not aware of ip net restrict
* Propagate Peer ip info to txpool
* fix
* cleanup
* eth/handler_test: unit test for TxGossipNetRestrict and TxPool() method
* eth: add short-circuit for incoming messages
* eth: rely on AcceptTxs
* eth: all tx propagating by default
* consistent OP Stack additions comment
* eth, cmd: restrict mempool only to trusted peers (#719)
* address comments
* eth/handler_test: modify unit test to check for trusted conn too
* add txGossipAllowed
* correct comments
* update fork.yaml
---------
Co-authored-by: Changwan Park <pcw109550@gmail.com>
* downloader: skip blobGasUsed check for optimism chains on Jovian (#723)
* Add IsOptimismJovian check to validate BlobGasUsed header field
Allow nonzero BlobGasUsed for Jovian headers on Optimism chains while
validating blob gas usage for other chains as before.
* tweak comment
* space
* superchain: update for new Jovian timestamps (#724)
* jovian: remove feature toggles (#703)
* jovian: remove feature toggles
the scope is now locked
* Rename MinBaseFee extraData identifiers to Jovian
* Fix expected error message in Optimism test
* Add test and comments for new Jovian precompile input size limits (#731)
* dockerfile: pin to alpine 3.22 (#737)
* dockerfile: pin to alpine 3.22
* pin ca-certificates version
* dockerfile: pin to golang:1.24-alpine@sha256:12c199
* dockerfile: pin to golang:1.24-alpine3.22
* Update superchain registry (#736)
* params: Set JovianTime to zero in OptimismTestConfig (#742)
* params: Set JovianTime to zero and remove Osaka in OptimismTestConfig
* Unset OsakaTime in OptimismTestConfig
* Fix `eth_simulateV1` after Jovian fork (#732)
* fix(eth_simulatev1): Create synthetic Jovian Deposit TX, to not fail in the CalcDAFootprint() function.
* fix(eth_simulatev1): Return block without synthetic Jovian deposit tx.
* fix(eth_simulatev1): Extract JovianDepositTx() from tests, activate Jovian fork based on parent.Time.
* Inject L1 attributes tx in Optimism simulation
* Unexport JovianDepositTx and move to tests
Remove exported JovianDepositTx from core/types and add a local
jovianDepositTx helper in miner tests. Also remove the unused
encoding/binary import from the core/types file and add it to the test
files where needed.
* Pass nil options to sim.execute in test
* Pass nil as second argument in simulation test
* Embed L1 attributes tx in simulator
* Handle Optimism genesis without L1 tx
* Rename finalTxes to prependedTxes
* Remove nil argument from sim.execute calls
* Update internal/ethapi/api.go
Co-authored-by: kustrun <9192608+kustrun@users.noreply.github.com>
---------
Co-authored-by: geoknee <georgeknee@googlemail.com>
* Run go run build/ci.go check_generate (#741)
* Run go run build/ci.go check_generate
Unfortunately, the check_generate script doesn't consider eth/ethconfig,
so ci can't catch this.
* Fix check_generate script and add it to ci
* consensus/misc/eip1559: Improve Holocene EIP-1559 params checks (#743)
* version: begin v1.16.8 release cycle
* core/txpool: drop peers on invalid KZG proofs
Co-authored-by: Gary Rong <garyrong0905@gmail.com>
Co-authored-by: MariusVanDerWijden <m.vanderwijden@live.de>:
* crypto/ecies: use aes blocksize
Co-authored-by: Gary Rong <garyrong0905@gmail.com>
* version: release go-ethereum v1.16.8 stable
* all: reduce diff to upstream (#748)
* miner: fix flaky TestInteropTxRejectedWithFailsafe test (#752)
The test was flaky due to a race condition in transaction pool handling.
When calling txpool.Add() with sync=false, the transaction is added to
the pool's queue but promotion to the "pending" pool happens
asynchronously in a background goroutine.
The test's Has() check passed because it checks all transactions (both
queued and pending), but generateWork() only retrieves transactions from
the "pending" pool via Pending(). If the background promotion hadn't
completed yet, the transaction wouldn't be processed.
Fix by changing sync=false to sync=true, ensuring the Add() call waits
for the transaction to be promoted to the pending pool before returning.
* miner: fix flaky TestDAFilters tests (#753)
Same root cause as d78d84f51: txpool.Add() with sync=false returns
before transactions are promoted to the pending pool, causing a race
with buildPayload() which only retrieves pending transactions.
Fix by changing sync=false to sync=true.
* Bump fork.yaml ref to v1.16.8 (#760)
* sync-superchain: use yq instead of dasel (#762)
* sync-superchain: use yq instead of dasel
Replaces dasel with yq for reading TOML files. yq has more stable syntax
across versions and is more commonly used in the ecosystem.
* ci: update to use yq instead of dasel
Updates CircleCI config to install yq instead of dasel for the
check-sr-diff job.
* ci: pin yq to v4.44.1
* crypto/ecies: fix ECIES invalid-curve handling (#33669)
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…
Fixes a regression introduced in #31791, see ethereum/go-ethereum#31791 (comment)
As a consequence of moving blob sidecar version migration code around, we ended up building blocks with a mix of v0 and v1 blob transactions (different proof encoding in the sidecar). This PR makes sure we are not building illegal blocks after Osaka. Blob migration is left for another PR. Related issues and PRs: - ethereum/go-ethereum#31791 - ethereum/go-ethereum#32347 - ethereum/go-ethereum#31966 - ethereum/go-ethereum#32235 --------- Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
Implements
engine_getBlobsV2which is needed for PeerDAS