Skip to content

Add eraE file format#16

Open
lightclient wants to merge 13 commits intoeth-clients:mainfrom
lightclient:add-erae-spec
Open

Add eraE file format#16
lightclient wants to merge 13 commits intoeth-clients:mainfrom
lightclient:add-erae-spec

Conversation

@lightclient
Copy link
Copy Markdown

@lightclient lightclient commented Feb 11, 2026

This added the EraE file format as we discussed in Berlin last year. It's been implemented and testing in go-ethereum and was recently merged into master: ethereum/go-ethereum#32157

Execution clients hoping to import historical block data can expect availability of that block data in this file format.

--

A few main differences between Era1 and EraE:

  • snappy encode uses block encoding instead of stream to match Era format
  • receipt type changes to "slim" receipt which does not include bloom filters
  • support for post-merge block data
  • component count allows dynamically sized item index
  • proofs is a future-compatible (optional) value that can be used to prove EraE files against a trusted CL header

Comment thread formats/erae.md Outdated
Copy link
Copy Markdown

@s1na s1na left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Copy Markdown
Member

@KolbyML KolbyML left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you update

with new new types you are defining

Ideally new types use unique type indexes

Comment thread formats/erae.md Outdated
Comment thread formats/erae.md Outdated
lightclient added a commit to ethereum/go-ethereum that referenced this pull request Feb 11, 2026
Update to match the spec:
eth-clients/e2store-format-specs#16

---------

Co-authored-by: lightclient <lightclient@protonmail.com>
Comment thread formats/erae.md Outdated
Comment thread formats/erae.md Outdated
Comment thread formats/ere.md
Comment thread formats/erae.md Outdated
Comment thread formats/erae.md Outdated
@lightclient
Copy link
Copy Markdown
Author

Resolved or responded to all commends - PTAL!

Copy link
Copy Markdown
Member

@KolbyML KolbyML left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good on my side

Could you add the new types to this markdown table https://github.com/eth-clients/e2store-format-specs/blob/main/types/README.md just so it is easier to see what formats the types are used in

I am assuming we are waiting to see what @arnetheduck and @kdeme have to say

Comment thread formats/erae.md Outdated
Comment thread formats/erae.md Outdated
lightclient and others added 2 commits February 13, 2026 05:51
Co-authored-by: kdeme <7857583+kdeme@users.noreply.github.com>
Co-authored-by: kdeme <7857583+kdeme@users.noreply.github.com>
Comment thread formats/erae.md Outdated
Comment thread formats/erae.md Outdated

indexes := header-index | body-index | receipts-index | difficulty-index? | proof-index?

The value `component-count` is the number of indexes stored by `indexes`. It should be in the range of 3-5, depending on whether `TotalyDifficulty` and `Proofs` are present
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo:

Suggested change
The value `component-count` is the number of indexes stored by `indexes`. It should be in the range of 3-5, depending on whether `TotalyDifficulty` and `Proofs` are present
The value `component-count` is the number of indexes stored by `indexes`. It should be in the range of 3-5, depending on whether `TotalDifficulty` and `Proofs` are present

