Commit Graph

15332 Commits

Author SHA1 Message Date
TinyFoxy 2eb185c92b
core, rlp: remove duplicated words (#29964) 2024-06-10 20:55:47 +08:00
jwasinger db273c8733
core: initialize developer genesis beacon root contract with 0 balance (#29963) 2024-06-10 13:58:50 +08:00
Gealber Morales 8bda642963
p2p: use package slices to sort in PeersInfo (#29957) 2024-06-09 22:50:22 +02:00
Gealber Morales 349fcdd22d
p2p/discover: add missing lock when calling tab.handleAddNode (#29960) 2024-06-09 22:47:51 +02:00
Ha DANG 1098d148a5
cmd/geth: remove unused param (#29952) 2024-06-08 13:04:16 +02:00
kukuru909 deaf10982c
cmd/clef, cmd/evm: fix markdown issues in README (#29954) 2024-06-08 13:00:53 +02:00
ucwong 6a49d13c13 go.mod : tidy 2024-06-07 15:57:46 +02:00
Gealber Morales 4405f18519
cmd/evm/internal/t8ntool: remove unused parameter (#29930) 2024-06-07 20:04:18 +08:00
Gary Rong 4461c1fc17 params: begin v1.14.6 release cycle 2024-06-06 21:23:44 +08:00
Gary Rong 0dd173a727 params: release Geth v1.14.5 2024-06-06 21:17:53 +08:00
Felix Lange 85459e1439
p2p/discover: unwrap 4-in-6 UDP source addresses (#29944)
Fixes an issue where discovery responses were not recognized.
2024-06-06 16:15:22 +03:00
Hteev Oli 0750cb0c8f
p2p/netutil: fix comments (#29942) 2024-06-06 10:56:41 +03:00
Marquis Shanahan cbbfa3eac0
rlp: no need to repeat called len method (#29936)
rlp: no need to repeat calling len
2024-06-06 10:55:38 +03:00
Marius Kjærstad 6c518fe606
build: upgrade -dlgo version to Go 1.22.4 (#29938) 2024-06-06 10:52:57 +03:00
Felix Lange bc6569462d
p2p: use netip.Addr where possible (#29891)
enode.Node was recently changed to store a cache of endpoint information. The IP address in the cache is a netip.Addr. I chose that type over net.IP because it is just better. netip.Addr is meant to be used as a value type. Copying it does not allocate, it can be compared with ==, and can be used as a map key.

This PR changes most uses of Node.IP() into Node.IPAddr(), which returns the cached value directly without allocating.
While there are still some public APIs left where net.IP is used, I have converted all code used internally by p2p/discover to the new types. So this does change some public Go API, but hopefully not APIs any external code actually uses.

There weren't supposed to be any semantic differences resulting from this refactoring, however it does introduce one: In package p2p/netutil we treated the 0.0.0.0/8 network (addresses 0.x.y.z) as LAN, but netip.Addr.IsPrivate() doesn't. The treatment of this particular IP address range is controversial, with some software supporting it and others not. IANA lists it as special-purpose and invalid as a destination for a long time, so I don't know why I put it into the LAN list. It has now been marked as special in p2p/netutil as well.
2024-06-05 19:31:04 +02:00
Marquis Shanahan d09ddac399
core/rawdb: remove unused deriveLogFields (#29913)
Co-authored-by: Gary Rong <garyrong0905@gmail.com>
Co-authored-by: Martin HS <martin@swende.se>
2024-06-05 21:05:00 +08:00
Hteev Oli e85e21c932
core/state, eth/tracers: fix typos (#29932) 2024-06-05 11:07:37 +02:00
Péter Szilágyi fc40d68e5b params: begin v1.14.5 release cycle 2024-06-05 11:20:35 +03:00
Péter Szilágyi 5550d8399f params: release Geth v1.14.4 2024-06-05 11:06:37 +03:00
rjl493456442 125fb1ff58
core/state: avoid data race (#29924) 2024-06-04 15:51:34 +03:00
SangIlMo 682ae838b2
internal/ethapi: recap higher args.Gas with block GasLimit in DoEstimateGas (#29738)
* internal/ethapi: recap higher args.Gas with block GasLimit in DoEstimateGas

* internal/ethapi: fix gas estimator capping code

* internal/ethapi: fix test

* fix goimports lint (remove space)

---------

Co-authored-by: Péter Szilágyi <peterke@gmail.com>
2024-06-04 10:59:41 +03:00
Roy Crihfield 68c0ec0815
trie: iterate values pre-order and fix seek behavior (#27838)
This pull request fixes the pre-order trie traversal by defining 
a more accurate iterator order and path comparison rule.

Co-authored-by: Gary Rong <garyrong0905@gmail.com>
2024-06-04 11:17:26 +08:00
Steven Wang adbbd8cd7b
core/state: prefetch account trie while starting a prefetcher (#29919)
Always prefetch the account trie while starting the prefetcher.

Co-authored-by: steven <steven@stevendeMacBook-Pro.local>
Co-authored-by: rjl493456442 <garyrong0905@gmail.com>
2024-06-04 11:12:24 +08:00
tianyeyouyou a6751d6fc8
core/rawdb,eth/protocols,p2p: prealloc slice size (#29893)
chore: prealloc slice size
2024-06-03 15:51:04 +03:00
miles 7270cba25c
log: fix a typo (#29883)
logger
2024-06-03 15:50:24 +03:00
maskpp b36c73813c
beacon/engine: prealloc capacity for map and slice (#29903)
* prealloc capacity for map and slice

* revert unnecessary change
2024-06-03 15:38:08 +03:00
HAOYUatHZ 50405e29b7
cmd/evm/internal/t8ntool: fix a typo (#29887)
* i8ntool: fix a typo

* cmd/evm/internal/t8ntool: fix typo typo

---------

Co-authored-by: Péter Szilágyi <peterke@gmail.com>
2024-06-03 15:31:23 +03:00
rjl493456442 d38b88a5a1
core/state: introduce stateupdate structure (#29530)
* core/state: introduce stateUpate structure

* core/state: remove outdated function description

* core/state: address comments
2024-06-03 14:17:12 +03:00
Chris Ziogas c9e0b3105b
Supply delta live tracer (#29347)
Introduces the first built-in live tracer. The supply tracer tracks ETH supply changes across blocks
and writes the output to disk. This will need to be enabled through CLI using the `--vmtrace supply` flag.

Co-authored-by: Sina Mahmoodi <itz.s1na@gmail.com>
2024-06-03 12:30:27 +02:00
Sina M d4b81f0e08
CODEOWNERS: @s1na owns core/tracing (#29899)
Update CODEOWNERS
2024-05-31 18:40:09 +02:00
Péter Szilágyi 2613523cb5
miner: lower default min miner tip from 1 gwei to 0.001 gwei (#29895) 2024-05-31 10:39:40 +03:00
tianyeyouyou bdc62f9beb
common/math: rename variable name `int` to `n` (#29890)
* chore: rename variable name `int` to `in`

* chore: rename variable name `int` to `n`
2024-05-31 10:25:49 +03:00
yujinpark 5d7d48fc3e
eth/gasprice: add comment to constant (#29892)
Co-authored-by: Felix Lange <fjl@twurst.com>
2024-05-30 18:22:23 +02:00
SuiYuan 2262bf3415
crypto/secp256k1: change receiver variable name to lowercase (#29889) 2024-05-30 16:24:16 +02:00
SuiYuan e015c1116f
ethdb: remove unnecessary function wrapper (#29888) 2024-05-30 21:23:04 +08:00
Felix Lange 6bb13e8e2b
eth/catalyst: ensure TxPool is synced in Fork (#29876)
This should fix an occasional test failure in ethclient/simulated.TestForkResendTx.
Inspection of logs revealed the cause of the failure to be that the txpool was not done
reorganizing by the time Fork is called.
2024-05-29 15:56:52 +02:00
hattizai 2f06c1e854
cmd/devp2p: fix node.TCP -> node.UDP (#29879) 2024-05-29 15:55:51 +02:00
Felix Lange 3fef53447f
build: upgrade to golangci-lint v1.59.0 (#29875) 2024-05-29 16:31:27 +03:00
Felix Lange 94a8b296e4
p2p/discover: refactor node and endpoint representation (#29844)
Here we clean up internal uses of type discover.node, converting most code to use
enode.Node instead. The discover.node type used to be the canonical representation of
network hosts before ENR was introduced. Most code worked with *node to avoid conversions
when interacting with Table methods. Since *node also contains internal state of Table and
is a mutable type, using *node outside of Table code is prone to data races. It's also
cleaner not having to wrap/unwrap *enode.Node all the time.

discover.node has been renamed to tableNode to clarify its purpose.

While here, we also change most uses of net.UDPAddr into netip.AddrPort. While this is
technically a separate refactoring from the *node -> *enode.Node change, it is more
convenient because *enode.Node handles IP addresses as netip.Addr. The switch to package
netip in discovery would've happened very soon anyway.

The change to netip.AddrPort stops at certain interface points. For example, since package
p2p/netutil has not been converted to use netip.Addr yet, we still have to convert to
net.IP/net.UDPAddr in a few places.
2024-05-29 15:02:26 +02:00
牛晓婕 e26fa9e40e
core/state: fix typo in comment (#29639) 2024-05-29 14:44:14 +02:00
trillo 2f0e63e5ac
eth/downloader, eth/tracer: fix typos in comments (#29707) 2024-05-29 14:43:07 +02:00
PolyMa 06263b1b35
all: fix typos in comments (#29873)
fix using `a` & `the` simutaneously
2024-05-29 12:24:10 +02:00
Steven Wang b8cf1636d4
accounts: fix TestUpdateKeyfileContents (#29867)
Create the directory before NewKeyStore. This ensures the watcher successfully starts on
the first attempt, and waitWatcherStart functions as intended.
2024-05-29 12:12:57 +02:00
lilasxie 153f8da887
p2p/nodestate: remove unused package (#29872) 2024-05-29 12:11:18 +02:00
bugmaker9371 daf4f72077
p2p/simulations: remove stale information about docker adapter (#29874) 2024-05-29 12:09:58 +02:00
Martin HS 5534c849b6
go.mod: update a number of dependencies (#29763)
* deps: update go-winio

* deps: update fastcache

* deps: update golang-set

* update fatih/color

* update natefinch/lumberjack.v2
2024-05-29 11:30:25 +03:00
lightclient cc22e0cdf0
p2p/discover: fix update logic in handleAddNode (#29836)
It seems the semantic differences between addFoundNode and addInboundNode were lost in
#29572. My understanding is addFoundNode is for a node you have not contacted directly
(and are unsure if is available) whereas addInboundNode is for adding nodes that have
contacted the local node and we can verify they are active.

handleAddNode seems to be the consolidation of those two methods, yet it bumps the node in
the bucket (updating it's IP addr) even if the node was not an inbound. This PR fixes
this. It wasn't originally caught in tests like TestTable_addSeenNode because the
manipulation of the node object actually modified the node value used by the test.

New logic is added to reject non-inbound updates unless the sequence number of the
(signed) ENR increases. Inbound updates, which are published by the updated node itself,
are always accepted. If an inbound update changes the endpoint, the node will be
revalidated on an expedited schedule.

Co-authored-by: Felix Lange <fjl@twurst.com>
2024-05-28 21:30:17 +02:00
jwasinger 171430c3f5
core/state: remove unused error from prefetcher trie method (#29768)
Co-authored-by: Gary Rong <garyrong0905@gmail.com>
Co-authored-by: Felix Lange <fjl@twurst.com>
2024-05-28 19:54:55 +02:00
jwasinger e517183719
eth, eth/downloader: remove references to LightChain, LightSync (#29711)
Co-authored-by: Gary Rong <garyrong0905@gmail.com>
2024-05-28 19:52:08 +02:00
Felix Lange af0a3274be
p2p/discover: fix crash when revalidated node is removed (#29864)
In #29572, I assumed the revalidation list that the node is contained in could only ever
be changed by the outcome of a revalidation request. But turns out that's not true: if the
node gets removed due to FINDNODE failure, it will also be removed from the list it is in.
This causes a crash.

The invariant is: while node is in table, it is always in exactly one of the two lists. So
it seems best to store a pointer to the current list within the node itself.
2024-05-28 18:13:03 +02:00