Commit graph

15862 commits

Author SHA1 Message Date
Felix Lange
4961445397
Update dropper.go 2025-04-14 10:58:59 +02:00
Csaba Kiraly
976e039e37
set doNotDropBefore to 10 minutes
The protection period is meant for peers to have time to start
contribution, but at the moment we have no logic related to
"start contribute", so the number is a bit arbitrary.

The logic in setting this based on the drop interval is from the other
side of things: for not protecting a new node too long. What I wanted
to avoid is protecting a node for too long, while the whole old
peerset can be changed. Actually, for this it would be better to
use peerDropIntervalMin ....

Let's make it independent for now, then we can consider again later.
I would like this number to be bigger than the time a the dropped
peer needs to find a replacement. 10min sounds safe to start with,
then we can checked the effect when it is rolled out, and adjust.

Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
2025-04-14 10:38:38 +02:00
Csaba Kiraly
2a9372ea5f
eth/dropper: changing error code to DiscUselessPeer
Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
2025-04-11 14:00:57 +02:00
Csaba Kiraly
ff66b1c42e
eth/dropper: remove unused peerEvent channel
Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
2025-04-11 12:00:28 +02:00
Csaba Kiraly
4a69bf90ff
eth/dropper: fixing logs
Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
2025-04-11 11:39:13 +02:00
Csaba Kiraly
7a76bdd75e
eth/dropper: simplify sync status query
Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
2025-04-11 11:37:14 +02:00
Csaba Kiraly
1647f51eed
eth/dropper: add metrics
Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
2025-04-11 10:34:09 +02:00
Csaba Kiraly
75c8ee1439
eth/dropper: simplify code
Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
2025-04-11 10:32:36 +02:00
Csaba Kiraly
5da26a98d0
eth/dropper: simplify cfg
Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
2025-04-10 17:11:01 +02:00
Csaba Kiraly
e9065acdde
simplify rand usage
Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
2025-04-10 09:52:52 +02:00
Csaba Kiraly
42d2c9b588
eth: renaming Connection Manager to Dropper
Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
2025-04-07 16:41:12 +02:00
Csaba Kiraly
8bb7f1ed11 eth/connmanager: randomize peer drop timers
Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
2025-03-29 08:07:36 +01:00
Csaba Kiraly
d46ef40900 fixing newlines
Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
2025-03-28 13:14:58 +01:00
Csaba Kiraly
77d634cd9b eth/connmanager: handle inbound and dialed peers separately
Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
2025-03-28 13:14:58 +01:00
Csaba Kiraly
301b396939 eth/connmanager: monitor sync status
Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
2025-03-28 13:14:55 +01:00
Csaba Kiraly
cb5d672649 eth/connmanager: no need to store srv
Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
2025-03-28 13:14:34 +01:00
Csaba Kiraly
628c5e5b7b eth/connmanager: get sync status
Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
2025-03-28 13:14:21 +01:00
Csaba Kiraly
61b26a93c5 eth/connman: fixup log levels 2025-03-28 13:13:42 +01:00
Csaba Kiraly
c41569d62a eth/connmanager: use slices.DeleteFunc to filter in place
Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
2025-03-28 13:13:42 +01:00
Csaba Kiraly
e0b0189d05 eth/connmanager: move Connection Manager to package eth
Better positioned in package eth to access relevant data about
connection quality.
2025-03-28 13:13:33 +01:00
Csaba Kiraly
ea8d05a1c9 p2p/server: expose MaxInboundConns and MaxDialedConns
Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
2025-03-28 13:12:12 +01:00
Csaba Kiraly
23cda63d5a p2p/peer: expose conn flags through getter functions
Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
2025-03-28 13:12:12 +01:00
Csaba Kiraly
4635dac0b5 p2p/connmanager: set meaningful defaults
Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
2025-03-28 13:12:12 +01:00
Csaba Kiraly
75e4c26564 p2p/connmanager: avoid dropping peers too early
Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
2025-03-28 13:12:12 +01:00
Csaba Kiraly
91c1c30996 p2p/connmanager: avoid dropping trusted peers
Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
2025-03-28 13:12:12 +01:00
Csaba Kiraly
7a49bf09c1 p2p/connmanager: only drop from dialed peers
Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
2025-03-28 13:12:12 +01:00
Csaba Kiraly
136d32d2c0 p2p/connmanager: add connection manager to create some churn
Dropping peers randomly with a slow pace to create some artificial
churn.

Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
2025-03-28 13:12:12 +01:00
rjl493456442
32f36a6749
core/txpool: fix nonce assignment in local tracker (#31496)
Fixes #31494
2025-03-28 12:32:24 +01:00
rekyyang
141968a48b
core/txpool/legacypool: fix data race in checkDelegationLimit (#31475) 2025-03-28 15:16:37 +08:00
Delweng
714fa4f2e6
cmd/geth: update geth subcommand arguments (#31293) 2025-03-28 15:15:13 +08:00
jwasinger
cc273cef0b
Merge pull request #31228 from curvegrid/fix-sim-rollback
eth/catalyst: force sync of txpool before clearing subpools in Rollback
2025-03-27 18:40:15 +01:00
georgehao
6143c350ae
internal/ethapi: CreateAccessList with stateOverrides (#31497)
Add support for state overrides in eth_createAccessList. This will make the method consistent
with other execution methods.

---------

Co-authored-by: Sina Mahmoodi <itz.s1na@gmail.com>
2025-03-27 12:22:17 +01:00
protolambda
a82303f4e3
accounts/abi: include access-list in gas estimation (#31394)
Simple bugfix to include the access-list in the gas-estimation step of
the ABI bindings code.
2025-03-26 16:14:17 +01:00
VolodymyrBg
a775e68421
eth: downgrade peer removal error to warning level (#31492) 2025-03-26 19:57:08 +08:00
rjl493456442
5b4a743493
core/rawdb: remove LES database stats (#31495)
This removes DB schema for LES related db entries. LES has been non-functional
since the merge.
2025-03-26 12:48:04 +01:00
Delweng
c1ff2d8ba9
core/state: fix double-increment of accountLoaded counter (#31493) 2025-03-26 12:59:40 +08:00
sashabeton
c49aadc4b6
internal/ethapi: exclude 7702 authorities from result in eth_createAccessList (#31336)
closes https://github.com/ethereum/go-ethereum/issues/31335

---------

Co-authored-by: sashabeton <sashabeton2007@gmail.com>
2025-03-25 15:01:21 +01:00
rjl493456442
4dfec7e83e
trie: optimize memory allocation (#30932)
This pull request removes the node copy operation to reduce memory
allocation. Key Changes as below:

**(a) Use `decodeNodeUnsafe` for decoding nodes retrieved from the trie
node reader**

In the current implementation of the MPT, once a trie node blob is
retrieved, it is passed to `decodeNode` for decoding. However,
`decodeNode` assumes the supplied byte slice might be mutated later, so
it performs a deep copy internally before parsing the node.

Given that the node reader is implemented by the path database and the
hash database, both of which guarantee the immutability of the returned
byte slice. By restricting the node reader interface to explicitly
guarantee that the returned byte slice will not be modified, we can
safely replace `decodeNode` with `decodeNodeUnsafe`. This eliminates the
need for a redundant byte copy during each node resolution.

**(b) Modify the trie in place**

In the current implementation of the MPT, a copy of a trie node is
created before any modifications are made. These modifications include:
- Node resolution: Converting the value from a hash to the actual node.
- Node hashing: Tagging the hash into its cache.
- Node commit: Replacing the children with its hash.
- Structural changes: For example, adding a new child to a fullNode or
replacing a child of a shortNode.

This mechanism ensures that modifications only affect the live tree,
leaving all previously created copies unaffected.

Unfortunately, this property leads to a huge memory allocation
requirement. For example, if we want to modify the fullNode for n times,
the node will be copied for n times.

In this pull request, all the trie modifications are made in place. In
order to make sure all previously created copies are unaffected, the
`Copy` function now will deep-copy all the live nodes rather than the
root node itself.

With this change, while the `Copy` function becomes more expensive, it's
totally acceptable as it's not a frequently used one. For the normal
trie operations (Get, GetNode, Hash, Commit, Insert, Delete), the node
copy is not required anymore.
2025-03-25 14:59:44 +01:00
Shude Li
4ff5093df1
all: use fmt.Appendf instead of fmt.Sprintf where possible (#31301) 2025-03-25 14:53:02 +01:00
nethoxa
21d36f7c37
core: process EL requests in GenerateVerkleChain (#31175) 2025-03-25 14:13:05 +01:00
Felix Lange
aa6d0ef5f2 version: begin v1.15.7 release cycle 2025-03-25 12:26:15 +01:00
Felix Lange
19d2b4c880 version: release v1.15.6 stable 2025-03-25 11:30:13 +01:00
rjl493456442
a14b8eca04
core/txpool: reject stale transaction for local tracking (#31473)
Fixes https://github.com/ethereum/go-ethereum/issues/31451
2025-03-25 11:16:26 +01:00
Rez
71e9c9b8a7
internal/ethapi: support for beacon root and withdrawals in simulate api (#31304)
Adds block override fields for beacon block root and withdrawals to the eth_simulateV1.
Addresses https://github.com/ethereum/go-ethereum/issues/31264
2025-03-24 19:08:53 +01:00
rjl493456442
8e3b94da1e
tests: update test submodule (#31479)
This commit upgrades the test submodule to latest version:

Latest:
81862e4848
Old:
faf33b4714
2025-03-24 22:19:14 +08:00
Felföldi Zsolt
28238b6b7e
beacon/params: new checkpoints (#31470)
This PR updates beacon checkpoints. The checkpoints are now stored as
embedded hex files, in the same format that
https://github.com/ethereum/go-ethereum/pull/31469 uses.
2025-03-24 12:27:40 +01:00
Felföldi Zsolt
cbe902d5da
core/filtermaps: fix log indexer init conditions (#31455)
This PR adds an extra condition to the log indexer initialization in
order to avoid initializing with block 0 as target head. Previously this
caused the indexer to initialize without a checkpoint. Later, when the
real chain head was set, it indexed the entire history, then unindexed
most of it if only the recent history was supposed to be indexed. Now
the init only happens when there is an actual synced chain head and
therefore the index is initialized at the most recent checkpoint and
only the last year is indexed according to the default parameters.
During checkpoint initialization the best available checkpoint is also
checked against the history cutoff point and fails if the indexing would
have to start from a block older than the cutoff. If initialization
fails then the indexer reverts to unindexed mode instead of retrying
because the the failure conditions cannot be expected to recover later.
2025-03-24 12:27:11 +01:00
Felix Lange
fd4049dc1e
core/rawdb: improve database stats output (#31463)
Instead of reporting all filtermaps stuff in one line, I'm breaking it
down into the three separate kinds of entries here.

```
+-----------------------+-----------------------------+------------+------------+
|       DATABASE        |          CATEGORY           |    SIZE    |   ITEMS    |
+-----------------------+-----------------------------+------------+------------+
| Key-Value store       | Log index filter-map rows   | 59.21 GiB  |  616077345 |
| Key-Value store       | Log index last-block-of-map | 12.35 MiB  |     269755 |
| Key-Value store       | Log index block-lv          | 421.70 MiB |   22109169 |
```

Also added some other changes to make it easier to debug:

- restored bloombits into the inspect output, so we notice if it doesn't
get deleted for some reason
- tracking of unaccounted key examples
2025-03-24 10:07:38 +01:00
jwasinger
b0b2b76509
internal/ethapi: return code 3 from call/estimateGas even if a revert reason was not returned (#31456) 2025-03-23 17:38:26 +01:00
rjl493456442
624a5d8b23
eth/filter: downgrade log level (#31450) 2025-03-21 14:08:51 +01:00