Commit Graph

15758 Commits

Author SHA1 Message Date
islishude 7888f922e7 gofmt 2025-03-02 09:56:40 +08:00
islishude 0b28df8e7b all: replace slice manipulation with slices package for improved readability 2025-03-01 23:09:54 +08:00
Shude Li 31c972febf
ethclient: add BlobBaseFee method (#31290) 2025-03-01 14:11:51 +01:00
jwasinger d2bbde2f2d
eth: check blob transaction validity on the peer goroutine when received (#31219)
This ensures that if we receive a blob transaction announcement where we cannot
link the tx to the sidecar commitments, we will drop the sending peer. This check
is added in the protocol handler for the PooledTransactions message.

Tests for this have also been added in the cross-client "eth" protocol test suite.

---------

Co-authored-by: Felix Lange <fjl@twurst.com>
2025-03-01 14:10:38 +01:00
Kuwon Sebastian Na ebc3232b49
eth: do not add failed tx to localTxTracker (#31202)
In transaction-sending APIs such as `eth_sendRawTransaction`, a submitted transaction 
failing the configured txpool validation rules (i.e. fee too low) would cause an error to be
returned, even though the transaction was successfully added into the locals tracker.
Once added there, the transaction may even be included into the chain at a later time,
when fee market conditions change.

This change improves on this by performing the validation in the locals tracker, basically
skipping some of the validation rules for local transactions. We still try to add the tx to the
main pool immediately, but an error will only be returned for transactions which are 
fundamentally invalid.

---------

Co-authored-by: Gary Rong <garyrong0905@gmail.com>
2025-03-01 13:58:57 +01:00
Darioush Jalali 4038c59845
eth: remove EventMux accessors (#30017)
Hi, it seems these methods in the `backend.go` and `api_backend.go`
files are not used that expose the eventMux, but that is not needed.
2025-02-28 20:07:21 +08:00
Matthieu Vachon e1e326e069
core/tracing: stringer for gas and nonce change reasons (#31234) 2025-02-28 12:53:56 +01:00
Felix Lange 6c286beb39
build/deb: add step for new Go bootstrap to debian rules (#31283)
Next attempt at fixing the build on launchpad.net
2025-02-27 17:52:22 +01:00
Martin HS 767c202e47
all: drop x/exp direct dependency (#30558)
This is a not-particularly-important "cleanliness" PR. It removes the
last remnants of the `x/exp` package, where we used the `maps.Keys`
function.

The original returned the keys in a slice, but when it became 'native'
the signature changed to return an iterator, so the new idiom is
`slices.Collect(maps.Keys(theMap))`, unless of course the raw iterator
can be used instead.

In some cases, where we previously collect into slice and then sort, we
can now instead do `slices.SortXX` on the iterator instead, making the
code a bit more concise.

This PR might be _slighly_ less optimal, because the original `x/exp`
implementation allocated the slice at the correct size off the bat,
which I suppose the new code won't.

Putting it up for discussion.

---------

Co-authored-by: Felix Lange <fjl@twurst.com>
2025-02-27 15:53:52 +01:00
Shude Li f005d95b55
build: simplify go mod tidy check (#31266)
This changes the go mod tidy check to use the go mod tidy -diff command,
removing the custom diffing for go.mod. The check for go.mod/go.sum is now
performed in the check_generate action.

Also included is a change where check_generate and check_baddeps will now
run on the GitHub Actions lint step.

---------

Co-authored-by: Felix Lange <fjl@twurst.com>
2025-02-27 15:52:00 +01:00
Felix Lange fa16d497bc
build: update PPA Go bootstrap version to 1.23 (#31282)
This is for fixing the PPA build, which has been failing since the
update to Go 1.24. In Go 1.24, the required Go version for bootstrapping
was updated to 1.22. In general, they are following through with always
depending on the Go version two releases ago for bootstrapping.

Since we still support Ubuntu Xenial (16.04) until its EOL date of
04/2026, and Xenial only has golang 1.10 as a package, we now need to
build Go a total of four times to get the most recent version. I'm adding a step
for Go 1.23 here. This should last us until Go 1.25, which should be out around
04/2026, and we can hopefully drop the first bootstrapping step at that time.
2025-02-27 12:07:36 +01:00
buddho fc4dd183e9
core/txpool: fix error logs flood caused by removeAuthorities (#31249)
when remove an non-SetCodeTxType transaction, error logs flood
```
t=2025-02-25T03:11:06+0000 lvl=error msg="Authority with untracked tx" addr=0xD5bf9221fCB1C31Cd1EE477a60c148d40dD63DC1 hash=0x626fdf205a5b1619deb2f9e51fed567353f80acbd522265b455daa0821c571d9
```

in this PR, only try to removeAuthorities for txs with SetCodeTxType

in addition, the performance of removeAuthorities improved a lot,
because no need range all `t.auths` now.

---------

Co-authored-by: lightclient <lightclient@protonmail.com>
2025-02-27 17:08:33 +08:00
lightclient 1d2043e806
eth/gasprice: sanity check ratio values (#31270)
Follow on to #31246. Adds a sanity check in the test to make sure the
ratio value never goes over 1. Would have avoided the issue in #31245.
2025-02-27 15:40:35 +08:00
Felföldi Zsolt 939a804146
cmd/workload: RPC workload tests for filters and history (#31189)
Co-authored-by: Felix Lange <fjl@twurst.com>
Co-authored-by: Sina Mahmoodi <itz.s1na@gmail.com>
2025-02-27 00:07:14 +01:00
James 2585776aab
eth/gasprice: fix eth_feeHistory blobGasRatio (#31246)
This change divides BlobGasUsed by MaxBlobGasPerBlock instead of
MaxBlobsPerBlock. Dividing by MaxBlobsPerBlock
meant the blobGasUsedRatio was an incorrect large number. This bug was
introduced by a typo
[here](e6f3ce7b16 (diff-3357b2399699d7cf954c543cbfb02ff442eb24491e55f5e813e3cc85829b3e8dR110))

Fixes https://github.com/ethereum/go-ethereum/issues/31245
2025-02-26 11:24:14 -07:00
rjl493456442 c7caca4564
build: filter out .git folder for go generate check (#31265)
Fixes lint issue

    >>> /home/appveyor/.gvm/gos/go1.24.0/bin/go generate ./...
    ci.go:404: File changed: .git/index
    ci.go:407: One or more generated files were updated by running 'go generate ./...'
    exit status 1
2025-02-26 11:49:02 +01:00
Felix Lange f485e213b6 version: begin v1.15.4 release cycle 2025-02-25 16:20:50 +01:00
Felix Lange 612c9e0f4a version: release go-ethereum v1.15.3 stable 2025-02-25 16:18:34 +01:00
Shude Li 756310fa43
eth/protocols/eth: fix loading "eth" ENR key in dial filter (#31251)
This fixes an issue where dial candidates from discv5 would be ignored
because the "eth" ENR entry was not loaded correctly.
2025-02-25 13:40:57 +01:00
jwasinger f6883431c2
ethclient/simulated: add goroutine leak test (#31033)
Adds a basic sanity test case to catch any go-routines leaked from
instantiation/closing of a simulated backend.
2025-02-25 12:21:35 +01:00
Marius van der Wijden 7d8aca95d2
params: add deposit contract addresses (#31247)
We forgot to add the deposit contract address for holesky, causing
deposits to not be flagged correctly

---------

Co-authored-by: lightclient <14004106+lightclient@users.noreply.github.com>
2025-02-25 00:42:00 +01:00
rjl493456442 9211a0e3ec
core/txpool: move setcode tx validation into legacyPool (#31209)
In this PR, several improvements have been made:

Authorization-related validations have been moved to legacyPool. 
Previously, these checks were part of the standard validation procedure,
which applies common validations across different pools. Since these 
checks are specific to SetCode transactions, relocating them to
legacyPool
is a more reasonable choice.

Additionally, authorization conflict checks are now performed regardless
of whether the transaction is a replacement or not.

---------

Co-authored-by: lightclient <lightclient@protonmail.com>
2025-02-24 14:17:21 -07:00
Marius van der Wijden fbe0005070
crypto: add comment to FromECDSAPub (#31241)
closes https://github.com/ethereum/go-ethereum/issues/26240
2025-02-24 12:23:25 +01:00
Marius van der Wijden a0e6381c48
go.mod: update cloudflare-go (#31240)
Updates cloudflare-go from v0.79.0 to v0.114.0 which also gets rid of a
dependency to `github.com/hashicorp/go-retryablehttp` which had a
security flaw.

Diff:
https://github.com/cloudflare/cloudflare-go/compare/v0.79.0...v0.114.0

I did a quick sanity check on the diff on all methods that we use and
went through the release notes, there was nothing related to how we use
it afaict
2025-02-24 10:31:33 +01:00
Felix Lange 9e6f924671
eth: report error from setupDiscovery at startup (#31233)
I ran into this while trying to debug a discv5 thing. I tried to disable
DNS discovery using `--discovery.dns=false`, which doesn't work.
Annoyingly, geth started anyway and discarded the error silently. I
eventually found my mistake, but it took way longer than it should have.

Also including a small change to the error message for invalid DNS URLs
here. The user actually needs to see the URL to make sense of the error.
2025-02-23 17:38:32 +01:00
levisyin d103f179b9
build: replace `tenv` linter with `usetesting` (#31172) 2025-02-21 13:36:18 +01:00
Maximilian Hubert cb9653d253
cmd/clef: improve documentation in readme (#31218)
Fixed broken or outdated links and improved documentation formatting to
ensure consistency and correct references.

---------

Co-authored-by: Sina M <1591639+s1na@users.noreply.github.com>
2025-02-21 11:45:02 +01:00
Sina M 8a14362bf7
internal/ethapi: fix prev hashes in eth_simulate (#31122)
Shout-out to @Gabriel-Trintinalia for discovering this issue. The gist
of it as follows:

When processing a block, we should provide the parent block as well as
the last 256 block hashes. Some of these parents data (specifically the
hash) was incorrect because even though during the processing of the
parent block we have updated the header, that header was not updating
the TransactionsRoot and ReceiptsRoot fields (types.NewBlock makes a new
copy of the header and changes it only on that instance).

---------

Co-authored-by: lightclient <lightclient@protonmail.com>
2025-02-21 09:52:55 +01:00
jwasinger 5552ada486
signer/core: fix encoding of `bytes` nested within array (#31049)
Fixes an incorrect encoding of recursive bytes types.
closes https://github.com/ethereum/go-ethereum/issues/30979
2025-02-21 09:48:24 +01:00
rrhlrmrr 53e8e1fdf2
core/types: remove unneeded todo marker (#31179) 2025-02-21 13:45:29 +08:00
Felix Lange 2a81bbaa4f
p2p/nat: remove test with default servers (#31225)
The test occasionally fails when network connectivity is bad or if it
hits the wrong server. We usually don't add tests with external network
dependency so I'm removing them.

Fixes #31220
2025-02-21 10:42:54 +08:00
Martin HS 301a868d28
oss-fuzz: remove deprecated targets (#31224)
Fixes https://github.com/ethereum/go-ethereum/issues/31223

(sorry, I thought the fork fork would be created on my repo, not
upstream, when I used the GH editor)
2025-02-20 18:46:25 +01:00
Delweng dcc0b3704d
eth/tracers: refactor block context in test runner (#29450)
This commit contains a minor refactoring of the block context
used within the test runners.

---------

Signed-off-by: jsvisa <delweng@gmail.com>
2025-02-20 15:04:35 +01:00
nethoxa b1f88ef9bd
internal/ethapi: handle prague system calls in eth_simulate (#31176)
eth_simulate was not processing prague system calls for history contract and EL
requests resulting in inaccurate stateRoot and requestsRoot fields in the block.
2025-02-20 14:30:55 +01:00
Marius van der Wijden c8781be762
core/txpool/legacypool: add setCodeTx reorg test (#31206)
This PR adds a test that makes sure that a node can send multiple
transactions again once a authorization is removed
2025-02-20 20:11:48 +08:00
Sina M 67cd4cd5a1
.github: downgrade go for lint step (#31217) 2025-02-20 10:27:13 +01:00
Felix Lange aac621987e
core/asm: delete assembler/disassembler (#31211)
I maintain an improved version of the go-ethereum assembler at
https://github.com/fjl/geas. We don't really use core/asm in our tests,
and it has some bugs that prevent it from being useful, so I'm removing
the package.
2025-02-19 06:57:08 -07:00
levisyin 07d7fe2b33
build: upgrade -dlgo version to Go 1.24.0 (#31159)
Co-authored-by: Felix Lange <fjl@twurst.com>
2025-02-19 11:21:22 +01:00
Matthieu Vachon dab746b3ef
eth/catalyst: support earlier forks in SimulatedBeacon (#31084)
Co-authored-by: Marius van der Wijden <m.vanderwijden@live.de>
2025-02-18 21:08:43 +01:00
Marius van der Wijden ef00a6e9a2
params: add osaka blob schedule (#31174)
Prevents crashes when running execution spec tests for osaka
2025-02-18 15:03:48 +01:00
rjl493456442 32c6aa8a1a
core/vm: clean up EVM environmental structure (#31061)
This PR does a few things including:

- Remove `ContractRef` interface
- Remove `vm.AccountRef` which implements `ContractRef` interface
- Maintain the `jumpDests` struct in EVM for sharing between call frames
- Simplify the delegateCall context initialization
2025-02-18 21:53:33 +08:00
EdisonSR 7332a1bc0a
ethclient: add comment describing block number tags (#30984)
Adds a comment on how to use rpc.*BlockNumber and the explanation of the block number tags

---------

Co-authored-by: Gary Rong <garyrong0905@gmail.com>
2025-02-18 11:15:36 +01:00
piersy 68d477670c
utils: clarify description for history.state flag (#31164) 2025-02-18 13:50:19 +08:00
Marius van der Wijden 3adfa1fbeb
trie: do not expect ordering in stacktrie during fuzzing (#31170)
This PR removes the assumption of the stacktrie and trie to have the
same ordering. This was hit by the fuzzers on oss-fuzz

---------

Co-authored-by: Gary Rong <garyrong0905@gmail.com>
2025-02-18 10:48:42 +08:00
Felix Lange aec1964410 version: begin v1.15.3 release cycle 2025-02-17 12:01:20 +01:00
Felix Lange c8c62dafc7 version: release go-ethereum v1.15.2 stable 2025-02-17 11:59:48 +01:00
Felix Lange d37a0b8cd0
eth/protocols/eth: add discovery iterator to protocol (#31185)
We somehow forgot to add this in #30302, so discv5 and DNS have actually
been disabled since then.

Fixes #31168
2025-02-17 10:12:03 +01:00
Felix Lange c113e3b5b1
p2p: fix marshaling of NAT in TOML (#31192)
This fixes an issue where a nat.Interface unmarshaled from the TOML
config file could not be re-marshaled to TOML correctly.

Fixes #31183
2025-02-17 09:47:12 +01:00
Felix Lange e5bc789185
consensus/beacon: fix isPostMerge for mainnet (#31191)
This fixes a regression introduced in #31153 where we didn't consider
mainnet to be in PoS, causing #31190.
The problem is, `params.MainnetChainConfig` does not have a defined
`MergeNetsplitBlock`, so it isn't considered to be in PoS in
`CalcDifficulty`.
2025-02-17 07:30:06 +01:00
minh-bq 68de26e346
core/types: create block's bloom by merging receipts' bloom (#31129)
Currently, when calculating block's bloom, we loop through all the
receipt logs to calculate the hash value. However, normally, after going
through applyTransaction, the receipt's bloom is already calculated
based on the receipt log, so the block's bloom can be calculated by just
ORing these receipt's blooms.
```
goos: darwin
goarch: arm64
pkg: github.com/ethereum/go-ethereum/core/types
cpu: Apple M1 Pro
BenchmarkCreateBloom
BenchmarkCreateBloom/small
BenchmarkCreateBloom/small-10             810922              1481 ns/op             104 B/op          5 allocs/op
BenchmarkCreateBloom/large
BenchmarkCreateBloom/large-10               8173            143764 ns/op            9614 B/op        401 allocs/op
BenchmarkCreateBloom/small-mergebloom
BenchmarkCreateBloom/small-mergebloom-10                 5178918               232.0 ns/op             0 B/op          0 allocs/op
BenchmarkCreateBloom/large-mergebloom
BenchmarkCreateBloom/large-mergebloom-10                   54110             22207 ns/op               0 B/op          0 allocs/op
```

---------

Co-authored-by: Gary Rong <garyrong0905@gmail.com>
Co-authored-by: Zsolt Felfoldi <zsfelfoldi@gmail.com>
2025-02-13 18:05:58 +01:00