Commit graph

15202 commits

Author SHA1 Message Date
Amin Talebi
905a19b3c8 internal/ethapi: add state override to estimateGas (#27845) 2023-11-10 11:09:46 -06:00
ucwong
13f88de1ef accounts: use atomic type (#27857) 2023-11-10 11:09:46 -06:00
ucwong
f7b3aedcb5 internal: use atomic type (#27858) 2023-11-10 11:09:46 -06:00
Christopher Harrison
0458ddfa6d internal/ethapi, graphql: correct comments about gas price logic (#27752) 2023-11-10 11:09:46 -06:00
ucwong
818db9b353 log: use atomic types (#27763)
Co-authored-by: Felix Lange <fjl@twurst.com>
2023-11-10 11:09:46 -06:00
Felix Lange
932ffcbbf8 core/types: support yParity field in JSON transactions (#27744)
This adds support for the "yParity" field in transaction objects returned by RPC
APIs. We somehow forgot to add this field even though it has been in the spec for
a long time.
2023-11-10 11:09:46 -06:00
Darioush Jalali
b1d0e1e9d5 all: remove trailing whitespace (#27741) 2023-11-10 11:09:46 -06:00
Felix Lange
d8807c42b3 core/types: fix immutability guarantees in Block (#27844)
This change rearranges the accessor methods in block.go and fixes some minor issues with
the copy-on-write logic of block data. Fixed issues:

- Block.WithWithdrawals did not create a shallow copy of the block.

- Block.WithBody copied the header unnecessarily, and did not preserve withdrawals.

However, the bugs did not affect any code in go-ethereum because blocks are *always*
created using NewBlockWithHeader().WithBody().WithWithdrawals()
2023-11-10 11:09:46 -06:00
Péter Szilágyi
5e11ddf79b eth/protocols/snap: fix batch writer when resuming an aborted sync (#27842) 2023-11-10 11:09:46 -06:00
Marius Kjærstad
bd2d199404 build: upgrade -dlgo version to Go 1.20.7 (#27835) 2023-11-10 11:09:46 -06:00
ucwong
f438ff5d47 p2p: use atomic types (#27764)
Co-authored-by: Felix Lange <fjl@twurst.com>
2023-11-10 11:09:46 -06:00
Delweng
45e662000f cmd/geth: disable automaxprocs log (#27814)
Co-authored-by: Felix Lange <fjl@twurst.com>
2023-11-10 11:09:46 -06:00
rjl493456442
b7ea2f2445 all: implement path-based state scheme (#25963)
* all: implement path-based state scheme

* all: edits from review

* core/rawdb, trie/triedb/pathdb: review changes

* core, light, trie, eth, tests: reimplement pbss history

* core, trie/triedb/pathdb: track block number in state history

* trie/triedb/pathdb: add history documentation

* core, trie/triedb/pathdb: address comments from Peter's review

Important changes to list:

- Cache trie nodes by path in clean cache
- Remove root->id mappings when history is truncated

* trie/triedb/pathdb: fallback to disk if unexpect node in clean cache

* core/rawdb: fix tests

* trie/triedb/pathdb: rename metrics, change clean cache key

* trie/triedb: manage the clean cache inside of disk layer

* trie/triedb/pathdb: move journal function

* trie/triedb/path: fix tests

* trie/triedb/pathdb: fix journal

* trie/triedb/pathdb: fix history

* trie/triedb/pathdb: try to fix tests on windows

* core, trie: address comments

* trie/triedb/pathdb: fix test issues

---------

Co-authored-by: Felix Lange <fjl@twurst.com>
Co-authored-by: Martin Holst Swende <martin@swende.se>
2023-11-10 11:09:46 -06:00
ucwong
9ad7158974 cmd/bootnode: fix timer leak (#27754) 2023-11-10 11:09:46 -06:00
Delweng
1680bf1b71 cmd/evm: set ExcessBlobGas from env (#27796)
Sets the `currentExcessBlobGas` from env, alternatively calculates it based on `parentExcessBlobGas` and `parentBlobGasUsed`. It then emits the `currentExcessBlobGas` and `currentBlobGasUsed` into the output, to be used as parent-values for a future iteration. 

Closes #27785
Closes #27783

---------

Signed-off-by: jsvisa <delweng@gmail.com>
Co-authored-by: Martin Holst Swende <martin@swende.se>
2023-11-10 11:09:46 -06:00
Delweng
b2f7349a6b consensus/misc: move eip1559 into a package (#27828)
* consensus/misc: move eip1559 as a sub directory

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

* consensus/misc: package name

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

* all: eip1559

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

---------

Signed-off-by: jsvisa <delweng@gmail.com>
2023-11-10 11:09:46 -06:00
rjl493456442
96cb2894b4 core/txpool/blobpool: remove error log when finalized block is nil (#27822)
* core/txpool/blobpool: remove error log when finalized block is nil

* core/txpool/blobpool: take peter's suggestion
2023-11-10 11:09:46 -06:00
Martin Holst Swende
76964e42e3 tests: make tests pass on windows/386 (#27821)
* tests: split up state test execution

* Revert "tests: split up state test execution"

This reverts commit 96017c248c.

* build: bump test timeout to 20 minutes
2023-11-10 11:09:46 -06:00
Delweng
857b4f45c0 all: replace data gas to blob gas in comments (#27825)
* eth: excessDataGas -> excessBlobGas

* consensus: data gas -> blob gas

* core: data gas -> blob gas

* params: data gas -> blob gas
2023-11-10 11:09:46 -06:00
Zig Blathazar
6d08d1239a cmd/bootnode: defer udp connection close (#27787) 2023-11-10 11:09:46 -06:00
rjl493456442
426aec583b core, trie: track state change set with account address (#27815) 2023-11-10 11:09:46 -06:00
Delweng
cd2e754633 core: remove pointless check for excessBlobGas nilness (#27797)
* core: check excessBlobGas in front

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

* core: no need to manual panic

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

* core: no comment

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

---------

Signed-off-by: jsvisa <delweng@gmail.com>
2023-11-10 11:09:46 -06:00
Shude Li
2fa03e1f92 eth: conver if-else-if chain to tagged switch (#27816) 2023-11-10 11:09:46 -06:00
Shude Li
13645bb8d5 cmd/geth: import package catalyst once (#27803) 2023-11-10 11:09:46 -06:00
Mario Vega
ac8154a248 core/types: fix receipt blob fields marshaling (#27793) 2023-11-10 11:09:46 -06:00
Marius van der Wijden
23f7874257 core/types: put header fields in correct order (#27791) 2023-11-10 11:09:46 -06:00
Péter Szilágyi
50f1fb085b all: rename dataGas to blobGas (#27789) 2023-11-10 11:09:46 -06:00
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