427 Commits

Author SHA1 Message Date
Simon Dudley
789542f76d Pull in Consensys/tuweni v2.7.0 (#8330)
This replaces io.tmio/tuweni with the Consensys fork.

Also Includes:
- reduce check argument args allocations - https://github.com/Consensys/tuweni/pull/10
which should reduce Integer and int[] and therefore gc pressure

Signed-off-by: Simon Dudley <simon.dudley@consensys.net>
2025-03-17 19:42:25 +10:00
Sally MacFarlane
93e6135749 disable flaky DNSDaemonTest (#8374)
Signed-off-by: Sally MacFarlane <macfarla.github@gmail.com>
2025-03-04 23:38:43 +00:00
Matilda-Clerke
90015fca42 Refactor packet classes for dependency injection (#8271)
* Apply expiration checks in PacketData classes

Signed-off-by: Matilda Clerke <matilda.clerke@consensys.net>

* Fix broken unit tests

Signed-off-by: Matilda Clerke <matilda.clerke@consensys.net>

* spotless

Signed-off-by: Matilda Clerke <matilda.clerke@consensys.net>

* Fix failing test

Signed-off-by: Matilda Clerke <matilda.clerke@consensys.net>

* Refactor to use clock to validate expiry

Signed-off-by: Matilda Clerke <matilda.clerke@consensys.net>

* Refactor Packet and PacketData

Signed-off-by: Matilda Clerke <matilda.clerke@consensys.net>

* Move java.inject version to platform/build.gradle

Signed-off-by: Matilda Clerke <matilda.clerke@consensys.net>

* Update copyright notices on Packet and PacketData classes

Signed-off-by: Matilda Clerke <matilda.clerke@consensys.net>

* Update PeerDiscoveryControllerTest to avoid use of Thread.sleep

Signed-off-by: Matilda Clerke <matilda.clerke@consensys.net>

* Update copyright noticed on PeerDiscoveryControllerTest and MockPacketDataFactory

Signed-off-by: Matilda Clerke <matilda.clerke@consensys.net>

* Remove old PacketTest

Signed-off-by: Matilda Clerke <matilda.clerke@consensys.net>

* Reorder platform/build.gradle api platform dependencies to alphabetical order

Signed-off-by: Matilda Clerke <matilda.clerke@consensys.net>

---------

Signed-off-by: Matilda Clerke <matilda.clerke@consensys.net>
2025-02-13 02:09:58 +00:00
Gabriel-Trintinalia
b150b103e2 Check if discovery service is running before admin_addPeer (#8160)
Signed-off-by: Gabriel-Trintinalia <gabriel.trintinalia@consensys.net>
2025-01-23 22:29:13 +00:00
Vaidik
9c12ed19df handling IllegalArgumentException caused by Discovery Disabled
* Update ethereum/p2p/src/main/java/org/hyperledger/besu/ethereum/p2p/discovery/Endpoint.java

Co-authored-by: Sally MacFarlane <macfarla.github@gmail.com>
Signed-off-by: Vaidik <vaidikbhardwaj00@gmail.com>

* loopback address
* use constant

Signed-off-by: Sally MacFarlane <macfarla.github@gmail.com>

---------

Signed-off-by: Vaidik <vaidikbhardwaj00@gmail.com>
Signed-off-by: Sally MacFarlane <macfarla.github@gmail.com>
Co-authored-by: Sally MacFarlane <macfarla.github@gmail.com>
2025-01-15 00:10:11 +00:00
Usman Saleem
01126c0853 Reimplement EthereumNodeRecord for DNS discovery (#7989)
* Reimplement EthereumNodeRecord and remove dependency on tuweni-devp2p
* Refactor EthereumNodeRecord for DNSDaemon
* Update EthereumNodeRecord to use Besu RLP
* additional unit tests
* Convert ENR to Java record
* regenerate equals and hashcode for enr record
---------

Signed-off-by: Usman Saleem <usman@usmans.info>
2025-01-07 13:14:39 +10:00
Sally MacFarlane
63496dbc6c Remove P2P TLS (experimental) feature (#7942) 2024-11-29 15:43:50 +10:00
Fabio Di Fabio
02722bcd8a Consolidate all metric collectors into the metrics system (#7877)
* Consolidate all metric collectors into the metrics system

Signed-off-by: Fabio Di Fabio <fabio.difabio@consensys.net>

* Fixes

Signed-off-by: Fabio Di Fabio <fabio.difabio@consensys.net>

* Do not recreate the Prometheus metric system

Signed-off-by: Fabio Di Fabio <fabio.difabio@consensys.net>

---------

Signed-off-by: Fabio Di Fabio <fabio.difabio@consensys.net>
2024-11-19 16:10:03 +00:00
Stefan Pingel
11a62a0720 Fix unhandled exception (#7743)
* clean up and use thread safe cache

Signed-off-by: stefan.pingel@consensys.net <stefan.pingel@consensys.net>
2024-10-09 13:36:51 +10:00
Justin Florentine
f4dc48d94d Simplifying BesuCommand step 1 (#7682)
Simplifying BesuCommand
---------

Signed-off-by: Justin Florentine <justin+github@florentine.us>
2024-10-02 15:46:34 +00:00
Usman Saleem
d081c1754c fix: Fix DNSDaemonTest - remove flaky assertion (#7701)
* fix: Fix DNSDaemonTest - remove flaky assertion

Signed-off-by: Usman Saleem <usman@usmans.info>

---------

Signed-off-by: Usman Saleem <usman@usmans.info>
2024-10-01 15:31:56 +10:00
Stefan Pingel
9c80c9bf42 Improve finding peers (#7626)
* add check before adding peer to peer table

Signed-off-by: stefan.pingel@consensys.net <stefan.pingel@consensys.net>
2024-10-01 08:47:47 +10:00
Justin Florentine
d5c10e2b4e Dagger controller tests (#7567)
Separate out flex group privacy test since it requires differently configured dependencies.
test specific, inline module/component definitions
reusable module for providing mockable enclaves, besu commands, and genesis
dagger support for transaction simulation
dagger support for plugin setup

---------

Signed-off-by: jflo <justin+github@florentine.us>
Signed-off-by: Justin Florentine <justin+github@florentine.us>
2024-09-03 12:43:51 -04:00
Matilda-Clerke
da98fa5541 Reintroduce engine get client version v1 with commit in manifest (#7548)
* Include Commit-Hash in manifests
* Add commit method in BesuInfo
* Use 8 character hash in EngineGetClientVersionV1 and revert calculateVersion back to original spec

Signed-off-by: Matilda Clerke <matilda.clerke@consensys.net>
Co-authored-by: garyschulte <garyschulte@gmail.com>
2024-08-30 18:13:53 +00:00
shubham kesri
4801106674 Fixed | Initialising the encodedPubKey with empty String in case userInfo is null (#7508)
Signed-off-by: kesrishubham2510 <shubhamkeshari90@gmail.com>
Co-authored-by: Sally MacFarlane <macfarla.github@gmail.com>
2024-08-23 00:42:12 +00:00
Fabio Di Fabio
fd077a7273 Revert "Dagger controller tests (#7341)" (#7497)
This reverts commit 38a025b870.

# Conflicts:
#	acceptance-tests/dsl/src/main/java/org/hyperledger/besu/tests/acceptance/dsl/node/ThreadBesuNodeRunner.java

Signed-off-by: Fabio Di Fabio <fabio.difabio@consensys.net>
2024-08-20 23:24:46 +00:00
Justin Florentine
38a025b870 Dagger controller tests (#7341)
* daggerize PrivacyReorgTest
* inline as many dagger bits into tests as possible
* refactored to use inner classes
* BesuComponent can now be provided


---------

Signed-off-by: Justin Florentine <justin+github@florentine.us>
Signed-off-by: Sally MacFarlane <macfarla.github@gmail.com>
Co-authored-by: Sally MacFarlane <macfarla.github@gmail.com>
2024-08-02 17:01:58 +00:00
Matt Whitehead
7e4a25a9ba Add new PoA network option to use bootnodes during any peer table refresh, not just the first one (#7314)
* Add new config option to use bootnodes during any peer table refresh, not just the first one

Signed-off-by: Matthew Whitehead <matthew1001@gmail.com>

* Update everything-config list

Signed-off-by: Matthew Whitehead <matthew1001@gmail.com>

* Revert debug setting

Signed-off-by: Matthew Whitehead <matthew1001@gmail.com>

* Update ethereum/p2p/src/main/java/org/hyperledger/besu/ethereum/p2p/discovery/internal/PeerDiscoveryController.java

Co-authored-by: Stefan Pingel <16143240+pinges@users.noreply.github.com>
Signed-off-by: Matt Whitehead <matthew1001@hotmail.com>

---------

Signed-off-by: Matthew Whitehead <matthew1001@gmail.com>
Signed-off-by: Matt Whitehead <matthew1001@hotmail.com>
Co-authored-by: Stefan Pingel <16143240+pinges@users.noreply.github.com>
2024-07-23 09:25:07 +00:00
Danno Ferrin
17f4dc9a8a Update unit test (#7317)
* Update parameterized unit tests so the enumerate with --dry-run
* Update the prague-withdrawal.json unit test to handle current code

Signed-off-by: Danno Ferrin <danno@numisight.com>
Co-authored-by: Sally MacFarlane <macfarla.github@gmail.com>
2024-07-15 04:31:18 +00:00
Stefan Pingel
8a9a84ad58 Check for snap server (#6609)
* EthPeer add isServingSnap to be able to make sure that we have enough snap servers connected when we are snap syncing

Signed-off-by: stefan.pingel@consensys.net <stefan.pingel@consensys.net>
Signed-off-by: Sally MacFarlane <macfarla.github@gmail.com>
Co-authored-by: Sally MacFarlane <macfarla.github@gmail.com>
2024-07-03 15:17:13 +10:00
Stefan Pingel
f5e5ad53e7 Investigate chain halts when syncing (#7162)
Fix some reasons for chain download halts when syncing

Signed-off-by: stefan.pingel@consensys.net <stefan.pingel@consensys.net>
Signed-off-by: Stefan Pingel <16143240+pinges@users.noreply.github.com>
Co-authored-by: Sally MacFarlane <macfarla.github@gmail.com>
2024-06-20 14:54:20 +10:00
Gabriel-Trintinalia
e3e86c7ef6 Subnet-Based Peer Permissions (#7168)
Signed-off-by: Gabriel-Trintinalia <gabriel.trintinalia@consensys.net>
2024-06-13 04:44:29 +00:00
Usman Saleem
c7e2e4dbbf fix(test): Fix dns daemon periodic test (#7200)
* fix(test): Fix dns daemon periodic test

Increase second run to 3 seconds

Signed-off-by: Usman Saleem <usman@usmans.info>

* fix(test): Fix dns daemon periodic test

change vertx testContext verify to failNow

Signed-off-by: Usman Saleem <usman@usmans.info>

* fix(test): Fix dns daemon periodic test

Remove Disabled

Signed-off-by: Usman Saleem <usman@usmans.info>

* fix(test): Code formatting

Signed-off-by: Usman Saleem <usman@usmans.info>

---------

Signed-off-by: Usman Saleem <usman@usmans.info>
2024-06-12 10:40:32 +10:00
Sally MacFarlane
186b4c5d21 disable flaky test (#7202)
Signed-off-by: Sally MacFarlane <macfarla.github@gmail.com>
2024-06-11 07:37:35 +00:00
Usman Saleem
54a3e6a287 feat: Refactor Node DNS Resolver to use vertx virtual threads (#7189)
Signed-off-by: Usman Saleem <usman@usmans.info>
2024-06-08 20:18:55 +10:00
Usman Saleem
e4902af05e feat: Node discovery via DNS (#7129)
- Node discovery via DNS module as a vertex verticle (code adapted from Tuweni)
- Mock DNS server in unit tests.

---------

Signed-off-by: Usman Saleem <usman@usmans.info>
Co-authored-by: Sally MacFarlane <macfarla.github@gmail.com>
2024-06-05 10:21:02 +10:00
garyschulte
ebb883075f Feature/fleet mode rebase (#6641)
* fleet mode squash commit rebase

Signed-off-by: garyschulte <garyschulte@gmail.com>
2024-05-22 17:02:34 +00:00
Stefan Pingel
5fa1750606 Peering - Find and remove peers from the peer table that share the same IP and TCP port with different discovery ports (#7089)
Find and remove peers from the peer table that share the same IP and TCP port with different discovery ports
---------

Signed-off-by: stefan.pingel@consensys.net <stefan.pingel@consensys.net>
Signed-off-by: Sally MacFarlane <macfarla.github@gmail.com>
Co-authored-by: Sally MacFarlane <macfarla.github@gmail.com>
2024-05-12 20:55:17 +10:00
Usman Saleem
d85036d3b2 Apply Hyperledger license header to ethereum/ethstats and ethereum/evmtool (#7037)
Signed-off-by: Usman Saleem <usman@usmans.info>
2024-05-02 22:18:04 +00:00
Usman Saleem
a98dfff4f6 build - Update license headers formatting (#7018)
Fix license headers formatting under: ethereum/

---------

Signed-off-by: Usman Saleem <usman@usmans.info>
2024-05-01 01:10:25 +00:00
StevenMia
2bb0a59860 chore: fix some typos in comments (#6951)
* chore: fix some typos in comments

Signed-off-by: StevenMia <flite@foxmail.com>

* Apply suggestions from code review

fix typo

Signed-off-by: Sally MacFarlane <macfarla.github@gmail.com>

---------

Signed-off-by: StevenMia <flite@foxmail.com>
Signed-off-by: Sally MacFarlane <macfarla.github@gmail.com>
Co-authored-by: Sally MacFarlane <macfarla.github@gmail.com>
2024-04-17 03:09:48 +00:00
Sally MacFarlane
6699907204 check for empty in disconnect reason bytes (#6938)
Signed-off-by: Sally MacFarlane <macfarla.github@gmail.com>
2024-04-15 14:45:35 +10:00
Sally MacFarlane
2a74ea1f1b richness for breach of protocol reasons (#6925)
Signed-off-by: Sally MacFarlane <macfarla.github@gmail.com>
2024-04-10 07:22:01 +00:00
Danno Ferrin
001080a72b Upgrade spotless to 1.22.0 (#6898)
Upgrade spotless to 1.22.0 and reformat.
This is required for Java21 support.

Signed-off-by: Danno Ferrin <danno@numisight.com>
Co-authored-by: Danno Ferrin <danno@numisight.com>
Co-authored-by: Sally MacFarlane <macfarla.github@gmail.com>
2024-04-09 04:12:56 +00:00
Sally MacFarlane
d753b2a5d6 added richness to useless peer disconnect reasons (#6899)
Signed-off-by: Sally MacFarlane <macfarla.github@gmail.com>
2024-04-08 16:54:03 +10:00
Jason Frame
758adc7d74 Improve logging of peer disconnects due to subprotocol triggered reason (#6886)
Signed-off-by: Jason Frame <jason.frame@consensys.net>
2024-04-05 18:21:47 +10:00
Sally MacFarlane
b04e82a4c2 [MINOR] nuke those extra ellipses (#6870)
* no extra ellipses

Signed-off-by: Sally MacFarlane <macfarla.github@gmail.com>

* no extra ellipses

Signed-off-by: Sally MacFarlane <macfarla.github@gmail.com>

* spurious semicolon

Signed-off-by: Sally MacFarlane <macfarla.github@gmail.com>

* duplicated word

Signed-off-by: Sally MacFarlane <macfarla.github@gmail.com>

---------

Signed-off-by: Sally MacFarlane <macfarla.github@gmail.com>
2024-04-03 09:44:59 +00:00
Usman Saleem
e954537fcc build - Refactor Besu custom error prone dependency (#6692)
Move Besu custom error-prone checks into its own repository and use it as an external dependency. This allows to move to a newer version of Google errorprone checks as well while cleaning up build.gradle file.

Key changes resulted due to this change:

* String toLowerCase and toUpperCase to use Locale.ROOT as argument
* Use interface such as List,Map or NavigatableMap instead of concrete class where appropriate.
* Simplify StringBuilder to plain String
* Suppress warnings where appropriate.
-----
Signed-off-by: Usman Saleem <usman@usmans.info>
2024-03-27 06:17:40 +10:00
Matt Whitehead
42b32d2531 Log an info message on startup to indicate if IPv6 peer connectivity is possible (#6750)
Signed-off-by: Matthew Whitehead <matthew1001@gmail.com>
2024-03-19 08:57:51 +00:00
Simon Dudley
6dd3c84052 Move potentially spammy peer discovery warn log to debug (#6728)
Signed-off-by: Simon Dudley <simon.dudley@consensys.net>
2024-03-14 05:48:07 +00:00
Danno Ferrin
9ef48d4399 Remove uses of org.jetbrains annotations (#6558)
* Remove uses of org.jetbrains annotations

We have a mix of org.jetbrains.annotations.NotNull and
javax.annotations.Nonnull. Change all to the latter. Add an errorprone
check to enforce this.

Signed-off-by: Danno Ferrin <danno.ferrin@swirldslabs.com>

* spotless

Signed-off-by: Danno Ferrin <danno.ferrin@swirldslabs.com>

* spdx

Signed-off-by: Danno Ferrin <danno.ferrin@swirldslabs.com>

---------

Signed-off-by: Danno Ferrin <danno.ferrin@swirldslabs.com>
2024-02-13 08:52:18 +10:00
Sally MacFarlane
2077bb78c4 Deprecate --Xp2p-peer-lower-bound (#6501)
* deprecate p2p-peer-lower-bound

Signed-off-by: Sally MacFarlane <macfarla.github@gmail.com>

---------

Signed-off-by: Sally MacFarlane <macfarla.github@gmail.com>
Co-authored-by: Stefan Pingel <16143240+pinges@users.noreply.github.com>
2024-02-02 11:11:10 +10:00
Stefan Pingel
497faef833 Disconnect worst peer (#6443)
* When refreshing, only disconnect a peer if we have max peers
* If we are disconnecting a peer, disconnect the least useful peer 

Signed-off-by: stefan.pingel@consensys.net <stefan.pingel@consensys.net>
Signed-off-by: Stefan Pingel <16143240+pinges@users.noreply.github.com>
Co-authored-by: Sally MacFarlane <macfarla.github@gmail.com>
2024-01-31 15:40:04 +10:00
garyschulte
79245bb9af Filter Discovered peers for ipv6 support (#6498)
* use existing NetworkUtility for PeerDiscoveryAgent pingpacket data filtering, add ipv6 check/fallback
* log at debug when we override pingpacket from
* use java native address parsing rather than lookup by host

Signed-off-by: garyschulte <garyschulte@gmail.com>
2024-01-30 20:44:24 -08:00
Sally MacFarlane
d47e52664a standardize on length of truncated peer ID logging (#6485)
* add a method for the loggable id to standardise the length

* use same length as peer id for short enode method

Signed-off-by: Sally MacFarlane <macfarla.github@gmail.com>

---------

Signed-off-by: Sally MacFarlane <macfarla.github@gmail.com>
Co-authored-by: Stefan Pingel <16143240+pinges@users.noreply.github.com>
2024-01-31 13:13:05 +10:00
garyschulte
98ab26df2f filter empty ipv4 and ipv6 ping packet source addresses (#6474)
* add empty ipv4 and ipv6 to the filtered ping packet source addresses

Signed-off-by: garyschulte <garyschulte@gmail.com>
2024-01-29 08:41:31 -08:00
garyschulte
30958e636d Add broadcast address to PingPacketData from filter (#6456)
* make list of ping packet data 'from' address which we ignore
* add test coverage

Signed-off-by: garyschulte <garyschulte@gmail.com>
2024-01-24 11:11:47 -08:00
Stefan Pingel
921bc175c8 Make fork id the default and try to recover the DiscoveryPeer for incoming connections from the PeerTable (#5628)
* make the request for the ENR the default and try to recover the DiscoveryPeer for incoming connections from the PeerTable

Signed-off-by: Stefan <stefan.pingel@consensys.net>
Signed-off-by: stefan.pingel@consensys.net <stefan.pingel@consensys.net>
2024-01-22 14:56:43 +10:00
Matt Whitehead
98718ae270 Only accept a address from a peer if it is a valid IP address (#6439)
Signed-off-by: Matthew Whitehead <matthew1001@gmail.com>
2024-01-19 14:08:53 +00:00
Matt Whitehead
925f4946b8 Use From field in a PING packet when creating a peer table entry (#6225)
* Use P2P 'from' host when parsing incoming P2P packets, if it is present

Signed-off-by: Matthew Whitehead <matthew1001@gmail.com>

* Use UDP source address if PING 'from' address is 127.0.0.1 and add a unit test.

Signed-off-by: Matthew Whitehead <matthew1001@gmail.com>

* Spotless Java, address PR comment

Signed-off-by: Matthew Whitehead <matthew1001@gmail.com>

* Refactor handleIncomingPacket to allow for specific trace logs to show how selection is being done

Signed-off-by: Matthew Whitehead <matthew1001@gmail.com>

* Add change log entry

Signed-off-by: Matthew Whitehead <matthew1001@gmail.com>

* Refactor handleIncomingPacket

Signed-off-by: Matthew Whitehead <matthew1001@gmail.com>

---------

Signed-off-by: Matthew Whitehead <matthew1001@gmail.com>
2024-01-19 10:34:02 +00:00