all: Store DA footprint in blob gas used header field#694
Merged
sebastianst merged 1 commit intooptimismfrom Oct 17, 2025
Merged
all: Store DA footprint in blob gas used header field#694sebastianst merged 1 commit intooptimismfrom
sebastianst merged 1 commit intooptimismfrom
Conversation
aeae4cd to
a27091a
Compare
058290f to
2c8d336
Compare
2c8d336 to
7258cb8
Compare
5479845 to
9cc4cbc
Compare
7258cb8 to
d639492
Compare
This was referenced Oct 14, 2025
geoknee
reviewed
Oct 15, 2025
d639492 to
49a31dc
Compare
joshklop
reviewed
Oct 16, 2025
49a31dc to
373f773
Compare
geoknee
approved these changes
Oct 17, 2025
373f773 to
e86c0c4
Compare
e86c0c4 to
26cf90a
Compare
ClaytonNorthey92
added a commit
to hemilabs/op-geth
that referenced
this pull request
Dec 1, 2025
* cmd/workload: rework tracegen to run tracing at block level (#32092)
This PR changes the trace test to block level, aiming for better
execution performance.
---------
Co-authored-by: zsfelfoldi <zsfelfoldi@gmail.com>
* core/state: add GetStateAndCommittedState (#31585)
Improves the SSTORE gas calculation a bit. Previously we would pull up
the state object twice. This is okay for existing objects, since they
are cached, however non-existing objects are not cached, thus we needed
to go through all 128 diff layers as well as the disk layer twice, just
for the gas calculation
```
goos: linux
goarch: amd64
pkg: github.com/ethereum/go-ethereum/core/vm
cpu: AMD Ryzen 9 5900X 12-Core Processor
│ /tmp/old.txt │ /tmp/new.txt │
│ sec/op │ sec/op vs base │
Interpreter-24 1118.0n ± 2% 602.8n ± 1% -46.09% (p=0.000 n=10)
```
---------
Co-authored-by: Gary Rong <garyrong0905@gmail.com>
* cmd/utils, internal/debug: hide the deprecated flags (#32128)
Some of the flags were deprecated, so try to hide them in the help
message. And move the `--vmodule` and `--logjson` flags to the
DeprecatedCategory.
* .gitea: add windows build (experimental)
* cmd/utils: show full deprecated flags (#32141)
This is a follow up PR after #32128 , Seems I've missed to add
--txlookuplimit as hidden. In hte meanwhile, I also add the other
deprecated flags into the output of `show-deprecated-flags`
* cmd/utils: update flag description of gcmode (#32145)
* .gitea: add workflow_dispatch for release build
* .gitea: update PATH
* .gitea: set PATH
* gitea: try with cmd
* gitea: set PATH in script
* .gitea: fix typo in windows workflow
* core/vm: move nil-check out of the interpreter loop (#32068)
Moves the jumptable nil check our of the interpreter loop.
Benchmarks show a 2-10% improvement.
* core/vm: implement EIP-7939 - CLZ opcode (#31989)
https://eips.ethereum.org/EIPS/eip-7939
---------
Co-authored-by: spencer-tb <spencer@spencertaylorbrown.uk>
Co-authored-by: Felix Lange <fjl@twurst.com>
* core/txpool/blobpool: lower log level for warnings (#32142)
- Change the log level to `warning`, during syncing blocks, the `final
== nil` is normal.
- Change to log tx hash.
* .github, internal/flags: improve actions test runs (#32150)
This change enables more tests to run on GitHub actions. First, it
removes the `-short` flag passed to `go test`, unskipping some longer
running tests. We also enable the full consensus tests to run by
enabling submodules during git clone.
The EF now operates org wide runners with the `self-hosted-ghr` label.
These are auto-scaling runners which should ideally allow us to process
any amount of testing load we throw at them. The new runners have `HOME`
configured differently from the actual user home directory, so our
internal test for resolving `~` had to be adapted to work in this scenario.
* consensus/misc/eip4844: implement EIP-7918 (#31965)
https://eips.ethereum.org/EIPS/eip-7918
---------
Co-authored-by: Felix Lange <fjl@twurst.com>
* core/vm: implement EIP-7951 - precompile for secp256r1 (#31991)
https://github.com/ethereum/EIPs/pull/9833
Based on #27540, #30043
---------
Co-authored-by: Ulaş Erdoğan <uerdogan2001@hotmail.com>
* cmd, eth/catalyst: exit geth only if exitWhenSynced is specified (#32149)
This pull request modifies the behavior of `--synctarget` to terminate
the node only when `--exitWhenSynced` is explicitly specified.
* eth/catalyst: abort dev mode block commit if shut down is triggered (#32166)
alternate approach to https://github.com/ethereum/go-ethereum/pull/31328
suggested by @MariusVanDerWijden . This prevents Geth from outputting a
lot of logs when trying to commit on-demand dev mode blocks while the
client is shutting down.
The issue is hard to reproduce, but I've seen it myself and it is
annoying when it happens. I think this is a reasonable simple solution,
and we can revisit if we find that the output is still too large (i.e.
there is a large delay between initiating shut down and the simulated
beacon receiving the signal, while in this loop).
Co-authored-by: Marius van der Wijden <m.vanderwijden@live.de>
* miner, core, core/txpool: implement EIP 7825 - TX Gas Limit Cap (#31824)
Implements EIP-7825
---------
Co-authored-by: Gary Rong <garyrong0905@gmail.com>
Co-authored-by: lightclient <lightclient@protonmail.com>
Co-authored-by: MariusVanDerWijden <m.vanderwijden@live.de>
* core/vm: update gas cost of CLZ to five (#32172)
https://github.com/ethereum/EIPs/commit/a794de3fcf71bb8c71e8bafdba11f63133ce4516
* core,miner: implement EIP-7934 - RLP Execution Block Size Limit (#31990)
This PR adds a block validation check for the maximum block size, as required by
EIP-7934, and also applies a slightly lower size limit during block building.
---------
Co-authored-by: spencer-tb <spencer@spencertaylorbrown.uk>
Co-authored-by: Felix Lange <fjl@twurst.com>
Co-authored-by: Gary Rong <garyrong0905@gmail.com>
* Remove checkInterop from Block Building Path (#585)
* cmd/utils: add the missing check for the HoodiFlag in blsync (#32179)
Hoodi network flag should be exclusive to other network flags for both blysnc standalone and integrated mode.
* feat: bump scr commit (#640)
* cmd/clef: update Safe API documentation links in changelog (#32136)
This PR updates the outdated documentation URL from docs.gnosis.io to
the new official docs.safe.global domain. The change reflects the
rebranding from Gnosis Safe to Safe and ensures that users are directed
to the current API documentation for transaction service reference.
* txpool: Move Ingress Filter Checks to addTxsLocked (#642)
* txpool: introduce MaxTxGasLimit feature to enforce per-transaction gas limits (#626)
Adds a new flag `--txpool.maxtxgas` which represents the maximum gas limit for individual transactions (0 = no limit) when added to the mempool. Transactions exceeding this limit will be rejected by the transaction pool.
Co-authored-by: Mark Tyneway <mark.tyneway@gmail.com>
* core/types: add block-level access list structures with encoding/decoding (#31948)
This adds the SSZ types from the
[EIP-7928](https://eips.ethereum.org/EIPS/eip-7928) and also adds
encoder/decoder generation using https://github.com/ferranbt/fastssz.
The fastssz dependency is updated because the generation will not work
properly with the master branch version due to a bug in fastssz.
---------
Co-authored-by: Gary Rong <garyrong0905@gmail.com>
* eth/downloader: fix ancient limit in snap sync (#32188)
This pull request fixes an issue in disabling direct-ancient mode in
snap sync.
Specifically, if `origin >= frozen && origin != 0`, it implies a part of
chain data has been written into the key-value store, all the following
writes into ancient store scheduled by downloader will be rejected
with error
`ERROR[07-10|03:46:57.924] Error importing chain data to ancients
err="can't add block 1166 hash: the append operation is out-order: have
1166 want 0"`.
This issue is detected by the https://github.com/ethpandaops/kurtosis-sync-test,
which initiates the first snap sync cycle without the finalized header and
implicitly disables the direct-ancient mode. A few seconds later the second
snap sync cycle is initiated with the finalized information and direct-ancient mode
is enabled incorrectly.
* .github: remove karalabe from CODEOWNERS
* cmd/geth: update vcheck testdata, add docs on generating signatures (#32121)
Fixed typo in security release URL by replacing:
Old: https://blog.ethereum.org/2020/11/12/geth_security_release/
New: https://blog.ethereum.org/2020/11/12/geth-security-release/
---------
Co-authored-by: lightclient <lightclient@protonmail.com>
* signer/core/apitypes: require blob txs to have tx.to set (#32197)
Check the `to` address before building the blob tx.
---------
Co-authored-by: jwasinger <j-wasinger@hotmail.com>
* accounts/keystore: update links to documenation (#32194)
---
**Description:**
- Replaced outdated GitHub wiki links with the official Ethereum
documentation for Web3 Secret Storage.
- Updated references in `keystore.go` and `passphrase.go` for improved
accuracy and reliability.
---
* ethclient/gethclient: remove race condition in tests (#32206)
alternative to https://github.com/ethereum/go-ethereum/pull/32200
The race condition is not happening yet, since there is only a single
call to `newTestBackend`, but there might be more in the future
* tracing: Show OptimismBaseFeeRecipient in prestate (#407)
The OptimismBaseFeeRecipient should show up in prestate tracing results
(both the normal prestate and the diff mode prestate results) if IsOptimism.
I added one prestate diff test with Optimism turned on to show that it
works correctly. This required adding the L1CostFunc to the test block context.
* params: EIP-7892 - Blob Parameter Only Hardforks (#32193)
This is a resubmit of https://github.com/ethereum/go-ethereum/pull/31820
against the `master` branch.
---------
Co-authored-by: Marius van der Wijden <m.vanderwijden@live.de>
Co-authored-by: Gary Rong <garyrong0905@gmail.com>
* eth/fetcher: fix announcement drop logic (#32210)
This PR fixes an issue in the tx_fetcher DoS prevention logic where the
code keeps the overflow amount (`want - maxTxAnnounces`) instead of the
allowed amount (`maxTxAnnounces - used`). The specific changes are:
- Correct slice indexing in the announcement drop logic
- Extend the overflow test case to cover the inversion scenario
* miner: set sidecar version when recomputing proofs (#32199)
- If the block number is `osaka` fork and needs to recompute some `blob
proofs` to `cell proofs`, here also needs to set version to `1`.
* miner, txpool: detect supervisor failsafe and reject interop transactions if enabled (#636)
* miner, txpool: detect supervisor failsafe and reject interop transactions if enabled
Add routine to periodically check for failsafe mode by calling supervisor RPC and checking error for sentinel value
Backend caches result, miner inspects the cache. Txpool checks over RPC on ingress.
Adds comprehensive tests.
* move SupervisorInFailSafe method to BackendWithInterop interface
* rename
* use interoptypes.TxToInteropAccessList in commitTransaction
* use admin_getFailsafeEnabled instead of stubbed CheckAccessList
* fixes
* fixes
* all: fix outdated ethereum wiki json-rpc json-rpc doc links (#32209)
Replace outdated wiki reference with ethereum.org
documentation links
* core/types: fix CellProofsAt method (#32198)
* triedb/pathdb: introduce file-based state journal (#32060)
Introduce file-based state journal in path database, fixing
the Pebble restriction when the journal size exceeds 4GB.
---------
Signed-off-by: jsvisa <delweng@gmail.com>
Co-authored-by: Gary Rong <garyrong0905@gmail.com>
* core/rawdb: change the mechanism to schedule freezer sync (#32135)
This pull request slightly improves the freezer fsync mechanism by scheduling
the Sync operation based on the number of uncommitted items and original
time interval.
Originally, freezer.Sync was triggered every 30 seconds, which worked well during
active chain synchronization. However, once the initial state sync is complete,
the fixed interval causes Sync to be scheduled too frequently.
To address this, the scheduling logic has been improved to consider both the time
interval and the number of uncommitted items. This additional condition helps
avoid unnecessary Sync operations when the chain is idle.
* eth/protocols/snap, p2p/discover: improve zero time checks (#32214)
* all: update dead wiki links (#32215)
---
**Description:**
- Replaced outdated GitHub wiki links with current, official
documentation URLs.
- Removed links that redirect or are no longer relevant.
- Ensured all references point to up-to-date and reliable sources.
---
* core/rawdb: reduce allocations in rawdb.ReadHeaderNumber (#31913)
This is something interesting I came across during my benchmarks, we
spent ~3.8% of all allocations allocating the header number on the heap.
```
(pprof) list GetHeaderByHash
Total: 38197204475
ROUTINE ======================== github.com/ethereum/go-ethereum/core.(*BlockChain).GetHeaderByHash in github.com/ethereum/go-ethereum/core/blockchain_reader.go
0 5786566117 (flat, cum) 15.15% of Total
. . 79:func (bc *BlockChain) GetHeaderByHash(hash common.Hash) *types.Header {
. 5786566117 80: return bc.hc.GetHeaderByHash(hash)
. . 81:}
. . 82:
. . 83:// GetHeaderByNumber retrieves a block header from the database by number,
. . 84:// caching it (associated with its hash) if found.
. . 85:func (bc *BlockChain) GetHeaderByNumber(number uint64) *types.Header {
ROUTINE ======================== github.com/ethereum/go-ethereum/core.(*HeaderChain).GetHeaderByHash in github.com/ethereum/go-ethereum/core/headerchain.go
0 5786566117 (flat, cum) 15.15% of Total
. . 404:func (hc *HeaderChain) GetHeaderByHash(hash common.Hash) *types.Header {
. 1471264309 405: number := hc.GetBlockNumber(hash)
. . 406: if number == nil {
. . 407: return nil
. . 408: }
. 4315301808 409: return hc.GetHeader(hash, *number)
. . 410:}
. . 411:
. . 412:// HasHeader checks if a block header is present in the database or not.
. . 413:// In theory, if header is present in the database, all relative components
. . 414:// like td and hash->number should be present too.
(pprof) list GetBlockNumber
Total: 38197204475
ROUTINE ======================== github.com/ethereum/go-ethereum/core.(*HeaderChain).GetBlockNumber in github.com/ethereum/go-ethereum/core/headerchain.go
94438817 1471264309 (flat, cum) 3.85% of Total
. . 100:func (hc *HeaderChain) GetBlockNumber(hash common.Hash) *uint64 {
94438817 94438817 101: if cached, ok := hc.numberCache.Get(hash); ok {
. . 102: return &cached
. . 103: }
. 1376270828 104: number := rawdb.ReadHeaderNumber(hc.chainDb, hash)
. . 105: if number != nil {
. 554664 106: hc.numberCache.Add(hash, *number)
. . 107: }
. . 108: return number
. . 109:}
. . 110:
. . 111:type headerWriteResult struct {
(pprof) list ReadHeaderNumber
Total: 38197204475
ROUTINE ======================== github.com/ethereum/go-ethereum/core/rawdb.ReadHeaderNumber in github.com/ethereum/go-ethereum/core/rawdb/accessors_chain.go
204606513 1376270828 (flat, cum) 3.60% of Total
. . 146:func ReadHeaderNumber(db ethdb.KeyValueReader, hash common.Hash) *uint64 {
109577863 1281242178 147: data, _ := db.Get(headerNumberKey(hash))
. . 148: if len(data) != 8 {
. . 149: return nil
. . 150: }
95028650 95028650 151: number := binary.BigEndian.Uint64(data)
. . 152: return &number
. . 153:}
. . 154:
. . 155:// WriteHeaderNumber stores the hash->number mapping.
. . 156:func WriteHeaderNumber(db ethdb.KeyValueWriter, hash common.Hash, number uint64) {
```
Opening this to discuss the idea, I know that rawdb.EmptyNumber is not a
great name for the variable, open to suggestions
* trie: avoid spawning goroutines for empty children (#32220)
* eth/downloader: improve nil pointer protection (#32222)
Fix #32221
---------
Co-authored-by: rjl493456442 <garyrong0905@gmail.com>
* account/abi/bind/v2: fix TestDeploymentWithOverrides (#32212)
The root cause of the flaky test was a nonce conflict caused by async
contract deployments.
This solution defines a custom deployer with automatic nonce management.
* eth/tracers: apply block header overrides correctly (#32183)
Fixes #32175.
This fixes the scenario where the blockhash opcode would return 0x0
during RPC simulations when using BlockOverrides with a future block
number. The root cause was that BlockOverrides.Apply() only modified the
vm.BlockContext, but GetHashFn() depends on the actual
types.Header.Number to resolve valid historical block hashes. This
caused a mismatch and resulted in incorrect behavior during trace and
call simulations.
---------
Co-authored-by: shantichanal <158101918+shantichanal@users.noreply.github.com>
Co-authored-by: lightclient <lightclient@protonmail.com>
* triedb/pathdb: avoid duplicate metadata reads (#32226)
* eth/protocols/snap: fix negative eta in state progress logging (#32225)
* triedb/pathdb: improve the performance of parse index block (#32219)
The implementation of `parseIndexBlock` used a reverse loop with slice
appends to build the restart points, which was less cache-friendly and
involved unnecessary allocations and operations. In this PR we change
the implementation to read and validate the restart points in one single
forward loop.
Here is the benchmark test:
```bash
go test -benchmem -bench=BenchmarkParseIndexBlock ./triedb/pathdb/
```
The result as below:
```
benchmark old ns/op new ns/op delta
BenchmarkParseIndexBlock-8 52.9 37.5 -29.05%
```
about 29% improvements
---------
Signed-off-by: jsvisa <delweng@gmail.com>
* all: define constructor for BlobSidecar (#32213)
The main purpose of this change is to enforce the version setting when
constructing the blobSidecar, avoiding creating sidecar with wrong/default
version tag.
* params: update tx gas limit cap (#32230)
Updates the tx gas limit cap to the new parameter (2^24)
https://github.com/ethereum/EIPs/pull/9986/files
* core/txpool/blobpool: remove unused `txValidationFn` from BlobPool (#32237)
This PR removes the now‑unused `txValidationFn` field from BlobPool.
It became obsolete after a PR https://github.com/ethereum/go-ethereum/pull/31202
was merged.
Resolves https://github.com/ethereum/go-ethereum/issues/32236
* triedb/pathdb: fix incorrect address length in history searching (#32248)
We should use account length to check address, else OOB maybe occured
Signed-off-by: jsvisa <delweng@gmail.com>
* core/vm: triple modexp cost post-cancun (#32231)
https://github.com/ethereum/EIPs/pull/9969/files
* core, params: add limit for max blobs in blob transaction (#32246)
[EIP-7594](https://eips.ethereum.org/EIPS/eip-7594) defines a limit of
max 6 blobs per transaction. We need to enforce this limit during block
processing.
> Additionally, a limit of 6 blobs per transaction is introduced.
Clients MUST enforce this limit when validating blob transactions at
submission time, when received from the network, and during block
production and processing.
* superchain: skip celo mainnet genesis processing (#646)
* superchain: skip celo mainnet genesis processing
* superchain: add GetChain tests
* superchain: add clarifying comments for celo exclusion
* build: update tests to fusaka-devnet-3 (#32251)
* core/types: minimize this invalid intermediate state (#32241)
* core/rawdb: downgrade log level in chain freezer (#32253)
* triedb/pathdb: use binary.append to eliminate the tmp scratch slice (#32250)
`binary.AppendUvarint` offers better performance than using append
directly, because it avoids unnecessary memory allocation and copying.
In our case, it can increase the performance by +35.8% for the
`blockWriter.append` function:
```
benchmark old ns/op new ns/op delta
BenchmarkBlockWriterAppend-8 5.97 3.83 -35.80%
```
---------
Signed-off-by: jsvisa <delweng@gmail.com>
Co-authored-by: Gary Rong <garyrong0905@gmail.com>
* p2p/rlpx: optimize XOR operation using bitutil.XORBytes (#32217)
Replace manual byte-by-byte XOR implementation with the optimized
bitutil.XORBytes function. This improves performance by using word-sized
operations on supported architectures while maintaining the same
functionality. The optimized version processes data in bulk rather than
one byte at a time
---------
Co-authored-by: Felix Lange <fjl@twurst.com>
* eth/gasestimator: fix potential overflow (#32255)
Improve binary search, preventing the potential overflow in certain L2 cases
* triedb/pathdb: fix an deadlock in history indexer (#32260)
Seems the `signal.result` was not sent back in shorten case, this will
cause a deadlock.
---------
Signed-off-by: jsvisa <delweng@gmail.com>
Co-authored-by: Gary Rong <garyrong0905@gmail.com>
* eth/protocols/snap: add healing and syncing metrics (#32258)
Adds the heal time and snap sync time to grafana
---------
Co-authored-by: Gary Rong <garyrong0905@gmail.com>
* core: replace the empty fmt.Errorf with errors.New (#32274)
The `errors.new` function does not require string formatting, so its
performance is better than that of `fmt.Errorf`.
* eth/catalyst: fix error message in ExecuteStatelessPayloadV4 (#32269)
Correct the error message in the ExecuteStatelessPayloadV4 function to
reference newPayloadV4 and the Prague fork, instead of incorrectly
referencing newPayloadV3 and Cancun.
This improves clarity during debugging and aligns the error message with
the actual function and fork being validated. No logic is changed.
---------
Co-authored-by: rjl493456442 <garyrong0905@gmail.com>
* cmd, eth, internal: introduce debug_sync (#32177)
Alternative implementation of https://github.com/ethereum/go-ethereum/pull/32159
* all: replace fmt.Errorf with errors.New (#32286)
The errors.new function does not require string formatting, so its
performance is better than that of fmt.Errorf.
* downloader: fix typos, grammar and formatting (#32288)
* ethclient/simulated: Fix flaky rollback test (#32280)
This PR addresses a flakiness in the rollback test discussed in
https://github.com/ethereum/go-ethereum/issues/32252
I found `nonce` collision caused transactions occasionally fail to send.
I tried to change error message in the failed test like:
```
if err = client.SendTransaction(ctx, signedTx); err != nil {
t.Fatalf("failed to send transaction: %v, nonce: %d", err, signedTx.Nonce())
}
```
and I occasionally got test failure with this message:
```
=== CONT TestFlakyFunction/Run_#100
rollback_test.go:44: failed to send transaction: already known, nonce: 0
--- FAIL: TestFlakyFunction/Run_#100 (0.07s)
```
Although `nonces` are obtained via `PendingNonceAt`, we observed that,
in rare cases (approximately 1 in 1000), two transactions from the same
sender end up with the same nonce. This likely happens because `tx0` has
not yet propagated to the transaction pool before `tx1` requests its
nonce. When the test succeeds, `tx0` and `tx1` have nonces `0` and `1`,
respectively. However, in rare failures, both transactions end up with
nonce `0`.
We modified the test to explicitly assign nonces to each transaction. By
controlling the nonce values manually, we eliminated the race condition
and ensured consistent behavior. After several thousand runs, the
flakiness was no longer reproducible in my local environment.
Reduced internal polling interval in `pendingStateHasTx()` to speed up
test execution without impacting stability. It reduces test time for
`TestTransactionRollbackBehavior` from about 7 seconds to 2 seconds.
* core/state: preallocate capacity for logs list (#32291)
Improvement: preallocate capacity for `logs` at first to avoid
reallocating multi times.
* core/state: improve PrettyPrint function (#32293)
* core/types: expose sigHash as Hash for SetCodeAuthorization (#32298)
* common/hexutil: replace customized bit sizer with bit.Uintsize (#32304)
* accounts/abi: precompile regex (#32301)
* cmd/devp2p/internal/v4test: add test for ENRRequest (#32303)
This adds a cross-client protocol test for a recently discovered bug in Nethermind.
* trie: reduce the memory allocation in trie hashing (#31902)
This pull request optimizes trie hashing by reducing memory allocation
overhead. Specifically:
- define a fullNodeEncoder pool to reuse encoders and avoid memory
allocations.
- simplify the encoding logic for shortNode and fullNode by getting rid
of the Go interfaces.
* core/vm: add configurable jumpdest analysis cache (#32143)
This adds a method on vm.EVM to set the jumpdest cache implementation.
It can be used to maintain an analysis cache across VM invocations, to improve
performance by skipping the analysis for already known contracts.
---------
Co-authored-by: lmittmann <lmittmann@users.noreply.github.com>
Co-authored-by: Felix Lange <fjl@twurst.com>
* eth: fix typos and outdated comments (#32324)
* eth/filters: fix error when blockHash is used with fromBlock/toBlock (#31877)
This introduces an error when the filter has both `blockHash` and
`fromBlock`/`toBlock`, since these are mutually exclusive. Seems the
tests were actually returning `not found` error, which went undetected
since there was no check on the actual returned error in the test.
* rlp/rlpgen: implement package renaming support (#31148)
This adds support for importing types from multiple identically-named
packages.
---------
Co-authored-by: Felix Lange <fjl@twurst.com>
* beacon/params, core/filtermaps: update checkpoints (#32336)
This PR updates checkpoints for blsync and filtermaps.
* version: release v1.16.2 (#32343)
* version: begin v1.16.3 release cycle (#32345)
* core/state: introduce the TransitionState object (verkle transition part 1) (#31634)
This is the first part of #31532
It maintains a series of conversion maker which are to be updated by the
conversion code (in a follow-up PR, this is a breakdown of a larger PR
to make things easier to review). They can be used in this way:
- During the conversion, by storing the conversion markers when the
block has been processed. This is meant to be written in a function that
isn't currently present, hence [this
TODO](https://github.com/ethereum/go-ethereum/pull/31634/files#diff-89272f61e115723833d498a0acbe59fa2286e3dc7276a676a7f7816f21e248b7R384).
Part of https://github.com/ethereum/go-ethereum/issues/31583
---------
Signed-off-by: Guillaume Ballet <3272758+gballet@users.noreply.github.com>
Co-authored-by: Gary Rong <garyrong0905@gmail.com>
* eth/catalyst: avoid load the same blob tx multi times (#32190)
- If all the `vhashes` are in the same `sidecar`, then it will load the
same blob tx many times. This PR aims to upgrade this.
---------
Co-authored-by: Gary Rong <garyrong0905@gmail.com>
* eth/gasestimator: check ErrGasLimitTooHigh conditions (#32348)
This PR makes 2 changes to how
[EIP-7825](https://github.com/ethereum/go-ethereum/pull/31824) behaves.
When `eth_estimateGas` or `eth_createAccessList` is called without any
gas limit in the payload, geth will choose the block's gas limit or the
`RPCGasCap`, which can be larger than the `maxTxGas`.
When this happens for `estimateGas`, the gas estimation just errors out
and ends, when it should continue doing binary search to find the lowest
possible gas limit.
This PR will:
- Add a check to see if `hi` is larger than `maxTxGas` and cap it to
`maxTxGas` if it's larger. And add a special case handling for gas
estimation execute when it errs with `ErrGasLimitTooHigh`
---------
Co-authored-by: Gary Rong <garyrong0905@gmail.com>
* core/filtermaps: remove unnecessary nil check and add cv2 lock (#32309)
Co-authored-by: zsfelfoldi <zsfelfoldi@gmail.com>
* go.mod: upgraded github.com/golang-jwt/jwt/v4 v4.5.1 => v4.5.2 (#32356)
https://pkg.go.dev/vuln/GO-2025-3553
* rpc: use reflect.TypeFor (#32316)
* crypto/kzg4844: use reflect.TypeFor (#32319)
* common, common/hexutil: use reflect.TypeFor (#32321)
* beacon/merkle: use reflect.TypeFor (#32322)
* core: use reflect.TypeFor (#32320)
https://github.com/golang/go/issues/60088
* p2p/enode: use atomic.Pointer in LocalNode (#32360)
* signer/core/apitypes: simplify reflect []byte creation (#32315)
Co-authored-by: Felix Lange <fjl@twurst.com>
* rlp: use reflect.TypeFor (#32317)
Co-authored-by: Felix Lange <fjl@twurst.com>
* eth/downloader: fix incomplete code comment (#32354)
* metrics: use atomic.Pointer in runtimeHistogram (#32361)
Co-authored-by: Felix Lange <fjl@twurst.com>
* core/vm: fold EVMInterpreter into EVM (#32352)
The separation serves no purpose atm, and the circular dependency that
EVM and EVMInterpreter had was begging for them to be merged.
* ethclient: fix flaky pending tx test (#32380)
Fixes: https://github.com/ethereum/go-ethereum/issues/32252
* ethdb/leveldb: check iterator error in Database.DeleteRange (#32384)
Add missing it.Error() check after iteration in Database.DeleteRange to
avoid silently ignoring iterator errors before writing the batch.
Aligns behavior with batch.DeleteRange, which already validates iterator
errors. No other functional changes; existing tests pass (TestLevelDB).
* core/vm: make types consistent in makeDup (#32378)
* miner: remove todo comment (#32389)
see
https://github.com/ethereum/go-ethereum/pull/32372#discussion_r2265885182
* downloader: fix comment (#32382)
The previous comment stated that every 3rd block has a tx and every 5th
has an uncle.
The implementation actually adds one transaction to every second block
and does not add uncles.
Updated the comment to reflect the real behavior to avoid confusion when
reading tests.
* accounts/abi, accounts/keystore: use reflect.TypeFor (#32323)
Co-authored-by: Felix Lange <fjl@twurst.com>
* eth/downloader: skip nil peer in GetHeader (#32369)
The GetHeader function was incorrectly returning an error when
encountering nil peers in the peers list, which contradicted the comment
"keep retrying if none are yet available".
Changed the logic to skip nil peers with 'continue' instead of returning
an error, allowing the function to properly iterate through all
available peers and attempt to retrieve the target header from each valid peer.
This ensures the function behaves as intended - trying all available
peers before giving up, rather than failing on the first nil peer encountered.
* trie, core: rework tracer and track origin value of dirty nodes (#32306)
These changes made in the PR should be highlighted here
The trie tracer is split into two distinct structs: opTracer and prevalueTracer.
The former is specific to MPT, while the latter is generic and applicable to all
trie implementations.
The original values of dirty nodes are tracked in a NodeSet. This serves
as the foundation for both full archive node implementations and the state live
tracer.
* consensus: fix ambiguous invalid gas limit error (#32405)
## Description
Correct symmetric tolerance in gas limit validation:
Replace ambiguous "+-=" with standard "+/-" in the error message.
Logic rejects when |header − parent| ≥ limit, so allowed range is |Δ| ≤
limit − 1.
No logic or functionality has been modified.
* metrics: Block Basefee (#658)
* basefee metric
* Handle nil basefee for before london hf
* Update forkdiff
* trie: refactor to use slices.Concat (#32401)
* cmd: fix inconsistent function name in comment (#32411)
fix inconsistent function name in comment
Signed-off-by: youzichuan <youzichuan6@outlook.com>
* eth: abort `requiredBlocks` check if peer handler terminated (#32413)
* node: remove unused err var (#32398)
* rlp: optimize intsize (#32421)
goos: darwin
goarch: arm64
pkg: github.com/ethereum/go-ethereum/rlp
cpu: Apple M4
│ old.txt │ new.txt │
│ sec/op │ sec/op vs base │
Intsize 2.175n ± 5% 1.050n ± 4% -51.76% (p=0.000 n=10)
* eth/tracers: Adds codeHash to prestateTracer's response (#32391)
**Problem:** Including full account code in prestateTracer response
significantly increases response payload size.
**Solution:** Add codeHash field to the response. This will allow
client-side bytecode caching and is a non-breaking change.
**Note:** codeHash for EoAs is excluded to save space.
---------
Co-authored-by: Sina Mahmoodi <itz.s1na@gmail.com>
* eth/syncer: fix typo (#32427)
avaibale -> available
* p2p: refactor to use time.Now().UnixMilli() in golang std lib (#32402)
* .github: upgrade workflows to Go 1.25 (#32425)
* build: upgrade -dlgo version to Go 1.25.0 (#32412)
* crypto/secp256k1: use ReadBits from common/math (#32430)
* build: remove unused functions (#32393)
* catalyst/api: centralize OPStack validation into helper functions (#592)
* catalyist/api: centralize OPStack validation into helper functions
located in a seperate file for a cleaner diff to upstream
* add test coverage for optimism validation checks
return unadorned errors from helper and allow caller to wrap
* lint
* use engine.InvalidPayloadAttributes.With() for all failed optimism FCU checks
* typos
* fix: only check optimism payload attributes if they are not nil
* combine conditions
* move test
* combine checks
* add check on withdrawals root from canyon to isthmus
* lint
* trie, core/state: add the transition tree (verkle transition part 2) (#32366)
This add some of the changes that were missing from #31634. It
introduces the `TransitionTrie`, which is a façade pattern between the
current MPT trie and the overlay tree.
---------
Signed-off-by: Guillaume Ballet <3272758+gballet@users.noreply.github.com>
Co-authored-by: rjl493456442 <garyrong0905@gmail.com>
* cmd/evm: use PathScheme in blockrunner (#32444)
This is a preparatory change for Verkle/binary trees, since they don't
support the hash-based database scheme. This has no impact on the MPT.
* core/vm: refactor to use bitutil.TestBytes (#32434)
* crypto/bn256: refactor to use bitutil.TestBytes (#32435)
* consensus/misc/eip4844: use blob parameters of current header (#32424)
This changes the implementation to resolve the blob parameters according
to the current header timestamp. This matters for EIP-7918, where we
would previously resolve the UpdateFraction according to the parent
header fork, leading to a confusing situation at the fork transition
block.
---------
Co-authored-by: MariusVanDerWijden <m.vanderwijden@live.de>
* rlp: remove workaround for Value.Bytes (#32433)
As of Go 1.19, it is permitted to call Bytes() on a reflect.Value
representing an adressable byte array. So we can remove our workaround,
undoing #22924.
https://go.dev/doc/go1.19#reflectpkgreflect
> The method [Value.Bytes](https://go.dev/pkg/reflect/#Value.Bytes) now
accepts addressable arrays in addition to slices.
* core/vm: fix EIP-7823 modexp input length check (#32363)
The order of the checks was wrong which would have allowed a call to
modexp with `baseLen == 0 && modLen == 0` post fusaka.
Also handles an edge case where base/mod/exp length >= 2**64
---------
Co-authored-by: Felix Lange <fjl@twurst.com>
* metrics: add tinygo build flag for CPU time (#32454)
* core/rawdb: add non-unix alternative for tablewriter (#32455)
Continuation of https://github.com/ethereum/go-ethereum/issues/32022
tablewriter assumes unix or windows, which may not be the case for
embedded targets.
For v0.0.5 of tablewriter, it is noted in table.go: "The protocols were
written in pure Go and works on windows and unix systems"
---------
Co-authored-by: rjl493456442 <garyrong0905@gmail.com>
* eth/syncer: stop ticker to prevent resource leak (#32443)
* core/rawdb: enhance database key construction (#32431)
* rpc: add SetWebsocketReadLimit in Server (#32279)
Exposing the public method to setReadLimits for Websocket RPC to
prevent OOM.
Current, Geth Server is using a default 32MB max read limit (message
size) for websocket, which is prune to being attacked for OOM. Any one
can easily launch a client to send a bunch of concurrent large request
to cause the node to crash for OOM. One example of such script that can
easily crash a Geth node running websocket server is like this:
https://gist.githubusercontent.com/DeltaXV/b64d221e342e9c1ec6c99c1ab8201544/raw/ec830979ac9a707d98f40dfcc0ce918fc8fb9057/poc.go
---------
Co-authored-by: Felix Lange <fjl@twurst.com>
* CODEOWNERS: add gballet as the owner of trie package (#32466)
* ethclient/gethclient: use common.Hash to debug_traceTransaction (#32404)
* graphql: add query depth limit to prevent DoS attacks (#32344)
## Summary
This PR addresses a DoS vulnerability in the GraphQL service by
implementing a maximum query depth limit. While #26026 introduced
timeout handling, it didn't fully mitigate the attack vector where
deeply nested queries can still consume excessive CPU and memory
resources before the timeout is reached.
## Changes
- Added `maxQueryDepth` constant (set to 20) to limit the maximum
nesting depth of GraphQL queries
- Applied the depth limit using `graphql.MaxDepth()` option when parsing
the schema
- Added test case `TestGraphQLMaxDepth` to verify that queries exceeding
the depth limit are properly rejected
## Security Impact
Without query depth limits, malicious actors could craft deeply nested
queries that:
- Consume excessive CPU cycles during query parsing and execution
- Allocate large amounts of memory for nested result structures
- Potentially cause service degradation or outages even with timeout
protection
This fix complements the existing timeout mechanism by preventing
resource-intensive queries from being executed in the first place.
## Testing
Added `TestGraphQLMaxDepth` which verifies that queries with nesting
depth > 20 are rejected with a `MaxDepthExceeded` error.
## References
- Original issue: #26026
- Related security best practices:
https://www.howtographql.com/advanced/4-security/
---------
Co-authored-by: Felix Lange <fjl@twurst.com>
* p2p: update MaxPeers comment (#32414)
* eth/catalyst: return methods by reflect (#32300)
Return the exposed methods in `ConsensusAPI` by reflection.
* internal/ethapi, miner: fix GetBlockReceipts for pending (#32461)
* trie, core/state: introduce trie Prefetch for optimizing preload (#32134)
This pull introduces a `Prefetch` operation in the trie to prefetch trie
nodes in parallel. It is used by the `triePrefetcher` to accelerate state
loading and improve overall chain processing performance.
* beacon/engine,eth/catalyst: Fix engine API checks and exec payload creation (#662)
* p2p: using math.MaxInt32 from go std lib (#32357)
Co-authored-by: Felix Lange <fjl@twurst.com>
* rlp: refactor to use maths.ReadBits (#32432)
* fixes missing protection of nil pointer dereference in scwallet (#32186)
Fixes #32181
Signed-off-by: kapil <kapilsareen584@gmail.com>
* accounts/usbwallet: correct version comparison logic (#32417)
## Description
This PR fixes a bug in the Ledger hardware wallet version validation
logic for EIP-155 transaction signing. The original condition
incorrectly allowed older versions that don't support EIP-155 such as
0.9.9 and 0.1.5 to proceed.
* p2p: remove todo comment, as it's unnecessary (#32397)
as metioned in https://github.com/ethereum/go-ethereum/pull/32351, I
think this comment is unnecessary.
* core/types: reduce allocations for transaction comparison (#31912)
This PR should reduce overall allocations of a running node by ~10
percent. Since most allocations are coming from the re-heaping of the
transaction pool.
```
(pprof) list EffectiveGasTipCmp
Total: 38197204475
ROUTINE ======================== github.com/ethereum/go-ethereum/core/types.(*Transaction).EffectiveGasTipCmp in github.com/ethereum/go-ethereum/core/types/transaction.go
0 3766837369 (flat, cum) 9.86% of Total
. . 386:func (tx *Transaction) EffectiveGasTipCmp(other *Transaction, baseFee *big.Int) int {
. . 387: if baseFee == nil {
. . 388: return tx.GasTipCapCmp(other)
. . 389: }
. . 390: // Use more efficient internal method.
. . 391: txTip, otherTip := new(big.Int), new(big.Int)
. 1796172553 392: tx.calcEffectiveGasTip(txTip, baseFee)
. 1970664816 393: other.calcEffectiveGasTip(otherTip, baseFee)
. . 394: return txTip.Cmp(otherTip)
. . 395:}
. . 396:
. . 397:// EffectiveGasTipIntCmp compares the effective gasTipCap of a transaction to the given gasTipCap.
. . 398:func (tx *Transaction) EffectiveGasTipIntCmp(other *big.Int, baseFee *big.Int) int {
```
This PR reduces the allocations for comparing two transactions from 2 to
0:
```
goos: linux
goarch: amd64
pkg: github.com/ethereum/go-ethereum/core/types
cpu: Intel(R) Core(TM) Ultra 7 155U
│ /tmp/old.txt │ /tmp/new.txt │
│ sec/op │ sec/op vs base │
EffectiveGasTipCmp/Original-14 64.67n ± 2% 25.13n ± 9% -61.13% (p=0.000 n=10)
│ /tmp/old.txt │ /tmp/new.txt │
│ B/op │ B/op vs base │
EffectiveGasTipCmp/Original-14 16.00 ± 0% 0.00 ± 0% -100.00% (p=0.000 n=10)
│ /tmp/old.txt │ /tmp/new.txt │
│ allocs/op │ allocs/op vs base │
EffectiveGasTipCmp/Original-14 2.000 ± 0% 0.000 ± 0% -100.00% (p=0.000 n=10)
```
It also speeds up the process by ~60%
There are two minor caveats with this PR:
- We change the API for `EffectiveGasTipCmp` and `EffectiveGasTipIntCmp`
(which are probably not used by much)
- We slightly change the behavior of `tx.EffectiveGasTip` when it
returns an error. It would previously return a negative number on error,
now it does not (since uint256 does not allow for negative numbers)
---------
Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
Co-authored-by: Csaba Kiraly <csaba.kiraly@gmail.com>
* triedb/pathdb: improve err message in historical state reader (#32477)
Fixes https://github.com/ethereum/go-ethereum/issues/32474
* core, miner, trie: add metrics tracking state trie depth (#32388)
Co-authored-by: shantichanal <158101918+shantichanal@users.noreply.github.com>
Co-authored-by: Gary Rong <garyrong0905@gmail.com>
Co-authored-by: Guillaume Ballet <3272758+gballet@users.noreply.github.com>
* p2p/discover: add discv5 invalid findnodes result test cases (#32481)
Supersedes #32470.
### What
- snap: shorten stall watchdog in `eth/protocols/snap/sync_test.go` from
1m to 10s.
- discover/v5: consolidate FINDNODE negative tests into a single
table-driven test:
- `TestUDPv5_findnodeCall_InvalidNodes` covers:
- invalid IP (unspecified `0.0.0.0`) → ignored
- low UDP port (`<=1024`) → ignored
### Why
- Addresses TODOs:
- “Make tests smaller” (reduce long 1m timeout).
- “check invalid IPs”; also cover low port per `verifyResponseNode`
rules (UDP must be >1024).
### How it’s validated
- Test-only changes; no production code touched.
- Local runs:
- `go test ./p2p/discover -count=1 -timeout=300s` → ok
- `go test ./eth/protocols/snap -count=1 -timeout=600s` → ok
- Lint:
- `go run build/ci.go lint` → 0 issues on modified files.
### Notes
- The test harness uses `enode.ValidSchemesForTesting` (which includes
the “null” scheme), so records signed with `enode.SignNull` are
signature-valid; failures here are due to IP/port validation in
`verifyResponseNode` and `netutil.CheckRelayAddr`.
- Tests are written as a single table-driven function for clarity; no
helpers or environment switching.
---------
Co-authored-by: lightclient <lightclient@protonmail.com>
* node: fix vhosts for adminAPI (#32488)
* core,trie: fix typo in TransitionTrie (#32491)
Change `NewTransitionTree` to the correct `NewTransitionTrie`.
Signed-off-by: pxwanglu <pxwanglu@icloud.com>
* .github/workflows: naive PR format checker (#32480)
Full disclosure: this has been generated by AI. The goal is to have a
quick check that the PR format is correct, before we merge it. This is
to avoid the periodical case when someone forgets to add a milestone or
check the title matches our preferred format.
* p2p: use slices.Clone (#32428)
Replaces a helper method with slices.Clone
* eth/protocols/eth: Handle DepositTx Receipts
* eth: Catch nil chainViews in backend filter maps update
* params: fix history serve window for verkle test (#32127)
Fixes the history serve window parameter for the
test function `getContractStoredBlockHash`.
Fixes #32458.
* eth/tracers: add missing teardown in TestTraceChain (#32472)
The TestTraceChain function was missing a defer backend.teardown() call,
which is required to properly release blockchain resources after test
completion.
---------
Co-authored-by: Sina Mahmoodi <itz.s1na@gmail.com>
* internal/web3ext: remove deprecated method debug_seedHash (#32495)
The corresponding function was removed in #27178
* triedb/pathdb: rename history to state history (#32498)
This is a internal refactoring PR, renaming the history to stateHistory.
It's a pre-requisite PR for merging trienode history, avoid the name
conflict.
* build: add support for ubuntu 25.04 (#31666)
* cmd: fix typo in comment (#32501)
The function name in the comment should be `writeErrors` instead of
`writeQueries`.
Signed-off-by: tzchenxixi <tzchenxixi@icloud.com>
* eth/tracers: fix supply tracer uncle accounting (#31882)
Uncle rewards were being omitted in the supply tracer due
to a bug. This PR fixes that.
---------
Co-authored-by: Sina Mahmoodi <itz.s1na@gmail.com>
* triedb/pathdb: refactor state history write (#32497)
This pull request refactors the internal implementation in path database
a bit, specifically:
- purge the state index data in batch
- simplify the logic of state history construction and index, make it more readable
* rpc: refactor read limit test (#32494)
closes #32240 #32232
The main cause for the time out is the slow json encoding of large data.
In #32240 they tried to resolve the issue by reducing the size of the
test. However as Felix pointed out, the test is still kind of confusing.
I've refactored the test so it is more understandable and have reduced
the amount of data needed to be json encoded. I think it is still
important to ensure that the default read limit is not active, so I have
retained one large (~32 MB) test case, but it's at least smaller than
the existing ~64 MB test case.
* eth: replace hardcoded sleep with polling loop in snap sync test (#32499)
Replace hardcoded 5-second sleep with polling loop that actively checks
snap sync state. This approach is already used in other project tests
(like account_cache_test.go) and provides better reliability by:
- Reducing flaky behavior on slower systems
- Finishing early when sync completes quickly
- Using 1-second timeout with 100ms polling intervals
---------
Co-authored-by: lightclient <lightclient@protonmail.com>
* internal/ethapi: fix precompile override for eth_estimateGas (#31795)
Fix and close https://github.com/ethereum/go-ethereum/issues/31719.
---------
Co-authored-by: Sina Mahmoodi <itz.s1na@gmail.com>
* accounts/abi: fix panic when check event with log has empty or nil topics (#32503)
When the log has empty or nil topics, the generated bindings code will
panic when accessing `log.Topics[0]`, add a check to avoid it.
* core, internal, miner, signer: convert legacy sidecar in Osaka fork (#32347)
This pull request implements #32235 , constructing blob sidecar in new
format (cell proof)
if the Osaka has been activated.
Apart from that, it introduces a pre-conversion step in the blob pool
before adding the txs.
This mechanism is essential for handling the remote **legacy** blob txs
from the network.
One thing is still missing and probably is worthy being highlighted
here: the blobpool may
contain several legacy blob txs before the Osaka and these txs should be
converted once
Osaka is activated. While the `GetBlob` API in blobpool is capable for
generating cell proofs
at the runtime, converting legacy txs at one time is much cheaper
overall.
---------
Co-authored-by: MariusVanDerWijden <m.vanderwijden@live.de>
Co-authored-by: lightclient <lightclient@protonmail.com>
* eth/tracers: fix testcase 7702_delegate (#32349)
Fixes a prestateTracer test case covering 7702 delegation.
---------
Co-authored-by: Jared Wasinger <j-wasinger@hotmail.com>
Co-authored-by: Sina Mahmoodi <itz.s1na@gmail.com>
* node: fix problematic function name in comment (#32510)
fix problematic function name in comment
Signed-off-by: slicesequal <slicesequal@outlook.com>
* eth: stabilize tx relay peer selection (#31714)
When maxPeers was just above some perfect square, and a few peers
dropped for some reason, we changed the peer selection function.
When new peers were acquired, we changed again.
This PR improves the selection function, in two ways. First, it will always select
sqrt(peers) to broadcast to. Second, the selection now uses siphash with a secret
key, to guard against information leaks about tx source.
---------
Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
Co-authored-by: Felix Lange <fjl@twurst.com>
* core: improve error context in state processor for Prague EIPs (#32509)
Add better error context for EIP-6110, EIP-7002, and EIP-7251 processing
in state processor to improve debugging capabilities.
* all: fix problematic function name in comment (#32513)
Fix problematic function name in comment.
Do my best to correct them all with a script to avoid spamming PRs.
* triedb/pathdb, core: keep root->id mappings after truncation (#32502)
This pull request preserves the root->ID mappings in the path database
even after the associated state histories are truncated, regardless of
whether the truncation occurs at the head or the tail.
The motivation is to support an additional history type, trienode history.
Since the root->ID mappings are shared between two history instances,
they must not be removed by either one.
As a consequence, the root->ID mappings remain in the database even
after the corresponding histories are pruned. While these mappings may
become dangling, it is safe and cheap to keep them.
Additionally, this pull request enhances validation during historical
reader construction, ensuring that only canonical historical state will be
served.
* README: add twitter badge to documentation (#32516)
* core/rawdb: inspect database in parallel (#32506)
`db inspect` on the full database currently takes **30min+**, because
the db iterate was run in one thread, propose to split the key-space to
256 sub range, and assign them to the worker pool to speed up.
After the change, the time of running `db inspect --workers 16` reduced
to **10min**(the keyspace is not evenly distributed).
---------
Signed-off-by: jsvisa <delweng@gmail.com>
Co-authored-by: Gary Rong <garyrong0905@gmail.com>
* all: improve ETA calculation across all progress indicators (#32521)
### Summary
Fixes long-standing ETA calculation errors in progress indicators that
have been present since February 2021. The current implementation
produces increasingly inaccurate estimates due to integer division
precision loss.
### Problem
https://github.com/ethereum/go-ethereum/blob/3aeccadd04aee2d18bdb77826f86b1ca000d3b67/triedb/pathdb/history_indexer.go#L541-L553
The ETA calculation has two critical issues:
1. **Integer division precision loss**: `speed` is calculated as
`uint64`
2. **Off-by-one**: `speed` uses `+ 1`(2 times) to avoid division by
zero, however it makes mistake in the final calculation
This results in wildly inaccurate time estimates that don't improve as
progress continues.
### Example
Current output during state history indexing:
```
lvl=info msg="Indexing state history" processed=16858580 left=41802252 elapsed=18h22m59.848s eta=11h36m42.252s
```
**Expected calculation:**
- Speed: 16858580 ÷ 66179848ms = 0.255 blocks/ms
- ETA: 41802252 ÷ 0.255 = ~45.6 hours
**Current buggy calculation:**
- Speed: rounds to 1 block/ms
- ETA: 41802252 ÷ 1 = ~11.6 hours ❌
### Solution
- Created centralized `CalculateETA()` function in common package
- Replaced all 8 duplicate code copies across the codebase
### Testing
Verified accurate ETA calculations during archive node reindexing with
significantly improved time estimates.
* core/stateless: only report leaf depth in witness stats (#32507)
Filtering for leaf nodes was missing from #32388, which means that even
the root done was reported, which made little sense for the bloatnet
data processing we want to do.
* trie/bintrie: add eip7864 binary trees and run its tests (#32365)
Implement the binary tree as specified in [eip-7864](https://eips.ethereum.org/EIPS/eip-7864).
This will gradually replace verkle trees in the codebase. This is only
running the tests and will not be executed in production, but will help
me rebase some of my work, so that it doesn't bitrot as much.
---------
Signed-off-by: Guillaume Ballet
Co-authored-by: Parithosh Jayanthi <parithosh.jayanthi@ethereum.org>
Co-authored-by: rjl493456442 <garyrong0905@gmail.com>
* internal/ethapi,params: add `eth_config` (#32239)
~Will probably be mostly supplanted by #32224, but this should do for
now for devnet 3.~
Seems like #32224 is going to take some more time, so I have completed
the implementation of eth_config here. It is quite a bit simpler to
implement now that the config hashing was removed.
---------
Co-authored-by: MariusVanDerWijden <m.vanderwijden@live.de>
Co-authored-by: Guillaume Ballet <3272758+gballet@users.noreply.github.com>
Co-authored-by: rjl493456442 <garyrong0905@gmail.com>
* version: release v1.16.3
* feat: bump superchain registry (#669)
* ci: Update forkdiff version to v0.1.1 (#670)
* feat: introduce minimum base fee (#666)
* add minBaseFee to superchain/types and Jovian to params/config
* extend extraData header field
* validate/encode eip1559
* spike add jovian 1559 tests
* update calcBaseFee test and fix logic for calcBaseFee
* update comment
* validate params should be 9 not 10
* dont leave out version byte in extraData
* 0 minbasefee is valid
* dont need default minBaseFee
* add test that fails for curr impl
* do one check at the end to enforce minBaseFee
* 9 bytes not 10 in validate err msg
* extend coverage
* nits
* fix test
* use feature naming and assume eip1559params 8bytes still
* best effort decode
* feature flag
* nits
* handle FCU and payload building args properly
* have payload building test support holocene still
* nits + fix api payload fcu
* use option A of feature flag + nits
* Switch from log2 to significand + exponent for min base fee
* Clear out the higher 4 bits of the significand
* Add encode/decode helpers for min base fee factors
* Remove the check for a blank min base fee
* bit manipulation change
* eth/catalyst: fix ExtraData validation for Jovian min base fee; add tests
* use u64 approach
* feedback + add specs link
* use more compact syntax
* move expectation to end of struct
* combine tests
* rename feature flag
* add new optimism-specific file with general validation and decoding functions
* move optimism specific code to new file
* remove validation and add comments
validation is done in catalyst/api
* remove feature flags altogether
* remove validation from decoding fn
* fix and use generic extradata validation fn
* add comments
* finish removing feature flag
* fix tests
* Apply suggestions from code review
* add spec link
* use inline fn to clean up diff to upstream
* add test cases and factor into subtests with require statement
* tidy up jovianConfig() helper and rename a test
* Introduce Holocene/JovianExtraDataVersionByte
* tweak
* consistency
* rename minbasefee to jovian in validation fn error msg
* assert holocene params in payload_building_test.go
* fix regression
* use ptr for MinBaseFee in PayloadAttributes
* eip1559_optimism: have Validate/DecodeOptimismExtraData take a ForkChecker interface and return a *uint64 for MinBaseFee
* introduce EncodeOptimismExtraData
* lint (whitespace only)
* fix pointer comparison in assertion
* add test for determinism of payload id
* dereference pointer when computing ID
This is not strictly necessary, but it is clearer.
* use eip1559.DecodeOptimismExtraData in test
and extend coverage to missing minbasefee
* Update consensus/misc/eip1559/eip1559_optimism.go
Co-authored-by: Sebastian Stammler <seb@oplabs.co>
* use isOptimismHolocene in CalcBaseFee and document assumption about extraData validity
* TestBuildPatload: use nil minBaseFee expectation preJovian
* rework closure to reduce diff to upstream
* remove empty line
---------
Co-authored-by: William Law <williamlaw.wtl@gmail.com>
Co-authored-by: Niran Babalola <niran@niran.org>
Co-authored-by: Sebastian Stammler <seb@oplabs.co>
* jovian: make isthmus gas params extraction forward-compatible (#671)
* sync-superchain: Handle case where skipped genesis file doesn't exist. (#673)
* feat: bump superchain registry to include arena-z sepolia isthmus hardfork (#678)
* chore(superchain-registry): bump version for addresses cleanup (#672)
* eth/downloader: Fix deposit receipt correction (#680)
* all: Introduce feature toggles for Jovian (#677)
* introduce IsMinBaseFee feature toggle
Allows feature to be easily removed from Jovian hardfork.
When the hardfork scope is locked, this commit can be reverted.
* decouple features
* add isOperatorFeeFix toggle
* Remove approval hold job from release workflow (#683)
Removed approval hold job from release process in CircleCI config.
* params: add bpo forks to eth_config (#32579)
BPO forks should also be included in eth_config response.
* params: schedule Osaka/BPO1/BPO2 for testnets (#32735)
Timestamps taken from:
- Holesky:
https://github.com/eth-clients/holesky/blob/main/metadata/genesis.json
- Sepolia:
https://github.com/eth-clients/sepolia/blob/main/metadata/genesis.json
- Hoodi:
https://github.com/eth-clients/hoodi/blob/main/metadata/genesis.json
* core,miner,parms: DA footprint block limit (constant gas scalar) (#655)
* all: Make DA footprint gas scalar configurable (#675)
Co-authored-by: Sebastian Stammler <seb@oplabs.co>
* core/types: implement operator fee fix (Jovian) (#696)
* fix!: multiply operatorFeeScalar by 100 instead of dividing by 1e6
* apply comments
* apply comments
* remove dup IsOperatorFeeFix
---------
Co-authored-by: fakedev9999 <taehoon@succinct.xyz>
* consensus/beacon: Fix OP Legacy header verification dispatch (#697)
* all: Store DA footprint in blob gas used header field (#694)
* all: update c-kzg-4844 to 2.1.5 (#702)
* superchain: update scr import to include worldchain-sepolia isthmus time (#704)
* core: add gauge metrics + histograms for block gas used and blob gas used (#705)
* core: add gauge metric for block gas used and blob gas used
This can be used to track the DA footprint per block
* encapsulate OPStack additions into new file and function
* add histogram metrics for (blob)GasUsed
* update fork.yaml
* typos
* superchain: update scr import to include jovian activation timestamp (#707)
* Add new precompile limits for Jovian (#709)
This introduces more realistic limits on accelerated precompiles for the Jovian hard fork.
* superchain: Update for new Jovian timestamps (#712)
* core/types: Populate Jovian receipt fields (#710)
* core/types: Move receipt tests OP diff to separate file
* core/types: Populate Jovian receipt fields
* core/txpool/blobpool: migrate billy to new slot size (#31966)
Implements a migration path for the blobpool slotter
---------
Co-authored-by: lightclient <lightclient@protonmail.com>
Co-authored-by: lightclient <14004106+lightclient@users.noreply.github.com>
Co-authored-by: Gary Rong <garyrong0905@gmail.com>
* params: set osaka and BPO1 & BPO2 mainnet dates (#33063)
Sets the fusaka, bpo1, bpo2 timestamps for mainnet
see: https://notes.ethereum.org/@bbusa/fusaka-bpo-timeline
* superchain: update for new Jovian timestamps (#716)
* triedb/pathdb: sync ancient store before journal (#32557) (#718)
This pull request addresses the corrupted path database with log
indicating:
`history head truncation out of range, tail: 122557, head: 212208,
target: 212557`
This is a rare edge case where the in-memory layers, including the write
buffer
in the disk layer, are fully persisted (e.g., written to file), but the
state history
freezer is not properly closed (e.g., Geth is terminated after
journaling but
before freezer.Close). In this situation, the recent state history
writes will be
truncated on the next startup, while the in-memory layers resolve
correctly.
As a result, the state history falls behind the disk layer (including
the write buffer).
In this pull request, the state history freezer is always synced before
journal,
ensuring the state history writes are always persisted before the
others.
Edit:
It's confirmed that devops team has 10s container termination setting.
It
explains why Geth didn't finish the entire termination without state
history
being closed.
https://github.com/ethpandaops/fusaka-devnets/pull/63/files
Co-authored-by: rjl493456442 <garyrong0905@gmail.com>
* finalize merge of v1.101603.4
* checkpoint
* fixed tests besides one
* remove pr validation, I don't think it's used by us
* fix test broken with upstream pull merge
* added forgotten options
* Additional Logging
* Additional Logging
* Go generate
* logging around time overrides
* add overrides to new struct
* revert gen receipts go file
* don't modify map
* correct comparison
* Logging
* More logging
* Short-circuit modern signer's tx.From extraction for PoP / BTC Attr Dep
* Short-circuit modern signer's tx.From extraction for PoP / BTC Attr Dep
* Short-circuit modern signer's tx.From extraction for PoP / BTC Attr Dep
* Logging
* Do not pre-populate precompiles for gas calculation, remove some logging
* Remove precompile prepare logging
* Remove gas param logging
---------
Signed-off-by: jsvisa <delweng@gmail.com>
Signed-off-by: Guillaume Ballet <3272758+gballet@users.noreply.github.com>
Signed-off-by: youzichuan <youzichuan6@outlook.com>
Signed-off-by: kapil <kapilsareen584@gmail.com>
Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
Signed-off-by: pxwanglu <pxwanglu@icloud.com>
Signed-off-by: tzchenxixi <tzchenxixi@icloud.com>
Signed-off-by: slicesequal <slicesequal@outlook.com>
Signed-off-by: Guillaume Ballet
Co-authored-by: rjl493456442 <garyrong0905@gmail.com>
Co-authored-by: zsfelfoldi <zsfelfoldi@gmail.com>
Co-authored-by: Marius van der Wijden <m.vanderwijden@live.de>
Co-authored-by: Zhou <DanialZhouMAX@gmail.com>
Co-authored-by: Felix Lange <fjl@twurst.com>
Co-authored-by: Ömer Faruk Irmak <omerfirmak@gmail.com>
Co-authored-by: Giulio rebuffo <giulio.rebuffo@gmail.com>
Co-authored-by: spencer-tb <spencer@spencertaylorbrown.uk>
Co-authored-by: maskpp <maskpp266@gmail.com>
Co-authored-by: Sina M <1591639+s1na@users.noreply.github.com>
Co-authored-by: Ulaş Erdoğan <uerdogan2001@hotmail.com>
Co-authored-by: jwasinger <j-wasinger@hotmail.com>
Co-authored-by: lightclient <lightclient@protonmail.com>
Co-authored-by: Axel Kingsley <axel.kingsley@gmail.com>
Co-authored-by: Jacob Elias <19310318+jelias2@users.noreply.github.com>
Co-authored-by: CrazyFrog <anna.shuraeva13@gmail.com>
Co-authored-by: Niran Babalola <niran.babalola@coinbase.com>
Co-authored-by: Mark Tyneway <mark.tyneway@gmail.com>
Co-authored-by: PixelPilot <161360836+PixelPil0t1@users.noreply.github.com>
Co-authored-by: kilavvy <140459108+kilavvy@users.noreply.github.com>
Co-authored-by: Karl Bartel <karl.bartel@clabs.co>
Co-authored-by: Bosul Mun <bsbs8645@snu.ac.kr>
Co-authored-by: George Knee <georgeknee@googlemail.com>
Co-authored-by: FT <140458077+zeevick10@users.noreply.github.com>
Co-authored-by: Delweng <delweng@gmail.com>
Co-authored-by: asamuj <105436033+asamuj@users.noreply.github.com>
Co-authored-by: Maxim Evtush <154841002+maximevtush@users.noreply.github.com>
Co-authored-by: CertiK-Geth <138698582+CertiK-Geth@users.noreply.github.com>
Co-authored-by: steven <wangpeculiar@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: kourin <kourin.code@gmail.com>
Co-authored-by: Sam Stokes <35908605+bitwiseguy@users.noreply.github.com>
Co-authored-by: Micke <155267459+reallesee@users.noreply.github.com>
Co-authored-by: gzeon <h@arry.io>
Co-authored-by: nthumann <nthumanna@gmail.com>
Co-authored-by: Galoretka <galoretochka@gmail.com>
Co-authored-by: ericxtheodore <ericxtheodore@outlook.com>
Co-authored-by: Tomás Andróil <tomasandroil@gmail.com>
Co-authored-by: kashitaka <takao.w9st.kashima@xica.net>
Co-authored-by: Daniel Katzan <108216499+dkatzan@users.noreply.github.com>
Co-authored-by: cui <cuiweixie@gmail.com>
Co-authored-by: lmittmann <3458786+lmittmann@users.noreply.github.com>
Co-authored-by: lmittmann <lm…
ClaytonNorthey92
pushed a commit
to hemilabs/op-geth
that referenced
this pull request
Dec 16, 2025
ClaytonNorthey92
added a commit
to hemilabs/op-geth
that referenced
this pull request
Feb 23, 2026
* core/overlay: copy BaseRoot in TransitionState.Copy (#32613)
This change ensures TransitionState.Copy preserves BaseRoot. During a
Verkle transition, ts.BaseRoot is required to construct the overlay MPT
when ts.InTransition() is true. Previously, copies dropped BaseRoot,
risking an invalid zero-hash base trie and inconsistent behavior.
* core/txpool/blobpool: filter blob txs with sidecar version (#32577)
As a consequence of moving blob sidecar version migration code around,
we ended up building blocks with a mix of v0 and v1 blob transactions
(different proof encoding in the sidecar).
This PR makes sure we are not building illegal blocks after Osaka. Blob
migration is left for another PR.
Related issues and PRs:
- https://github.com/ethereum/go-ethereum/pull/31791
- https://github.com/ethereum/go-ethereum/pull/32347
- https://github.com/ethereum/go-ethereum/pull/31966
- https://github.com/ethereum/go-ethereum/issues/32235
---------
Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
* core/txpool/blobpool: migrate billy to new slot size (#31966)
Implements a migration path for the blobpool slotter
---------
Co-authored-by: lightclient <lightclient@protonmail.com>
Co-authored-by: lightclient <14004106+lightclient@users.noreply.github.com>
Co-authored-by: Gary Rong <garyrong0905@gmail.com>
* rlp: remove duplicate optionalAndTailField test case (#32614)
* eth/catalyst: allow fcuV3 for BPO forks (#32615)
This fixes an issue with the engine API after BPO forks have passed.
* go.mod: add tool section in module file (#32598)
This removes the tools.go workaround in favor of the official
tool management infrastructure, which was added in Go 1.24.
* cmd/keeper: add the keeper zkvm guest program (#32543)
Keeper is a zmvm guest program that runs the block transition.
It relies on the zkvm maker implementing `getInput`. For now, we only
provide a single implementation for the 'ziren' VM.
Why keeper?
In the _Mass Effect_ lore, the keepers are animals (?) who maintain the
citadel. Nothing is known from them, and attempts at tampering with them
have failed, as they self-destruct upon inquiry. They have a secret,
nefarious purpose that is only revealed later in the game series, don't
want any spoilers so I didn't dig deeper. All in all, a good metaphor
for zkvms.
---------
Co-authored-by: weilzkm <140377101+weilzkm@users.noreply.github.com>
Co-authored-by: Felix Lange <fjl@twurst.com>
* cmd/evm/internal/t8ntool: use ApplyTransaction instead of ApplyMessage (#32618)
ApplyTransaction calls the hooks and builds the receipt, so some
duplicated code can be removed from t8ntool. Test cases have been
changed to add the `blockNumber` and `blockHash` in receipts, since
they were previously not filled in.
* chore(superchain-registry): bump version for addresses cleanup (#672)
* eth/downloader: Fix deposit receipt correction (#680)
* core/tracing: remove unnecessary 'copy' field skip in TestAllHooksCalled (#32622)
This test iterated over Hooks fields and skipped a field named copy. The
Hooks struct has no such field, making the condition dead code.
* p2p/discover: expose timeout in lookupFailed
Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
# Conflicts:
# p2p/discover/lookup.go
* core/rawdb: fix typo in TestWriteAncientHeaderChain (#32587)
* core/stateless: API methods to get execution witness of block
This PR adds a new RPC call, which re-executes a block with stateless
mode activated, so that the witness data are collected and returned.
They are `debug_executionWitnessByHash` which takes in a block hash
and `debug_executionWitness` which takes in a block number.
---------
Signed-off-by: Guillaume Ballet <3272758+gballet@users.noreply.github.com>
* core/vm: use go-bigmodexpfix for modexp (#32576)
This changes the modexp precompile to use a fork of math/big with some
patches by @GottfriedHerold to improve worst-case performance.
* revert to using table parameter
using it.lookup.tab inside is unsafe
Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
* go.mod: update c-kzg (#32639)
Updates c-kzg to the latest release:
https://github.com/ethereum/c-kzg-4844/releases/tag/v2.1.3
* go.mod: update go-eth-kzg (#32640)
Updates go-eth-kzg:
https://github.com/crate-crypto/go-eth-kzg/releases/tag/v1.4.0
* core/stateless: add vmwitnessstats cli flag to report leaf stats + log to console (#32619)
The format that is currently reported by the chain isn't very useful, as
it gives an average for ALL the nodes, and not only the leaves, which
skews the results.
Also, until now there was no way to activate the reporting of errors.
We also decided that metrics weren't the right tool to report this data,
so we decided to dump it to the console if the flag is enabled. A better
system should be built, but for now, printing to the logs does the job.
* triedb/pathdb: generalize the history indexer (#32523)
This pull request is based on #32306 , is the second part for shipping
trienode history.
Specifically, this pull request generalize the existing index mechanism,
making is usable
by both state history and trienode history in the near future.
* trie: add sub-trie iterator support (#32520)
- Adds `NodeIteratorWithPrefix()` method to support iterating only nodes
within a specific key prefix
- Adds `NodeIteratorWithRange()` method to support iterating only nodes
within a specific key range
Current `NodeIterator` always traverses the entire remaining trie from a
start position. For non-ethereum applications using the trie implementation,
there's no way to limit iteration to just a subtree with a specific prefix.
**Usage:**
```go
// Only iterate nodes with prefix "key1"
iter, err := trie.NodeIteratorWithPrefix([]byte("key1"))
```
Testing: Comprehensive test suite covering edge cases and boundary conditions.
Closes #32484
---------
Co-authored-by: gballet <guillaume.ballet@gmail.com>
Co-authored-by: Gary Rong <garyrong0905@gmail.com>
* cmd/keeper: disable GC for zkvm execution (#32638)
ZKVMs are constrained environments that liberally allocate memory and
never release it. In this context, using the GC is only going to cause
issues down the road, and slow things down in any case.
* all: Introduce feature toggles for Jovian (#677)
* introduce IsMinBaseFee feature toggle
Allows feature to be easily removed from Jovian hardfork.
When the hardfork scope is locked, this commit can be reverted.
* decouple features
* add isOperatorFeeFix toggle
* Remove approval hold job from release workflow (#683)
Removed approval hold job from release process in CircleCI config.
* core: fix fork readiness log (#32623)
When I implemented in #31340 I didn't expect multiple forks to be
configured at once, but this is exactly how BPOs are defined. This
updates the method to determine the next scheduled fork rather than the
last fork.
* core/rawdb: report truncateErr in concurrent truncate failure (#32651)
* build: update to execution-spec-tests v5.0.0 (#32592)
https://github.com/ethereum/execution-spec-tests/releases/tag/v5.0.0
As of this release, execution-spec-tests also contains all state tests
that were previously in ethereum/tests. We can probably remove the tests
submodule now. However, this would mean we are missing the pre-cancun
tests. Still need to figure out how to resolve this.
---------
Co-authored-by: MariusVanDerWijden <m.vanderwijden@live.de>
* eth/catalyst, beacon/engine: enable BPO and Osaka on stateless APIs (#32636)
Addresses https://github.com/ethereum/go-ethereum/issues/32630
This pull request enables the stateless engine APIs for Osaka and the
following BPOs. Apart from that, a few more descriptions have been added
in the engine APIs, making it easier to follow the spec change.
* eth/filters, cmd: add config of eth_getLogs address limit (#32327)
Add cli configurable limit for the number of addresses allowed in
eth_getLogs filter criteria:
https://github.com/ethereum/go-ethereum/issues/32264
Key changes:
- Added --rpc.getlogmaxaddrs CLI flag (default: 1000) to configure the
maximum number of addresses
- Updated ethconfig.Config with FilterMaxAddresses field for
configuration management
- Modified filter system to use the configurable limit instead of the
hardcoded maxAddresses constant
- Enhanced test coverage with new test cases for address limit
validation
- Removed hardcoded validation from JSON unmarshaling, moving it to
runtime validation
Please notice that I remove the check at FilterCriteria UnmarshalJSON
because the runtime config can not pass into this validation.
Please help review this change!
---------
Co-authored-by: zsfelfoldi <zsfelfoldi@gmail.com>
Co-authored-by: rjl493456442 <garyrong0905@gmail.com>
* beacon/config: fix LoadForks with non-string values (#32609)
Fixes a crash when loading the beacon chain config if new fields like
`BLOB_SCHEDULE: []` are present.
Previously, the config loader assumed all values were strings, causing
errors such as:
```
Fatal: Could not load beacon chain config '/network-configs/config.yaml': failed to parse beacon chain config file: yaml: unmarshal errors:
line 242: cannot unmarshal !!seq into string
```
This PR updates the parsing logic to handle non-string values correctly
and adds explicit validation for fork fields.
* internal/ethapi: skip tx gas limit check for calls (#32641)
This disables the tx gaslimit cap for eth_call and related RPC operations.
I don't like how this fix works. Ideally we'd be checking the tx
gaslimit somewhere else, like in the block validator, or any other place
that considers block transactions. Doing the check in StateTransition
means it affects all possible ways of executing a message.
The challenge is finding a place for this check that also triggers
correctly in tests where it is wanted. So for now, we are just combining
this with the EOA sender check for transactions. Both are disabled for
call-type messages.
* beacon/blsync: test validated finality (#32633)
This PR improves `TestBlockSync` so that it also tests the finality
update validation.
Note: to this date four long and complex (at least partly AI generated)
PRs arrived that did something related to testing finality but honestly
we do not need a bloated "comprehensive" test to test a trivial feature
because maintaining these tests can also be a pain over the long term.
This PR adds some sufficient sanity checks to detect if finality ever
gets broken by a future change.
* core/state: add missing address key in state_object log (#32676)
* crypto/bn256: switch to gnark again (#32659)
We recently update our default implementation to gnark in
https://github.com/ethereum/go-ethereum/pull/32024
Then we found a consensus issue and reverted it in
https://github.com/ethereum/go-ethereum/commit/65d77c51295c3b5c237a082af856a6926766a51c
We fixed the consensus issue and have been fuzzing it more since then in
https://github.com/ethereum/go-ethereum/pull/32055/files
https://github.com/ethereum/go-ethereum/pull/32065
https://github.com/ethereum/go-ethereum/pull/32055/files
So I think now is the time to update it back to gnark
* core/txpool/blobpool: remove conversion in GetBlobs (#32578)
This disables blob proof conversion in `GetBlobs` by default, making it
conditional.
---------
Co-authored-by: Felix Lange <fjl@twurst.com>
* p2p: using testing.B.Loop (#32664)
* core/state: using testing.B.Loop (#32658)
before:
go test -run=^$ -bench=. ./core/state/... 120.85s user 7.96s system 129%
cpu 1:39.13 tota
after:
go test -run=^$ -bench=. ./core/state/... 21.32s user 2.12s system 97%
cpu 24.006 total
* eth: using testing.B.Loop (#32657)
before:
go test -run=^$ -bench=. ./eth/... 827.57s user 23.80s system 361% cpu
3:55.49 total
after:
go test -run=^$ -bench=. ./eth/... 281.62s user 13.62s system 245% cpu
2:00.49 total
* log: using testing.B.Loop (#32663)
before:
go test -run=^$ -bench=. ./log -timeout=1h 12.19s user 2.19s system 89%
cpu 16.025 total
after:
go test -run=^$ -bench=. ./log -timeout=1h 10.64s user 1.53s system 89%
cpu 13.607 total
---------
Co-authored-by: lightclient <lightclient@protonmail.com>
* core: using testing.B.Loop (#32662)
Co-authored-by: lightclient <lightclient@protonmail.com>
* core/vm: using testing.B.Loop (#32660)
before:
go test -run=^$ -bench=. ./core/vm/... -timeout=1h 1841.87s user 40.96s
system 124% cpu 25:15.76 total
after:
go test -run=^$ -bench=. ./core/vm/... -timeout=1h 1588.65s user 33.79s
system 123% cpu 21:53.25 total
---------
Co-authored-by: lightclient <lightclient@protonmail.com>
* core/types: using testing.B.Loop (#32643)
before:
go test -run=^$ -bench=. ./core/types 47.80s user 2.18s system 102% cpu
48.936 tota
after:
go test -run=^$ -bench=. ./core/types 42.42s user 2.27s system 112% cpu
39.593 total
* crypto: using testing.B.Loop (#32645)
before:
go test -run=^$ -bench=. ./crypto/... 94.83s user 2.68s system 138% cpu
1:10.55 tota
after:
go test -run=^$ -bench=. ./crypto/... 75.43s user 2.58s system 123% cpu
1:03.01 total
* fix: correct typo in TestMustParseUint64Panic error message (#32648)
Fix typo in test error message where "MustParseBig" was incorrectly
used instead of "MustParseUint64" in the TestMustParseUint64Panic
function.
The test still functions correctly, but now the error message
accurately reflects the function being tested.
* common, eth: remove duplicate test cases (#32624)
Remove redundant duplicate test vectors. The two entries were identical
and back-to-back, providing no additional coverage while adding noise.
Keeping a single instance maintains test intent and clarity without
altering behavior.
* core/rawdb: fix bad blocks sorted failure message to map index→number correctly (#32627)
Fix the t.Fatalf format arguments in TestBadBlockStorage to match the
intended #index output. Previously, the left number used i+1 and the
right index used the block number, producing misleading diagnostics.
Correct mapping improves test failure clarity and debuggability.
* params: update config description links to new format (#32681)
A PR in the specs repo broke our existing links:
https://github.com/ethereum/execution-specs/pull/1416
This PR fixes it and adds the Prague and Osaka specs.
* core/txpool/blobpool: introduce sidecar conversion for legacy blob transactions (#32656)
This pull request introduces a queue for legacy sidecar conversion to
handle transactions that persist after the Osaka fork. Simply dropping
these transactions would significantly harm the user experience.
To balance usability with system complexity, we have introduced a
conversion time window of two hours post Osaka fork. During this period,
the system will accept legacy blob transactions and convert them in a
background process.
After the window, all legacy transactions will be rejected. Notably, all
the blob transactions will be validated statically before the conversion,
and also all conversion are performed in a single thread, minimize the risk
of being DoS.
We believe this two hour window provides sufficient time to process
in-flight legacy transactions and allows submitters to migrate to the
new format.
---------
Co-authored-by: Felix Lange <fjl@twurst.com>
* go.work.sum: add to repo (#32677)
* core/state: fix committed-state expectations in StateDB tests (#32678)
* triedb/pathdb: move head truncation log (#32649)
Print the `Truncating from head` log only if head truncation is needed.
* cmd, tests: fix snapshot dump and export-preimages (#32650)
Address #32646
* go.work, build: remove workspace file (#32699)
https://go.dev/ref/mod#go-work-file advises against checking `go.work`
files because they can interfere with local development. We added the
workspace file in order to make `go test` and other tools work across
multiple modules. But it seems to cause weird issues with the
`go.work.sum` file being modified, etc.
So with this PR, we instead run all the `ci.go` commands for all modules
in the workspace manually.
* cmd/era: fix iterator error source handling in checkAccumulator (#32698)
This change replaces wrapping a stale outer err with the iterator’s own
error after Next(), and switches the post-BlockAndReceipts() check to
use the returned err. According to internal/era iterator contract,
Error() should be consulted immediately after Next() to surface
iteration errors, while decoding errors from Block/Receipts are returned
directly. The previous code could hide the real failure (using nil or
unrelated err), leading to misleading diagnostics and missed iteration
errors.
---------
Co-authored-by: lightclient <lightclient@protonmail.com>
* cmd/evm/internal/t8ntool: fix nil pointer dereference in Osaka blob gas calculation (#32714)
The parent header was missing the BaseFee field when calculating the
reserve price for EIP-7918 in the Osaka fork, causing a nil pointer
dereference. This fix ensures BaseFee is properly set from ParentBaseFee
in the environment.
Added regression test case 34 to verify Osaka fork blob gas calculation
works correctly with parent base fee.
* core/txpool/blobpool: add legacy sidecar conversion in reinject (#32688)
This adds the conversion for the legacy sidecar if these
transactions are reorged out after the osaka.
* accounts/keystore: use runtime.AddCleanup (#32610)
* internal/ethapi: fix merge transition in eth_simulate (#32616)
This PR fixes the fork detection of `eth_simulateV1`, particularly
for networks that are post-merge since genesis, like Hoodi.
* trie: align AllFFPrefix test assertion and message (#32719)
* build: module-aware FindMainPackages (#32736)
This fixes `go run build/ci.go install`. It was failing because we
resolved all main packages by parsing sources, which fails when the
source directory contains multiple modules.
* miner: default gaslimit 60M (#32734)
* core/txpool/blobpool: fork boundary conversion 3 (#32716)
This implements the conversion of existing blob transactions to the new proof
version. Conversion is triggered at the Osaka fork boundary. The conversion is
designed to be idempotent, and may be triggered multiple times in case of a reorg
around the fork boundary.
This change is the last missing piece that completes our strategy for the blobpool
conversion. After the Osaka fork,
- new transactions will be converted on-the-fly upon entry to the pool
- reorged transactions will be converted while being reinjected
- (this change) existing transactions will be converted in the background
---------
Co-authored-by: Gary Rong <garyrong0905@gmail.com>
Co-authored-by: lightclient <lightclient@protonmail.com>
* trie: fix TestOneElementProof expected value message (#32738)
- Correct the error message in TestOneElementProof to expect 'v' instead
of 'k'.
- The trie is updated with key "k" and value "v"; on mismatch the
expected value must be 'v'.
- Aligns the message with the actual test logic and other similar checks
in this file, reducing confusion during test failures. No behavioral
changes.
* accounts/keystore: use ticker to avoid timer allocations (#32732)
Replace time.After with a long‑lived time.Ticker in KeyStore.updater, preventing per‑iteration timer allocations and potential timer buildup.
Co-authored-by: lightclient <lightclient@protonmail.com>
* accounts/abi/bind: fix data race in TestWaitDeployedCornerCases (#32740)
Fixes race in WaitDeploy test where the backend is closed before goroutine using it wraps up.
---------
Co-authored-by: lightclient <lightclient@protonmail.com>
* all: add bpo1 and bpo2 overrides (#32737)
This adds overrides to the cli for BPO1 and BPO2.
---------
Co-authored-by: Gary Rong <garyrong0905@gmail.com>
* core/txpool/blobpool: convert and add one-by-one (#32718)
This is a small improvement on #32656 in case Add was called with
multiple type 3 transactions, adding transactions to the pool one-by-one
as they are converted.
Announcement to peers is still done in a batch.
Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
* build: upgrade to execution-spec-tests v5.1.0 (#32742)
https://github.com/ethereum/execution-spec-tests/releases/tag/v5.1.0
* core/txpool: add eip2681 check for incoming transactions (#32726)
* all: refactor to use builtin max/min (#32694)
Replaces the last few instances of `math.Max` and `math.Min` with go builtins.
* params: schedule Osaka/BPO1/BPO2 for testnets (#32735)
Timestamps taken from:
- Holesky:
https://github.com/eth-clients/holesky/blob/main/metadata/genesis.json
- Sepolia:
https://github.com/eth-clients/sepolia/blob/main/metadata/genesis.json
- Hoodi:
https://github.com/eth-clients/hoodi/blob/main/metadata/genesis.json
* version: release go-ethereum v1.16.4 stable
* version: begin v1.16.5 release cycle
* internal/ethapi: fix outdated comments (#32751)
Fix outdated comments
* ethapi: reject oversize storage keys before hex decode (#32750)
Bail out of decodeHash when the raw hex string is longer than 32 byte before actually decoding.
---------
Co-authored-by: lightclient <lightclient@protonmail.com>
* signer/core: fix TestSignTx to decode res2 (#32749)
Decode the modified transaction and verify the value differs from original.
---------
Co-authored-by: lightclient <lightclient@protonmail.com>
* trie: correct error messages for UpdateStorage operations (#32746)
Fix incorrect error messages in TestVerkleTreeReadWrite and TestVerkleRollBack functions.
* eth/tracers/native: add keccak256preimage tracer (#32569)
Introduces a new tracer which returns the preimages
of evm KECCAK256 hashes.
See #32570.
---------
Co-authored-by: Sina M <1591639+s1na@users.noreply.github.com>
Co-authored-by: Sina Mahmoodi <itz.s1na@gmail.com>
* params: add amsterdam fork config (#32687)
Adds Amsterdam as fork config option.
Co-authored-by: lightclient <lightclient@protonmail.com>
* build: remove duplicated func FileExist (#32768)
* eth/catalyst: check osaka in engine_getBlobsV1 (#32731)
ref
https://github.com/ethereum/execution-apis/blob/main/src/engine/osaka.md#cancun-api
> Client software MUST return -38005: Unsupported fork error if the
Osaka fork has been activated.
---------
Signed-off-by: Delweng <delweng@gmail.com>
Co-authored-by: rjl493456442 <garyrong0905@gmail.com>
* trie: fix error message in test (#32772)
Fixes an error message in TestReplication
* internal/ethapi: remove redundant check in test (#32760)
Removes a redundant check in TestCreateAccessListWithStateOverrides
* cmd/evm/internal/t8ntool: panic on database corruption (#32776)
These functions were previously ignoring the error returned by both
`statedb.Commit()` and the subsequent `state.New()`,
which could silently fail and cause panics later when the `statedb` is
used.
This change adds proper error checking and panics with a descriptive
error
message if state creation fails.
While unlikely in normal operation, this can occur if there are database
corruption issues or if invalid root hashes are provided, making
debugging
significantly easier when such issues do occur.
This issue was encountered and fixed in
https://github.com/gballet/go-ethereum/pull/552
where the error handling proved essential for debugging
cc: @gballet as this was discussed in a call already.
* params: fix bpo config comments (#32755)
Looks like we forgot to update names when copying.
* core/rawdb: update comments (#32668)
- Replace outdated NewFreezer doc that referenced map[string]bool/snappy
toggle with accurate description of -map[string]freezerTableConfig
(noSnappy, prunable).
- Fix misleading field comment on freezerTable.config that spoke as if
it were a boolean (“if true”), clarifying it’s a struct and noting
compression is non-retroactive.
* params: implement String() method for ChainConfig (#32766)
Fixes issue #32762 where ChainConfig logging displays pointer addresses
instead of actual timestamp values for fork activation times.
Before: ShanghaiTime:(*uint64)(0xc000373fb0),
CancunTime:(*uint64)(0xc000373fb8)
After: ShanghaiTime: 1681338455, CancunTime: 1710338135, VerkleTime: nil
The String() method properly dereferences timestamp pointers and handles
nil values for unset fork times, making logs more readable and useful
for debugging chain configuration issues.
---------
Co-authored-by: rjl493456442 <garyrong0905@gmail.com>
* params: add blob config information in the banner (#32771)
Extend the chain banner with blob config information.
Co-authored-by: Felix Lange <fjl@twurst.com>
* core/txpool: remove unused signer field from TxPool (#32787)
The TxPool.signer field was never read and each subpool (legacy/blob)
maintains its own signer instance. This field remained after txpool
refactoring into subpools and is dead code. Removing it reduces
confusion and simplifies the constructor.
* core/state: correct expected value in TestMessageCallGas (#32780)
* go.mod, cmd/keeper/go.mod: upgrade victoria metrics dependency (#32720)
This is required for geth to compile to WASM.
* params: add bpo forks to eth_config (#32579)
BPO forks should also be included in eth_config response.
* params: schedule Osaka/BPO1/BPO2 for testnets (#32735)
Timestamps taken from:
- Holesky:
https://github.com/eth-clients/holesky/blob/main/metadata/genesis.json
- Sepolia:
https://github.com/eth-clients/sepolia/blob/main/metadata/genesis.json
- Hoodi:
https://github.com/eth-clients/hoodi/blob/main/metadata/genesis.json
* eth/catalyst: extend payloadVersion support to osaka/post-osaka forks (#32800)
This PR updates the `payloadVersion` function in `simulated_beacon.go`
to handle additional following forks used during development and testing
phases after Osaka.
This change ensures that the simulated beacon correctly resolves the
payload version for these forks, enabling consistent and valid execution
payload handling during local testing or simulation.
* p2p: fix error message in test (#32804)
* signer/core: fix error message in test (#32807)
* params: fix banner message (#32796)
* core/types, trie: reduce allocations in derivesha (#30747)
Alternative to #30746, potential follow-up to #30743 . This PR makes the
stacktrie always copy incoming value buffers, and reuse them internally.
Improvement in #30743:
```
goos: linux
goarch: amd64
pkg: github.com/ethereum/go-ethereum/core/types
cpu: 12th Gen Intel(R) Core(TM) i7-1270P
│ derivesha.1 │ derivesha.2 │
│ sec/op │ sec/op vs base │
DeriveSha200/stack_trie-8 477.8µ ± 2% 430.0µ ± 12% -10.00% (p=0.000 n=10)
│ derivesha.1 │ derivesha.2 │
│ B/op │ B/op vs base │
DeriveSha200/stack_trie-8 45.17Ki ± 0% 25.65Ki ± 0% -43.21% (p=0.000 n=10)
│ derivesha.1 │ derivesha.2 │
│ allocs/op │ allocs/op vs base │
DeriveSha200/stack_trie-8 1259.0 ± 0% 232.0 ± 0% -81.57% (p=0.000 n=10)
```
This PR further enhances that:
```
goos: linux
goarch: amd64
pkg: github.com/ethereum/go-ethereum/core/types
cpu: 12th Gen Intel(R) Core(TM) i7-1270P
│ derivesha.2 │ derivesha.3 │
│ sec/op │ sec/op vs base │
DeriveSha200/stack_trie-8 430.0µ ± 12% 423.6µ ± 13% ~ (p=0.739 n=10)
│ derivesha.2 │ derivesha.3 │
│ B/op │ B/op vs base │
DeriveSha200/stack_trie-8 25.654Ki ± 0% 4.960Ki ± 0% -80.67% (p=0.000 n=10)
│ derivesha.2 │ derivesha.3 │
│ allocs/op │ allocs/op vs base │
DeriveSha200/stack_trie-8 232.00 ± 0% 37.00 ± 0% -84.05% (p=0.000 n=10)
```
So the total derivesha-improvement over *both PRS* is:
```
goos: linux
goarch: amd64
pkg: github.com/ethereum/go-ethereum/core/types
cpu: 12th Gen Intel(R) Core(TM) i7-1270P
│ derivesha.1 │ derivesha.3 │
│ sec/op │ sec/op vs base │
DeriveSha200/stack_trie-8 477.8µ ± 2% 423.6µ ± 13% -11.33% (p=0.015 n=10)
│ derivesha.1 │ derivesha.3 │
│ B/op │ B/op vs base │
DeriveSha200/stack_trie-8 45.171Ki ± 0% 4.960Ki ± 0% -89.02% (p=0.000 n=10)
│ derivesha.1 │ derivesha.3 │
│ allocs/op │ allocs/op vs base │
DeriveSha200/stack_trie-8 1259.00 ± 0% 37.00 ± 0% -97.06% (p=0.000 n=10)
```
Since this PR always copies the incoming value, it adds a little bit of
a penalty on the previous insert-benchmark, which copied nothing (always
passed the same empty slice as input) :
```
goos: linux
goarch: amd64
pkg: github.com/ethereum/go-ethereum/trie
cpu: 12th Gen Intel(R) Core(TM) i7-1270P
│ stacktrie.7 │ stacktrie.10 │
│ sec/op │ sec/op vs base │
Insert100K-8 88.21m ± 34% 92.37m ± 31% ~ (p=0.280 n=10)
│ stacktrie.7 │ stacktrie.10 │
│ B/op │ B/op vs base │
Insert100K-8 3.424Ki ± 3% 4.581Ki ± 3% +33.80% (p=0.000 n=10)
│ stacktrie.7 │ stacktrie.10 │
│ allocs/op │ allocs/op vs base │
Insert100K-8 22.00 ± 5% 26.00 ± 4% +18.18% (p=0.000 n=10)
```
---------
Co-authored-by: Gary Rong <garyrong0905@gmail.com>
Co-authored-by: Felix Lange <fjl@twurst.com>
* p2p/enode: fix discovery AyncFilter deadlock on shutdown (#32572)
Description:
We found a occasionally node hang issue on BSC, I think Geth may
also have the issue, so pick the fix patch here.
The fix on BSC repo: https://github.com/bnb-chain/bsc/pull/3347
When the hang occurs, there are two routines stuck.
- routine 1: AsyncFilter(...)
On node start, it will run part of the DiscoveryV4 protocol, which could
take considerable time, here is its hang callstack:
```
goroutine 9711 [chan receive]: // this routine was stuck on read channel: `<-f.slots`
github.com/ethereum/go-ethereum/p2p/enode.AsyncFilter.func1()
github.com/ethereum/go-ethereum/p2p/enode/iter.go:206 +0x125
created by github.com/ethereum/go-ethereum/p2p/enode.AsyncFilter in goroutine 1
github.com/ethereum/go-ethereum/p2p/enode/iter.go:192 +0x205
```
- Routine 2: Node Stop
It is the main routine to shutdown the process, but it got stuck when it
tries to shutdown the discovery components, as it tries to drain the
channel of `<-f.slots`, but the extra 1 slot will never have chance to
be resumed.
```
goroutine 11796 [chan receive]:
github.com/ethereum/go-ethereum/p2p/enode.(*asyncFilterIter).Close.func1()
github.com/ethereum/go-ethereum/p2p/enode/iter.go:248 +0x5c
sync.(*Once).doSlow(0xc032a97cb8?, 0xc032a97d18?)
sync/once.go:78 +0xab
sync.(*Once).Do(...)
sync/once.go:69
github.com/ethereum/go-ethereum/p2p/enode.(*asyncFilterIter).Close(0xc092ff8d00?)
github.com/ethereum/go-ethereum/p2p/enode/iter.go:244 +0x36
github.com/ethereum/go-ethereum/p2p/enode.(*bufferIter).Close.func1()
github.com/ethereum/go-ethereum/p2p/enode/iter.go:299 +0x24
sync.(*Once).doSlow(0x11a175f?, 0x2bfe63e?)
sync/once.go:78 +0xab
sync.(*Once).Do(...)
sync/once.go:69
github.com/ethereum/go-ethereum/p2p/enode.(*bufferIter).Close(0x30?)
github.com/ethereum/go-ethereum/p2p/enode/iter.go:298 +0x36
github.com/ethereum/go-ethereum/p2p/enode.(*FairMix).Close(0xc0004bfea0)
github.com/ethereum/go-ethereum/p2p/enode/iter.go:379 +0xb7
github.com/ethereum/go-ethereum/eth.(*Ethereum).Stop(0xc000997b00)
github.com/ethereum/go-ethereum/eth/backend.go:960 +0x4a
github.com/ethereum/go-ethereum/node.(*Node).stopServices(0xc0001362a0, {0xc012e16330, 0x1, 0xc000111410?})
github.com/ethereum/go-ethereum/node/node.go:333 +0xb3
github.com/ethereum/go-ethereum/node.(*Node).Close(0xc0001362a0)
github.com/ethereum/go-ethereum/node/node.go:263 +0x167
created by github.com/ethereum/go-ethereum/cmd/utils.StartNode.func1.1 in goroutine 9729
github.com/ethereum/go-ethereum/cmd/utils/cmd.go:101 +0x78
```
The rootcause of the hang is caused by the extra 1 slot, which was
designed to make sure the routines in `AsyncFilter(...)` can be
finished. This PR fixes it by making sure the extra 1 shot can always be
resumed when node shutdown.
* core: refactor StateProcessor to accept ChainContext interface (#32739)
This pr implements https://github.com/ethereum/go-ethereum/issues/32733
to make StateProcessor more customisable.
## Compatibility notes
This introduces a breaking change to users using geth EVM as a library.
The `NewStateProcessor` function now takes one parameter which has the
chainConfig embedded instead of 2 parameters.
* p2p/enode: fix asyncfilter comment (#32823)
just finisher the sentence
Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
* trie: cleaner array concatenation (#32756)
It uses the slices.Concat and slices.Clone methods available now in Go.
* internal/ethapi: add timestamp to logs in eth_simulate (#32831)
Adds blockTimestamp to the logs in response of eth_simulateV1.
---------
Co-authored-by: Sina Mahmoodi <itz.s1na@gmail.com>
* build: faster gh actions workflow, no ubuntu on appveyor (#32829)
This PR does a few things:
- Sets the gh actions runner sizes for lint (s) and test (l) workflows
- Runs the tests on gh actions in parallel
- Skips fetching the spec tests when unnecessary (on windows in
appveyor)
- Removes ubuntu appveyor runner since it's essentially duplicate of the
gh action workflow now
The gh test seems to go down from ~35min to ~13min.
* cmd/devp2p/internal/ethtest: update to PoS-only test chain (#32850)
* core/rawdb: remove duplicated type storedReceiptRLP (#32820)
Co-authored-by: Felix Lange <fjl@twurst.com>
* eth/protocols/eth: use BlockChain interface in Handshake (#32847)
* cmd/devp2p/internal/ethtest: accept responses in any order (#32834)
In both `TestSimultaneousRequests` and `TestSameRequestID`, we send two
concurrent requests. The client under test is free to respond in either
order, so we need to handle responses both ways.
Also fixes an issue where some generated blob transactions didn't have
any blobs.
---------
Co-authored-by: Felix Lange <fjl@twurst.com>
* core/rawdb: correct misleading comments for state history accessors (#32783)
* eth/filters: terminate pending tx subscription on error (#32794)
Fixes issue #32793. When the pending tx subscription ends, the filter
is removed from `api.filters`, but it is not terminated. There is no other
way to terminate it, so the subscription will leak, and potentially block
the producer side.
* eth/filters: add `transactionReceipts` subscription (#32697)
- Introduce a new subscription kind `transactionReceipts` to allow clients to
receive transaction receipts over WebSocket as soon as they are available.
- Accept optional `transactionHashes` filter to subscribe to receipts for specific
transactions; an empty or omitted filter subscribes to all receipts.
- Preserve the same receipt format as returned by `eth_getTransactionReceipt`.
- Avoid additional HTTP polling, reducing RPC load and latency.
---------
Co-authored-by: Sina Mahmoodi <itz.s1na@gmail.com>
* core/txpool/legacypool: fix validTxMeter to count transactions (#32845)
invalidTxMeter was counting txs, while validTxMeter was counting
accounts. Better make the two comparable.
---------
Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
* eth/protocols/snap: optimize incHash (#32748)
* core/rawdb, triedb/pathdb: introduce trienode history (#32596)
It's a pull request based on the #32523 , implementing the structure of
trienode history.
* ethclient: add SubscribeTransactionReceipts (#32869)
Add `SubscribeTransactionReceipts` for ethclient. This is a complement
to https://github.com/ethereum/go-ethereum/pull/32697.
* node: fix error condition in gzipResponseWriter.init() (#32896)
* core/types: optimize MergeBloom by using bitutil (#32882)
```
goos: darwin
goarch: amd64
pkg: github.com/ethereum/go-ethereum/core/types
cpu: VirtualApple @ 2.50GHz
│ old.txt │ new.txt │
│ sec/op │ sec/op vs base │
CreateBloom/small-createbloom-10 1.676µ ± 4% 1.646µ ± 1% -1.76% (p=0.000 n=10)
CreateBloom/large-createbloom-10 164.8µ ± 3% 164.3µ ± 0% ~ (p=0.247 n=10)
CreateBloom/small-mergebloom-10 231.60n ± 0% 68.00n ± 0% -70.64% (p=0.000 n=10)
CreateBloom/large-mergebloom-10 21.803µ ± 3% 5.107µ ± 1% -76.58% (p=0.000 n=10)
geomean 6.111µ 3.113µ -49.06%
│ old.txt │ new.txt │
│ B/op │ B/op vs base │
CreateBloom/small-createbloom-10 112.0 ± 0% 112.0 ± 0% ~ (p=1.000 n=10) ¹
CreateBloom/large-createbloom-10 10.94Ki ± 0% 10.94Ki ± 0% ~ (p=0.474 n=10)
CreateBloom/small-mergebloom-10 0.000 ± 0% 0.000 ± 0% ~ (p=1.000 n=10) ¹
CreateBloom/large-mergebloom-10 0.000 ± 0% 0.000 ± 0% ~ (p=1.000 n=10) ¹
geomean ² +0.00% ²
¹ all samples are equal
² summaries must be >0 to compute geomean
│ old.txt │ new.txt │
│ allocs/op │ allocs/op vs base │
CreateBloom/small-createbloom-10 6.000 ± 0% 6.000 ± 0% ~ (p=1.000 n=10) ¹
CreateBloom/large-createbloom-10 600.0 ± 0% 600.0 ± 0% ~ (p=1.000 n=10) ¹
CreateBloom/small-mergebloom-10 0.000 ± 0% 0.000 ± 0% ~ (p=1.000 n=10) ¹
CreateBloom/large-mergebloom-10 0.000 ± 0% 0.000 ± 0% ~ (p=1.000 n=10) ¹
geomean ² +0.00% ²
¹ all samples are equal
² summaries must be >0 to compute geomean
```
* p2p: rm unused var seedMinTableTime (#32876)
* eth/filters: uninstall subscription in filter apis on error (#32894)
Fix https://github.com/ethereum/go-ethereum/issues/32893.
In the previous https://github.com/ethereum/go-ethereum/pull/32794, it
only handles the pending tx filter, while there are also head and log
filters. This PR applies the patch to all filter APIs and uses `defer`
to maintain code consistency.
* triedb, core/rawdb: implement the partial read in freezer (#32132)
This PR implements the partial read functionalities in the freezer, optimizing
the state history reader by resolving less data from freezer.
---------
Signed-off-by: jsvisa <delweng@gmail.com>
Co-authored-by: Gary Rong <garyrong0905@gmail.com>
* p2p/enode: optimize LogDist (#32887)
This speeds up LogDist by 75% using 64-bit operations instead
of byte-wise XOR.
---------
Co-authored-by: Felix Lange <fjl@twurst.com>
* p2p/enode: optimize DistCmp (#32888)
This speeds up DistCmp by 75% through using 64-bit operations instead of
byte-wise XOR.
* core/txpool/legacypool: move queue out of main txpool (#32270)
This PR move the queue out of the main transaction pool.
For now there should be no functional changes.
I see this as a first step to refactor the legacypool and make the queue
a fully separate concept from the main pending pool.
---------
Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
Co-authored-by: Csaba Kiraly <csaba.kiraly@gmail.com>
* cmd/workload: filter fuzzer test (#31613)
This PR adds a `filterfuzz` subcommand to the workload tester that
generates requests similarly to `filtergen` (though with a much smaller
block length limit) and also verifies the results by retrieving all
block receipts in the range and locally filtering out relevant results.
Unlike `filtergen` that operates on the finalized chain range only,
`filterfuzz` does check the head region, actually it seeds a new query
at every new chain head.
* p2p/discover: wait for bootstrap to be done (#32881)
This ensures the node is ready to accept other nodes into the
table before it is used in a test.
Closes #32863
* triedb/pathdb: catch int conversion overflow in 32-bit (#32899)
The limit check for `MaxUint32` is done after the cast to `int`. On 64
bits machines, that will work without a problem. On 32 bits machines,
that will always fail. The compiler catches it and refuses to build.
Note that this only fixes the compiler build. ~~If the limit is above
`MaxInt32` but strictly below `MaxUint32` then this will fail at runtime
and we have another issue.~~ I checked and this should not happen during
regular execution, although it might happen in tests.
* eth/catalyst: remove useless log on enabling Engine API (#32901)
* eth: do not warn on switching from snap sync to full sync (#32900)
This happens normally after a restart, so it is better to use Info level
here.
Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
* core/txpool/legacypool: fix pricedList updates (#32906)
This pr addresses a few issues brought by the #32270
- Add updates to pricedList after dropping transactions.
- Remove redundant deletions in queue.evictList, since
pool.removeTx(hash, true, true) already performs the removal.
- Prevent duplicate addresses during promotion when Reset is not nil.
* accounts/abi: check presence of payable fallback or receive before proceeding with transfer (#32374)
remove todo
* internal/ethapi: convert legacy blobtx proofs in sendRawTransaction (#32849)
This adds a temporary conversion path for blob transactions with legacy
proof sidecar. This feature will activate after Fusaka. We will phase
this out when the fork has sufficiently settled and client side
libraries have been upgraded to send the new proofs.
* core,miner,parms: DA footprint block limit (constant gas scalar) (#655)
* all: Make DA footprint gas scalar configurable (#675)
Co-authored-by: Sebastian Stammler <seb@oplabs.co>
* rpc: fix flaky test TestServerWebsocketReadLimit (#32889)
* eth/protocols/eth: reject message containing duplicated txs and drop peer (#32728)
Drop peer if sending the same transaction multiple times in a single message.
Fixes https://github.com/ethereum/go-ethereum/issues/32724
---------
Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
Co-authored-by: Gary Rong <garyrong0905@gmail.com>
Co-authored-by: Csaba Kiraly <csaba.kiraly@gmail.com>
* p2p/discover: remove hot-spin in table refresh trigger (#32912)
This fixes a regression introduced in #32518. In that PR, we removed the
slowdown logic that would throttle lookups when the table runs empty.
Said logic was originally added in #20389.
Usually it's fine, but there exist pathological cases, such as hive
tests, where the node can only discover one other node, so it can only
ever query that node and won't get any results. In cases like these, we
need to throttle the creation of lookups to avoid crazy CPU usage.
* version: release go-ethereum v1.16.5 stable
* version: begin v1.16.6 release cycle
* core/types: implement operator fee fix (Jovian) (#696)
* fix!: multiply operatorFeeScalar by 100 instead of dividing by 1e6
* apply comments
* apply comments
* remove dup IsOperatorFeeFix
---------
Co-authored-by: fakedev9999 <taehoon@succinct.xyz>
* cmd/geth: log current key in expandVerkle instead of keylist[0] (#32689)
Fix logging in the verkle dump path to report the actual key being
processed.
Previously, the loop always logged keylist[0], which misled users when
expanding multiple keys and made debugging harder. This change aligns
the
log with the key passed to root.Get, improving traceability and
diagnostics.
* consensus/beacon: Fix OP Legacy header verification dispatch (#697)
* ethclient: add support for eth_simulateV1 (#32856)
Adds ethclient support for the eth_simulateV1 RPC method, which allows
simulating transactions on top of a base state without making changes to
the blockchain.
---------
Co-authored-by: Sina Mahmoodi <itz.s1na@gmail.com>
* internal/ethapi: add eth_SendRawTransactionSync (#32830)
New RPC method eth_sendRawTransactionSync(rawTx, timeoutMs?) that
submits a signed tx and blocks until a receipt is available or a timeout
elapses.
Two CLI flags to tune server-side limits:
--rpc.txsync.defaulttimeout (default wait window)
--rpc.txsync.maxtimeout (upper bound; requests are clamped)
closes https://github.com/ethereum/go-ethereum/issues/32094
---------
Co-authored-by: aodhgan <gawnieg@gmail.com>
Co-authored-by: Sina Mahmoodi <itz.s1na@gmail.com>
* core/state: state copy bugfixes with Verkle Trees (#31696)
This change addresses critical issues in the state object duplication
process specific to Verkle trie implementations. Without these
modifications, updates to state objects fail to propagate correctly
through the trie structure after a statedb copy operation, leading to
inaccuracies in the computation of the state root hash.
---------
Co-authored-by: Guillaume Ballet <3272758+gballet@users.noreply.github.com>
* eth/ethconfig : fix eth generate config (#32929)
* eth, internal: add blob conversion for SendRawTransactionSync (#32930)
* all: Store DA footprint in blob gas used header field (#694)
* cmd/utils: use maximum uint64 value for receipt chain insertion (#32934)
* eth/fetcher: add metrics for tracking slow peers (#32964)
This PR introduces two new metrics to monitor slow peers
- One tracks the number of slow peers.
- The other measures the time it takes for those peers to become
"unfrozen"
These metrics help with monitoring and evaluating the need for future
optimization of the transaction fetcher and peer management, for example i
n peer scoring and prioritization.
Additionally, this PR moves the fetcher metrics into a separate file,
`eth/fetcher/metrics.go`.
* eth/fetcher: remove dangling peers from alternates (#32947)
This PR removes dangling peers in `alternates` map
In the current code, a dropped peer is removed from alternates for only
the specific transaction hash it was requesting. If that peer is listed
as an alternate for other transaction hashes, those entries still stick
around in alternates/announced even though that peer already got
dropped.
* triedb/pathdb: fix index out of range panic in decodeSingle (#32937)
Fixes TestCorruptedKeySection flaky test failure.
https://github.com/ethereum/go-ethereum/actions/runs/18600235182/job/53037084761?pr=32920
* core/types: prealloc map in HashDifference as in TxDifference (#32946)
* eth/filters: avoid rebuild the hash map multi times (#32965)
* core/vm: don't call SetCode after contract creation if initcode didn't return anything (#32916)
The code change is a noop here, and the tracing hook shouldn't be
invoked if the account code doesn't actually change.
* cmd/keeper: use the ziren keccak precompile (#32816)
Uses the go module's `replace` directive to delegate keccak computation
to precompiles.
This is still in draft because it needs more testing. Also, it relies on
a PR that I created, that hasn't been merged yet.
_Note that this PR doesn't implement the stateful keccak state
structure, and it reverts to the current behavior. This is a bit silly
since this is what is used in the tree root computation. The runtime
doesn't currently export the sponge. I will see if I can fix that in a
further PR, but it is going to take more time. In the meantime, this is
a useful first step_
* params: enable osaka on dev mode (#32917)
enables the osaka fork on dev mode
---------
Co-authored-by: Sina Mahmoodi <itz.s1na@gmail.com>
* core/txpool: Initialize journal writer for tx tracker (#32921)
Previously, the journal writer is nil until the first time rejournal
(default 1h), which means during this period, txs submitted to this node
are not written into journal file (transactions.rlp). If this node is
shutdown before the first time rejournal, then txs in pending or queue
will get lost.
Here, this PR initializes the journal writer soon after launch to solve
this issue.
---------
Co-authored-by: Gary Rong <garyrong0905@gmail.com>
* core/state: prevent SetCode hook if contract code is not changed (#32980)
This PR prevents the SetCode hook from being called when the contract
code
remains unchanged.
This situation can occur in the following cases:
- The deployed runtime code has zero length
- An EIP-7702 authorization attempt tries to unset a non-delegated
account
- An EIP-7702 authorization attempt tries to delegate to the same
account
* triedb/pathdb: make batch with pre-allocated size (#32914)
In this PR, the database batch for writing the history index data is
pre-allocated.
It's observed that database batch repeatedly grows the size of the
mega-batch,
causing significant memory allocation pressure. This approach can
effectively
mitigate the overhead.
* cmd/geth: add flag to set genesis (#32844)
This PR is an alternative to #32556.
Instead of trying to be smart and reuse `geth init`, we can introduce a
new flag `--genesis` that loads the `genesis.json` from file into the
`Genesis` object in the same path that the other network flags currently
work in.
Question: is something like `--genesis` enough to start deprecating
`geth init`?
--
```console
$ geth --datadir data --hoodi
..
INFO [10-06|22:37:11.202] - BPO2: @1762955544
..
$ geth --datadir data --genesis genesis.json
..
INFO [10-06|22:37:27.988] - BPO2: @1862955544
..
```
Pull the genesis [from the
specs](https://raw.githubusercontent.com/eth-clients/hoodi/refs/heads/main/metadata/genesis.json)
and modify one of the BPO timestamps to simulate a shadow fork.
---------
Co-authored-by: rjl493456442 <garyrong0905@gmail.com>
* core/types: remove unused `ErrInvalidTxType` var (#32989)
The var `ErrInvalidTxType` is never used in the code base.
* core/state: fix the flaky TestSizeTracker (#32993)
* cmd/devp2p: distinguish the jwt in devp2p and geth (#32972)
This PR fixes some docs for the devp2p suite and uses the CLI library's required value instead of manually checking if required flags are passed.
* all: update c-kzg-4844 to 2.1.5 (#702)
* superchain: update scr import to include worldchain-sepolia isthmus time (#704)
* p2p: silence on listener shutdown (#33001)
Co-authored-by: Felix Lange <fjl@twurst.com>
* cmd/utils: use IsHexAddress method (#32997)
Using the `IsHexAddress` method will result in no gaps in the
verification logic, making it simpler.
* crypto: implement ziren keccak state (#32996)
The #32816 was only using the keccak precompile for some minor task.
This PR implements a keccak state, which is what is used for hashing the
tree.
* rpc: fix a flaky test of the websocket (#33002)
Found in
https://github.com/ethereum/go-ethereum/actions/runs/17803828253/job/50611300621?pr=32585
```
--- FAIL: TestClientCancelWebsocket (0.33s)
panic: read tcp 127.0.0.1:36048->127.0.0.1:38643: read: connection reset by peer [recovered, repanicked]
goroutine 15 [running]:
testing.tRunner.func1.2({0x98dd20, 0xc0005b0100})
/opt/actions-runner/_work/_tool/go/1.25.1/x64/src/testing/testing.go:1872 +0x237
testing.tRunner.func1()
/opt/actions-runner/_work/_tool/go/1.25.1/x64/src/testing/testing.go:1875 +0x35b
panic({0x98dd20?, 0xc0005b0100?})
/opt/actions-runner/_work/_tool/go/1.25.1/x64/src/runtime/panic.go:783 +0x132
github.com/ethereum/go-ethereum/rpc.httpTestClient(0xc0001dc1c0?, {0x9d5e40, 0x2}, 0xc0002bc1c0)
/opt/actions-runner/_work/go-ethereum/go-ethereum/rpc/client_test.go:932 +0x2b1
github.com/ethereum/go-ethereum/rpc.testClientCancel({0x9d5e40, 0x2}, 0xc0001dc1c0)
/opt/actions-runner/_work/go-ethereum/go-ethereum/rpc/client_test.go:356 +0x15f
github.com/ethereum/go-ethereum/rpc.TestClientCancelWebsocket(0xc0001dc1c0?)
/opt/actions-runner/_work/go-ethereum/go-ethereum/rpc/client_test.go:319 +0x25
testing.tRunner(0xc0001dc1c0, 0xa07370)
/opt/actions-runner/_work/_tool/go/1.25.1/x64/src/testing/testing.go:1934 +0xea
created by testing.(*T).Run in goroutine 1
/opt/actions-runner/_work/_tool/go/1.25.1/x64/src/testing/testing.go:1997 +0x465
FAIL github.com/ethereum/go-ethereum/rpc 0.371s
```
In `testClientCancel` we wrap the server listener in `flakeyListener`,
which schedules an unconditional close of every accepted connection
after a random delay, if the random delay is zero then the timer fires
immediately, and then the http client paniced of connection reset by
peer.
Here we add a minimum 10ms to ensure the timeout won't fire immediately.
Signed-off-by: jsvisa <delweng@gmail.com>
* core: add gauge metrics + histograms for block gas used and blob gas used (#705)
* core: add gauge metric for block gas used and blob gas used
This can be used to track the DA footprint per block
* encapsulate OPStack additions into new file and function
* add histogram metrics for (blob)GasUsed
* update fork.yaml
* typos
* eth/tracers: fix crasher in TraceCall with BlockOverrides (#33015)
fix https://github.com/ethereum/go-ethereum/issues/33014
---------
Co-authored-by: lightclient <lightclient@protonmail.com>
* .gitea/workflows, build: add release build for keeper (#32632)
* build: fix keeper build (#33018)
At the time keeper support was added into ci.go, we were using a go.work
file to make ./cmd/keeper accessible from within the main go-ethereum
module. The workspace file has since been removed, so we need to build
keeper from within its own module instead.
* superchain: update scr import to include jovian activation timestamp (#707)
* core/rawdb, triedb/pathdb: re-structure the trienode history header (#32907)
In this PR, several changes have been made:
(a) restructure the trienode history header section
Previously, the offsets of the key and value sections were recorded before
encoding data into these sections. As a result, these offsets referred to the
start position of each chunk rather than the end position.
This caused an issue where the end position of the last chunk was
unknown, making it incompatible with the freezer partial-read APIs.
With this update, all offsets now refer to the end position, and the
start position of the first chunk is always 0.
(b) Enable partial freezer read for trienode data retrieval
The partial freezer read feature is now utilized in trienode data
retrieval, improving efficiency.
* rpc: remove unused vars (#33012)
* core/state: improve accessList copy (#33024)
* core: don't modify the shared chainId between tests (#33020)
* core/types: optimize modernSigner.Equal (#32971)
Equal is called every time the transaction sender is accessed,
even when the sender is cached, so it is worth optimizing.
---------
Co-authored-by: Felix Lange <fjl@twurst.com>
* Add new precompile limits for Jovian (#709)
This introduces more realistic limits on accelerated precompiles for the Jovian hard fork.
* core: refine condition for using legacy chain freezer directory (#33032)
* internal/jsre: pass correct args to setTimeout/setInterval callbacks (#32936)
## Description
- Summary: Correct the JS timer callback argument forwarding to match
standard JS semantics.
- What changed: In `internal/jsre/jsre.go`, the callback is now invoked
with only the arguments after the callback and delay.
- Why: Previously, the callback received the function and delay as
parameters, causing unexpected behavior and logic bugs for consumers.
* .github: add 32-bit CI targets (#32911)
This adds two new CI targets. One is for building all supported keeper
executables, the other is for running unit tests on 32-bit Linux.
---------
Co-authored-by: Felix Lange <fjl@twurst.com>
* superchain: Update for new Jovian timestamps (#712)
* core/types: Populate Jovian receipt fields (#710)
* core/types: Move receipt tests OP diff to separate file
* core/types: Populate Jovian receipt fields
* accounts/abi/bind/v2: fix error assertion in test (#33041)
* p2p: cleanup v4 if v5 failed (#33005)
Clean the previous resource (v4) if the latter (v5) failed.
* common: simplify FileExist helper (#32969)
* eth/downloader: fix incorrect waitgroup in test `XTestDelivery` (#33047)
* eth/tracers: fix prestateTracer for EIP-6780 SELFDESTRUCT (#33050)
fix https://github.com/ethereum/go-ethereum/issues/33049
* common: fix duration comparison in PrettyAge (#33064)
This pull request updates `PrettyAge.String` so that the age formatter
now treats exact unit boundaries (like a full day or week) as that unit
instead of spilling into smaller components, keeping duration output
aligned with human expectations.
* core/rawdb: fix db inspector by supporting trienode history (#33087)
* params: set osaka and BPO1 & BPO2 mainnet dates (#33063)
Sets the fusaka, bpo1, bpo2 timestamps for mainnet
see: https://notes.ethereum.org/@bbusa/fusaka-bpo-timeline
* version: release go-ethereum v1.16.6
* version: begin v1.16.7 release cycle
* core/txpool/blobpool: migrate billy to new slot size (#31966)
Implements a migration path for the blobpool slotter
---------
Co-authored-by: lightclient <lightclient@protonmail.com>
Co-authored-by: lightclient <14004106+lightclient@users.noreply.github.com>
Co-authored-by: Gary Rong <garyrong0905@gmail.com>
* params: set osaka and BPO1 & BPO2 mainnet dates (#33063)
Sets the fusaka, bpo1, bpo2 timestamps for mainnet
see: https://notes.ethereum.org/@bbusa/fusaka-bpo-timeline
* superchain: update for new Jovian timestamps (#716)
* go.mod: update to c-kzg v2.1.5 (#33093)
We unfortunately missed this update for the Geth v1.16.6 release, but it is critical.
* version: release go-ethereum v1.16.7 stable
* triedb/pathdb: sync ancient store before journal (#32557) (#718)
This pull request addresses the corrupted path database with log
indicating:
`history head truncation out of range, tail: 122557, head: 212208,
target: 212557`
This is a rare edge case where the in-memory layers, including the write
buffer
in the disk layer, are fully persisted (e.g., written to file), but the
state history
freezer is not properly closed (e.g., Geth is terminated after
journaling but
before freezer.Close). In this situation, the recent state history
writes will be
truncated on the next startup, while the in-memory layers resolve
correctly.
As a result, the state history falls behind the disk layer (including
the write buffer).
In this pull request, the state history freezer is always synced before
journal,
ensuring the state history writes are always persisted before the
others.
Edit:
It's confirmed that devops team has 10s container termination setting.
It
explains why Geth didn't finish the entire termination without state
history
being closed.
https://github.com/ethpandaops/fusaka-devnets/pull/63/files
Co-authored-by: rjl493456442 <garyrong0905@gmail.com>
* ci: add GitHub Actions workflow to build, attest and sign op-geth docker image (#720)
Signed-off-by: falcorocks <14293929+falcorocks@users.noreply.github.com>
* eth, cmd: add RollupNetrestrictTxPoolGossipFlag and RollupTxPoolTrustedPeersOnlyFlag (#706)
* eth, cmd: add RollupNetrestrictTxPoolGossipFlag
* fork.yaml: description of fork changes for tx gossip netrestrict
* eth: h.syncTransactions behind check for netrestrict for txpool gossip
* eth, eth/protocols: propagate netrestrict to Peer and limit incoming/outgoing message.
* eth, cmd: add RollupNetrestrictTxPoolGossipFlag PoC using `NilPool` (#713)
* Make peer struct not aware of ip net restrict
* Propagate Peer ip info to txpool
* fix
* cleanup
* eth/handler_test: unit test for TxGossipNetRestrict and TxPool() method
* eth: add short-circuit for incoming messages
* eth: rely on AcceptTxs
* eth: all tx propagating by default
* consistent OP Stack additions comment
* eth, cmd: restrict mempool only to trusted peers (#719)
* address comments
* eth/handler_test: modify unit test to check for trusted conn too
* add txGossipAllowed
* correct comments
* update fork.yaml
---------
Co-authored-by: Changwan Park <pcw109550@gmail.com>
* downloader: skip blobGasUsed check for optimism chains on Jovian (#723)
* Add IsOptimismJovian check to validate BlobGasUsed header field
Allow nonzero BlobGasUsed for Jovian headers on Optimism chains while
validating blob gas usage for other chains as before.
* tweak comment
* space
* superchain: update for new Jovian timestamps (#724)
* jovian: remove feature toggles (#703)
* jovian: remove feature toggles
the scope is now locked
* Rename MinBaseFee extraData identifiers to Jovian
* Fix expected error message in Optimism test
* Add test and comments for new Jovian precompile input size limits (#731)
* dockerfile: pin to alpine 3.22 (#737)
* dockerfile: pin to alpine 3.22
* pin ca-certificates version
* dockerfile: pin to golang:1.24-alpine@sha256:12c199
* dockerfile: pin to golang:1.24-alpine3.22
* Update superchain registry (#736)
* params: Set JovianTime to zero in OptimismTestConfig (#742)
* params: Set JovianTime to zero and remove Osaka in OptimismTestConfig
* Unset OsakaTime in OptimismTestConfig
* Fix `eth_simulateV1` after Jovian fork (#732)
* fix(eth_simulatev1): Create synthetic Jovian Deposit TX, to not fail in the CalcDAFootprint() function.
* fix(eth_simulatev1): Return block without synthetic Jovian deposit tx.
* fix(eth_simulatev1): Extract JovianDepositTx() from tests, activate Jovian fork based on parent.Time.
* Inject L1 attributes tx in Optimism simulation
* Unexport JovianDepositTx and move to tests
Remove exported JovianDepositTx from core/types and add a local
jovianDepositTx helper in miner tests. Also remove the unused
encoding/binary import from the core/types file and add it to the test
files where needed.
* Pass nil options to sim.execute in test
* Pass nil as second argument in simulation test
* Embed L1 attributes tx in simulator
* Handle Optimism genesis without L1 tx
* Rename finalTxes to prependedTxes
* Remove nil argument from sim.execute calls
* Update internal/ethapi/api.go
Co-authored-by: kustrun <9192608+kustrun@users.noreply.github.com>
---------
Co-authored-by: geoknee <georgeknee@googlemail.com>
* Run go run build/ci.go check_generate (#741)
* Run go run build/ci.go check_generate
Unfortunately, the check_generate script doesn't consider eth/ethconfig,
so ci can't catch this.
* Fix check_generate script and add it to ci
* consensus/misc/eip1559: Improve Holocene EIP-1559 params checks (#743)
* version: begin v1.16.8 release cycle
* core/txpool: drop peers on invalid KZG proofs
Co-authored-by: Gary Rong <garyrong0905@gmail.com>
Co-authored-by: MariusVanDerWijden <m.vanderwijden@live.de>:
* crypto/ecies: use aes blocksize
Co-authored-by: Gary Rong <garyrong0905@gmail.com>
* version: release go-ethereum v1.16.8 stable
* all: reduce diff to upstream (#748)
* miner: fix flaky TestInteropTxRejectedWithFailsafe test (#752)
The test was flaky due to a race condition in transaction pool handling.
When calling txpool.Add() with sync=false, the transaction is added to
the pool's queue but promotion to the "pending" pool happens
asynchronously in a background goroutine.
The test's Has() check passed because it checks all transactions (both
queued and pending), but generateWork() only retrieves transactions from
the "pending" pool via Pending(). If the background promotion hadn't
completed yet, the transaction wouldn't be processed.
Fix by changing sync=false to sync=true, ensuring the Add() call waits
for the transaction to be promoted to the pending pool before returning.
* miner: fix flaky TestDAFilters tests (#753)
Same root cause as d78d84f51: txpool.Add() with sync=false returns
before transactions are promoted to the pending pool, causing a race
with buildPayload() which only retrieves pending transactions.
Fix by changing sync=false to sync=true.
* Bump fork.yaml ref to v1.16.8 (#760)
* sync-superchain: use yq instead of dasel (#762)
* sync-superchain: use yq instead of dasel
Replaces dasel with yq for reading TOML files. yq has more stable syntax
across versions and is more commonly used in the ecosystem.
* ci: update to use yq instead of dasel
Updates CircleCI config to install yq instead of dasel for the
check-sr-diff job.
* ci: pin yq to v4.44.1
* crypto/ecies: fix ECIES invalid-curve handling (#33669)
Fix ECIES invalid-curve handling in RLPx handshake (reject invalid
ephemeral pubkeys early)
- Add curve validation in crypto/ecies.GenerateShared to reject invalid
public keys before ECDH.
- Update RLPx PoC test to assert invalid curve points fail with
ErrInvalidPublicKey.
Motivation / Context
RLPx handshake uses ECIES decryption on unauthenticated network input.
Prior to this change, an invalid-curve ephemeral public key would
proceed into ECDH and only fail at MAC verification, returning
ErrInvalidMessage. This allows an oracle on decrypt success/failure and
leaves the code path vulnerable to invalid…
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR changes the DA footprint implementation to store the DA footprint in the
blobGasUsedheader field instead of max'd in thegasUsedfield.A nice side effect is that the DA footprint can now be updated in the beacon consensus
FinalizeAndAssemblefunction, which is used by chain makers and monorepo block building code.Tests
Existing DA footprint miner test got updated.
Additional context
Monorepo PR: ethereum-optimism/optimism#17861
Metadata
Fixes #691