Commit graph

2247 commits

Author SHA1 Message Date
Felix Lange
f4ea07641a core/txpool: remove use of errors.Join function (#27523)
his function was added in Go 1.20, but our compatibility target
is Go 1.19.
2023-11-10 11:09:46 -06:00
Dan Laine
d7a94d9832 core: use slices package for sorting (#27489)
Co-authored-by: Felix Lange <fjl@twurst.com>
2023-11-10 11:09:46 -06:00
hero5512
8a351f6e70 core/txpool/legacypool: narrow down the scope of the variable (#27471)
Variables discarded, included can be defined closer to their usage.

Co-authored-by: Martin Holst Swende <martin@swende.se>
2023-11-10 11:09:46 -06:00
rjl493456442
cee45268f8 trie: remove parameter 'fromLevel' in Prove (#27512)
This removes the feature where top nodes of the proof can be elided.
It was intended to be used by the LES server, to save bandwidth 
when the client had already fetched parts of the state and only needed
some extra nodes to complete the proof. Alas, it never got implemented
in the client.
2023-11-10 11:09:46 -06:00
Marius van der Wijden
143c5214c9 go.mod: update kzg libraries to use big-endian (#27510)
* go.mod: update kzg libraries to use big-endian

* go.sum: ran go mod tidy

* core/testdata/precompiles: fix blob verification test

* core/testdata/precompiles: fix blob verification test
2023-11-10 11:09:46 -06:00
Martin Holst Swende
e9686cee73 core/txpool/legacypool: handle missing head in reset (#27479)
Fixes #27301, a crash that could occur during txpool reorg handling.
2023-11-10 11:09:46 -06:00
hero5512
d97bfa6e6c core/txpool/legacypool: remove redundant check for floatingRatio == 0 (#27477)
floatingRatio is a constant and always non-zero. So there is no need to
check for == 0.
2023-11-10 11:09:46 -06:00
jin
0a44648415 core/txpool/legacypool: reheap the tx list if london fork not enabled (#27481)
This change ensures Reheap will be called even before the London fork activates.
Since Reheap would otherwise only be called through `SetBaseFee` after London,
the list would just keep growing if the fork was not enabled or not reached yet.
2023-11-10 11:09:46 -06:00
Péter Szilágyi
3c12101056 all: move main transaction pool into a subpool (#27463)
* all: move main transaction pool into a subpool

* go.mod: remove superfluous updates

* core/txpool: review fixes, handle txs rejected by all subpools

* core/txpool: typos
2023-11-10 11:09:46 -06:00
Martin Holst Swende
ee79490ec6 core/types: add support for BlobTxType receipts (#27470)
Co-authored-by: Felix Lange <fjl@twurst.com>
2023-11-10 11:09:46 -06:00
aaronbuchwald
44a8cecbc6 core: remove unnecessary log copy (#27475)
The logs in this function are pulled straight from disk in rawdb.ReadRawReceipts and 
also modified in receipts.DeriveFields, so removing the copy should be fine.
2023-11-10 11:09:46 -06:00
Freeman Jiang
120956b80b core/types: add "chainID" field to legacy tx JSON encoding (#27452)
Co-authored-by: lightclient <14004106+lightclient@users.noreply.github.com>
2023-11-10 11:09:46 -06:00
Delweng
6d231bbe66 eth,core: add api debug_getTrieFlushInterval (#27303)
* core,eth: add api debug_getTrieFlushInterval

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

* eth/api_debug: comment of SetTrieFlushInterval

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

* Apply suggestions from code review

---------

Signed-off-by: jsvisa <delweng@gmail.com>
Co-authored-by: Martin Holst Swende <martin@swende.se>
2023-11-10 11:09:46 -06:00
Péter Szilágyi
4b555c7682 core/txpool: make transaction validation reusable across packages (pools) (#27429)
* core/txpool: abstraction prep work for secondary pools (blob pool)

* core/txpool: leave subpool concepts to a followup pr

* les: fix tests using hard coded errors

* core/txpool: use bitmaps instead of maps for tx type filtering
2023-11-10 11:09:46 -06:00
Daniel Katzan
210e688a5c core/txpool: fix minor flaw in isGapped check (#27404)
This fix a minor implementation issue with the newly introduced isGapped function and it is described in ticket: https://github.com/ethereum/go-ethereum/issues/27401
2023-11-10 11:09:46 -06:00
rjl493456442
1b82886dec core/state/snapshot, core/types, eth: move account definition to type (#27323)
* core/state/snapshot, core/types, eth: move account definition to type

* core, eth: revert snapshot Account API change
2023-11-10 11:09:46 -06:00
Marius van der Wijden
45907213fb core: 4844 opcode and precompile (#27356)
* core: crypto: implement BLOBHASH and pointEval precompile

* core: crypto: fixed nitpicks, moved precompile return value

* core/vm: fix review comments
2023-11-10 11:09:46 -06:00
rjl493456442
f60b50e6d3 core/state: clear out cached state data when reset occurs (#27376)
* core/state: remove cached snap data if reset occurs

* core/state: address comment from peter

* core/state: skip revert in case data is nil
2023-11-10 11:09:46 -06:00
Péter Szilágyi
17332a110e all: remove the Rinkeby testnet (#27406) 2023-11-10 11:09:46 -06:00
rjl493456442
68dea627c4 core/state: mark account as dirty when resetObject occurs (#27339)
This changes the journal logic to mark the state object dirty immediately when it
is reset. 

We're mostly adding this change to appease the fuzzer. Marking it dirty immediately
makes no difference in practice because accounts will always be modified by EVM
right after creation.
2023-11-10 11:09:46 -06:00
Guillaume Ballet
797c10068e core/state: move slot RLP encoding into the MPT implementation (#27000)
Continuing with a series of PRs to make the Trie interface more generic, this PR moves
the RLP encoding of storage slots inside the StateTrie and light.Trie implementations,
as other types of tries don't use RLP.
2023-11-10 11:09:46 -06:00
Péter Szilágyi
0eb3a6cdbb core, eth/downloader: validate blobtx.To at serialization time (#27393) 2023-11-10 11:09:46 -06:00
Péter Szilágyi
b606e38770 core, eth/downloader, params: validate blob tx bodies (#27392) 2023-11-10 11:09:46 -06:00
Péter Szilágyi
6083a3b66d consensus, core, eth/downloader, params: 4844 chain validation (#27382) 2023-11-10 11:09:46 -06:00
Guillaume Ballet
0ab863d79f core/types: remove superfluous todo-comment (#27383) 2023-11-10 11:09:46 -06:00
Delweng
a8091f2c34 core,console: replace noarg fmt.Errorf with errors.New (#27332)
* core: replace noarg fmt.Errorf with errors.New

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

* console: replace noarg fmt.Errorf with errors.New

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

* core: go autoimport

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

* core: dry

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

---------

Signed-off-by: jsvisa <delweng@gmail.com>
2023-11-10 11:09:46 -06:00
Park Changwan
8686762eb9 core/state: do not ignore null addr while iterative dump (#27320)
fixes bug which caused the zero-address to be ignored during an iterative state-dump.

---------

Co-authored-by: Martin Holst Swende <martin@swende.se>
2023-11-10 11:09:46 -06:00
Péter Szilágyi
b953419e4c all: tie timestamp based forks to the passage of London (#27279) 2023-11-10 11:09:46 -06:00
John Chase
b373df4b25 core/state/pruner: remove unused error-return (#27273) 2023-11-10 11:09:46 -06:00
Martin Holst Swende
9064a57b8c core/state/snapshot: check difflayer staleness early (#27255)
This PR adds a staleness-check to AccountRLP, before checking the bloom-filter and potentially going directly into the disklayer.

---------

Co-authored-by: rjl493456442 <garyrong0905@gmail.com>
2023-11-10 11:09:46 -06:00
joohhnnn
a0c2037a67 core/asm: remove unused return value (#27272) 2023-11-10 11:09:46 -06:00
Péter Szilágyi
cd548dc9eb core/types: un-ssz blob txs, add json marshalling and tweaks (#27256) 2023-11-10 11:09:46 -06:00
rjl493456442
8f91128563 all: new empty trie with types.EmptyRootHash instead of null (#27230) 2023-11-10 11:09:46 -06:00
Guillaume Ballet
74fb652210 core/state: unexport NodeIterator (#27239) 2023-11-10 11:09:46 -06:00
rjl493456442
7e555fb2ac all: port boring changes from pbss (#27176)
* all: port boring changes from pbss

* core, trie: address comments from martin

* trie: minor fixes

* core/rawdb: update comment

* core, eth, tests, trie: address comments

* tests, trie: add extra check when update trie database

* trie/triedb/hashdb: degrade the error to warning
2023-11-10 11:09:46 -06:00
ucwong
73ef7f14f6 core/state: initialize maps with known size (#27222)
* core/state : fix map size avoid resizing

* core/state : fixed size
2023-11-10 11:09:46 -06:00
ucwong
cd43de777d core/txpool : fix map size avoid resizing (#27221) 2023-11-10 11:09:46 -06:00
Péter Szilágyi
3eb53061af all: remove ethash pow, only retain shims needed for consensus and tests (#27178)
* all: remove ethash pow, only retain shims needed for consensus and tests

* all: thank you linter

* all: disallow launching Geth in legacy PoW mode

* cmd/env/internal/t8ntool: remove dangling ethash flag
2023-11-10 11:09:46 -06:00
Guillaume Ballet
317d990522 core: remove unused ContractCode method from BlockChain (#27186) 2023-11-10 11:09:46 -06:00
ucwong
2984cb3ae0 core/types: go generate (#27196)
Fixes a discrepancy between source and generated files, which was introduced when ExcessDataGas was added in https://github.com/ethereum/go-ethereum/pull/27046.
2023-11-10 11:09:46 -06:00
Péter Szilágyi
d3286a75b0 cmd, eth, les: replace Shanghai override flag with Cancun (#27171) 2023-11-10 11:09:46 -06:00
Roberto Bayardo
398ed490b3 core/types: fix discrepancy in receipt.EffectiveGasPrice json encoding tags (#27114)
Regenerate receipt json code to remove omit empty. Previously, there was a discrepancy between the generated code and the source. 

---------

Co-authored-by: lightclient@protonmail.com <lightclient@protonmail.com>
Co-authored-by: Martin Holst Swende <martin@swende.se>
2023-11-10 11:09:46 -06:00
Péter Szilágyi
e92895f248 cmd/utils, node: switch to Pebble as the default db if none exists (#27136)
* cmd/utils, node: switch to Pebble as the default db if none exists

* node: fall back to LevelDB on platforms not supporting Pebble

* core/rawdb, node: default to Pebble at the node level

* cmd/geth: fix some tests explicitly using leveldb

* ethdb/pebble: allow double closes, makes tests simpler
2023-11-10 11:09:46 -06:00
Péter Szilágyi
17fa4a6b3b core/types, params: add blob transaction type, RLP encoded for now (#27049)
* core/types, params: add blob transaction type, RLP encoded for now

* all: integrate Cancun (and timestamp based forks) into MakeSigner

* core/types: fix 2 back-and-forth type refactors

* core: fix review comment

* core/types: swap blob tx type id to 0x03
2023-11-10 11:09:46 -06:00
rjl493456442
03e5d4fce7 all: refactor trie API (#26995)
In this PR, all TryXXX(e.g. TryGet) APIs of trie are renamed to XXX(e.g. Get) with an error returned.

The original XXX(e.g. Get) APIs are renamed to MustXXX(e.g. MustGet) and does not return any error -- they print a log output. A future PR will change the behaviour to panic on errorrs.
2023-11-10 11:09:46 -06:00
Alex Beregszaszi
bc7f528b30 core/vm: order opcodes properly (#27113) 2023-11-10 11:09:46 -06:00
Delweng
5e4d726e2a
params: remove EIP150Hash from chainconfig (#27087)
The EIP150Hash was an idea where, after the fork, we hardcoded the forked hash as an extra defensive mechanism. It wasn't really used, since forks weren't contentious and for all the various testnets and private networks it's been a hassle to have around. 

This change removes that config field. 

---------

Signed-off-by: jsvisa <delweng@gmail.com>
2023-04-18 03:49:09 -04:00
Anusha
cb66eba85a
core: fix comment to reflect function name (#27070) 2023-04-17 11:02:31 -04:00
rjl493456442
b946b7a13b
core, miner: drop transactions from the same sender when error occurs (#27038)
This PR unifies the error handling in miner. 

Whenever an error occur while applying a transaction, the transaction should be regarded as invalid and all following transactions from the same sender not executable because of the nonce restriction. The only exception is the `nonceTooLow` error which is handled separately.
2023-04-05 07:09:25 -04:00
Marius van der Wijden
230df98e4d
core/txpool: disallow future churn by remote txs (#26907)
Prior to this change, it was possible that transactions are erroneously deemed as 'future' although they are in fact 'pending', causing them to be dropped due to 'future' not being allowed to replace 'pending'. 

This change fixes that, by doing a more in-depth inspection of the queue.
2023-04-05 04:59:32 -04:00