Commit graph

16597 commits

Author SHA1 Message Date
Denny Ooi
164933d316
p2p/discover: unwrap 4-in-6 UDP source addresses (#29944) (#1292)
Fixes an issue where discovery responses were not recognized.

Co-authored-by: Felix Lange <fjl@twurst.com>
2024-07-26 10:51:47 +05:30
Pratik Patil
e2cee054c6
Merge pull request #1294 from maticnetwork/master
v1.3.4 Backport master to develop
2024-07-26 10:12:59 +05:30
Pratik Patil
18a5d28154
Merge pull request #1291 from maticnetwork/1.3.4-candidate
v1.3.4
2024-07-26 10:07:39 +05:30
Manav Darji
29840e2016
bump version to v1.3.4 2024-07-25 16:48:09 +05:30
Manav Darji
dce4253605
PIP-35: enforce gas related configs for mainnet (#1290)
* enforce gas configs for all networks

* eth/gasprice: remove else if for log

* docs/cli: update example config

* fix tests

* internal/cli/server: fix tests

* miner: fix tests
2024-07-23 19:32:48 +05:30
Manav Darji
31545e5365
bump version to v1.3.4-beta3 2024-07-11 14:08:46 +05:30
Manav Darji
67159969e0
miner: log last tx hash before commit interrupt (#1289) 2024-07-11 14:08:07 +05:30
Manav Darji
1a05223076
PIP-35 for amoy: enforce gas related configs (#1285)
* enforce gas related configs for amoy

* internal/cli/server: revert changes to default config.toml for test

* eth: check nil genesis for tests
2024-07-11 11:05:12 +05:30
0xsajal
75f1f9ad77
README: Update discord link (#1288) 2024-07-10 17:09:27 +05:30
Manav Darji
32c9405afa
core/rawdb: log ancient pruner offset 2024-06-24 17:33:17 +05:30
Manav Darji
b228a47491
bump version to v1.3.4-beta2 2024-06-21 21:01:59 +05:30
Manav Darji
0bc2dcbd71
cmd/utils: use defined filter api instance instead of a new one (#1270) 2024-06-20 17:19:12 +05:30
dufucun
0d20e247b5
chore: fix some function names (#1257)
Signed-off-by: dufucun <dufuchun@sohu.com>
Co-authored-by: dufucun <dufucunn@sohu.com>
2024-06-20 07:07:27 +02:00
Manav Darji
c551b4198e
bump version to v1.3.4-beta 2024-06-19 10:58:22 +05:30
Manav Darji
2fd85b3717
eth, consensus: refactor whitelisting related logs and improve error handling (#1268)
* eth, consensus: refactor whitelisting related logs and error handling

* core: fix lint

* eth: fix tests, check against root error

* eth: use ctx correctly while logging

* eth: refactor comments and error message
2024-06-18 14:43:51 +05:30
Manav Darji
9c2d462e21
internal/cli: check for delete permissions before starting to prune (#1269) 2024-06-18 14:43:29 +05:30
Marcello Ardizzone
a9e5c95be8
chg: upgrade deps and solve sec issues (#1261)
* chg: upgrade deps and solve sec issues

* chg: use old kzg-4844 repo

* chg: ignore explicitly Errorf return value
2024-06-13 14:55:40 +05:30
Pratik Patil
bd5d54e9fe
Merge pull request #1267 from maticnetwork/psp-p2p-upstream
p2p: cherry-pick commits from geth for peering issues
2024-06-13 13:00:54 +05:30
Marcello Ardizzone
d67620c8f4
core, eth, internal, miner, params: enforce 30gwei for gas related configs in bor (#1264)
* add: enforce 30gwei for gas related configs in bor

* chg: fix lint
2024-06-12 14:41:25 +05:30
Pratik Patil
d0a212b4d0
Merge pull request #1266 from maticnetwork/master
Back merge master to develop after v1.3.3 release
2024-06-12 14:34:41 +05:30
Pratik Patil
625774fa78
Merge pull request #1265 from maticnetwork/1.3.3-candidate
v1.3.3 release
2024-06-12 12:53:42 +05:30
Pratik Patil
22670cd283
version bump to 1.3.3 2024-06-12 12:15:57 +05:30
Felix Lange
642f5528f6
p2p: fix race in dialScheduler (#29235)
Co-authored-by: Stefan <stefan@starflinger.eu>
2024-06-11 16:43:07 +05:30
Felix Lange
0e093b2c9c
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-06-11 15:53:50 +05:30
lightclient
7850a9f5f6
p2p/discover: fix update logic in handleAddNode (#29836)
It seems the semantic differences between addFoundNode and addInboundNode were lost in
(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-06-11 15:23:31 +05:30
Aaron Chen
b2c178d935
p2p/enode: fix TCPEndpoint (#29827) 2024-06-11 15:17:53 +05:30
Felix Lange
be1e580459
p2p/enode: fix endpoint determination for IPv6 (#29801)
enode.Node has separate accessor functions for getting the IP, UDP port and TCP port.
These methods performed separate checks for attributes set in the ENR.

With this PR, the accessor methods will now return cached information, and the endpoint is
determined when the node is created. The logic to determine the preferred endpoint is now
more correct, and considers how 'global' each address is when both IPv4 and IPv6 addresses
are present in the ENR.
2024-06-11 14:51:57 +05:30
Felix Lange
706cf1c779
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-06-11 14:07:20 +05:30
Felix Lange
1351a54287
p2p/discover: improved node revalidation (#29572)
Node discovery periodically revalidates the nodes in its table by sending PING, checking
if they are still alive. I recently noticed some issues with the implementation of this
process, which can cause strange results such as nodes dropping unexpectedly, certain
nodes not getting revalidated often enough, and bad results being returned to incoming
FINDNODE queries.

In this change, the revalidation process is improved with the following logic:

- We maintain two 'revalidation lists' containing the table nodes, named 'fast' and 'slow'.
- The process chooses random nodes from each list on a randomized interval, the interval being
  faster for the 'fast' list, and performs revalidation for the chosen node.
- Whenever a node is newly inserted into the table, it goes into the 'fast' list.
  Once validation passes, it transfers to the 'slow' list. If a request fails, or the
  node changes endpoint, it transfers back into 'fast'.
- livenessChecks is incremented by one for successful checks. Unlike the old implementation,
  we will not drop the node on the first failing check. We instead quickly decay the
  livenessChecks give it another chance.
- Order of nodes in bucket doesn't matter anymore.

I am also adding a debug API endpoint to dump the node table content.

Co-authored-by: Martin HS <martin@swende.se>
2024-06-11 13:53:35 +05:30
Manav Darji
e6a462504a
bump version to v1.3.3-beta3 2024-06-10 12:34:00 +05:30
Manav Darji
2aa76a9926
eth: change block propagation and announcement logs to debug 2024-06-10 12:32:17 +05:30
Manav Darji
6bc8334852
eth/fetcher: modify queue limits for improving sync near chain tip (#1260) 2024-06-07 21:57:19 +05:30
Anshal Shukla
e28c2036fc
remove additional bootnodes (#1255) 2024-06-06 23:13:43 +05:30
Marcello Ardizzone
57b77e3b6c
chg: fix percentile validation in fee history (#1235) 2024-06-06 11:23:30 +05:30
Pratik Patil
5b0805d706
version bump to 1.3.3-beta2 2024-06-06 11:04:19 +05:30
Pratik Patil
c0d1fbb86a
Fix panic when fetching block in case of reorg (#1259) 2024-06-06 10:59:45 +05:30
Pratik Patil
a0acefc04c
eth: broadcast block to static and trusted peers as well (#1258) 2024-06-06 10:57:20 +05:30
Manav Darji
d8374ecf3c
bump version to v1.3.3-beta 2024-05-30 14:15:09 +05:30
Pratik Patil
3278c79d80
Merge pull request #1254 from maticnetwork/upstream_merge
Merge upstream_merge branch to develop
2024-05-29 11:00:59 +05:30
Pratik Patil
f25b6efad2
Merge branch 'develop' of https://github.com/maticnetwork/bor into upstream_merge 2024-05-28 22:24:54 +05:30
Manav Darji
e789b4e312
eth/internal: add debug.peerStats for stats related to all connected peers (#1252)
* implement debug.peerStats for stats related to all connected peers

* add identifier for ipc

* display block number in peer stats

* eth/downloader: log error while terminating sync
2024-05-28 17:51:00 +05:30
Pratik Patil
6a5c55266e
Merge branch 'develop' of https://github.com/maticnetwork/bor into upstream_merge 2024-05-28 17:20:23 +05:30
Pratik Patil
5db6fa7174
Merge pull request #1253 from maticnetwork/psp-develop
Revert "Merge upstream_merge branch to develop (#1229)"
2024-05-28 15:44:50 +05:30
Pratik Patil
54c8ddb618
some fixed due to recent changes 2024-05-28 14:57:20 +05:30
Pratik Patil
052405b03e
Revert "Merge upstream_merge branch to develop (#1229)"
This reverts commit 7e2be02c26.
2024-05-28 14:10:49 +05:30
Pratik Patil
4170c2756a
Merge pull request #1250 from maticnetwork/psp-master
Backmerge Master to develop after 1.3.2 release
2024-05-27 11:38:44 +05:30
Pratik Patil
368a1a3859
not going into snap sync (#1247) 2024-05-27 10:54:49 +05:30
Pratik Patil
5f6a76bafe
added error handeling in ethstats.go which prevents node to panic (#1249) 2024-05-27 09:11:44 +05:30
Manav Darji
bade7f57df
Merge pull request #1245 from maticnetwork/v1.3.2-stable
v1.3.2
2024-05-10 16:12:41 +05:30
Anshal Shukla
7543b5d87a
release: v1.3.2 2024-05-09 11:30:34 +05:30