Commit graph

14354 commits

Author SHA1 Message Date
Péter Szilágyi
c3b5e6ad26 core/txpool/blobpool: fix a merge conflict from a package rename (#27790) 2023-11-10 11:09:46 -06:00
Felix Lange
4121121152 core/types: add 4844 data gas fields in Receipt (#27743)
* core/types: add data gas fields in Receipt

* core/types: use BlobGas method of tx

* core: fix test

* core/types: fix receipt tests, add data gas used field test

---------

Co-authored-by: Péter Szilágyi <peterke@gmail.com>
2023-11-10 11:09:46 -06:00
Péter Szilágyi
16fd9c786e core/txpool/blobpool: 4844 blob transaction pool (#26940)
* core/blobpool: implement txpool for blob txs

* core/txpool: track address reservations to notice any weird bugs

* core/txpool/blobpool: add support for in-memory operation for tests

* core/txpool/blobpool: fix heap updating after SetGasTip if account is evicted

* core/txpool/blobpool: fix eviction order if cheap leading txs are included

* core/txpool/blobpool: add note as to why the eviction fields are not inited in reinject

* go.mod: pull in inmem billy form upstream

* core/txpool/blobpool: fix review commens

* core/txpool/blobpool: make heap and heap test deterministic

* core/txpool/blobpool: luv u linter

* core/txpool: limit blob transactions to 16 per account

* core/txpool/blobpool: fix rebase errors

* core/txpool/blobpool: luv you linter

* go.mod: revert some strange crypto package dep updates
2023-11-10 11:09:46 -06:00
Darioush Jalali
0c56bf33c0 core/types: deepcopy ExcessDataGas, DataGasUsed (#27767) 2023-11-10 11:09:46 -06:00
Justin Traglia
618fcc660d crypto/kzg4844: do lazy init in all ckzg funcs (#27679)
* crypto/kzg4844: remove unnecessary init call & fix typo

* Fix kzg4844 tests/benchmarks

* Make init lazy & revert changes to tests
2023-11-10 11:09:46 -06:00
ucwong
f1fe86f5e3 cmd/devp2p: atomic types used (#27755) 2023-11-10 11:09:46 -06:00
ucwong
a5eb124660 cmd/geth: atomic types used (#27756) 2023-11-10 11:09:46 -06:00
rjl493456442
108b77bca6 all: expose block number information to statedb (#27753)
* core/state: clean up

* all: add block number infomration to statedb

* core, trie: rename blockNumber to block
2023-11-10 11:09:46 -06:00
Marius van der Wijden
d5672db15a ethclient/gethclient: gofmt -s (#27762) 2023-11-10 11:09:46 -06:00
Pierre Grimaud
04fcbcb8e6 cmd/evm/testdata: fix typos in docs (#27742) 2023-11-10 11:09:46 -06:00
Felix Lange
3a8ffd5d54 beacon/engine, eth/catalyst: EIP-4844 updates for the engine API (#27736)
This is a spin-out from the EIP-4844 devnet branch, containing just the Engine API modifications
and nothing else. The newPayloadV3 endpoint won't really work in this version, but we need the
data structures for testing so I'd like to get this in early.

Co-authored-by: Marius van der Wijden <m.vanderwijden@live.de>
2023-11-10 11:09:46 -06:00
Felföldi Zsolt
d84ccdb74e les: remove obsolete code related to PoW header syncing (#27737)
This change removes PoW header syncing related code from LES and also deletes 
duplicated packages les/catalyst, les/downloader and les/fetcher. These package copies
were created because people wanted to make changes in their eth/ counterparts, but weren't
able to adapt LES code to the API changes.
2023-11-10 11:09:46 -06:00
jwasinger
876a66cdfd core/state, core/vm: implement EIP 6780 (#27189)
EIP-6780: SELFDESTRUCT only in same transaction

>     SELFDESTRUCT will recover all funds to the caller but not delete the account, except when called in the same transaction as creation

---------

Co-authored-by: Martin Holst Swende <martin@swende.se>
2023-11-10 11:09:46 -06:00
Martin Holst Swende
1481df630b core, tests: EIP-4844 transaction processing logic (#27721)
This updates the reference tests to the latest version and also adds logic
to process EIP-4844 blob transactions into the state transition. We are now
passing most Cancun fork tests.

Co-authored-by: Marius van der Wijden <m.vanderwijden@live.de>
Co-authored-by: Felix Lange <fjl@twurst.com>
2023-11-10 11:09:46 -06:00
ucwong
31689cb6ad core/vm: use types.EmptyCodeHash (#27729) 2023-11-10 11:09:46 -06:00
jwasinger
50cb341607 core: replace instances of 'suicide' with 'selfdestruct' to improve code consistency. (#27716)
---------

Co-authored-by: Martin Holst Swende <martin@swende.se>
Co-authored-by: lightclient <14004106+lightclient@users.noreply.github.com>
2023-11-10 11:09:46 -06:00
Yurie
93400108c2 accounts/abi/bind/backends: fix goroutine leak in unit test (#27705) 2023-11-10 11:09:46 -06:00
Ömer Faruk Irmak
041d64c8a0 metrics: NilResettingTimer.Time should execute the timed function (#27724) 2023-11-10 11:09:46 -06:00
Delweng
098c798171 cmd/geth: use automaxprocs to apply cpu quota correctly (#27506)
It is usually best to set GOMAXPROCS to the number of available CPU cores. However, setting
it like that does not work well when the process is quota-limited to a certain number of CPUs.
The automaxprocs library configures GOMAXPROCS, taking such limits into account.
2023-11-10 11:09:46 -06:00
Ömer Faruk Irmak
5ad2a03ca1 metrics: NilTimer should still run the function to be timed (#27723) 2023-11-10 11:09:46 -06:00
Seungbae Yu
da8b8ed315 cmd/bootnode, p2p: support for alternate mapped ports (#26359)
This changes the port mapping procedure such that, when the requested port is unavailable
an alternative port suggested by the router is used instead.

We now also repeatedly request the external IP from the router in order to catch any IP changes.

Co-authored-by: Felix Lange <fjl@twurst.com>
2023-11-10 11:09:46 -06:00
ucwong
ddc0a3aedc core/blockchain: fast to snap in comments (#27722) 2023-11-10 11:09:46 -06:00
ucwong
e248e46964 go.sum: go mod tidy (#27717) 2023-11-10 11:09:46 -06:00
Ryan Schneider
99ee35ca1c eth/tracers/native: panic on memory read in prestateTracer (#27691)
Co-authored-by: Sina Mahmoodi <itz.s1na@gmail.com>
2023-11-10 11:09:46 -06:00
Delweng
c8d5e33465 eth/tracers: add ReturnData in the tracer's response (#27704)
The struct logger (or opcode tracer) was missing the return data field even
if this was explicitly enabled by user via `"enableReturnData": true` in the config.
This PR fixes this issue.

Co-authored-by: Sina Mahmoodi <itz.s1na@gmail.com>
2023-11-10 11:09:46 -06:00
Delweng
6b2f1a5bf7 internal/ethapi: add more testcase for GetTransactionReceipt (#27527)
* internal/ethapi: testBackend reuse the same db

Signed-off-by: jsvisa <delweng@gmail.com>

* internal/ethapi: implment GetTransaction

Signed-off-by: jsvisa <delweng@gmail.com>

* internal/ethapi: implement GetReceipts

Signed-off-by: jsvisa <delweng@gmail.com>

* internal/ethapi: insert receipts and setup txlookup

Signed-off-by: jsvisa <delweng@gmail.com>

* internal/ethapi: add simple success tx receipt test

Signed-off-by: jsvisa <delweng@gmail.com>

* internal/ethapi: add case create contract

Signed-off-by: jsvisa <delweng@gmail.com>

* internal/ethapi: add contract call receipt

Signed-off-by: jsvisa <delweng@gmail.com>

* internal/ethapi: add tx notfound

Signed-off-by: jsvisa <delweng@gmail.com>

* internal/ethapi: add dynamic fee testcase

* internal/ethapi: add accessList receipt

* internal/ethapi: no need to insert receipt chain, no error

* internal/ethapi: use HeaderByHash instead

* internal/ethapi: add one more case

---------

Signed-off-by: jsvisa <delweng@gmail.com>
2023-11-10 11:09:46 -06:00
Delweng
d927c53a0d internal: early exit if tx for getTxReceipt not found (#27712)
internal/ethapi: fast exit if tx notfound
2023-11-10 11:09:46 -06:00
Sina Mahmoodi
c5cd161825 graphql: fix race in withdrawals test (#27706)
graphql: fix race in test
2023-11-10 11:09:46 -06:00
Delweng
0c6fb9db35 eth, miner: rm redundant type declare (#27713)
* eth: rm redundant type from array, slice, or map

* miner: rm redundant type from array, slice, or map
2023-11-10 11:09:46 -06:00
Marius Kjærstad
c512742025 build: upgrade -dlgo version to Go 1.20.6 (#27708) 2023-11-10 11:09:46 -06:00
cui fliter
9e4c31366e accounts, cmd/evm: fix docstrings (#27703)
fix function name in comment

Signed-off-by: cui fliter <imcusg@gmail.com>
2023-11-10 11:09:46 -06:00
Felix Lange
95e09f6603 p2p/discover: filter bootnodes by netrestrict (#27701)
This prevents an issue where the node would attempt to contact the bootstrap
nodes even if they weren't contained in the netrestrict list.
2023-11-10 11:09:46 -06:00
rjl493456442
2fabfa07cc core/rawdb: support freezer batch read with no size limit (#27687)
This change adds the ability to perform reads from freezer without size limitation. This can be useful in cases where callers are certain that out-of-memory will not happen (e.g. reading only a few elements). 

The previous API was designed to behave both optimally and secure while servicing a request from a peer, whereas this change should _not_ be used when an untrusted peer can influence the query size.
2023-11-10 11:09:46 -06:00
Felix Lange
0c64444b6e go.mod: upgrade github.com/karalabe/usb to fix build warning (#27698) 2023-11-10 11:09:46 -06:00
Mskxn
08523174de console: add cleanup to avoid leaks in newTester (#27695) 2023-11-10 11:09:46 -06:00
lightclient
899a6560ec cmd/utils, p2p: clean up discovery setup (#27518)
This simplifies the code that initializes the discovery a bit, and
adds new flags for enabling/disabling discv4 and discv5 separately.

---------

Co-authored-by: Felix Lange <fjl@twurst.com>
2023-11-10 11:09:46 -06:00
rjl493456442
5b3e45ba53 core/state: value diff tracking in StateDB (#27349)
This change makes the StateDB track the state key value diff of a block transition.
We already tracked current account and storage values for the purpose of updating
the state snapshot. With this PR, we now also track the original (pre-transition) values
of accounts and storage slots.
2023-11-10 11:09:46 -06:00
Delweng
9a984bc54e internal/blocktest: add package for shared test code (#27270) 2023-11-10 11:09:46 -06:00
lightclient
7fbbce3470 eth: better active protocol handler tracking (#27665)
Fixes an issue where waitgroups were used erroneously, which could lead to waitgroup being added to while wait was already invoked.
2023-11-10 11:09:46 -06:00
Charles Cooper
b0a5097cea core/vm: implement EIP-5656, mcopy instruction (#26181)
Implements [EIP 5656](https://eips.ethereum.org/EIPS/eip-5656), MCOPY instruction, and enables it for Cancun. 

---------

Co-authored-by: Martin Holst Swende <martin@swende.se>
2023-11-10 11:09:46 -06:00
Martin Holst Swende
c8f00777a6 core/vm: define cancun + enable 1153 (tstore/tload) in cancun (#27663) 2023-11-10 11:09:46 -06:00
jwasinger
a71a6e7a48 miner: remove unused commented code (#27664) 2023-11-10 11:09:46 -06:00
Martin Holst Swende
373dfc6bcf core: remove outdated tests (#27662)
Back before #27178 , we spun up a number of ethash verifiers to verify headers. So we also had tests to ensure that we were indeed able to abort verification even if we had multiple workers running.

With PR #27178, we removed the parallelism in verification, and these tests are now failing, since we now just sequentially fire away the results as fast as possible on one routine.

This change removes the (sometimes failing) tests
2023-11-10 11:09:46 -06:00
lightclient
463ad60ac0 p2p, p2p/discover: add dial metrics (#27621)
This PR adds metrics for p2p dialing, which gives us visibility into the quality of the dial 
candidates  returned by our discovery methods.
2023-11-10 11:09:46 -06:00
jwasinger
7818ec3799 cmd/geth: implement dev mode for post-merge (#27327)
This change adds back the 'geth --dev' mode of operation, using a cl-mocker. 

---------

Co-authored-by: Martin Holst Swende <martin@swende.se>
Co-authored-by: rjl493456442 <garyrong0905@gmail.com>
Co-authored-by: lightclient <14004106+lightclient@users.noreply.github.com>
2023-11-10 11:09:46 -06:00
John Chase
2a99cd8fd0 signer/core: show helptext when clef rejects signing (#27538)
Co-authored-by: Martin Holst Swende <martin@swende.se>
2023-11-10 11:09:46 -06:00
Darioush Jalali
625e847b5b core: stop chain when tests are finished (#27660)
core (blockchain_test): add chain.Stop() to tests
2023-11-10 11:09:46 -06:00
Exca-DK
a50eaa85c6 ethdb/leveldb: update leveldb metrics collection (#27643)
This removes text parsing in leveldb metrics collection code. All metrics
can now be accessed through the stats API provided by leveldb.

We also add new gauge-typed metrics that count the number of tables at each level.

---------

Co-authored-by: Exca-DK <Exca-DK@users.noreply.github.com>
Co-authored-by: Gary Rong <garyrong0905@gmail.com>
Co-authored-by: Felix Lange <fjl@twurst.com>
2023-11-10 11:09:46 -06:00
rjl493456442
2c0c010df5 cmd, core, eth, graphql, trie: no persisted clean trie cache file (#27525)
The clean trie cache is persisted periodically, therefore Geth can
quickly warmup the cache in next restart.

However it will reduce the robustness of system. The assumption is
held in Geth that if the parent trie node is present, then the entire
sub-trie associated with the parent are all prensent.

Imagine the scenario that Geth rewinds itself to a past block and
restart, but Geth finds the root node of "future state" in clean
cache then regard this state is present in disk, while is not in fact.

Another example is offline pruning tool. Whenever an offline pruning
is performed, the clean cache file has to be removed to aviod hitting
the root node of "deleted states" in clean cache.

All in all, compare with the minor performance gain, system robustness
is something we care more.
2023-11-10 11:09:46 -06:00
Curith
ebfb635126 node: fix listening on IPv6 address (#27628) (#27635) 2023-11-10 11:09:46 -06:00