Dargon789 added a commit to Dargon789/go-ethereum that referenced this pull request Feb 13, 2026
* core/state: make test output message readable (ethereum#33400)

* crypto/signify: fix fuzz test compilation (ethereum#33402)

The fuzz test file has been broken for a while - it doesn't compile with
the `gofuzz` build tag.

Two issues:
- Line 59: called `SignifySignFile` which doesn't exist (should be
`SignFile`)
- Line 71: used `:=` instead of `=` for already declared `err` variable

* core/overlay: fix incorrect debug log key/value in LoadTransitionState (ethereum#32637)

* core/state: fix code existence not marked correctly (ethereum#33415)

When iterating over a map with value types in Go, the loop variable is a
copy. In `markCodeExistence`, assigning to `code.exists` modified only
the local copy, not the actual map entry, causing the existence flag to
always remain false.

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

Fix by changing `codes` from `map[common.Address]contractCode` to
`map[common.Address]*contractCode`, so mutations apply directly to the
struct.

* cmd/workload, eth/tracers/native: introduce state proof tests (ethereum#32247)

This pull request introduces a new workload command, providing the
features
for `eth_getProof` endpoint test generation and execution.

* eth/catalyst: fix invalid timestamp log message (ethereum#33440)

Fixes a typo in the NewPayload invalid timestamp warning where the
parent timestamp was incorrectly logged as the block timestamp.

* core: add code read statistics (ethereum#33442)

* core/txpool/blobpool: remove legacy sidecar conversion (ethereum#33352)

This PR removes the legacy sidecar conversion logic.

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

Note that conversion at the RPC layer is still supported, and version 0
blob
transactions will be automatically converted to version 1 there.

* tests/fuzzers: remove unused field from kv struct in rangeproof fuzzer (ethereum#33447)

Removes the unused `t bool` field from the `kv` struct in the rangeproof fuzzer.

* eth/catalyst: return empty response for GetBlobsV2 before Osaka (ethereum#33444)

Fix ethereum#33420

* core, eth: add lock protection in snap sync (ethereum#33428)

Fixes ethereum#33396, ethereum#33397, ethereum#33398

* graphql: add nil check in block resolver (ethereum#33225)

Add nil checks for header and block in Block resolver methods to prevent
panic when querying non-existent blocks.

* core/txpool/blobpool: fix slotter size limit (ethereum#33474)

Blobs are stored per transaction in the pool, so we need billy to handle
up to the per-tx limit, not to the per-block limit.

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

Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>

* eth/downloader: fix stale beacon header deletion (ethereum#33481)

In this PR, two things have been fixed:

--- 

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

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

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

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

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

--- 

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

Once the skeleton chain links with local one, it will try to schedule the 
synchronization by fetching the missing blocks and import them then. 
It's possible the last subchain already overwrites the previous subchain and 
results in having two subchains leftover. As a result, an error log will printed
https://github.com/ethereum/go-ethereum/blob/master/eth/downloader/skeleton.go#L1074

* console/prompt: use PromptInput in PromptConfirm method (ethereum#33445)

* params: fix wrong comment (ethereum#33503)

It seems that the comment for CopyGas was wrongly associated to
SloadGas.

* trie, go.mod: remove all references to go-verkle and go-ipa (ethereum#33461)

In order to reduce the amount of code that is embedded into the keeper
binary, I am removing all the verkle code that uses go-verkle and
go-ipa. This will be followed by further PRs that are more like stubs to
replace code when the keeper build is detected.

I'm keeping the binary tree of course. This means that you will still
see `isVerkle` variables all over the codebase, but they will be renamed
when code is touched (i.e. this is not an invitation for 30+ AI slop
PRs).

---------

Co-authored-by: Gary Rong <garyrong0905@gmail.com>

* .github/workflows: preventively close PRs that seem AI-generated (ethereum#33414)

This is a new step in my crusade against the braindead fad of starting
PR titles with a word that is completely redundant with github labels,
thus wasting prime first-line real-estate for something that isn't
necessary.

I noticed that every single one of these PRs are low-quality AI-slop, so
I think there is a strong case to be made for these PRs to be
auto-closed. A message is added before closing the PR, redirecting to
our contribution guidelines, so I expect quality first-time contributors
to read them and reopen the PR. In the case of spam PRs, the author is
unlikely to revisit a given PR, and so auto-closing might have a
positive impact. That's an experiment worth trying, imo.

* triedb/pathdb: optimize history indexing efficiency (ethereum#33303)

This pull request optimizes history indexing by splitting a single large
database
 batch into multiple smaller chunks.

Originally, the indexer will resolve a batch of state histories and
commit all
corresponding index entries atomically together with the indexing
marker.

While indexing more state histories in a single batch improves
efficiency, excessively
large batches can cause significant memory issues.

To mitigate this, the pull request splits the mega-batch into several
smaller batches
and flushes them independently during indexing. However, this introduces
a potential
inconsistency that some index entries may be flushed while the indexing
marker is not,
and an unclean shutdown may leave the database in a partially updated
state.
This can corrupt index data.

To address this, head truncation is introduced. After a restart, any
excessive index
entries beyond the expected indexing marker are removed, ensuring the
index remains
consistent after an unclean shutdown.

* beacon/light/sync: clear reqFinalityEpoch on server unregistration (ethereum#33483)

HeadSync kept reqFinalityEpoch entries for servers after receiving
EvUnregistered, while other per-server maps were cleared. This left
stale request.Server keys reachable from HeadSync, which can lead to a
slow memory leak in setups that dynamically register and unregister
servers.

The fix adds deletion of the reqFinalityEpoch entry in the
EvUnregistered handler. This aligns HeadSync with the cleanup pattern
used by other sync modules and keeps the finality request bookkeeping
strictly limited to currently registered servers.

* cmd/geth: remove deprecated vulnerability check command (ethereum#33498)

This PR removes the version-check command and its associated logic as
discussed in issue ethereum#31222.

Removed versionCheckCommand from misccmd.go and main.go.

Deleted version_check.go and its corresponding tests.

Cleaned up testdata/vcheck directory (~800 lines of JSON/signatures
removed).

Verified build with make geth

* core/state/snapshot: fix storageList memory accounting (ethereum#33505)

* eth/catalyst: implement getBlobsV3 (ethereum#33404)

This is used by cell-level dissemination (aka partial messages) to give
the CL all blobs the EL knows about and let CL communicate efficiently
about any other missing blobs. In other words, partial responses from
the EL is useful now.

See the related (closed) PR:
ethereum/execution-apis#674 and the new PR:
ethereum/execution-apis#719

* core/blockchain.go: cleanup finalized block on rewind in setHeadBeyondRoot (ethereum#33486)

Fix ethereum#33390 

`setHeadBeyondRoot` was failing to invalidate finalized blocks because
it compared against the original head instead of the rewound root. This
fix updates the comparison to use the post-rewind block number,
preventing the node from reporting a finalized block that no longer
exists. Also added relevant test cases for it.

* eth/fetcher: improve the condition to stall peer in tx fetcher (ethereum#32725)

Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
Co-authored-by: Csaba Kiraly <csaba.kiraly@gmail.com>

* core/rawdb: add trienode freezer support to InspectFreezerTable (ethereum#33515)

Adds missing trienode freezer case to InspectFreezerTable, making it
consistent with InspectFreezer which already supports it.

Co-authored-by: m6xwzzz <maskk.weller@gmail.com>

* ethstats: report newPayload processing time to stats server (ethereum#33395)

Add NewPayloadEvent to track engine API newPayload block processing
times and report them to ethstats. This enables monitoring of block
processing performance.

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

related: ethereum#33231

---------

Co-authored-by: MariusVanDerWijden <m.vanderwijden@live.de>

* core: re-organize the stats category (ethereum#33525)

Check out https://hackmd.io/dg7rizTyTXuCf2LSa2LsyQ for more details

* eth: txs fetch/send log at trace level only (ethereum#33541)

This logging was too intensive at debug level, it is better to have it
at trace level only.

Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>

* core/vm: avoid escape to heap (ethereum#33537)

* core/state, core/tracing: new state update hook (ethereum#33490)

### Description
Add a new `OnStateUpdate` hook which gets invoked after state is
committed.

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

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

---------

Co-authored-by: Gary Rong <garyrong0905@gmail.com>

* core/state: add cache statistics of contract code reader (ethereum#33532)

* internal/flags: update copyright year to 2026 (ethereum#33550)

* graphql: fix GasPrice for blob and setcode transactions (ethereum#33542)

Adds BlobTxType and SetCodeTxType to GasPrice switch case, aligning with
`MaxFeePerGas` and `MaxPriorityFeePerGas` handling.

Co-authored-by: m6xwzzz <maskk.weller@gmail.com>

* triedb/pathdb: introduce extension to history index structure (ethereum#33399)

It's a PR based on ethereum#33303 and introduces an approach for trienode
history indexing.

---

In the current archive node design, resolving a historical trie node at
a specific block
involves the following steps:

- Look up the corresponding trie node index and locate the first entry
whose state ID
   is greater than the target state ID.
- Resolve the trie node from the associated trienode history object.

A naive approach would be to store mutation records for every trie node,
similar to
how flat state mutations are recorded. However, the total number of trie
nodes is
extremely large (approximately 2.4 billion), and the vast majority of
them are rarely
modified. Creating an index entry for each individual trie node would be
very wasteful
in both storage and indexing overhead. To address this, we aggregate
multiple trie
nodes into chunks and index mutations at the chunk level instead. 

---

For a storage trie, the trie is vertically partitioned into multiple sub
tries, each spanning
three consecutive levels. The top three levels (1 + 16 + 256 nodes) form
the first chunk,
and every subsequent three-level segment forms another chunk.

```
Original trie structure

Level 0               [ ROOT ]                               1 node
Level 1        [0] [1] [2] ... [f]                          16 nodes
Level 2     [00] [01] ... [0f] [10] ... [ff]               256 nodes
Level 3   [000] [001] ... [00f] [010] ... [fff]           4096 nodes
Level 4   [0000] ... [000f] [0010] ... [001f] ... [ffff] 65536 nodes

Vertical split into chunks (3 levels per chunk)

Level0             [ ROOT ]                     1 chunk
Level3        [000]   ...     [fff]          4096 chunks
Level6   [000000]    ...    [fffffff]    16777216 chunks  
```

Within each chunk, there are 273 nodes in total, regardless of the
chunk's depth in the trie.

```
Level 0           [ 0 ]                         1 node
Level 1        [ 1 ] … [ 16 ]                  16 nodes
Level 2     [ 17 ] … … [ 272 ]                256 nodes
```

Each chunk is uniquely identified by the path prefix of the root node of
its corresponding
sub-trie. Within a chunk, nodes are identified by a numeric index
ranging from 0 to 272.

For example, suppose that at block 100, the nodes with paths `[]`,
`[0]`, `[f]`, `[00]`, and `[ff]`
are modified. The mutation record for chunk 0 is then appended with the
following entry:

`[100 → [0, 1, 16, 17, 272]]`, `272` is the numeric ID of path `[ff]`.

Furthermore, due to the structural properties of the Merkle Patricia
Trie, if a child node
is modified, all of its ancestors along the same path must also be
updated. As a result,
in the above example, recording mutations for nodes `00` and `ff` alone
is sufficient,
as this implicitly indicates that their ancestor nodes `[]`, `[0]` and
`[f]` were also
modified at block 100.

--- 

Query processing is slightly more complicated. Since trie nodes are
indexed at the chunk
level, each individual trie node lookup requires an additional filtering
step to ensure that
a given mutation record actually corresponds to the target trie node.

As mentioned earlier, mutation records store only the numeric
identifiers of leaf nodes,
while ancestor nodes are omitted for storage efficiency. Consequently,
when querying
an ancestor node, additional checks are required to determine whether
the mutation
record implicitly represents a modification to that ancestor.

Moreover, since trie nodes are indexed at the chunk level, some trie
nodes may be
updated frequently, causing their mutation records to dominate the
index. Queries
targeting rarely modified trie nodes would then scan a large amount of
irrelevant
index data, significantly degrading performance.

To address this issue, a bitmap is introduced for each index block and
stored in the
chunk's metadata. Before loading a specific index block, the bitmap is
checked to
determine whether the block contains mutation records relevant to the
target trie node.
If the bitmap indicates that the block does not contain such records,
the block is skipped entirely.

* ethclient: omit nil address/topics from filter args (ethereum#33464)

Fixes ethereum#33369

This omits "topics" and "addresses" from the filter when they are unspecified.
It is required for interoperability with some server implementations that cannot
handle `null` for these fields.

* rlp, trie, triedb/pathdb: compress trienode history (ethereum#32913)

This pull request introduces a mechanism to compress trienode history by
storing only the node diffs between consecutive versions.

- For full nodes, only the modified children are recorded in the history;
- For short nodes, only the modified value is stored;

If the node type has changed, or if the node is newly created or
deleted, the entire node value is stored instead.

To mitigate the overhead of reassembling nodes from diffs during history
reads, checkpoints are introduced by periodically storing full node values.

The current checkpoint interval is set to every 16 mutations, though
this parameter may be made configurable in the future.

* core/txpool/blobpool: allow gaps in blobpool (ethereum#32717)

Allow the blobpool to accept blobs out of nonce order

Previously, we were dropping blobs that arrived out-of-order. However,
since fetch decisions are done on receiver side,
out-of-order delivery can happen, leading to inefficiencies.

This PR:
- adds an in-memory blob tx storage, similar to the queue in the
legacypool
- a limited number of received txs can be added to this per account
- txs waiting in the gapped queue are not processed further and not
propagated further until they are unblocked by adding the previos nonce
to the blobpool

The size of the in-memory storage is currently limited per account,
following a slow-start logic.
An overall size limit, and a TTL is also enforced for DoS protection.

---------

Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
Co-authored-by: MariusVanDerWijden <m.vanderwijden@live.de>

* ethclient: restore BlockReceipts support for `BlockNumberOrHash` objects (ethereum#33242)

- pass `rpc.BlockNumberOrHash` directly to `eth_getBlockReceipts` so
`requireCanonical` and other fields survive
- aligns `BlockReceipts` with other `ethclient` methods and re-enables
canonical-only receipt queries

* tests: check correct revert on invalid tests (ethereum#33543)

This PR fixes an issue where `evm statetest` would not verify the
post-state root hash if the test case expected an exception (e.g.
invalid transaction).

The fix involves:
1.  Modifying `tests/state_test_util.go` in the `Run` method.
2. When an expected error occurs (`err != nil`), we now check if
`post.Root` is defined.
3. If defined, we recalculate the intermediate root from the current
state (which is reverted to the pre-transaction snapshot upon error).
4. We use `GetChainConfig` and `IsEIP158` to ensure the correct state
clearing rules are applied when calculating the root, avoiding
regressions on forks that require EIP-158 state clearing.
5. If the calculated root mismatches the expected root, the test now
fails.

This ensures that state tests are strictly verified against their
expected post-state, even for failure scenarios.

Fixes issue ethereum#33527

---------

Co-authored-by: MariusVanDerWijden <m.vanderwijden@live.de>

* core: remove duplicate chainHeadFeed.Send code (ethereum#33563)

The code was simply duplicate, so we can remove some code lines here.

Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>

* core/rawdb: skip missing block bodies during tx unindexing (ethereum#33573)

This PR fixes an issue where the tx indexer would repeatedly try to
“unindex” a block with a missing body, causing a spike in CPU usage.
This change skips these blocks and advances the index tail. The fix was
verified both manually on a local development chain and with a new test.

resolves ethereum#33371

* internal/ethapi: refactor RPC tx formatter (ethereum#33582)

* tests: repair oss-fuzz coverage command (ethereum#33304)

The coverage build path was generating go test commands with a bogus
-tags flag that held the coverpkg value, so the run kept failing. I
switched coverbuild to treat the optional argument as an override for
-coverpkg and stopped passing coverpkg from the caller. Now the script
emits a clean go test invocation that should actually succeed.

* rpc: fix limitedBuffer.Write to properly enforce size limit (ethereum#33545)

Updated the `avail` calculation to correctly compute remaining capacity:
`buf.limit - len(buf.output)`, ensuring the buffer never exceeds its
configured limit regardless of how many times `Write()` is called.

* version: begin v1.17.0 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>

* accounts/keystore: fix panic in decryptPreSaleKey (ethereum#33602)

Validate ciphertext length in decryptPreSaleKey, preventing runtime
panics on invalid input.

* rpc, internal/telemetry: add OpenTelemetry tracing for JSON-RPC calls (ethereum#33452)

Add Open Telemetry tracing inside the RPC server to help attribute runtime costs within `handler.handleCall()`. In particular, it allows us to distinguish time spent decoding arguments, invoking methods via reflection, and actually executing the method and constructing/encoding JSON responses.

---------

Co-authored-by: lightclient <lightclient@protonmail.com>

* rpc: extract OpenTelemetry trace context from request headers (ethereum#33599)

This PR adds support for the extraction of OpenTelemetry trace context
from incoming JSON-RPC request headers, allowing geth spans to be linked
to upstream traces when present.

---------

Co-authored-by: lightclient <lightclient@protonmail.com>

* triedb/pathdb: change the bitmap to big endian (ethereum#33584)

The bitmap is used in compact-encoded trie nodes to indicate which elements 
have been modified. The bitmap format has been updated to use big-endian
encoding. 

Bit positions are numbered from 0 to 15, where position 0 corresponds to
the most significant bit of b[0], and position 15 corresponds to the least
significant bit of b[1].

* eth/fetcher: refactor test code (ethereum#33610)

Remove a large amount of duplicate code from the tx_fetcher tests.

---------

Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
Co-authored-by: lightclient <lightclient@protonmail.com>

* core/vm: check if read-only in gas handlers (ethereum#33281)

This PR causes execution to terminate at the gas handler in the case of
sstore/call if they are invoked in a static execution context.

This aligns the behavior with EIP 7928 by ensuring that we don't record
any state reads in the access list from an SSTORE/CALL in this
circumstance.

---------

Co-authored-by: lightclient <lightclient@protonmail.com>

* core/vm: in selfdestruct gas calculation, return early if there isn't enough gas to cover cold account access costs (ethereum#33450)

There's no need to perform the subsequent state access on the target if
we already know that we are out of gas.

This aligns the state access behavior of selfdestruct with EIP-7928

* core: invoke selfdestruct tracer hooks during finalisation (ethereum#32919)

The core part of this PR that we need to adopt is to move the code and
nonce change hook invocations to occur at tx finalization, instead of
when the selfdestruct opcode is called.

Additionally:
* remove `SelfDestruct6780` now that it is essentially the same as
`SelfDestruct` just gated by `is new contract`
* don't duplicate `BalanceIncreaseSelfdestruct` (transfer to recipient
of selfdestruct) in the hooked statedb and in the opcode handler for the
selfdestruct opcode.
* balance is burned immediately when the beneficiary of the selfdestruct
is the sender, and the contract was created in the same transaction.
Previously we emit two balance increases to the recipient (see above
point), and a balance decrease from the sender.

---------

Co-authored-by: Sina Mahmoodi <itz.s1na@gmail.com>
Co-authored-by: Gary Rong <garyrong0905@gmail.com>
Co-authored-by: lightclient <lightclient@protonmail.com>

* triedb/pathdb: implement trienode history indexing scheme (ethereum#33551)

This PR implements the indexing scheme for trie node history. Check
ethereum#33399 for more details

* triedb/pathdb: enable trienode history (ethereum#32621)

It's the part-4 for trienode history. The trienode history persistence
has been enabled with this PR by flag `history.trienode <non-negative-number>`

* rpc: add a rpc.rangelimit flag (ethereum#33163)

Adding an RPC flag to limit the block range size for eth_getLogs and
eth_newFilter requests.

closing ethereum#24508

---------

Co-authored-by: MariusVanDerWijden <m.vanderwijden@live.de>

* accounts/abi/bind/v2: replace rng in test (ethereum#33612)

Replace deprecated rand.Seed() with rand.New(rand.NewSource()) in
dep_tree_test.go.

* build: remove circleci config (ethereum#33616)

This doesn't seem to be used anymore.

* rlp: improve SplitListValues allocation efficiency (ethereum#33554)

* core/vm: add read only protection for opcodes (ethereum#33637)

This PR reverts a part of changes brought by https://github.com/ethereum/go-ethereum/pull/33281/changes

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

It should act as a gatekeeper, otherwise, it is easy to introduce errors by adding
new gas measurement logic without consistently applying the read-only protection.

* triedb/pathdb: double check the list availability before regeneration (ethereum#33622)

Co-authored-by: rjl493456442 <garyrong0905@gmail.com>

* internal/debug: add integration with Grafana Pyroscope (ethereum#33623)

This adds support for Grafana Pyroscope, a continuous profiling solution. 
The client is configured similarly to metrics, i.e. run 

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

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

---------

Co-authored-by: Carlos Bermudez Porto <cbermudez.dev@gmail.com>

* accounts/scwallet: fix panic in decryptAPDU (ethereum#33606)

Validate ciphertext length in decryptAPDU, preventing runtime panics on
invalid input.

* core/state: ensure deterministic hook emission order in Finalise (ethereum#33644)

Fixes ethereum#33630

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

---------

Co-authored-by: jwasinger <j-wasinger@hotmail.com>

* core/txpool/legacypool: add metric for accounts in txpool  (ethereum#33646)

This PR adds metrics that count the number of accounts having transactions 
in the txpool. Together with the transaction count this can be used as a 
simple indicator of the diversity of transactions in the pool.

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

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

---------

Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>

* core/types: fix panic on invalid signature length (ethereum#33647)

Replace panic with error return in decodeSignature to prevent crashes on
invalid inputs, and update callers to propagate the error.

* core/txpool/legacypool: reset gauges on clear (ethereum#33654)

Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
Co-authored-by: rjl493456442 <garyrong0905@gmail.com>

* core, eth, internal, triedb/pathdb: enable eth_getProofs for history (ethereum#32727)

This PR enables the `eth_getProofs ` endpoint against the historical states.

* core/vm: update EIP-8024 - Missing immediate byte is now treated as 0x00 (ethereum#33614)

This PR updates the EIP-8024 implementation to match the latest spec
clarification.

---------

Co-authored-by: lightclient <lightclient@protonmail.com>

* core/txpool/legacypool: fix stale counter (ethereum#33653)

Calling `pool.priced.Removed` is needed to keep is sync with
`pool.all.Remove`.
It was called in other occurances, but not here.

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

Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>

* core: extend the code reader statistics (ethereum#33659)

This PR extends the statistics of contract code read by adding these
fields:

- **CacheHitBytes**: the total number of bytes served by cache
- **CacheMissBytes**: the total number of bytes read on cache miss
- **CodeReadBytes**: the total number of bytes for contract code read

* trie: preallocate slice capacity (ethereum#33689)

This PR optimizes memory allocation in StateTrie.PrefetchAccount() and
StateTrie.PrefetchStorage() by preallocating slice capacity when the
final size is known.

* triedb/pathdb: improve trienode reader for searching (ethereum#33681)

This PR optimizes the historical trie node reader by reworking how data
is accessed and memory is managed, reducing allocation overhead 
significantly.

Specifically:

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

- Besides, slice pre-allocation can avoid unnecessary deep-copy significantly.

* cmd/keeper: export getInput in wasm builds (ethereum#33686)

This is a tweak to the wasm build, that expects the `geth_io` namespace
to expect a `geth_io` module, providing a `len` and `read` methods. This
will be provided by the WASM interface in sp1. This forces an API change
on the OpenVM side, but the interface on their side is still being
designed, so we should proceed with this change, and we'll make a
different tag for OpenVM if this can't work for them.

Co-authored-by: wakabat <wakabat@protonmail.com>

* core/rawdb: preallocate slice in iterateTransactions (ethereum#33690)

Preallocate hashes slice with known length instead of using append in a
loop. This avoids multiple reallocations during transaction indexing.

* trie/bintrie: fix tree key hashing to match spec (ethereum#33694)

Based on [EIP-7864](https://eips.ethereum.org/EIPS/eip-7864), the tree
index should be 32 bytes instead of 31 bytes.
```
def get_tree_key(address: Address32, tree_index: int, sub_index: int):
    # Assumes STEM_SUBTREE_WIDTH = 256
    return tree_hash(address + tree_index.to_bytes(32, "little"))[:31] + bytes(
        [sub_index]
    )
```

* eth/tracers/native: add index to callTracer log (ethereum#33629)

closes ethereum#33566

* core: standardize slow block JSON output for cross-client metrics (ethereum#33655)

Implement standardized JSON format for slow block logging to enable
cross-client performance analysis and protocol research.

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

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

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


This should come after merging ethereum#33522

---------

Co-authored-by: Gary Rong <garyrong0905@gmail.com>

* eth/gasprice: reduce allocations (ethereum#33698)

Recent pprof from our validator shows ~6% of all allocations because of
the gas price oracle. This PR reduces that.

* crypto/kzg4844: preallocate proof slice in ComputeCellProofs (ethereum#33703)

Preallocate the proof slice with the known size instead of growing it
via append in a loop. The length is already known from the source slice.

* trie: fix flaky test (ethereum#33711)

* ethdb/pebble: disable seek compaction for Pebble (ethereum#33697)

This PR restores the previous Pebble configuration, disabling seek compaction.

This feature is still needed by hash mode archive node, mitigating the
overhead of frequent compaction.

* core/txpool/legacypool: clarify and fix non-executable tx heartbeat (ethereum#33704)

Heartbeats are used to drop non-executable transactions from the queue.
The timeout mechanism was not clearly documented, and it was updates
also when not necessary.

* crypto/ecies: fix ECIES invalid-curve handling (ethereum#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-curve/small-subgroup attacks.
The fix enforces IsOnCurve validation up front.

* core/state: add bounds check in heap eviction loop (ethereum#33712)

core/state: add bounds check in heap eviction loop

Add len(h) > 0 check before accessing h[0] to prevent potential panic
and align with existing heap access patterns in txpool, p2p, and mclock
packages.

* ethclient: fix timeout param for eth_sendRawTransactionSync (ethereum#33693)

Fix timeout parameter in eth_sendRawTransactionSync
to be an integer instead of hex. The spec has now been
clarified on this point.

* triedb/pathdb: preallocate slices in decodeRestartTrailer (ethereum#33715)

Preallocate capacity for `keyOffsets` and `valOffsets` slices in
`decodeRestartTrailer` since the exact size (`nRestarts`) is known
upfront.

---------

Co-authored-by: rjl493456442 <garyrong0905@gmail.com>

* signer/core/apitypes: add cell proofs (ethereum#32910)

Adds support for cell proofs in blob transactions in the signer

---------

Co-authored-by: Gary Rong <garyrong0905@gmail.com>

* triedb/pathdb: preallocate slices in encode methods (ethereum#33736)

Preallocates slices with known capacity in `stateSet.encode()` and
`StateSetWithOrigin.encode()` methods to eliminate redundant
reallocations during serialization.

* internal/ethapi: Add timestamp to eth_getTransactionByHash (ethereum#33709)

Implements ethereum/execution-apis#729 and
fixes ethereum#33491. It adds blockTimestamp to transaction objects returned
by the RPC.

* core: miner: reduce allocations in block building (ethereum#33375)

I recently went on a longer flight and started profiling the geth block
production pipeline.
This PR contains a bunch of individual fixes split into separate
commits.
I can drop some if necessary.


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

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

                │ /tmp/old.txt │            /tmp/new.txt             │
                │  allocs/op   │  allocs/op   vs base                │
BuildPayload-14    2.703k ± 4%   2.453k ± 5%  -9.25% (p=0.000 n=200)
```

* trie/bintrie: fix debug_executionWitness for binary tree (ethereum#33739)

The `Witness` method was not implemented for the binary tree, which
caused `debug_excutionWitness` to panic. This PR fixes that.

Note that the `TransitionTrie` version isn't implemented, and that's on
purpose: more thought must be given to what should go in the global
witness.

* accounts/usbwallet: add support for Ledger Nano Gen5 (ethereum#33297)

adds support for the 0x0008 / 0x8000 product ID (Ledger Apex | Nano
Gen5).

* core/types, internal/ethapi, signer/core/apitypes: avoid copying 128KB blobs in range loops (ethereum#33717)

kzg4844.Blob is 131072 bytes. Using `for _, blob := range` copies the
entire blob on each iteration. With up to 6 blobs per transaction, this
wastes ~768KB of memory copies.

Switch to index-based iteration and pass pointers directly.

* crypto/keccak: vendor in golang.org/x/crypto/sha3 (ethereum#33323)

The upstream libray has removed the assembly-based implementation of
keccak. We need to maintain our own library to avoid a peformance
regression.

---------

Co-authored-by: lightclient <lightclient@protonmail.com>

* core/txpool/legacypool: reduce unnecessary allocations during add (ethereum#33701)

Not many allocs we save here, but it also cleans up the logic and should
speed up the process a tiny bit

* metrics: add missing GaugeInfo case in GetAll() (ethereum#33748)

GetAll did not return GaugeInfo metrics, which affects "chain/info" and "geth/info".

* rlp: add RawList for working with un-decoded lists (ethereum#33755)

This adds a new type wrapper that decodes as a list, but does not
actually decode the contents of the list. The type parameter exists as a
marker, and enables decoding the elements lazily. RawList can also be
used for building a list incrementally.

* internal/ethapi: fix error code for revert in eth_simulateV1 (ethereum#33007)

The error code for revert should be consistent with eth_call and be 3.

* core/txpool/blobpool: reset counters and gapped on Clear (ethereum#33775)

Clear was only used in tests, but it was missing some of the cleanup.

Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>

* metrics: add missing ResettingTimer case in GetAll() (ethereum#33749)

Follow-up to ethereum#33748

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

Note: ResettingTimer.Snapshot() resets the timer by design, which is
consistent with how the prometheus exporter uses it.

* core/rawdb: check pruning tail in HasBody and HasReceipts (ethereum#33747)

### Problem

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

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

### Changes

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

This aligns `HasBody`/`HasReceipts` behavior with
`ReadBody`/`ReadReceipts` and fixes potential issues in
`skeleton.linked()` which relies on these checks during sync.

* metrics: reduce allocations for metrics (ethereum#33699)

* core/rawdb: close freezer table in InspectFreezerTable (ethereum#33776)

* core/vm: add missing PUSH0 handler in EIP-8024 test mini-interpreter (ethereum#33785)

* core/rawdb: fix incorrect tail value in unindexTransactions log output (ethereum#33796)

* internal/era: New EraE implementation (ethereum#32157)

Here is a draft for the New EraE implementation. The code follows along
with the spec listed at https://hackmd.io/pIZlxnitSciV5wUgW6W20w.

---------

Co-authored-by: shantichanal <158101918+shantichanal@users.noreply.github.com>
Co-authored-by: lightclient <lightclient@protonmail.com>
Co-authored-by: MariusVanDerWijden <m.vanderwijden@live.de>
Co-authored-by: Sina Mahmoodi <itz.s1na@gmail.com>

* cmd/geth: fix wrong flag names in influxdb metrics error messages (ethereum#33804)

* core/rawdb: close directory fd on Readdirnames error in cleanup (ethereum#33798)

* core/vm: 8024 tests should enforce explicit errors (ethereum#33787)

This PR makes `TestEIP8024_Execution` verify explicit error types (e.g.,
`ErrStackUnderflow` vs `ErrInvalidOpCode`) rather than accepting any
error. It also fails fast on unexpected opcodes in the mini-interpreter
to avoid false positives from missing opcode handling.

* eth: fix targetView==nil case (ethereum#33810)

This PR fixes a panic in a corner case situation when a `ChainEvent` is
received by `eth.Ethereum.updateFilterMapsHeads()` but the given chain
section does not exist in `BlockChain` any more. This can happen during
chain rewind because chain events are processed asynchronously. Ignoring
the event in this case is ok, the final event will point to the final
rewound head and the indexer will be updated.
Note that similar issues will not happen once we transition to
ethereum#32292 and the new indexer
built on top of this. Until then, the current fix should be fine.

* ethdb/pebble: fix CompactionDebtConcurrency comment (ethereum#33805)

* trie: fix embedded node size validation (ethereum#33803)

The `decodeRef` function used `size > hashLen` to reject oversized
embedded nodes, but this incorrectly allowed nodes of exactly 32 bytes
through. The encoding side (hasher.go, stacktrie.go) consistently uses
`len(enc) < 32` to decide whether to embed a node inline, meaning nodes
of 32+ bytes are always hash-referenced. The error message itself
already stated `want size < 32`, confirming the intended threshold.
Changed `size > hashLen` to `size >= hashLen` in `decodeRef` to align
the decoding validation with the encoding logic, the Yellow Paper spec,
and the surrounding comments.

* ethclient/gethclient: callTracer methods (ethereum#31510)

Added methods `TraceCallWithCallTracer` and `TraceTransactionWithCallTracer`.

Fixes ethereum#28182

---------

Co-authored-by: Sina Mahmoodi <itz.s1na@gmail.com>

* trie/bintrie: use correct key mapping in GetStorage and DeleteStorage (ethereum#33807)

GetStorage and DeleteStorage used GetBinaryTreeKey to compute the tree
key, while UpdateStorage used GetBinaryTreeKeyStorageSlot. The latter
applies storage slot remapping (header offset for slots <64, main
storage prefix for the rest), so reads and deletes were targeting
different tree locations than writes.

Replace GetBinaryTreeKey with GetBinaryTreeKeyStorageSlot in both
GetStorage and DeleteStorage to match UpdateStorage. Add a regression
test that verifies the write→read→delete→read round-trip for main
storage slots.

* rlp: return Iterator as non-pointer (ethereum#33818)

Most uses of the iterator are like this:

    it, _ := rlp.NewListIterator(data)
    for it.Next() {
        do(it.Value())
    }

This doesn't require the iterator to be a pointer and it's better to
have it stack-allocated. AFAIK the compiler cannot prove it is OK to
stack-allocate when it is returned as a pointer because the methods of
`Iterator` use pointer receiver and also mutate the object.

The iterator type was not exported until very recently, so I think it is
still OK to change this API.

* cmd/evm/internal/t8ntool, core/rawdb: fix RLP iterator error handling (ethereum#33820)

This fixes two cases where `Iterator.Err()` was misused. The method will
only return an error after `Next()` has returned false, so it makes no
sense to check for the error within the loop itself.

* triedb/pathdb: return nodeLoc by value to avoid heap allocation (ethereum#33819)

* eth/tracers: tests for bad block tracing (ethereum#33821)

Fixes ethereum#30833

* internal/era: update eraE type IDs to match spec (ethereum#33827)

Update to match the spec:
eth-clients/e2store-format-specs#16

---------

Co-authored-by: lightclient <lightclient@protonmail.com>

* node: http2 for JSON-RPC API (ethereum#33812)

The reasoning for using the cleartext format here is that the JSON-RPC
API is internal only. Providers which expose it publicly already put it
behind a proxy which handles also the encryption.

* rlp: add AppendRaw method to RawList (ethereum#33834)

This is helpful when building a list from already-encoded elements.

---------

Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
Co-authored-by: Daniel Liu <liudaniel@qq.com>
Co-authored-by: David Klank <155117116+davidjsonn@users.noreply.github.com>
Co-authored-by: Galoretka <galoretochka@gmail.com>
Co-authored-by: Ng Wei Han <47109095+weiihann@users.noreply.github.com>
Co-authored-by: rjl493456442 <garyrong0905@gmail.com>
Co-authored-by: Jonny Rhea <5555162+jrhea@users.noreply.github.com>
Co-authored-by: 0xFloki <signal-rooms-7n@icloud.com>
Co-authored-by: Jeevan <g1siddharthr@gmail.com>
Co-authored-by: Rizky Ikwan <rizzikwann@gmail.com>
Co-authored-by: Csaba Kiraly <cskiraly@users.noreply.github.com>
Co-authored-by: oooLowNeoNooo <ooolowneonooo@gmail.com>
Co-authored-by: Archkon <180910180+Archkon@users.noreply.github.com>
Co-authored-by: Guillaume Ballet <3272758+gballet@users.noreply.github.com>
Co-authored-by: Fibonacci747 <albertofibonacci12@gmail.com>
Co-authored-by: Rim Dinov <rdin35051@gmail.com>
Co-authored-by: Bashmunta <georgebashmunta@gmail.com>
Co-authored-by: Marco Munizaga <marco@marcopolo.io>
Co-authored-by: Csaba Kiraly <csaba.kiraly@gmail.com>
Co-authored-by: Mask Weller <Wellermask@gmail.com>
Co-authored-by: m6xwzzz <maskk.weller@gmail.com>
Co-authored-by: Andrew Davis <1709934+Savid@users.noreply.github.com>
Co-authored-by: MariusVanDerWijden <m.vanderwijden@live.de>
Co-authored-by: cui <cuiweixie@gmail.com>
Co-authored-by: LittleBingoo <zpksdhr@gmail.com>
Co-authored-by: Madison carter <madisoncarter1212@gmail.com>
Co-authored-by: maradini77 <140460067+maradini77@users.noreply.github.com>
Co-authored-by: Xuanyu Hu <helium729@outlook.com>
Co-authored-by: 0xcharry <idea.sermons.5p@icloud.com>
Co-authored-by: bigbear <155267841+aso20455@users.noreply.github.com>
Co-authored-by: Maxim Evtush <154841002+maximevtush@users.noreply.github.com>
Co-authored-by: Felix Lange <fjl@twurst.com>
Co-authored-by: lightclient <lightclient@protonmail.com>
Co-authored-by: DeFi Junkie <deffie.jnkiee@gmail.com>
Co-authored-by: jwasinger <j-wasinger@hotmail.com>
Co-authored-by: Sina Mahmoodi <itz.s1na@gmail.com>
Co-authored-by: Mael Regnery <mael@mqli.fr>
Co-authored-by: Lessa <230214854+adblesss@users.noreply.github.com>
Co-authored-by: lightclient <14004106+lightclient@users.noreply.github.com>
Co-authored-by: maskpp <maskpp266@gmail.com>
Co-authored-by: Carlos Bermudez Porto <cbermudez.dev@gmail.com>
Co-authored-by: forkfury <forkfury@gmail.com>
Co-authored-by: marukai67 <miserly.pendant0p@icloud.com>
Co-authored-by: wakabat <wakabat@protonmail.com>
Co-authored-by: CPerezz <37264926+CPerezz@users.noreply.github.com>
Co-authored-by: fengjian <445077+fengjian@users.noreply.github.com>
Co-authored-by: Noisy <125606576+donatik27@users.noreply.github.com>
Co-authored-by: milan-cb <milan.saxena@coinbase.com>
Co-authored-by: alex017 <dishes-18pole@icloud.com>
Co-authored-by: mmsqe <tqd0800210105@gmail.com>
Co-authored-by: vickkkkkyy <vickyaviles847@gmail.com>
Co-authored-by: Sina M <1591639+s1na@users.noreply.github.com>
Co-authored-by: Forostovec <ilonaforostovec22@gmail.com>
Co-authored-by: GarmashAlex <garmasholeksii@gmail.com>
Co-authored-by: sashass1315 <sashass1315@gmail.com>
Co-authored-by: shazam8253 <54690736+shazam8253@users.noreply.github.com>
Co-authored-by: shantichanal <158101918+shantichanal@users.noreply.github.com>
Co-authored-by: Felföldi Zsolt <zsfelfoldi@gmail.com>
Co-authored-by: Ragnar <rodiondenmark@gmail.com>
Co-authored-by: phrwlk <phrwlk7@gmail.com>
Dargon789 added a commit to Dargon789/go-ethereum that referenced this pull request Feb 14, 2026
* core/state: make test output message readable (ethereum#33400)

* crypto/signify: fix fuzz test compilation (ethereum#33402)

The fuzz test file has been broken for a while - it doesn't compile with
the `gofuzz` build tag.

Two issues:
- Line 59: called `SignifySignFile` which doesn't exist (should be
`SignFile`)
- Line 71: used `:=` instead of `=` for already declared `err` variable

* core/overlay: fix incorrect debug log key/value in LoadTransitionState (ethereum#32637)

* core/state: fix code existence not marked correctly (ethereum#33415)

When iterating over a map with value types in Go, the loop variable is a
copy. In `markCodeExistence`, assigning to `code.exists` modified only
the local copy, not the actual map entry, causing the existence flag to
always remain false.

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

Fix by changing `codes` from `map[common.Address]contractCode` to
`map[common.Address]*contractCode`, so mutations apply directly to the
struct.

* cmd/workload, eth/tracers/native: introduce state proof tests (ethereum#32247)

This pull request introduces a new workload command, providing the
features
for `eth_getProof` endpoint test generation and execution.

* eth/catalyst: fix invalid timestamp log message (ethereum#33440)

Fixes a typo in the NewPayload invalid timestamp warning where the
parent timestamp was incorrectly logged as the block timestamp.

* core: add code read statistics (ethereum#33442)

* core/txpool/blobpool: remove legacy sidecar conversion (ethereum#33352)

This PR removes the legacy sidecar conversion logic.

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

Note that conversion at the RPC layer is still supported, and version 0
blob
transactions will be automatically converted to version 1 there.

* tests/fuzzers: remove unused field from kv struct in rangeproof fuzzer (ethereum#33447)

Removes the unused `t bool` field from the `kv` struct in the rangeproof fuzzer.

* eth/catalyst: return empty response for GetBlobsV2 before Osaka (ethereum#33444)

Fix ethereum#33420

* core, eth: add lock protection in snap sync (ethereum#33428)

Fixes ethereum#33396, ethereum#33397, ethereum#33398

* graphql: add nil check in block resolver (ethereum#33225)

Add nil checks for header and block in Block resolver methods to prevent
panic when querying non-existent blocks.

* core/txpool/blobpool: fix slotter size limit (ethereum#33474)

Blobs are stored per transaction in the pool, so we need billy to handle
up to the per-tx limit, not to the per-block limit.

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

Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>

* eth/downloader: fix stale beacon header deletion (ethereum#33481)

In this PR, two things have been fixed:

--- 

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

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

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

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

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

--- 

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

Once the skeleton chain links with local one, it will try to schedule the 
synchronization by fetching the missing blocks and import them then. 
It's possible the last subchain already overwrites the previous subchain and 
results in having two subchains leftover. As a result, an error log will printed
https://github.com/ethereum/go-ethereum/blob/master/eth/downloader/skeleton.go#L1074

* console/prompt: use PromptInput in PromptConfirm method (ethereum#33445)

* params: fix wrong comment (ethereum#33503)

It seems that the comment for CopyGas was wrongly associated to
SloadGas.

* trie, go.mod: remove all references to go-verkle and go-ipa (ethereum#33461)

In order to reduce the amount of code that is embedded into the keeper
binary, I am removing all the verkle code that uses go-verkle and
go-ipa. This will be followed by further PRs that are more like stubs to
replace code when the keeper build is detected.

I'm keeping the binary tree of course. This means that you will still
see `isVerkle` variables all over the codebase, but they will be renamed
when code is touched (i.e. this is not an invitation for 30+ AI slop
PRs).

---------

Co-authored-by: Gary Rong <garyrong0905@gmail.com>

* .github/workflows: preventively close PRs that seem AI-generated (ethereum#33414)

This is a new step in my crusade against the braindead fad of starting
PR titles with a word that is completely redundant with github labels,
thus wasting prime first-line real-estate for something that isn't
necessary.

I noticed that every single one of these PRs are low-quality AI-slop, so
I think there is a strong case to be made for these PRs to be
auto-closed. A message is added before closing the PR, redirecting to
our contribution guidelines, so I expect quality first-time contributors
to read them and reopen the PR. In the case of spam PRs, the author is
unlikely to revisit a given PR, and so auto-closing might have a
positive impact. That's an experiment worth trying, imo.

* triedb/pathdb: optimize history indexing efficiency (ethereum#33303)

This pull request optimizes history indexing by splitting a single large
database
 batch into multiple smaller chunks.

Originally, the indexer will resolve a batch of state histories and
commit all
corresponding index entries atomically together with the indexing
marker.

While indexing more state histories in a single batch improves
efficiency, excessively
large batches can cause significant memory issues.

To mitigate this, the pull request splits the mega-batch into several
smaller batches
and flushes them independently during indexing. However, this introduces
a potential
inconsistency that some index entries may be flushed while the indexing
marker is not,
and an unclean shutdown may leave the database in a partially updated
state.
This can corrupt index data.

To address this, head truncation is introduced. After a restart, any
excessive index
entries beyond the expected indexing marker are removed, ensuring the
index remains
consistent after an unclean shutdown.

* beacon/light/sync: clear reqFinalityEpoch on server unregistration (ethereum#33483)

HeadSync kept reqFinalityEpoch entries for servers after receiving
EvUnregistered, while other per-server maps were cleared. This left
stale request.Server keys reachable from HeadSync, which can lead to a
slow memory leak in setups that dynamically register and unregister
servers.

The fix adds deletion of the reqFinalityEpoch entry in the
EvUnregistered handler. This aligns HeadSync with the cleanup pattern
used by other sync modules and keeps the finality request bookkeeping
strictly limited to currently registered servers.

* cmd/geth: remove deprecated vulnerability check command (ethereum#33498)

This PR removes the version-check command and its associated logic as
discussed in issue ethereum#31222.

Removed versionCheckCommand from misccmd.go and main.go.

Deleted version_check.go and its corresponding tests.

Cleaned up testdata/vcheck directory (~800 lines of JSON/signatures
removed).

Verified build with make geth

* core/state/snapshot: fix storageList memory accounting (ethereum#33505)

* eth/catalyst: implement getBlobsV3 (ethereum#33404)

This is used by cell-level dissemination (aka partial messages) to give
the CL all blobs the EL knows about and let CL communicate efficiently
about any other missing blobs. In other words, partial responses from
the EL is useful now.

See the related (closed) PR:
ethereum/execution-apis#674 and the new PR:
ethereum/execution-apis#719

* core/blockchain.go: cleanup finalized block on rewind in setHeadBeyondRoot (ethereum#33486)

Fix ethereum#33390 

`setHeadBeyondRoot` was failing to invalidate finalized blocks because
it compared against the original head instead of the rewound root. This
fix updates the comparison to use the post-rewind block number,
preventing the node from reporting a finalized block that no longer
exists. Also added relevant test cases for it.

* eth/fetcher: improve the condition to stall peer in tx fetcher (ethereum#32725)

Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
Co-authored-by: Csaba Kiraly <csaba.kiraly@gmail.com>

* core/rawdb: add trienode freezer support to InspectFreezerTable (ethereum#33515)

Adds missing trienode freezer case to InspectFreezerTable, making it
consistent with InspectFreezer which already supports it.

Co-authored-by: m6xwzzz <maskk.weller@gmail.com>

* ethstats: report newPayload processing time to stats server (ethereum#33395)

Add NewPayloadEvent to track engine API newPayload block processing
times and report them to ethstats. This enables monitoring of block
processing performance.

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

related: ethereum#33231

---------

Co-authored-by: MariusVanDerWijden <m.vanderwijden@live.de>

* core: re-organize the stats category (ethereum#33525)

Check out https://hackmd.io/dg7rizTyTXuCf2LSa2LsyQ for more details

* eth: txs fetch/send log at trace level only (ethereum#33541)

This logging was too intensive at debug level, it is better to have it
at trace level only.

Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>

* core/vm: avoid escape to heap (ethereum#33537)

* core/state, core/tracing: new state update hook (ethereum#33490)

### Description
Add a new `OnStateUpdate` hook which gets invoked after state is
committed.

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

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

---------

Co-authored-by: Gary Rong <garyrong0905@gmail.com>

* core/state: add cache statistics of contract code reader (ethereum#33532)

* internal/flags: update copyright year to 2026 (ethereum#33550)

* graphql: fix GasPrice for blob and setcode transactions (ethereum#33542)

Adds BlobTxType and SetCodeTxType to GasPrice switch case, aligning with
`MaxFeePerGas` and `MaxPriorityFeePerGas` handling.

Co-authored-by: m6xwzzz <maskk.weller@gmail.com>

* triedb/pathdb: introduce extension to history index structure (ethereum#33399)

It's a PR based on ethereum#33303 and introduces an approach for trienode
history indexing.

---

In the current archive node design, resolving a historical trie node at
a specific block
involves the following steps:

- Look up the corresponding trie node index and locate the first entry
whose state ID
   is greater than the target state ID.
- Resolve the trie node from the associated trienode history object.

A naive approach would be to store mutation records for every trie node,
similar to
how flat state mutations are recorded. However, the total number of trie
nodes is
extremely large (approximately 2.4 billion), and the vast majority of
them are rarely
modified. Creating an index entry for each individual trie node would be
very wasteful
in both storage and indexing overhead. To address this, we aggregate
multiple trie
nodes into chunks and index mutations at the chunk level instead. 

---

For a storage trie, the trie is vertically partitioned into multiple sub
tries, each spanning
three consecutive levels. The top three levels (1 + 16 + 256 nodes) form
the first chunk,
and every subsequent three-level segment forms another chunk.

```
Original trie structure

Level 0               [ ROOT ]                               1 node
Level 1        [0] [1] [2] ... [f]                          16 nodes
Level 2     [00] [01] ... [0f] [10] ... [ff]               256 nodes
Level 3   [000] [001] ... [00f] [010] ... [fff]           4096 nodes
Level 4   [0000] ... [000f] [0010] ... [001f] ... [ffff] 65536 nodes

Vertical split into chunks (3 levels per chunk)

Level0             [ ROOT ]                     1 chunk
Level3        [000]   ...     [fff]          4096 chunks
Level6   [000000]    ...    [fffffff]    16777216 chunks  
```

Within each chunk, there are 273 nodes in total, regardless of the
chunk's depth in the trie.

```
Level 0           [ 0 ]                         1 node
Level 1        [ 1 ] … [ 16 ]                  16 nodes
Level 2     [ 17 ] … … [ 272 ]                256 nodes
```

Each chunk is uniquely identified by the path prefix of the root node of
its corresponding
sub-trie. Within a chunk, nodes are identified by a numeric index
ranging from 0 to 272.

For example, suppose that at block 100, the nodes with paths `[]`,
`[0]`, `[f]`, `[00]`, and `[ff]`
are modified. The mutation record for chunk 0 is then appended with the
following entry:

`[100 → [0, 1, 16, 17, 272]]`, `272` is the numeric ID of path `[ff]`.

Furthermore, due to the structural properties of the Merkle Patricia
Trie, if a child node
is modified, all of its ancestors along the same path must also be
updated. As a result,
in the above example, recording mutations for nodes `00` and `ff` alone
is sufficient,
as this implicitly indicates that their ancestor nodes `[]`, `[0]` and
`[f]` were also
modified at block 100.

--- 

Query processing is slightly more complicated. Since trie nodes are
indexed at the chunk
level, each individual trie node lookup requires an additional filtering
step to ensure that
a given mutation record actually corresponds to the target trie node.

As mentioned earlier, mutation records store only the numeric
identifiers of leaf nodes,
while ancestor nodes are omitted for storage efficiency. Consequently,
when querying
an ancestor node, additional checks are required to determine whether
the mutation
record implicitly represents a modification to that ancestor.

Moreover, since trie nodes are indexed at the chunk level, some trie
nodes may be
updated frequently, causing their mutation records to dominate the
index. Queries
targeting rarely modified trie nodes would then scan a large amount of
irrelevant
index data, significantly degrading performance.

To address this issue, a bitmap is introduced for each index block and
stored in the
chunk's metadata. Before loading a specific index block, the bitmap is
checked to
determine whether the block contains mutation records relevant to the
target trie node.
If the bitmap indicates that the block does not contain such records,
the block is skipped entirely.

* ethclient: omit nil address/topics from filter args (ethereum#33464)

Fixes ethereum#33369

This omits "topics" and "addresses" from the filter when they are unspecified.
It is required for interoperability with some server implementations that cannot
handle `null` for these fields.

* rlp, trie, triedb/pathdb: compress trienode history (ethereum#32913)

This pull request introduces a mechanism to compress trienode history by
storing only the node diffs between consecutive versions.

- For full nodes, only the modified children are recorded in the history;
- For short nodes, only the modified value is stored;

If the node type has changed, or if the node is newly created or
deleted, the entire node value is stored instead.

To mitigate the overhead of reassembling nodes from diffs during history
reads, checkpoints are introduced by periodically storing full node values.

The current checkpoint interval is set to every 16 mutations, though
this parameter may be made configurable in the future.

* core/txpool/blobpool: allow gaps in blobpool (ethereum#32717)

Allow the blobpool to accept blobs out of nonce order

Previously, we were dropping blobs that arrived out-of-order. However,
since fetch decisions are done on receiver side,
out-of-order delivery can happen, leading to inefficiencies.

This PR:
- adds an in-memory blob tx storage, similar to the queue in the
legacypool
- a limited number of received txs can be added to this per account
- txs waiting in the gapped queue are not processed further and not
propagated further until they are unblocked by adding the previos nonce
to the blobpool

The size of the in-memory storage is currently limited per account,
following a slow-start logic.
An overall size limit, and a TTL is also enforced for DoS protection.

---------

Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
Co-authored-by: MariusVanDerWijden <m.vanderwijden@live.de>

* ethclient: restore BlockReceipts support for `BlockNumberOrHash` objects (ethereum#33242)

- pass `rpc.BlockNumberOrHash` directly to `eth_getBlockReceipts` so
`requireCanonical` and other fields survive
- aligns `BlockReceipts` with other `ethclient` methods and re-enables
canonical-only receipt queries

* tests: check correct revert on invalid tests (ethereum#33543)

This PR fixes an issue where `evm statetest` would not verify the
post-state root hash if the test case expected an exception (e.g.
invalid transaction).

The fix involves:
1.  Modifying `tests/state_test_util.go` in the `Run` method.
2. When an expected error occurs (`err != nil`), we now check if
`post.Root` is defined.
3. If defined, we recalculate the intermediate root from the current
state (which is reverted to the pre-transaction snapshot upon error).
4. We use `GetChainConfig` and `IsEIP158` to ensure the correct state
clearing rules are applied when calculating the root, avoiding
regressions on forks that require EIP-158 state clearing.
5. If the calculated root mismatches the expected root, the test now
fails.

This ensures that state tests are strictly verified against their
expected post-state, even for failure scenarios.

Fixes issue ethereum#33527

---------

Co-authored-by: MariusVanDerWijden <m.vanderwijden@live.de>

* core: remove duplicate chainHeadFeed.Send code (ethereum#33563)

The code was simply duplicate, so we can remove some code lines here.

Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>

* core/rawdb: skip missing block bodies during tx unindexing (ethereum#33573)

This PR fixes an issue where the tx indexer would repeatedly try to
“unindex” a block with a missing body, causing a spike in CPU usage.
This change skips these blocks and advances the index tail. The fix was
verified both manually on a local development chain and with a new test.

resolves ethereum#33371

* internal/ethapi: refactor RPC tx formatter (ethereum#33582)

* tests: repair oss-fuzz coverage command (ethereum#33304)

The coverage build path was generating go test commands with a bogus
-tags flag that held the coverpkg value, so the run kept failing. I
switched coverbuild to treat the optional argument as an override for
-coverpkg and stopped passing coverpkg from the caller. Now the script
emits a clean go test invocation that should actually succeed.

* rpc: fix limitedBuffer.Write to properly enforce size limit (ethereum#33545)

Updated the `avail` calculation to correctly compute remaining capacity:
`buf.limit - len(buf.output)`, ensuring the buffer never exceeds its
configured limit regardless of how many times `Write()` is called.

* version: begin v1.17.0 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>

* accounts/keystore: fix panic in decryptPreSaleKey (ethereum#33602)

Validate ciphertext length in decryptPreSaleKey, preventing runtime
panics on invalid input.

* rpc, internal/telemetry: add OpenTelemetry tracing for JSON-RPC calls (ethereum#33452)

Add Open Telemetry tracing inside the RPC server to help attribute runtime costs within `handler.handleCall()`. In particular, it allows us to distinguish time spent decoding arguments, invoking methods via reflection, and actually executing the method and constructing/encoding JSON responses.

---------

Co-authored-by: lightclient <lightclient@protonmail.com>

* rpc: extract OpenTelemetry trace context from request headers (ethereum#33599)

This PR adds support for the extraction of OpenTelemetry trace context
from incoming JSON-RPC request headers, allowing geth spans to be linked
to upstream traces when present.

---------

Co-authored-by: lightclient <lightclient@protonmail.com>

* triedb/pathdb: change the bitmap to big endian (ethereum#33584)

The bitmap is used in compact-encoded trie nodes to indicate which elements 
have been modified. The bitmap format has been updated to use big-endian
encoding. 

Bit positions are numbered from 0 to 15, where position 0 corresponds to
the most significant bit of b[0], and position 15 corresponds to the least
significant bit of b[1].

* eth/fetcher: refactor test code (ethereum#33610)

Remove a large amount of duplicate code from the tx_fetcher tests.

---------

Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
Co-authored-by: lightclient <lightclient@protonmail.com>

* core/vm: check if read-only in gas handlers (ethereum#33281)

This PR causes execution to terminate at the gas handler in the case of
sstore/call if they are invoked in a static execution context.

This aligns the behavior with EIP 7928 by ensuring that we don't record
any state reads in the access list from an SSTORE/CALL in this
circumstance.

---------

Co-authored-by: lightclient <lightclient@protonmail.com>

* core/vm: in selfdestruct gas calculation, return early if there isn't enough gas to cover cold account access costs (ethereum#33450)

There's no need to perform the subsequent state access on the target if
we already know that we are out of gas.

This aligns the state access behavior of selfdestruct with EIP-7928

* core: invoke selfdestruct tracer hooks during finalisation (ethereum#32919)

The core part of this PR that we need to adopt is to move the code and
nonce change hook invocations to occur at tx finalization, instead of
when the selfdestruct opcode is called.

Additionally:
* remove `SelfDestruct6780` now that it is essentially the same as
`SelfDestruct` just gated by `is new contract`
* don't duplicate `BalanceIncreaseSelfdestruct` (transfer to recipient
of selfdestruct) in the hooked statedb and in the opcode handler for the
selfdestruct opcode.
* balance is burned immediately when the beneficiary of the selfdestruct
is the sender, and the contract was created in the same transaction.
Previously we emit two balance increases to the recipient (see above
point), and a balance decrease from the sender.

---------

Co-authored-by: Sina Mahmoodi <itz.s1na@gmail.com>
Co-authored-by: Gary Rong <garyrong0905@gmail.com>
Co-authored-by: lightclient <lightclient@protonmail.com>

* triedb/pathdb: implement trienode history indexing scheme (ethereum#33551)

This PR implements the indexing scheme for trie node history. Check
ethereum#33399 for more details

* triedb/pathdb: enable trienode history (ethereum#32621)

It's the part-4 for trienode history. The trienode history persistence
has been enabled with this PR by flag `history.trienode <non-negative-number>`

* rpc: add a rpc.rangelimit flag (ethereum#33163)

Adding an RPC flag to limit the block range size for eth_getLogs and
eth_newFilter requests.

closing ethereum#24508

---------

Co-authored-by: MariusVanDerWijden <m.vanderwijden@live.de>

* accounts/abi/bind/v2: replace rng in test (ethereum#33612)

Replace deprecated rand.Seed() with rand.New(rand.NewSource()) in
dep_tree_test.go.

* build: remove circleci config (ethereum#33616)

This doesn't seem to be used anymore.

* rlp: improve SplitListValues allocation efficiency (ethereum#33554)

* core/vm: add read only protection for opcodes (ethereum#33637)

This PR reverts a part of changes brought by https://github.com/ethereum/go-ethereum/pull/33281/changes

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

It should act as a gatekeeper, otherwise, it is easy to introduce errors by adding
new gas measurement logic without consistently applying the read-only protection.

* triedb/pathdb: double check the list availability before regeneration (ethereum#33622)

Co-authored-by: rjl493456442 <garyrong0905@gmail.com>

* internal/debug: add integration with Grafana Pyroscope (ethereum#33623)

This adds support for Grafana Pyroscope, a continuous profiling solution. 
The client is configured similarly to metrics, i.e. run 

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

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

---------

Co-authored-by: Carlos Bermudez Porto <cbermudez.dev@gmail.com>

* accounts/scwallet: fix panic in decryptAPDU (ethereum#33606)

Validate ciphertext length in decryptAPDU, preventing runtime panics on
invalid input.

* core/state: ensure deterministic hook emission order in Finalise (ethereum#33644)

Fixes ethereum#33630

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

---------

Co-authored-by: jwasinger <j-wasinger@hotmail.com>

* core/txpool/legacypool: add metric for accounts in txpool  (ethereum#33646)

This PR adds metrics that count the number of accounts having transactions 
in the txpool. Together with the transaction count this can be used as a 
simple indicator of the diversity of transactions in the pool.

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

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

---------

Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>

* core/types: fix panic on invalid signature length (ethereum#33647)

Replace panic with error return in decodeSignature to prevent crashes on
invalid inputs, and update callers to propagate the error.

* core/txpool/legacypool: reset gauges on clear (ethereum#33654)

Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
Co-authored-by: rjl493456442 <garyrong0905@gmail.com>

* core, eth, internal, triedb/pathdb: enable eth_getProofs for history (ethereum#32727)

This PR enables the `eth_getProofs ` endpoint against the historical states.

* core/vm: update EIP-8024 - Missing immediate byte is now treated as 0x00 (ethereum#33614)

This PR updates the EIP-8024 implementation to match the latest spec
clarification.

---------

Co-authored-by: lightclient <lightclient@protonmail.com>

* core/txpool/legacypool: fix stale counter (ethereum#33653)

Calling `pool.priced.Removed` is needed to keep is sync with
`pool.all.Remove`.
It was called in other occurances, but not here.

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

Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>

* core: extend the code reader statistics (ethereum#33659)

This PR extends the statistics of contract code read by adding these
fields:

- **CacheHitBytes**: the total number of bytes served by cache
- **CacheMissBytes**: the total number of bytes read on cache miss
- **CodeReadBytes**: the total number of bytes for contract code read

* trie: preallocate slice capacity (ethereum#33689)

This PR optimizes memory allocation in StateTrie.PrefetchAccount() and
StateTrie.PrefetchStorage() by preallocating slice capacity when the
final size is known.

* triedb/pathdb: improve trienode reader for searching (ethereum#33681)

This PR optimizes the historical trie node reader by reworking how data
is accessed and memory is managed, reducing allocation overhead 
significantly.

Specifically:

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

- Besides, slice pre-allocation can avoid unnecessary deep-copy significantly.

* cmd/keeper: export getInput in wasm builds (ethereum#33686)

This is a tweak to the wasm build, that expects the `geth_io` namespace
to expect a `geth_io` module, providing a `len` and `read` methods. This
will be provided by the WASM interface in sp1. This forces an API change
on the OpenVM side, but the interface on their side is still being
designed, so we should proceed with this change, and we'll make a
different tag for OpenVM if this can't work for them.

Co-authored-by: wakabat <wakabat@protonmail.com>

* core/rawdb: preallocate slice in iterateTransactions (ethereum#33690)

Preallocate hashes slice with known length instead of using append in a
loop. This avoids multiple reallocations during transaction indexing.

* trie/bintrie: fix tree key hashing to match spec (ethereum#33694)

Based on [EIP-7864](https://eips.ethereum.org/EIPS/eip-7864), the tree
index should be 32 bytes instead of 31 bytes.
```
def get_tree_key(address: Address32, tree_index: int, sub_index: int):
    # Assumes STEM_SUBTREE_WIDTH = 256
    return tree_hash(address + tree_index.to_bytes(32, "little"))[:31] + bytes(
        [sub_index]
    )
```

* eth/tracers/native: add index to callTracer log (ethereum#33629)

closes ethereum#33566

* core: standardize slow block JSON output for cross-client metrics (ethereum#33655)

Implement standardized JSON format for slow block logging to enable
cross-client performance analysis and protocol research.

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

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

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


This should come after merging ethereum#33522

---------

Co-authored-by: Gary Rong <garyrong0905@gmail.com>

* eth/gasprice: reduce allocations (ethereum#33698)

Recent pprof from our validator shows ~6% of all allocations because of
the gas price oracle. This PR reduces that.

* crypto/kzg4844: preallocate proof slice in ComputeCellProofs (ethereum#33703)

Preallocate the proof slice with the known size instead of growing it
via append in a loop. The length is already known from the source slice.

* trie: fix flaky test (ethereum#33711)

* ethdb/pebble: disable seek compaction for Pebble (ethereum#33697)

This PR restores the previous Pebble configuration, disabling seek compaction.

This feature is still needed by hash mode archive node, mitigating the
overhead of frequent compaction.

* core/txpool/legacypool: clarify and fix non-executable tx heartbeat (ethereum#33704)

Heartbeats are used to drop non-executable transactions from the queue.
The timeout mechanism was not clearly documented, and it was updates
also when not necessary.

* crypto/ecies: fix ECIES invalid-curve handling (ethereum#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-curve/small-subgroup attacks.
The fix enforces IsOnCurve validation up front.

* core/state: add bounds check in heap eviction loop (ethereum#33712)

core/state: add bounds check in heap eviction loop

Add len(h) > 0 check before accessing h[0] to prevent potential panic
and align with existing heap access patterns in txpool, p2p, and mclock
packages.

* ethclient: fix timeout param for eth_sendRawTransactionSync (ethereum#33693)

Fix timeout parameter in eth_sendRawTransactionSync
to be an integer instead of hex. The spec has now been
clarified on this point.

* triedb/pathdb: preallocate slices in decodeRestartTrailer (ethereum#33715)

Preallocate capacity for `keyOffsets` and `valOffsets` slices in
`decodeRestartTrailer` since the exact size (`nRestarts`) is known
upfront.

---------

Co-authored-by: rjl493456442 <garyrong0905@gmail.com>

* signer/core/apitypes: add cell proofs (ethereum#32910)

Adds support for cell proofs in blob transactions in the signer

---------

Co-authored-by: Gary Rong <garyrong0905@gmail.com>

* triedb/pathdb: preallocate slices in encode methods (ethereum#33736)

Preallocates slices with known capacity in `stateSet.encode()` and
`StateSetWithOrigin.encode()` methods to eliminate redundant
reallocations during serialization.

* internal/ethapi: Add timestamp to eth_getTransactionByHash (ethereum#33709)

Implements ethereum/execution-apis#729 and
fixes ethereum#33491. It adds blockTimestamp to transaction objects returned
by the RPC.

* core: miner: reduce allocations in block building (ethereum#33375)

I recently went on a longer flight and started profiling the geth block
production pipeline.
This PR contains a bunch of individual fixes split into separate
commits.
I can drop some if necessary.


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

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

                │ /tmp/old.txt │            /tmp/new.txt             │
                │  allocs/op   │  allocs/op   vs base                │
BuildPayload-14    2.703k ± 4%   2.453k ± 5%  -9.25% (p=0.000 n=200)
```

* trie/bintrie: fix debug_executionWitness for binary tree (ethereum#33739)

The `Witness` method was not implemented for the binary tree, which
caused `debug_excutionWitness` to panic. This PR fixes that.

Note that the `TransitionTrie` version isn't implemented, and that's on
purpose: more thought must be given to what should go in the global
witness.

* accounts/usbwallet: add support for Ledger Nano Gen5 (ethereum#33297)

adds support for the 0x0008 / 0x8000 product ID (Ledger Apex | Nano
Gen5).

* core/types, internal/ethapi, signer/core/apitypes: avoid copying 128KB blobs in range loops (ethereum#33717)

kzg4844.Blob is 131072 bytes. Using `for _, blob := range` copies the
entire blob on each iteration. With up to 6 blobs per transaction, this
wastes ~768KB of memory copies.

Switch to index-based iteration and pass pointers directly.

* crypto/keccak: vendor in golang.org/x/crypto/sha3 (ethereum#33323)

The upstream libray has removed the assembly-based implementation of
keccak. We need to maintain our own library to avoid a peformance
regression.

---------

Co-authored-by: lightclient <lightclient@protonmail.com>

* core/txpool/legacypool: reduce unnecessary allocations during add (ethereum#33701)

Not many allocs we save here, but it also cleans up the logic and should
speed up the process a tiny bit

* metrics: add missing GaugeInfo case in GetAll() (ethereum#33748)

GetAll did not return GaugeInfo metrics, which affects "chain/info" and "geth/info".

* rlp: add RawList for working with un-decoded lists (ethereum#33755)

This adds a new type wrapper that decodes as a list, but does not
actually decode the contents of the list. The type parameter exists as a
marker, and enables decoding the elements lazily. RawList can also be
used for building a list incrementally.

* internal/ethapi: fix error code for revert in eth_simulateV1 (ethereum#33007)

The error code for revert should be consistent with eth_call and be 3.

* core/txpool/blobpool: reset counters and gapped on Clear (ethereum#33775)

Clear was only used in tests, but it was missing some of the cleanup.

Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>

* metrics: add missing ResettingTimer case in GetAll() (ethereum#33749)

Follow-up to ethereum#33748

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

Note: ResettingTimer.Snapshot() resets the timer by design, which is
consistent with how the prometheus exporter uses it.

* core/rawdb: check pruning tail in HasBody and HasReceipts (ethereum#33747)

### Problem

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

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

### Changes

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

This aligns `HasBody`/`HasReceipts` behavior with
`ReadBody`/`ReadReceipts` and fixes potential issues in
`skeleton.linked()` which relies on these checks during sync.

* metrics: reduce allocations for metrics (ethereum#33699)

* core/rawdb: close freezer table in InspectFreezerTable (ethereum#33776)

* core/vm: add missing PUSH0 handler in EIP-8024 test mini-interpreter (ethereum#33785)

* core/rawdb: fix incorrect tail value in unindexTransactions log output (ethereum#33796)

* internal/era: New EraE implementation (ethereum#32157)

Here is a draft for the New EraE implementation. The code follows along
with the spec listed at https://hackmd.io/pIZlxnitSciV5wUgW6W20w.

---------

Co-authored-by: shantichanal <158101918+shantichanal@users.noreply.github.com>
Co-authored-by: lightclient <lightclient@protonmail.com>
Co-authored-by: MariusVanDerWijden <m.vanderwijden@live.de>
Co-authored-by: Sina Mahmoodi <itz.s1na@gmail.com>

* cmd/geth: fix wrong flag names in influxdb metrics error messages (ethereum#33804)

* core/rawdb: close directory fd on Readdirnames error in cleanup (ethereum#33798)

* core/vm: 8024 tests should enforce explicit errors (ethereum#33787)

This PR makes `TestEIP8024_Execution` verify explicit error types (e.g.,
`ErrStackUnderflow` vs `ErrInvalidOpCode`) rather than accepting any
error. It also fails fast on unexpected opcodes in the mini-interpreter
to avoid false positives from missing opcode handling.

* eth: fix targetView==nil case (ethereum#33810)

This PR fixes a panic in a corner case situation when a `ChainEvent` is
received by `eth.Ethereum.updateFilterMapsHeads()` but the given chain
section does not exist in `BlockChain` any more. This can happen during
chain rewind because chain events are processed asynchronously. Ignoring
the event in this case is ok, the final event will point to the final
rewound head and the indexer will be updated.
Note that similar issues will not happen once we transition to
ethereum#32292 and the new indexer
built on top of this. Until then, the current fix should be fine.

* ethdb/pebble: fix CompactionDebtConcurrency comment (ethereum#33805)

* trie: fix embedded node size validation (ethereum#33803)

The `decodeRef` function used `size > hashLen` to reject oversized
embedded nodes, but this incorrectly allowed nodes of exactly 32 bytes
through. The encoding side (hasher.go, stacktrie.go) consistently uses
`len(enc) < 32` to decide whether to embed a node inline, meaning nodes
of 32+ bytes are always hash-referenced. The error message itself
already stated `want size < 32`, confirming the intended threshold.
Changed `size > hashLen` to `size >= hashLen` in `decodeRef` to align
the decoding validation with the encoding logic, the Yellow Paper spec,
and the surrounding comments.

* ethclient/gethclient: callTracer methods (ethereum#31510)

Added methods `TraceCallWithCallTracer` and `TraceTransactionWithCallTracer`.

Fixes ethereum#28182

---------

Co-authored-by: Sina Mahmoodi <itz.s1na@gmail.com>

* trie/bintrie: use correct key mapping in GetStorage and DeleteStorage (ethereum#33807)

GetStorage and DeleteStorage used GetBinaryTreeKey to compute the tree
key, while UpdateStorage used GetBinaryTreeKeyStorageSlot. The latter
applies storage slot remapping (header offset for slots <64, main
storage prefix for the rest), so reads and deletes were targeting
different tree locations than writes.

Replace GetBinaryTreeKey with GetBinaryTreeKeyStorageSlot in both
GetStorage and DeleteStorage to match UpdateStorage. Add a regression
test that verifies the write→read→delete→read round-trip for main
storage slots.

* rlp: return Iterator as non-pointer (ethereum#33818)

Most uses of the iterator are like this:

    it, _ := rlp.NewListIterator(data)
    for it.Next() {
        do(it.Value())
    }

This doesn't require the iterator to be a pointer and it's better to
have it stack-allocated. AFAIK the compiler cannot prove it is OK to
stack-allocate when it is returned as a pointer because the methods of
`Iterator` use pointer receiver and also mutate the object.

The iterator type was not exported until very recently, so I think it is
still OK to change this API.

* cmd/evm/internal/t8ntool, core/rawdb: fix RLP iterator error handling (ethereum#33820)

This fixes two cases where `Iterator.Err()` was misused. The method will
only return an error after `Next()` has returned false, so it makes no
sense to check for the error within the loop itself.

* triedb/pathdb: return nodeLoc by value to avoid heap allocation (ethereum#33819)

* eth/tracers: tests for bad block tracing (ethereum#33821)

Fixes ethereum#30833

* internal/era: update eraE type IDs to match spec (ethereum#33827)

Update to match the spec:
eth-clients/e2store-format-specs#16

---------

Co-authored-by: lightclient <lightclient@protonmail.com>

* node: http2 for JSON-RPC API (ethereum#33812)

The reasoning for using the cleartext format here is that the JSON-RPC
API is internal only. Providers which expose it publicly already put it
behind a proxy which handles also the encryption.

* rlp: add AppendRaw method to RawList (ethereum#33834)

This is helpful when building a list from already-encoded elements.

* rlp: validate and cache element count in RawList (ethereum#33840)

This changes `RawList` to ensure the count of items is always valid.
Lists with invalid structure, i.e. ones where an element exceeds the
size of the container, are now detected during decoding of the `RawList`
and thus cannot exist.

Also remove `RawList.Empty` since it is now fully redundant, and
`Iterator.Count` since it returns incorrect results in the presence of
invalid input. There are no callers of these methods (yet).

* rlp: add back Iterator.Count, with fixes (ethereum#33841)

I removed `Iterator.Count` in ethereum#33840, because it appeared to be unused
and did not provide the documented invariant: the returned count should
always be an upper bound on the number of iterations allowed by `Next`.

In order to make `Count` work, the semantics of `CountValues` has to
change to return the number of items up and including the invalid one. I
have reviewed all callsites of `CountValues` to assess if changing this
is safe. There aren't that many, and the only call that doesn't check
the error and return is in the trie node parser,
`trie.decodeNodeUnsafe`. There, we distinguish the node type based on
the number of items, and it previously returned an error for item count
zero. In order to avoid any potential issue that could result from this
change, I'm adding an error check in that function, though it isn't
necessary.

* Update testdata

---------

Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
Co-authored-by: Daniel Liu <liudaniel@qq.com>
Co-authored-by: David Klank <155117116+davidjsonn@users.noreply.github.com>
Co-authored-by: Galoretka <galoretochka@gmail.com>
Co-authored-by: Ng Wei Han <47109095+weiihann@users.noreply.github.com>
Co-authored-by: rjl493456442 <garyrong0905@gmail.com>
Co-authored-by: Jonny Rhea <5555162+jrhea@users.noreply.github.com>
Co-authored-by: 0xFloki <signal-rooms-7n@icloud.com>
Co-authored-by: Jeevan <g1siddharthr@gmail.com>
Co-authored-by: Rizky Ikwan <rizzikwann@gmail.com>
Co-authored-by: Csaba Kiraly <cskiraly@users.noreply.github.com>
Co-authored-by: oooLowNeoNooo <ooolowneonooo@gmail.com>
Co-authored-by: Archkon <180910180+Archkon@users.noreply.github.com>
Co-authored-by: Guillaume Ballet <3272758+gballet@users.noreply.github.com>
Co-authored-by: Fibonacci747 <albertofibonacci12@gmail.com>
Co-authored-by: Rim Dinov <rdin35051@gmail.com>
Co-authored-by: Bashmunta <georgebashmunta@gmail.com>
Co-authored-by: Marco Munizaga <marco@marcopolo.io>
Co-authored-by: Csaba Kiraly <csaba.kiraly@gmail.com>
Co-authored-by: Mask Weller <Wellermask@gmail.com>
Co-authored-by: m6xwzzz <maskk.weller@gmail.com>
Co-authored-by: Andrew Davis <1709934+Savid@users.noreply.github.com>
Co-authored-by: MariusVanDerWijden <m.vanderwijden@live.de>
Co-authored-by: cui <cuiweixie@gmail.com>
Co-authored-by: LittleBingoo <zpksdhr@gmail.com>
Co-authored-by: Madison carter <madisoncarter1212@gmail.com>
Co-authored-by: maradini77 <140460067+maradini77@users.noreply.github.com>
Co-authored-by: Xuanyu Hu <helium729@outlook.com>
Co-authored-by: 0xcharry <idea.sermons.5p@icloud.com>
Co-authored-by: bigbear <155267841+aso20455@users.noreply.github.com>
Co-authored-by: Maxim Evtush <154841002+maximevtush@users.noreply.github.com>
Co-authored-by: Felix Lange <fjl@twurst.com>
Co-authored-by: lightclient <lightclient@protonmail.com>
Co-authored-by: DeFi Junkie <deffie.jnkiee@gmail.com>
Co-authored-by: jwasinger <j-wasinger@hotmail.com>
Co-authored-by: Sina Mahmoodi <itz.s1na@gmail.com>
Co-authored-by: Mael Regnery <mael@mqli.fr>
Co-authored-by: Lessa <230214854+adblesss@users.noreply.github.com>
Co-authored-by: lightclient <14004106+lightclient@users.noreply.github.com>
Co-authored-by: maskpp <maskpp266@gmail.com>
Co-authored-by: Carlos Bermudez Porto <cbermudez.dev@gmail.com>
Co-authored-by: forkfury <forkfury@gmail.com>
Co-authored-by: marukai67 <miserly.pendant0p@icloud.com>
Co-authored-by: wakabat <wakabat@protonmail.com>
Co-authored-by: CPerezz <37264926+CPerezz@users.noreply.github.com>
Co-authored-by: fengjian <445077+fengjian@users.noreply.github.com>
Co-authored-by: Noisy <125606576+donatik27@users.noreply.github.com>
Co-authored-by: milan-cb <milan.saxena@coinbase.com>
Co-authored-by: alex017 <dishes-18pole@icloud.com>
Co-authored-by: mmsqe <tqd0800210105@gmail.com>
Co-authored-by: vickkkkkyy <vickyaviles847@gmail.com>
Co-authored-by: Sina M <1591639+s1na@users.noreply.github.com>
Co-authored-by: Forostovec <ilonaforostovec22@gmail.com>
Co-authored-by: GarmashAlex <garmasholeksii@gmail.com>
Co-authored-by: sashass1315 <sashass1315@gmail.com>
Co-authored-by: shazam8253 <54690736+shazam8253@users.noreply.github.com>
Co-authored-by: shantichanal <158101918+shantichanal@users.noreply.github.com>
Co-authored-by: Felföldi Zsolt <zsfelfoldi@gmail.com>
Co-authored-by: Ragnar <rodiondenmark@gmail.com>
Co-authored-by: phrwlk <phrwlk7@gmail.com>
Dargon789 added a commit to Dargon789/go-ethereum that referenced this pull request Feb 14, 2026
* Update config.yml (#51)

Update the CircleCI configuration to use a custom Docker executor with secured Docker Hub credentials, remove the aws-cli orb, and rename the job and workflow to match the web3-defi-game project.

CI:

Define a custom executor using cimg/base:stable image authenticated via DOCKER_HUB_USER and DOCKER_HUB_PASSWORD
Remove the aws-cli orb and its install step
Rename the CI job to web3-defi-game-project- and the workflow to my-custom-workflow

Signed-off-by: Dargon789 <64915515+Dargon789@users.noreply.github.com>

* eth/downloader: fix incorrect waitgroup in test `XTestDelivery` (#33047) (#52)

Summary by Sourcery
Fix a deadlock in the XTestDelivery test by correctly incrementing the WaitGroup before starting the goroutine.

Bug Fixes:

Correct WaitGroup synchronization in XTestDelivery test by adding the missing wg.Add(1) call.
Tests:

Add missing wg.Add(1) before launching the goroutine in XTestDelivery to ensure proper synchronization.

Co-authored-by: wit liu <wit765765346@gmail.com>

* core/state: make test output message readable (#33400)

* crypto/signify: fix fuzz test compilation (#33402)

The fuzz test file has been broken for a while - it doesn't compile with
the `gofuzz` build tag.

Two issues:
- Line 59: called `SignifySignFile` which doesn't exist (should be
`SignFile`)
- Line 71: used `:=` instead of `=` for already declared `err` variable

* core/overlay: fix incorrect debug log key/value in LoadTransitionState (#32637)

* core/state: fix code existence not marked correctly (#33415)

When iterating over a map with value types in Go, the loop variable is a
copy. In `markCodeExistence`, assigning to `code.exists` modified only
the local copy, not the actual map entry, causing the existence flag to
always remain false.

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

Fix by changing `codes` from `map[common.Address]contractCode` to
`map[common.Address]*contractCode`, so mutations apply directly to the
struct.

* cmd/workload, eth/tracers/native: introduce state proof tests (#32247)

This pull request introduces a new workload command, providing the
features
for `eth_getProof` endpoint test generation and execution.

* eth/catalyst: fix invalid timestamp log message (#33440)

Fixes a typo in the NewPayload invalid timestamp warning where the
parent timestamp was incorrectly logged as the block timestamp.

* core: add code read statistics (#33442)

* core/txpool/blobpool: remove legacy sidecar conversion (#33352)

This PR removes the legacy sidecar conversion logic.

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

Note that conversion at the RPC layer is still supported, and version 0
blob
transactions will be automatically converted to version 1 there.

* tests/fuzzers: remove unused field from kv struct in rangeproof fuzzer (#33447)

Removes the unused `t bool` field from the `kv` struct in the rangeproof fuzzer.

* eth/catalyst: return empty response for GetBlobsV2 before Osaka (#33444)

Fix #33420

* core, eth: add lock protection in snap sync (#33428)

Fixes #33396, #33397, #33398

* graphql: add nil check in block resolver (#33225)

Add nil checks for header and block in Block resolver methods to prevent
panic when querying non-existent blocks.

* core/txpool/blobpool: fix slotter size limit (#33474)

Blobs are stored per transaction in the pool, so we need billy to handle
up to the per-tx limit, not to the per-block limit.

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

Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>

* eth/downloader: fix stale beacon header deletion (#33481)

In this PR, two things have been fixed:

--- 

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

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

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

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

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

--- 

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

Once the skeleton chain links with local one, it will try to schedule the 
synchronization by fetching the missing blocks and import them then. 
It's possible the last subchain already overwrites the previous subchain and 
results in having two subchains leftover. As a result, an error log will printed
https://github.com/ethereum/go-ethereum/blob/master/eth/downloader/skeleton.go#L1074

* console/prompt: use PromptInput in PromptConfirm method (#33445)

* params: fix wrong comment (#33503)

It seems that the comment for CopyGas was wrongly associated to
SloadGas.

* trie, go.mod: remove all references to go-verkle and go-ipa (#33461)

In order to reduce the amount of code that is embedded into the keeper
binary, I am removing all the verkle code that uses go-verkle and
go-ipa. This will be followed by further PRs that are more like stubs to
replace code when the keeper build is detected.

I'm keeping the binary tree of course. This means that you will still
see `isVerkle` variables all over the codebase, but they will be renamed
when code is touched (i.e. this is not an invitation for 30+ AI slop
PRs).

---------

Co-authored-by: Gary Rong <garyrong0905@gmail.com>

* .github/workflows: preventively close PRs that seem AI-generated (#33414)

This is a new step in my crusade against the braindead fad of starting
PR titles with a word that is completely redundant with github labels,
thus wasting prime first-line real-estate for something that isn't
necessary.

I noticed that every single one of these PRs are low-quality AI-slop, so
I think there is a strong case to be made for these PRs to be
auto-closed. A message is added before closing the PR, redirecting to
our contribution guidelines, so I expect quality first-time contributors
to read them and reopen the PR. In the case of spam PRs, the author is
unlikely to revisit a given PR, and so auto-closing might have a
positive impact. That's an experiment worth trying, imo.

* triedb/pathdb: optimize history indexing efficiency (#33303)

This pull request optimizes history indexing by splitting a single large
database
 batch into multiple smaller chunks.

Originally, the indexer will resolve a batch of state histories and
commit all
corresponding index entries atomically together with the indexing
marker.

While indexing more state histories in a single batch improves
efficiency, excessively
large batches can cause significant memory issues.

To mitigate this, the pull request splits the mega-batch into several
smaller batches
and flushes them independently during indexing. However, this introduces
a potential
inconsistency that some index entries may be flushed while the indexing
marker is not,
and an unclean shutdown may leave the database in a partially updated
state.
This can corrupt index data.

To address this, head truncation is introduced. After a restart, any
excessive index
entries beyond the expected indexing marker are removed, ensuring the
index remains
consistent after an unclean shutdown.

* beacon/light/sync: clear reqFinalityEpoch on server unregistration (#33483)

HeadSync kept reqFinalityEpoch entries for servers after receiving
EvUnregistered, while other per-server maps were cleared. This left
stale request.Server keys reachable from HeadSync, which can lead to a
slow memory leak in setups that dynamically register and unregister
servers.

The fix adds deletion of the reqFinalityEpoch entry in the
EvUnregistered handler. This aligns HeadSync with the cleanup pattern
used by other sync modules and keeps the finality request bookkeeping
strictly limited to currently registered servers.

* cmd/geth: remove deprecated vulnerability check command (#33498)

This PR removes the version-check command and its associated logic as
discussed in issue #31222.

Removed versionCheckCommand from misccmd.go and main.go.

Deleted version_check.go and its corresponding tests.

Cleaned up testdata/vcheck directory (~800 lines of JSON/signatures
removed).

Verified build with make geth

* core/state/snapshot: fix storageList memory accounting (#33505)

* eth/catalyst: implement getBlobsV3 (#33404)

This is used by cell-level dissemination (aka partial messages) to give
the CL all blobs the EL knows about and let CL communicate efficiently
about any other missing blobs. In other words, partial responses from
the EL is useful now.

See the related (closed) PR:
https://github.com/ethereum/execution-apis/pull/674 and the new PR:
https://github.com/ethereum/execution-apis/pull/719

* core/blockchain.go: cleanup finalized block on rewind in setHeadBeyondRoot (#33486)

Fix #33390 

`setHeadBeyondRoot` was failing to invalidate finalized blocks because
it compared against the original head instead of the rewound root. This
fix updates the comparison to use the post-rewind block number,
preventing the node from reporting a finalized block that no longer
exists. Also added relevant test cases for it.

* eth/fetcher: improve the condition to stall peer in tx fetcher (#32725)

Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
Co-authored-by: Csaba Kiraly <csaba.kiraly@gmail.com>

* core/rawdb: add trienode freezer support to InspectFreezerTable (#33515)

Adds missing trienode freezer case to InspectFreezerTable, making it
consistent with InspectFreezer which already supports it.

Co-authored-by: m6xwzzz <maskk.weller@gmail.com>

* ethstats: report newPayload processing time to stats server (#33395)

Add NewPayloadEvent to track engine API newPayload block processing
times and report them to ethstats. This enables monitoring of block
processing performance.

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

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

---------

Co-authored-by: MariusVanDerWijden <m.vanderwijden@live.de>

* core: re-organize the stats category (#33525)

Check out https://hackmd.io/dg7rizTyTXuCf2LSa2LsyQ for more details

* eth: txs fetch/send log at trace level only (#33541)

This logging was too intensive at debug level, it is better to have it
at trace level only.

Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>

* core/vm: avoid escape to heap (#33537)

* core/state, core/tracing: new state update hook (#33490)

### Description
Add a new `OnStateUpdate` hook which gets invoked after state is
committed.

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

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

---------

Co-authored-by: Gary Rong <garyrong0905@gmail.com>

* core/state: add cache statistics of contract code reader (#33532)

* internal/flags: update copyright year to 2026 (#33550)

* graphql: fix GasPrice for blob and setcode transactions (#33542)

Adds BlobTxType and SetCodeTxType to GasPrice switch case, aligning with
`MaxFeePerGas` and `MaxPriorityFeePerGas` handling.

Co-authored-by: m6xwzzz <maskk.weller@gmail.com>

* triedb/pathdb: introduce extension to history index structure (#33399)

It's a PR based on #33303 and introduces an approach for trienode
history indexing.

---

In the current archive node design, resolving a historical trie node at
a specific block
involves the following steps:

- Look up the corresponding trie node index and locate the first entry
whose state ID
   is greater than the target state ID.
- Resolve the trie node from the associated trienode history object.

A naive approach would be to store mutation records for every trie node,
similar to
how flat state mutations are recorded. However, the total number of trie
nodes is
extremely large (approximately 2.4 billion), and the vast majority of
them are rarely
modified. Creating an index entry for each individual trie node would be
very wasteful
in both storage and indexing overhead. To address this, we aggregate
multiple trie
nodes into chunks and index mutations at the chunk level instead. 

---

For a storage trie, the trie is vertically partitioned into multiple sub
tries, each spanning
three consecutive levels. The top three levels (1 + 16 + 256 nodes) form
the first chunk,
and every subsequent three-level segment forms another chunk.

```
Original trie structure

Level 0               [ ROOT ]                               1 node
Level 1        [0] [1] [2] ... [f]                          16 nodes
Level 2     [00] [01] ... [0f] [10] ... [ff]               256 nodes
Level 3   [000] [001] ... [00f] [010] ... [fff]           4096 nodes
Level 4   [0000] ... [000f] [0010] ... [001f] ... [ffff] 65536 nodes

Vertical split into chunks (3 levels per chunk)

Level0             [ ROOT ]                     1 chunk
Level3        [000]   ...     [fff]          4096 chunks
Level6   [000000]    ...    [fffffff]    16777216 chunks  
```

Within each chunk, there are 273 nodes in total, regardless of the
chunk's depth in the trie.

```
Level 0           [ 0 ]                         1 node
Level 1        [ 1 ] … [ 16 ]                  16 nodes
Level 2     [ 17 ] … … [ 272 ]                256 nodes
```

Each chunk is uniquely identified by the path prefix of the root node of
its corresponding
sub-trie. Within a chunk, nodes are identified by a numeric index
ranging from 0 to 272.

For example, suppose that at block 100, the nodes with paths `[]`,
`[0]`, `[f]`, `[00]`, and `[ff]`
are modified. The mutation record for chunk 0 is then appended with the
following entry:

`[100 → [0, 1, 16, 17, 272]]`, `272` is the numeric ID of path `[ff]`.

Furthermore, due to the structural properties of the Merkle Patricia
Trie, if a child node
is modified, all of its ancestors along the same path must also be
updated. As a result,
in the above example, recording mutations for nodes `00` and `ff` alone
is sufficient,
as this implicitly indicates that their ancestor nodes `[]`, `[0]` and
`[f]` were also
modified at block 100.

--- 

Query processing is slightly more complicated. Since trie nodes are
indexed at the chunk
level, each individual trie node lookup requires an additional filtering
step to ensure that
a given mutation record actually corresponds to the target trie node.

As mentioned earlier, mutation records store only the numeric
identifiers of leaf nodes,
while ancestor nodes are omitted for storage efficiency. Consequently,
when querying
an ancestor node, additional checks are required to determine whether
the mutation
record implicitly represents a modification to that ancestor.

Moreover, since trie nodes are indexed at the chunk level, some trie
nodes may be
updated frequently, causing their mutation records to dominate the
index. Queries
targeting rarely modified trie nodes would then scan a large amount of
irrelevant
index data, significantly degrading performance.

To address this issue, a bitmap is introduced for each index block and
stored in the
chunk's metadata. Before loading a specific index block, the bitmap is
checked to
determine whether the block contains mutation records relevant to the
target trie node.
If the bitmap indicates that the block does not contain such records,
the block is skipped entirely.

* ethclient: omit nil address/topics from filter args (#33464)

Fixes #33369

This omits "topics" and "addresses" from the filter when they are unspecified.
It is required for interoperability with some server implementations that cannot
handle `null` for these fields.

* rlp, trie, triedb/pathdb: compress trienode history (#32913)

This pull request introduces a mechanism to compress trienode history by
storing only the node diffs between consecutive versions.

- For full nodes, only the modified children are recorded in the history;
- For short nodes, only the modified value is stored;

If the node type has changed, or if the node is newly created or
deleted, the entire node value is stored instead.

To mitigate the overhead of reassembling nodes from diffs during history
reads, checkpoints are introduced by periodically storing full node values.

The current checkpoint interval is set to every 16 mutations, though
this parameter may be made configurable in the future.

* core/txpool/blobpool: allow gaps in blobpool (#32717)

Allow the blobpool to accept blobs out of nonce order

Previously, we were dropping blobs that arrived out-of-order. However,
since fetch decisions are done on receiver side,
out-of-order delivery can happen, leading to inefficiencies.

This PR:
- adds an in-memory blob tx storage, similar to the queue in the
legacypool
- a limited number of received txs can be added to this per account
- txs waiting in the gapped queue are not processed further and not
propagated further until they are unblocked by adding the previos nonce
to the blobpool

The size of the in-memory storage is currently limited per account,
following a slow-start logic.
An overall size limit, and a TTL is also enforced for DoS protection.

---------

Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
Co-authored-by: MariusVanDerWijden <m.vanderwijden@live.de>

* ethclient: restore BlockReceipts support for `BlockNumberOrHash` objects (#33242)

- pass `rpc.BlockNumberOrHash` directly to `eth_getBlockReceipts` so
`requireCanonical` and other fields survive
- aligns `BlockReceipts` with other `ethclient` methods and re-enables
canonical-only receipt queries

* tests: check correct revert on invalid tests (#33543)

This PR fixes an issue where `evm statetest` would not verify the
post-state root hash if the test case expected an exception (e.g.
invalid transaction).

The fix involves:
1.  Modifying `tests/state_test_util.go` in the `Run` method.
2. When an expected error occurs (`err != nil`), we now check if
`post.Root` is defined.
3. If defined, we recalculate the intermediate root from the current
state (which is reverted to the pre-transaction snapshot upon error).
4. We use `GetChainConfig` and `IsEIP158` to ensure the correct state
clearing rules are applied when calculating the root, avoiding
regressions on forks that require EIP-158 state clearing.
5. If the calculated root mismatches the expected root, the test now
fails.

This ensures that state tests are strictly verified against their
expected post-state, even for failure scenarios.

Fixes issue #33527

---------

Co-authored-by: MariusVanDerWijden <m.vanderwijden@live.de>

* core: remove duplicate chainHeadFeed.Send code (#33563)

The code was simply duplicate, so we can remove some code lines here.

Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>

* core/rawdb: skip missing block bodies during tx unindexing (#33573)

This PR fixes an issue where the tx indexer would repeatedly try to
“unindex” a block with a missing body, causing a spike in CPU usage.
This change skips these blocks and advances the index tail. The fix was
verified both manually on a local development chain and with a new test.

resolves #33371

* internal/ethapi: refactor RPC tx formatter (#33582)

* tests: repair oss-fuzz coverage command (#33304)

The coverage build path was generating go test commands with a bogus
-tags flag that held the coverpkg value, so the run kept failing. I
switched coverbuild to treat the optional argument as an override for
-coverpkg and stopped passing coverpkg from the caller. Now the script
emits a clean go test invocation that should actually succeed.

* rpc: fix limitedBuffer.Write to properly enforce size limit (#33545)

Updated the `avail` calculation to correctly compute remaining capacity:
`buf.limit - len(buf.output)`, ensuring the buffer never exceeds its
configured limit regardless of how many times `Write()` is called.

* version: begin v1.17.0 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>

* accounts/keystore: fix panic in decryptPreSaleKey (#33602)

Validate ciphertext length in decryptPreSaleKey, preventing runtime
panics on invalid input.

* rpc, internal/telemetry: add OpenTelemetry tracing for JSON-RPC calls (#33452)

Add Open Telemetry tracing inside the RPC server to help attribute runtime costs within `handler.handleCall()`. In particular, it allows us to distinguish time spent decoding arguments, invoking methods via reflection, and actually executing the method and constructing/encoding JSON responses.

---------

Co-authored-by: lightclient <lightclient@protonmail.com>

* rpc: extract OpenTelemetry trace context from request headers (#33599)

This PR adds support for the extraction of OpenTelemetry trace context
from incoming JSON-RPC request headers, allowing geth spans to be linked
to upstream traces when present.

---------

Co-authored-by: lightclient <lightclient@protonmail.com>

* triedb/pathdb: change the bitmap to big endian (#33584)

The bitmap is used in compact-encoded trie nodes to indicate which elements 
have been modified. The bitmap format has been updated to use big-endian
encoding. 

Bit positions are numbered from 0 to 15, where position 0 corresponds to
the most significant bit of b[0], and position 15 corresponds to the least
significant bit of b[1].

* eth/fetcher: refactor test code (#33610)

Remove a large amount of duplicate code from the tx_fetcher tests.

---------

Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
Co-authored-by: lightclient <lightclient@protonmail.com>

* core/vm: check if read-only in gas handlers (#33281)

This PR causes execution to terminate at the gas handler in the case of
sstore/call if they are invoked in a static execution context.

This aligns the behavior with EIP 7928 by ensuring that we don't record
any state reads in the access list from an SSTORE/CALL in this
circumstance.

---------

Co-authored-by: lightclient <lightclient@protonmail.com>

* core/vm: in selfdestruct gas calculation, return early if there isn't enough gas to cover cold account access costs (#33450)

There's no need to perform the subsequent state access on the target if
we already know that we are out of gas.

This aligns the state access behavior of selfdestruct with EIP-7928

* core: invoke selfdestruct tracer hooks during finalisation (#32919)

The core part of this PR that we need to adopt is to move the code and
nonce change hook invocations to occur at tx finalization, instead of
when the selfdestruct opcode is called.

Additionally:
* remove `SelfDestruct6780` now that it is essentially the same as
`SelfDestruct` just gated by `is new contract`
* don't duplicate `BalanceIncreaseSelfdestruct` (transfer to recipient
of selfdestruct) in the hooked statedb and in the opcode handler for the
selfdestruct opcode.
* balance is burned immediately when the beneficiary of the selfdestruct
is the sender, and the contract was created in the same transaction.
Previously we emit two balance increases to the recipient (see above
point), and a balance decrease from the sender.

---------

Co-authored-by: Sina Mahmoodi <itz.s1na@gmail.com>
Co-authored-by: Gary Rong <garyrong0905@gmail.com>
Co-authored-by: lightclient <lightclient@protonmail.com>

* triedb/pathdb: implement trienode history indexing scheme (#33551)

This PR implements the indexing scheme for trie node history. Check
https://github.com/ethereum/go-ethereum/pull/33399 for more details

* triedb/pathdb: enable trienode history (#32621)

It's the part-4 for trienode history. The trienode history persistence
has been enabled with this PR by flag `history.trienode <non-negative-number>`

* rpc: add a rpc.rangelimit flag (#33163)

Adding an RPC flag to limit the block range size for eth_getLogs and
eth_newFilter requests.

closing https://github.com/ethereum/go-ethereum/issues/24508

---------

Co-authored-by: MariusVanDerWijden <m.vanderwijden@live.de>

* accounts/abi/bind/v2: replace rng in test (#33612)

Replace deprecated rand.Seed() with rand.New(rand.NewSource()) in
dep_tree_test.go.

* build: remove circleci config (#33616)

This doesn't seem to be used anymore.

* rlp: improve SplitListValues allocation efficiency (#33554)

* core/vm: add read only protection for opcodes (#33637)

This PR reverts a part of changes brought by https://github.com/ethereum/go-ethereum/pull/33281/changes

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

It should act as a gatekeeper, otherwise, it is easy to introduce errors by adding
new gas measurement logic without consistently applying the read-only protection.

* triedb/pathdb: double check the list availability before regeneration (#33622)

Co-authored-by: rjl493456442 <garyrong0905@gmail.com>

* internal/debug: add integration with Grafana Pyroscope (#33623)

This adds support for Grafana Pyroscope, a continuous profiling solution. 
The client is configured similarly to metrics, i.e. run 

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

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

---------

Co-authored-by: Carlos Bermudez Porto <cbermudez.dev@gmail.com>

* accounts/scwallet: fix panic in decryptAPDU (#33606)

Validate ciphertext length in decryptAPDU, preventing runtime panics on
invalid input.

* core/state: ensure deterministic hook emission order in Finalise (#33644)

Fixes #33630

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

---------

Co-authored-by: jwasinger <j-wasinger@hotmail.com>

* core/txpool/legacypool: add metric for accounts in txpool  (#33646)

This PR adds metrics that count the number of accounts having transactions 
in the txpool. Together with the transaction count this can be used as a 
simple indicator of the diversity of transactions in the pool.

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

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

---------

Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>

* core/types: fix panic on invalid signature length (#33647)

Replace panic with error return in decodeSignature to prevent crashes on
invalid inputs, and update callers to propagate the error.

* core/txpool/legacypool: reset gauges on clear (#33654)

Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
Co-authored-by: rjl493456442 <garyrong0905@gmail.com>

* core, eth, internal, triedb/pathdb: enable eth_getProofs for history (#32727)

This PR enables the `eth_getProofs ` endpoint against the historical states.

* core/vm: update EIP-8024 - Missing immediate byte is now treated as 0x00 (#33614)

This PR updates the EIP-8024 implementation to match the latest spec
clarification.

---------

Co-authored-by: lightclient <lightclient@protonmail.com>

* core/txpool/legacypool: fix stale counter (#33653)

Calling `pool.priced.Removed` is needed to keep is sync with
`pool.all.Remove`.
It was called in other occurances, but not here.

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

Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>

* core: extend the code reader statistics (#33659)

This PR extends the statistics of contract code read by adding these
fields:

- **CacheHitBytes**: the total number of bytes served by cache
- **CacheMissBytes**: the total number of bytes read on cache miss
- **CodeReadBytes**: the total number of bytes for contract code read

* trie: preallocate slice capacity (#33689)

This PR optimizes memory allocation in StateTrie.PrefetchAccount() and
StateTrie.PrefetchStorage() by preallocating slice capacity when the
final size is known.

* triedb/pathdb: improve trienode reader for searching (#33681)

This PR optimizes the historical trie node reader by reworking how data
is accessed and memory is managed, reducing allocation overhead 
significantly.

Specifically:

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

- Besides, slice pre-allocation can avoid unnecessary deep-copy significantly.

* cmd/keeper: export getInput in wasm builds (#33686)

This is a tweak to the wasm build, that expects the `geth_io` namespace
to expect a `geth_io` module, providing a `len` and `read` methods. This
will be provided by the WASM interface in sp1. This forces an API change
on the OpenVM side, but the interface on their side is still being
designed, so we should proceed with this change, and we'll make a
different tag for OpenVM if this can't work for them.

Co-authored-by: wakabat <wakabat@protonmail.com>

* core/rawdb: preallocate slice in iterateTransactions (#33690)

Preallocate hashes slice with known length instead of using append in a
loop. This avoids multiple reallocations during transaction indexing.

* trie/bintrie: fix tree key hashing to match spec (#33694)

Based on [EIP-7864](https://eips.ethereum.org/EIPS/eip-7864), the tree
index should be 32 bytes instead of 31 bytes.
```
def get_tree_key(address: Address32, tree_index: int, sub_index: int):
    # Assumes STEM_SUBTREE_WIDTH = 256
    return tree_hash(address + tree_index.to_bytes(32, "little"))[:31] + bytes(
        [sub_index]
    )
```

* eth/tracers/native: add index to callTracer log (#33629)

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

* core: standardize slow block JSON output for cross-client metrics (#33655)

Implement standardized JSON format for slow block logging to enable
cross-client performance analysis and protocol research.

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

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

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


This should come after merging #33522

---------

Co-authored-by: Gary Rong <garyrong0905@gmail.com>

* eth/gasprice: reduce allocations (#33698)

Recent pprof from our validator shows ~6% of all allocations because of
the gas price oracle. This PR reduces that.

* crypto/kzg4844: preallocate proof slice in ComputeCellProofs (#33703)

Preallocate the proof slice with the known size instead of growing it
via append in a loop. The length is already known from the source slice.

* trie: fix flaky test (#33711)

* ethdb/pebble: disable seek compaction for Pebble (#33697)

This PR restores the previous Pebble configuration, disabling seek compaction.

This feature is still needed by hash mode archive node, mitigating the
overhead of frequent compaction.

* core/txpool/legacypool: clarify and fix non-executable tx heartbeat (#33704)

Heartbeats are used to drop non-executable transactions from the queue.
The timeout mechanism was not clearly documented, and it was updates
also when not necessary.

* 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-curve/small-subgroup attacks.
The fix enforces IsOnCurve validation up front.

* core/state: add bounds check in heap eviction loop (#33712)

core/state: add bounds check in heap eviction loop

Add len(h) > 0 check before accessing h[0] to prevent potential panic
and align with existing heap access patterns in txpool, p2p, and mclock
packages.

* ethclient: fix timeout param for eth_sendRawTransactionSync (#33693)

Fix timeout parameter in eth_sendRawTransactionSync
to be an integer instead of hex. The spec has now been
clarified on this point.

* triedb/pathdb: preallocate slices in decodeRestartTrailer (#33715)

Preallocate capacity for `keyOffsets` and `valOffsets` slices in
`decodeRestartTrailer` since the exact size (`nRestarts`) is known
upfront.

---------

Co-authored-by: rjl493456442 <garyrong0905@gmail.com>

* signer/core/apitypes: add cell proofs (#32910)

Adds support for cell proofs in blob transactions in the signer

---------

Co-authored-by: Gary Rong <garyrong0905@gmail.com>

* triedb/pathdb: preallocate slices in encode methods (#33736)

Preallocates slices with known capacity in `stateSet.encode()` and
`StateSetWithOrigin.encode()` methods to eliminate redundant
reallocations during serialization.

* internal/ethapi: Add timestamp to eth_getTransactionByHash (#33709)

Implements https://github.com/ethereum/execution-apis/issues/729 and
fixes #33491. It adds blockTimestamp to transaction objects returned
by the RPC.

* core: miner: reduce allocations in block building (#33375)

I recently went on a longer flight and started profiling the geth block
production pipeline.
This PR contains a bunch of individual fixes split into separate
commits.
I can drop some if necessary.


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

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

                │ /tmp/old.txt │            /tmp/new.txt             │
                │  allocs/op   │  allocs/op   vs base                │
BuildPayload-14    2.703k ± 4%   2.453k ± 5%  -9.25% (p=0.000 n=200)
```

* trie/bintrie: fix debug_executionWitness for binary tree (#33739)

The `Witness` method was not implemented for the binary tree, which
caused `debug_excutionWitness` to panic. This PR fixes that.

Note that the `TransitionTrie` version isn't implemented, and that's on
purpose: more thought must be given to what should go in the global
witness.

* accounts/usbwallet: add support for Ledger Nano Gen5 (#33297)

adds support for the 0x0008 / 0x8000 product ID (Ledger Apex | Nano
Gen5).

* core/types, internal/ethapi, signer/core/apitypes: avoid copying 128KB blobs in range loops (#33717)

kzg4844.Blob is 131072 bytes. Using `for _, blob := range` copies the
entire blob on each iteration. With up to 6 blobs per transaction, this
wastes ~768KB of memory copies.

Switch to index-based iteration and pass pointers directly.

* crypto/keccak: vendor in golang.org/x/crypto/sha3 (#33323)

The upstream libray has removed the assembly-based implementation of
keccak. We need to maintain our own library to avoid a peformance
regression.

---------

Co-authored-by: lightclient <lightclient@protonmail.com>

* core/txpool/legacypool: reduce unnecessary allocations during add (#33701)

Not many allocs we save here, but it also cleans up the logic and should
speed up the process a tiny bit

* metrics: add missing GaugeInfo case in GetAll() (#33748)

GetAll did not return GaugeInfo metrics, which affects "chain/info" and "geth/info".

* rlp: add RawList for working with un-decoded lists (#33755)

This adds a new type wrapper that decodes as a list, but does not
actually decode the contents of the list. The type parameter exists as a
marker, and enables decoding the elements lazily. RawList can also be
used for building a list incrementally.

* internal/ethapi: fix error code for revert in eth_simulateV1 (#33007)

The error code for revert should be consistent with eth_call and be 3.

* core/txpool/blobpool: reset counters and gapped on Clear (#33775)

Clear was only used in tests, but it was missing some of the cleanup.

Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>

* metrics: add missing ResettingTimer case in GetAll() (#33749)

Follow-up to https://github.com/ethereum/go-ethereum/pull/33748

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

Note: ResettingTimer.Snapshot() resets the timer by design, which is
consistent with how the prometheus exporter uses it.

* core/rawdb: check pruning tail in HasBody and HasReceipts (#33747)

### Problem

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

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

### Changes

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

This aligns `HasBody`/`HasReceipts` behavior with
`ReadBody`/`ReadReceipts` and fixes potential issues in
`skeleton.linked()` which relies on these checks during sync.

* metrics: reduce allocations for metrics (#33699)

* core/rawdb: close freezer table in InspectFreezerTable (#33776)

* core/vm: add missing PUSH0 handler in EIP-8024 test mini-interpreter (#33785)

* core/rawdb: fix incorrect tail value in unindexTransactions log output (#33796)

* internal/era: New EraE implementation (#32157)

Here is a draft for the New EraE implementation. The code follows along
with the spec listed at https://hackmd.io/pIZlxnitSciV5wUgW6W20w.

---------

Co-authored-by: shantichanal <158101918+shantichanal@users.noreply.github.com>
Co-authored-by: lightclient <lightclient@protonmail.com>
Co-authored-by: MariusVanDerWijden <m.vanderwijden@live.de>
Co-authored-by: Sina Mahmoodi <itz.s1na@gmail.com>

* cmd/geth: fix wrong flag names in influxdb metrics error messages (#33804)

* core/rawdb: close directory fd on Readdirnames error in cleanup (#33798)

* core/vm: 8024 tests should enforce explicit errors (#33787)

This PR makes `TestEIP8024_Execution` verify explicit error types (e.g.,
`ErrStackUnderflow` vs `ErrInvalidOpCode`) rather than accepting any
error. It also fails fast on unexpected opcodes in the mini-interpreter
to avoid false positives from missing opcode handling.

* eth: fix targetView==nil case (#33810)

This PR fixes a panic in a corner case situation when a `ChainEvent` is
received by `eth.Ethereum.updateFilterMapsHeads()` but the given chain
section does not exist in `BlockChain` any more. This can happen during
chain rewind because chain events are processed asynchronously. Ignoring
the event in this case is ok, the final event will point to the final
rewound head and the indexer will be updated.
Note that similar issues will not happen once we transition to
https://github.com/ethereum/go-ethereum/pull/32292 and the new indexer
built on top of this. Until then, the current fix should be fine.

* ethdb/pebble: fix CompactionDebtConcurrency comment (#33805)

* trie: fix embedded node size validation (#33803)

The `decodeRef` function used `size > hashLen` to reject oversized
embedded nodes, but this incorrectly allowed nodes of exactly 32 bytes
through. The encoding side (hasher.go, stacktrie.go) consistently uses
`len(enc) < 32` to decide whether to embed a node inline, meaning nodes
of 32+ bytes are always hash-referenced. The error message itself
already stated `want size < 32`, confirming the intended threshold.
Changed `size > hashLen` to `size >= hashLen` in `decodeRef` to align
the decoding validation with the encoding logic, the Yellow Paper spec,
and the surrounding comments.

* ethclient/gethclient: callTracer methods (#31510)

Added methods `TraceCallWithCallTracer` and `TraceTransactionWithCallTracer`.

Fixes #28182

---------

Co-authored-by: Sina Mahmoodi <itz.s1na@gmail.com>

* trie/bintrie: use correct key mapping in GetStorage and DeleteStorage (#33807)

GetStorage and DeleteStorage used GetBinaryTreeKey to compute the tree
key, while UpdateStorage used GetBinaryTreeKeyStorageSlot. The latter
applies storage slot remapping (header offset for slots <64, main
storage prefix for the rest), so reads and deletes were targeting
different tree locations than writes.

Replace GetBinaryTreeKey with GetBinaryTreeKeyStorageSlot in both
GetStorage and DeleteStorage to match UpdateStorage. Add a regression
test that verifies the write→read→delete→read round-trip for main
storage slots.

* rlp: return Iterator as non-pointer (#33818)

Most uses of the iterator are like this:

    it, _ := rlp.NewListIterator(data)
    for it.Next() {
        do(it.Value())
    }

This doesn't require the iterator to be a pointer and it's better to
have it stack-allocated. AFAIK the compiler cannot prove it is OK to
stack-allocate when it is returned as a pointer because the methods of
`Iterator` use pointer receiver and also mutate the object.

The iterator type was not exported until very recently, so I think it is
still OK to change this API.

* cmd/evm/internal/t8ntool, core/rawdb: fix RLP iterator error handling (#33820)

This fixes two cases where `Iterator.Err()` was misused. The method will
only return an error after `Next()` has returned false, so it makes no
sense to check for the error within the loop itself.

* triedb/pathdb: return nodeLoc by value to avoid heap allocation (#33819)

* eth/tracers: tests for bad block tracing (#33821)

Fixes #30833

* internal/era: update eraE type IDs to match spec (#33827)

Update to match the spec:
https://github.com/eth-clients/e2store-format-specs/pull/16

---------

Co-authored-by: lightclient <lightclient@protonmail.com>

* node: http2 for JSON-RPC API (#33812)

The reasoning for using the cleartext format here is that the JSON-RPC
API is internal only. Providers which expose it publicly already put it
behind a proxy which handles also the encryption.

* rlp: add AppendRaw method to RawList (#33834)

This is helpful when building a list from already-encoded elements.

* core/state: make test output message readable (ethereum#33400) (#82)

* core/state: make test output message readable (#33400)

* crypto/signify: fix fuzz test compilation (#33402)

The fuzz test file has been broken for a while - it doesn't compile with
the `gofuzz` build tag.

Two issues:
- Line 59: called `SignifySignFile` which doesn't exist (should be
`SignFile`)
- Line 71: used `:=` instead of `=` for already declared `err` variable

* core/overlay: fix incorrect debug log key/value in LoadTransitionState (#32637)

* core/state: fix code existence not marked correctly (#33415)

When iterating over a map with value types in Go, the loop variable is a
copy. In `markCodeExistence`, assigning to `code.exists` modified only
the local copy, not the actual map entry, causing the existence flag to
always remain false.

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

Fix by changing `codes` from `map[common.Address]contractCode` to
`map[common.Address]*contractCode`, so mutations apply directly to the
struct.

* cmd/workload, eth/tracers/native: introduce state proof tests (#32247)

This pull request introduces a new workload command, providing the
features
for `eth_getProof` endpoint test generation and execution.

* eth/catalyst: fix invalid timestamp log message (#33440)

Fixes a typo in the NewPayload invalid timestamp warning where the
parent timestamp was incorrectly logged as the block timestamp.

* core: add code read statistics (#33442)

* core/txpool/blobpool: remove legacy sidecar conversion (#33352)

This PR removes the legacy sidecar conversion logic.

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

Note that conversion at the RPC layer is still supported, and version 0
blob
transactions will be automatically converted to version 1 there.

* tests/fuzzers: remove unused field from kv struct in rangeproof fuzzer (#33447)

Removes the unused `t bool` field from the `kv` struct in the rangeproof fuzzer.

* eth/catalyst: return empty response for GetBlobsV2 before Osaka (#33444)

Fix #33420

* core, eth: add lock protection in snap sync (#33428)

Fixes #33396, #33397, #33398

* graphql: add nil check in block resolver (#33225)

Add nil checks for header and block in Block resolver methods to prevent
panic when querying non-existent blocks.

* core/txpool/blobpool: fix slotter size limit (#33474)

Blobs are stored per transaction in the pool, so we need billy to handle
up to the per-tx limit, not to the per-block limit.

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

Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>

* eth/downloader: fix stale beacon header deletion (#33481)

In this PR, two things have been fixed:

--- 

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

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

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

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

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

--- 

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

Once the skeleton chain links with local one, it will try to schedule the 
synchronization by fetching the missing blocks and import them then. 
It's possible the last subchain already overwrites the previous subchain and 
results in having two subchains leftover. As a result, an error log will printed
https://github.com/ethereum/go-ethereum/blob/master/eth/downloader/skeleton.go#L1074

* console/prompt: use PromptInput in PromptConfirm method (#33445)

* params: fix wrong comment (#33503)

It seems that the comment for CopyGas was wrongly associated to
SloadGas.

* trie, go.mod: remove all references to go-verkle and go-ipa (#33461)

In order to reduce the amount of code that is embedded into the keeper
binary, I am removing all the verkle code that uses go-verkle and
go-ipa. This will be followed by further PRs that are more like stubs to
replace code when the keeper build is detected.

I'm keeping the binary tree of course. This means that you will still
see `isVerkle` variables all over the codebase, but they will be renamed
when code is touched (i.e. this is not an invitation for 30+ AI slop
PRs).

---------

Co-authored-by: Gary Rong <garyrong0905@gmail.com>

* .github/workflows: preventively close PRs that seem AI-generated (#33414)

This is a new step in my crusade against the braindead fad of starting
PR titles with a word that is completely redundant with github labels,
thus wasting prime first-line real-estate for something that isn't
necessary.

I noticed that every single one of these PRs are low-quality AI-slop, so
I think there is a strong case to be made for these PRs to be
auto-closed. A message is added before closing the PR, redirecting to
our contribution guidelines, so I expect quality first-time contributors
to read them and reopen the PR. In the case of spam PRs, the author is
unlikely to revisit a given PR, and so auto-closing might have a
positive impact. That's an experiment worth trying, imo.

* triedb/pathdb: optimize history indexing efficiency (#33303)

This pull request optimizes history indexing by splitting a single large
database
 batch into multiple smaller chunks.

Originally, the indexer will resolve a batch of state histories and
commit all
corresponding index entries atomically together with the indexing
marker.

While indexing more state histories in a single batch improves
efficiency, excessively
large batches can cause significant memory issues.

To mitigate this, the pull request splits the mega-batch into several
smaller batches
and flushes them independently during indexing. However, this introduces
a potential
inconsistency that some index entries may be flushed while the indexing
marker is not,
and an unclean shutdown may leave the database in a partially updated
state.
This can corrupt index data.

To address this, head truncation is introduced. After a restart, any
excessive index
entries beyond the expected indexing marker are removed, ensuring the
index remains
consistent after an unclean shutdown.

* beacon/light/sync: clear reqFinalityEpoch on server unregistration (#33483)

HeadSync kept reqFinalityEpoch entries for servers after receiving
EvUnregistered, while other per-server maps were cleared. This left
stale request.Server keys reachable from HeadSync, which can lead to a
slow memory leak in setups that dynamically register and unregister
servers.

The fix adds deletion of the reqFinalityEpoch entry in the
EvUnregistered handler. This aligns HeadSync with the cleanup pattern
used by other sync modules and keeps the finality request bookkeeping
strictly limited to currently registered servers.

* cmd/geth: remove deprecated vulnerability check command (#33498)

This PR removes the version-check command and its associated logic as
discussed in issue #31222.

Removed versionCheckCommand from misccmd.go and main.go.

Deleted version_check.go and its corresponding tests.

Cleaned up testdata/vcheck directory (~800 lines of JSON/signatures
removed).

Verified build with make geth

* core/state/snapshot: fix storageList memory accounting (#33505)

* eth/catalyst: implement getBlobsV3 (#33404)

This is used by cell-level dissemination (aka partial messages) to give
the CL all blobs the EL knows about and let CL communicate efficiently
about any other missing blobs. In other words, partial responses from
the EL is useful now.

See the related (closed) PR:
https://github.com/ethereum/execution-apis/pull/674 and the new PR:
https://github.com/ethereum/execution-apis/pull/719

* core/blockchain.go: cleanup finalized block on rewind in setHeadBeyondRoot (#33486)

Fix #33390 

`setHeadBeyondRoot` was failing to invalidate finalized blocks because
it compared against the original head instead of the rewound root. This
fix updates the comparison to use the post-rewind block number,
preventing the node from reporting a finalized block that no longer
exists. Also added relevant test cases for it.

* eth/fetcher: improve the condition to stall peer in tx fetcher (#32725)

Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
Co-authored-by: Csaba Kiraly <csaba.kiraly@gmail.com>

* core/rawdb: add trienode freezer support to InspectFreezerTable (#33515)

Adds missing trienode freezer case to InspectFreezerTable, making it
consistent with InspectFreezer which already supports it.

Co-authored-by: m6xwzzz <maskk.weller@gmail.com>

* ethstats: report newPayload processing time to stats server (#33395)

Add NewPayloadEvent to track engine API newPayload block processing
times and report them to ethstats. This enables monitoring of block
processing performance.

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

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

---------

Co-authored-by: MariusVanDerWijden <m.vanderwijden@live.de>

* core: re-organize the stats category (#33525)

Check out https://hackmd.io/dg7rizTyTXuCf2LSa2LsyQ for more details

* eth: txs fetch/send log at trace level only (#33541)

This logging was too intensive at debug level, it is better to have it
at trace level only.

Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>

* core/vm: avoid escape to heap (#33537)

* core/state, core/tracing: new state update hook (#33490)

### Description
Add a new `OnStateUpdate` hook which gets invoked after state is
committed.

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

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

---------

Co-authored-by: Gary Rong <garyrong0905@gmail.com>

* core/state: add cache statistics of contract code reader (#33532)

* internal/flags: update copyright year to 2026 (#33550)

* graphql: fix GasPrice for blob and setcode transactions (#33542)

Adds BlobTxType and SetCodeTxType to GasPrice switch case, aligning with
`MaxFeePerGas` and `MaxPriorityFeePerGas` handling.

Co-authored-by: m6xwzzz <maskk.weller@gmail.com>

* triedb/pathdb: introduce extension to history index structure (#33399)

It's a PR based on #33303 and introduces an approach for trienode
history indexing.

---

In the current archive node design, resolving a historical trie node at
a specific block
involves the following steps:

- Look up the corresponding trie node index and locate the first entry
whose state ID
   is greater than the target state ID.
- Resolve the trie node from the associated trienode history object.

A naive approach would be to store mutation records for every trie node,
similar to
how flat state mutations are recorded. However, the total number of trie
nodes is
extremely large (approximately 2.4 billion), and the vast majority of
them are rarely
modified. Creating an index entry for each individual trie node would be
very wasteful
in both storage and indexing overhead. To address this, we aggregate
multiple trie
nodes into chunks and index mutations at the chunk level instead. 

---

For a storage trie, the trie is vertically partitioned into multiple sub
tries, each spanning
three consecutive levels. The top three levels (1 + 16 + 256 nodes) form
the first chunk,
and every subsequent three-level segment forms another chunk.

```
Original trie structure

Level 0               [ ROOT ]                               1 node
Level 1        [0] [1] [2] ... [f]                          16 nodes
Level 2     [00] [01] ... [0f] [10] ... [ff]               256 nodes
Level 3   [000] [001] ... [00f] [010] ... [fff]           4096 nodes
Level 4   [0000] ... [000f] [0010] ... [001f] ... [ffff] 65536 nodes

Vertical split into chunks (3 levels per chunk)

Level0             [ ROOT ]                     1 chunk
Level3        [000]   ...     [fff]          4096 chunks
Level6   [000000]    ...    [fffffff]    16777216 chunks  
```

Within each chunk, there are 273 nodes in total, regardless of the
chunk's depth in the trie.

```
Level 0           [ 0 ]                         1 node
Level 1        [ 1 ] … [ 16 ]                  16 nodes
Level 2     [ 17 ] … … [ 272 ]                256 nodes
```

Each chunk is uniquely identified by the path prefix of the root node of
its corresponding
sub-trie. Within a chunk, nodes are identified by a numeric index
ranging from 0 to 272.

For example, suppose that at block 100, the nodes with paths `[]`,
`[0]`, `[f]`, `[00]`, and `[ff]`
are modified. The mutation record for chunk 0 is then appended with the
following entry:

`[100 → [0, 1, 16, 17, 272]]`, `272` is the numeric ID of path `[ff]`.

Furthermore, due to the structural properties of the Merkle Patricia
Trie, if a child node
is modified, all of its ancestors along the same path must also be
updated. As a result,
in the above example, recording mutations for nodes `00` and `ff` alone
is sufficient,
as this implicitly indicates that their ancestor nodes `[]`, `[0]` and
`[f]` were also
modified at block 100.

--- 

Query processing is slightly more complicated. Since trie nodes are
indexed at the chunk
level, each individual trie node lookup requires an additional filtering
step to ensure that
a given mutation record actually corresponds to the target trie node.

As mentioned earlier, mutation records store only the numeric
identifiers of leaf nodes,
while ancestor nodes are omitted for storage efficiency. Consequently,
when querying
an ancestor node, additional checks are required to determine whether
the mutation
record implicitly represents a modification to that ancestor.

Moreover, since trie nodes are indexed at the chunk level, some trie
nodes may be
updated frequently, causing their mutation records to dominate the
index. Queries
targeting rarely modified trie nodes would then scan a large amount of
irrelevant
index data, significantly degrading performance.

To address this issue, a bitmap is introduced for each index block and
stored in the
chunk's metadata. Before loading a specific index block, the bitmap is
checked to
determine whether the block contains mutation records relevant to the
target trie node.
If the bitmap indicates that the block does not contain such records,
the block is skipped entirely.

* ethclient: omit nil address/topics from filter args (#33464)

Fixes #33369

This omits "topics" and "addresses" from the filter when they are unspecified.
It is required for interoperability with some server implementations that cannot
handle `null` for these fields.

* rlp, trie, triedb/pathdb: compress trienode history (#32913)

This pull request introduces a mechanism to compress trienode history by
storing only the node diffs between consecutive versions.

- For full nodes, only the modified children are recorded in the history;
- For short nodes, only the modified value is stored;

If the node type has changed, or if the node is newly created or
deleted, the entire node value is stored instead.

To mitigate the overhead of reassembling nodes from diffs during history
reads, checkpoints are introduced by periodically storing full node values.

The current checkpoint interval is set to every 16 mutations, though
this parameter may be made configurable in the future.

* core/txpool/blobpool: allow gaps in blobpool (#32717)

Allow the blobpool to accept blobs out of nonce order

Previously, we were dropping blobs that arrived out-of-order. However,
since fetch decisions are done on receiver side,
out-of-order delivery can happen, leading to inefficiencies.

This PR:
- adds an in-memory blob tx storage, similar to the queue in the
legacypool
- a limited number of received txs can be added to this per account
- txs waiting in the gapped queue are not processed further and not
propagated further until they are unblocked by adding the previos nonce
to the blobpool

The size of the in-memory storage is currently limited per account,
following a slow-start logic.
An overall size limit, and a TTL is also enforced for DoS protection.

---------

Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
Co-authored-by: MariusVanDerWijden <m.vanderwijden@live.de>

* ethclient: restore BlockReceipts support for `BlockNumberOrHash` objects (#33242)

- pass `rpc.BlockNumberOrHash` directly to `eth_getBlockReceipts` so
`requireCanonical` and other fields survive
- aligns `BlockReceipts` with other `ethclient` methods and re-enables
canonical-only receipt queries

* tests: check correct revert on invalid tests (#33543)

This PR fixes an issue where `evm statetest` would not verify the
post-state root hash if the test case expected an exception (e.g.
invalid transaction).

The fix involves:
1.  Modifying `tests/state_test_util.go` in the `Run` method.
2. When an expected error occurs (`err != nil`), we now check if
`post.Root` is defined.
3. If defined, we recalculate the intermediate root from the current
state (which is reverted to the pre-transaction snapshot upon error).
4. We use `GetChainConfig` and `IsEIP158` to ensure the correct state
clearing rules are applied when calculating the root, avoiding
regressions on forks that require EIP-158 state clearing.
5. If the calculated root mismatches the expected root, the test now
fails.

This ensures that state tests are strictly verified against their
expected post-state, even for failure scenarios.

Fixes issue #33527

---------

Co-authored-by: MariusVanDerWijden <m.vanderwijden@live.de>

* core: remove duplicate chainHeadFeed.Send code (#33563)

The code was simply duplicate, so we can remove some code lines here.

Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>

* core/rawdb: skip missing block bodies during tx unindexing (#33573)

This PR fixes an issue where the tx indexer would repeatedly try to
“unindex” a block with a missing body, causing a spike in CPU usage.
This change skips these blocks and advances the index tail. The fix was
verified both manually on a local development chain and with a new test.

resolves #33371

* internal/ethapi: refactor RPC tx formatter (#33582)

* tests: repair oss-fuzz coverage command (#33304)

The coverage build path was generating go test commands with a bogus
-tags flag that held the coverpkg value, so the run kept failing. I
switched coverbuild to treat the optional argument as an override for
-coverpkg and stopped passing coverpkg from the caller. Now the script
emits a clean go test invocation that should actually succeed.

* rpc: fix limitedBuffer.Write to properly enforce size limit (#33545)

Updated the `avail` calculation to correctly compute remaining capacity:
`buf.limit - len(buf.output)`, ensuring the buffer never exceeds its
configured limit regardless of how many times `Write()` is called.

* version: begin v1.17.0 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>

* accounts/keystore: fix panic in decryptPreSaleKey (#33602)

Validate ciphertext length in decryptPreSaleKey, preventing runtime
panics on invalid input.

* rpc, internal/telemetry: add OpenTelemetry tracing for JSON-RPC calls (#33452)

Add Open Telemetry tracing inside the RPC server to help attribute runtime costs within `handler.handleCall()`. In particular, it allows us to distinguish time spent decoding arguments, invoking methods via reflection, and actually executing the method and constructing/encoding JSON responses.

---------

Co-authored-by: lightclient <lightclient@protonmail.com>

* rpc: extract OpenTelemetry trace context from request headers (#33599)

This PR adds support for the extraction of OpenTelemetry trace context
from…
@kdeme
Copy link
Copy Markdown
Contributor

kdeme commented Feb 24, 2026

We have erae implementation in Nimbus (WIP): status-im/nimbus-eth1#3979

This version can generate the erae files with proofs for pre-merge eras now in case you want to test this against go-ethereum implementation @lightclient

@s1na
Copy link
Copy Markdown

s1na commented Feb 25, 2026

Btw geth exports for sepolia are up: https://ethpandaops.io/data/history/?history-erae-network=sepolia&history-format=erae

kvhnuke pushed a commit to kvhnuke/go-ethereum-tokens that referenced this pull request Mar 1, 2026
Update to match the spec:
eth-clients/e2store-format-specs#16

---------

Co-authored-by: lightclient <lightclient@protonmail.com>
@kdeme
Copy link
Copy Markdown
Contributor

kdeme commented Mar 7, 2026

I have two more remarks:

  1. What are the shortened hashes (assuming that's what they are) from in the erae names that are available on https://ethpandaops.io/data/history/?history-erae-network=sepolia&history-format=erae ? With era they are from the beacon state historical_roots and historical_summaries. And with era1 they are from the HistoricalHashesAccumulator. But here we do not have some overlapping accumulator to take a root/hash from.

  2. A bit more nitpicky but regarding the erae extension naming: There is also an era format PR open for blobs, and that one sticks with the 3 letter extension name erb. I think it would be nice to be at least consistent with naming there, so perhaps we could call it ere files.

@s1na
Copy link
Copy Markdown

s1na commented Mar 9, 2026

What are the shortened hashes (assuming that's what they are) from in the erae names that are available on

I can take the first one: they are the shortened block hash of the latest block of the era.

@Matilda-Clerke
Copy link
Copy Markdown
Contributor

LGTM

@lightclient
Copy link
Copy Markdown
Author

@kdeme SGTM on changing name to ere, done in 8b0e864.

@lightclient
Copy link
Copy Markdown
Author

I think all outstanding feedback has been addressed? PTAL again when you have a chance.

Comment thread formats/ere.md
TotalDifficulty = { type: [0x06, 0x00], data: uint256(header.total_difficulty) }
Proof = { type: [0x0b, 0x00], data: snappyFramed(rlp([proof-type, ssz(BlockProofHistoricalHashesAccumulator) | ssz(BlockProofHistoricalRoots) | ssz(BlockProofHistoricalSummariesCapella) | ssz(BlockProofHistoricalSummariesDeneb)]))}
AccumulatorRoot = { type: [0x07, 0x00], data: hash_tree_root(List(HeaderRecord, 8192)) }
Index = { type: [0x66, 0x32], data: index }
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Index = { type: [0x66, 0x32], data: index }
Index = { type: [0x67, 0x32], data: index }

is it not 0x67 now ? It can require a new BlockIndex type too

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants