Commit Graph

51 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
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
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
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
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
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
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
Danno Ferrin
33751dc50f Address import performance issues (#5734)
* ensure we are on a single tuweni version
* factor out an unneeded concatenate

Signed-off-by: Danno Ferrin <danno.ferrin@swirldslabs.com>
2023-08-02 12:56:37 +10:00
Nischal Sharma
a5fe79f1ad ethereum/p2p - migrated tests from Junit4 to Junit5 (#5718)
Signed-off-by: Nischal Sharma <nischal@web3labs.com>
Co-authored-by: Sally MacFarlane <macfarla.github@gmail.com>
2023-07-26 04:41:08 +10:00
Antoine Toulme
901661cb4f Update tuweni2.4.2 (#5684)
* Revert "Revert "Update Tuweni to 2.4.1 (#5513)" (#5585)"

This reverts commit 6111e1bbc3.

Signed-off-by: Antoine Toulme <antoine@lunar-ocean.com>

* update Tuweni to 2.4.2

Signed-off-by: Antoine Toulme <antoine@lunar-ocean.com>

---------

Signed-off-by: Antoine Toulme <antoine@lunar-ocean.com>
2023-07-11 22:26:32 -07:00
Sally MacFarlane
6111e1bbc3 Revert "Update Tuweni to 2.4.1 (#5513)" (#5585)
This reverts commit b96418143c.

Signed-off-by: Sally MacFarlane <macfarla.github@gmail.com>
2023-06-13 13:12:23 +10:00
Fabio Di Fabio
c3ab8e017d Improve log of p2p messages (#5542)
* Improve log of p2p messages

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

* [skip ci] Update ethereum/p2p/src/main/java/org/hyperledger/besu/ethereum/p2p/rlpx/wire/AbstractMessageData.java

Co-authored-by: Gabriel Fukushima <gabrielfukushima@gmail.com>
Signed-off-by: Fabio Di Fabio <fabio.difabio@consensys.net>

* Use a more flexible way to trim logged data

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

* Sanitize user input before printing it in logs

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

---------

Signed-off-by: Fabio Di Fabio <fabio.difabio@consensys.net>
Co-authored-by: Gabriel Fukushima <gabrielfukushima@gmail.com>
Co-authored-by: Sally MacFarlane <macfarla.github@gmail.com>
2023-06-09 14:38:41 +10:00
Antoine Toulme
b96418143c Update Tuweni to 2.4.1 (#5513)
* update to 2.4.1

* update use of DNS daemon with Vertx

* fix issue with Bytes.repeat

* update antlr version

* fix dns tests

Signed-off-by: Antoine Toulme <antoine@lunar-ocean.com>

---------

Signed-off-by: Antoine Toulme <antoine@lunar-ocean.com>
Co-authored-by: Sally MacFarlane <macfarla.github@gmail.com>
2023-06-09 12:31:20 +10:00
Danno Ferrin
ebbc0df773 Reduce EVM module dependencies (#5285)
Refactor crypto, datatypes, and plugin-api to reduce plugin APIs in the EVM.

Split crypto into crypto services and crypto algorithms
Reverse the dependency between datatyps and plugin-api.
Remove plugin Hash and Address types (use datatypes)
Move PublicKey and Quantity into datatypes.

Lots of changes to imports and build files, and some fromPlugin calls removed.

Signed-off-by: Danno Ferrin <danno.ferrin@swirldslabs.com>
Signed-off-by: Danno Ferrin <danno.ferrin@shemnon.com>
Co-authored-by: Justin Florentine <justin+github@florentine.us>
2023-03-30 18:34:37 -05:00
Diego López León
98dc2ace37 Upgrade Web3J (#3752)
* Upgrade web3j dependencies to latest versions

Signed-off-by: Diego López León <dieguitoll@gmail.com>
Signed-off-by: Antony Denyer <git@antonydenyer.co.uk>
Co-authored-by: Antony Denyer <git@antonydenyer.co.uk>
Co-authored-by: Miguel Rojo <miguelangel.rojofernandez@mastercard.com>
Co-authored-by: Miguel Angel Rojo <freemanz1486@gmail.com>
2022-08-04 08:59:02 -06:00
Danno Ferrin
755771d22c Dependency Version Updates for 22.7.0-RC1 (#4004)
Update dependency versions.

Dependencies skipped because they require compatibility work
 * vertx
 * JMH
 * Prometheus
 * RocksDB
 * Web3j
 * Gradle

Signed-off-by: Danno Ferrin <danno.ferrin@gmail.com>
2022-06-23 11:03:07 -03:00
Danno Ferrin
daf680c97b Reduce EVM library dependencies (#3832)
* Reduce EVM library dependencies

Reduce the runtime dependencies of the EVM module by moving a
class used by a single class out of util to the owned module (QosTimer)
and them removing un-used dependencies from EVM and dependant modules.

Signed-off-by: Danno Ferrin <danno.ferrin@gmail.com>
2022-05-16 10:12:37 +10:00
Fabio Di Fabio
386945984a Filter Netty native lib errors likewise the pure Java implementation (#3807)
Signed-off-by: Fabio Di Fabio <fabio.difabio@consensys.net>
2022-05-11 08:54:26 +02:00
Sally MacFarlane
baed1ef02c add constraint for jnr-posix dependency (#3789)
* require 3.1.15 of jnr-posix

* cover more bases with epl license

Signed-off-by: Sally MacFarlane <sally.macfarlane@consensys.net>

Co-authored-by: Stefan Pingel <16143240+pinges@users.noreply.github.com>
2022-05-06 13:58:44 +10:00
Danno Ferrin
b4027d6e39 Use JUnit 5 for unit test execution (#3620)
Change the unit test execution to use the Junit5 JUnitPlatform. This
allows for a mix of junit 4 and junit 5 tests and for a gradual
migration to junit 5 instead of a big bang. One class depended on
junit 4 exceptions and was updated. Two tests depending on 
native libraries fail gracefully on mac (and only mac).

Signed-off-by: Danno Ferrin <danno.ferrin@gmail.com>
2022-04-02 00:34:48 +10:00
Diego López León
ed1329cf84 Introduce SLF4J for logging (#3285)
* Bump SLF4J version

Signed-off-by: Diego López León <dieguitoll@gmail.com>

* Replace log4j2 API with SLF4j API

Signed-off-by: Diego López León <dieguitoll@gmail.com>

* Replace usage of LogManager#getFormatterLogger

This is for keeping compatibility with SLF4J. If neccesary, a specific formatter can be created for the RlpBlockImporter class

Signed-off-by: Diego López León <dieguitoll@gmail.com>

* Unset the default logging value for the retesteth

This is because it's not possible to resolve the root logger level into a Log4J2 field

Signed-off-by: Diego López León <dieguitoll@gmail.com>

* Prevent creation of Logger context outside SLF4J

org.hyperledger.besu.cli.BesuCommand#setAllLevels was taken from
https://github.com/apache/logging-log4j2/blob/rel%2F2.17.1/log4j-core/src/main/java/org/apache/logging/log4j/core/config/Configurator.java#L309

Signed-off-by: Diego López León <dieguitoll@gmail.com>

* Add FATAL level deprecation message

Signed-off-by: Diego López León <dieguitoll@gmail.com>

* [Sonar] Fix java:S2139

Exceptions should be either logged or rethrown but not both

Signed-off-by: Diego López León <dieguitoll@gmail.com>

* [Sonar] Fix java:S3457

Printf-style format strings should be used correctly

Signed-off-by: Diego López León <dieguitoll@gmail.com>

* Add changelog

Signed-off-by: Diego López León <dieguitoll@gmail.com>
2022-01-25 20:14:54 -03:00
Diego López León
7daa4f871f Vert.x upgrade (with tests) (#3135)
* compile issues sorted, some tests failing

Signed-off-by: Justin Florentine <justin+github@florentine.us>

* closing runnerBehind closes the vertx shared with runnerAhead, which now throws an exception

Signed-off-by: Justin Florentine <justin+github@florentine.us>

* checkpoint when 4/5 websocket login tests pass

Signed-off-by: Justin Florentine <justin+github@florentine.us>

* exp moved to attribute from principal

Signed-off-by: Justin Florentine <justin+github@florentine.us>

* fixed more tests

Signed-off-by: Justin Florentine <justin+github@florentine.us>

* fixed more tests

Signed-off-by: Justin Florentine <justin+github@florentine.us>

* exception handling test improvement

Signed-off-by: Justin Florentine <justin+github@florentine.us>

* exception handling test improvement

Signed-off-by: Justin Florentine <justin+github@florentine.us>

* static renamed

Signed-off-by: Justin Florentine <justin+github@florentine.us>

* We want old implementation of the host()

Newly vertex handles the forward headers and modifies host(). In the
process vert.x loses track of port from Host header in case the port was
not a string.

Signed-off-by: Jiri Peinlich <jiri.peinlich@gmail.com>

* adding dependency on jackson-databind for tests

Signed-off-by: Jiri Peinlich <jiri.peinlich@gmail.com>

* making sure changes are spotless

Signed-off-by: Jiri Peinlich <jiri.peinlich@gmail.com>

* Dealing with regression

Signed-off-by: Jiri Peinlich <jiri.peinlich@gmail.com>

* fixing last failing vert.x test hopefully

Signed-off-by: Jiri Peinlich <jiri.peinlich@gmail.com>

* removed commented out code

Signed-off-by: Justin Florentine <justin+github@florentine.us>

* reverts debugging adjustment

Signed-off-by: Justin Florentine <justin+github@florentine.us>

* removed commented out code

Signed-off-by: Justin Florentine <justin+github@florentine.us>

* minor whitespace cleanup

Signed-off-by: Justin Florentine <justin+github@florentine.us>

* (internal) Refactor 'onchain' to 'flexible' where applicable (#3075)

* CLI option name change

Signed-off-by: Frank Li <b439988l@gmail.com>

* refactor privacyparameters.java and add deprecation warning

Signed-off-by: Frank Li <b439988l@gmail.com>

* more refactoring

Signed-off-by: Frank Li <b439988l@gmail.com>

* add to everything.toml

Signed-off-by: Frank Li <b439988l@gmail.com>

* bugs

Signed-off-by: Frank Li <b439988l@gmail.com>

* more missing variable names

Signed-off-by: Frank Li <b439988l@gmail.com>

* more classes

Signed-off-by: Frank Li <b439988l@gmail.com>

* more classes

Signed-off-by: Frank Li <b439988l@gmail.com>

* fix compile error

Signed-off-by: Frank Li <b439988l@gmail.com>

* add new test to invalidate passing both commands

Signed-off-by: Frank Li <b439988l@gmail.com>

* more refactoring + more tests

Signed-off-by: Frank Li <b439988l@gmail.com>

* new batch

Signed-off-by: Frank Li <b439988l@gmail.com>

* final batch?

Signed-off-by: Frank Li <b439988l@gmail.com>

* failing unit test

Signed-off-by: Frank Li <b439988l@gmail.com>

* revert incorrect refactoring back to onchain

Signed-off-by: Frank Li <b439988l@gmail.com>

* fix unit test

Signed-off-by: Frank Li <b439988l@gmail.com>

* comment

Signed-off-by: Frank Li <b439988l@gmail.com>

* comment

Signed-off-by: Frank Li <b439988l@gmail.com>

* support both privx methods

Signed-off-by: Frank Li <b439988l@gmail.com>

* add to changelog

Signed-off-by: Frank Li <b439988l@gmail.com>

* address comment

Signed-off-by: Frank Li <b439988l@gmail.com>

* add plugin privacy

Signed-off-by: Frank Li <b439988l@gmail.com>
Signed-off-by: Justin Florentine <justin+github@florentine.us>

* checkpoint when 4/5 websocket login tests pass

Signed-off-by: Justin Florentine <justin+github@florentine.us>

* trying to figure out how to decouple this test

Signed-off-by: Justin Florentine <justin+github@florentine.us>

* spotless

Signed-off-by: Justin Florentine <justin+github@florentine.us>

* removes Orion from integration test

Signed-off-by: Justin Florentine <justin+github@florentine.us>

* spotless

Signed-off-by: Justin Florentine <justin+github@florentine.us>

* Add jackson dependency to merge module

Signed-off-by: Diego López León <dieguitoll@gmail.com>

* Migrate JWTAuthOptions creations for public keys

Signed-off-by: Diego López León <dieguitoll@gmail.com>

* Check http client response status

Signed-off-by: Diego López León <dieguitoll@gmail.com>

* Replace Orian with Tessera in tests

Signed-off-by: Diego López León <dieguitoll@gmail.com>

* Change Tessera expected error messages in tests

Signed-off-by: Diego López León <dieguitoll@gmail.com>

* Change executor of integrationTests to allow spanning Docker processes

Signed-off-by: Diego López León <dieguitoll@gmail.com>

Co-authored-by: Justin Florentine <justin+github@florentine.us>
Co-authored-by: Jiri Peinlich <jiri.peinlich@gmail.com>
Co-authored-by: Frank Li <39414003+frankisawesome@users.noreply.github.com>
Co-authored-by: Sally MacFarlane <sally.macfarlane@consensys.net>
2021-12-22 08:52:32 +10:00
Justin Florentine
89d936dca1 removes transitive deps on slf4j impl (#2988)
Signed-off-by: Justin Florentine <justin+github@florentine.us>

Co-authored-by: Sally MacFarlane <sally.macfarlane@consensys.net>
2021-11-11 10:45:27 +10:00
Danno Ferrin
2abc7074bb Create new datatypes module for Address, Hash, and Wei (#2779)
* Create new datatypes module

Create a new `datatypes` module to hold datatypes that are broadly used.
This will aid modularization by making sure the base types in the module
minimize the amount of unrelated support classes needed.

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

* Add Address, Hash, and Wei to datatypes

Move the Address, Hash, and Wei to datatypes in as they are needed for
EVM modularization.

Signed-off-by: Danno Ferrin <danno.ferrin@gmail.com>
2021-09-20 14:08:09 -06:00
Antoine Toulme
11f5cfb022 Upgrade to Apache Tuweni 2.0 (#2376)
* Upgrade to Apache Tuweni 2.0

Signed-off-by: Antoine Toulme <antoine@lunar-ocean.com>

* Remove intermediate repository

Signed-off-by: Antoine Toulme <antoine@lunar-ocean.com>

* Remove all occurrences of toBytes

Signed-off-by: Antoine Toulme <antoine@lunar-ocean.com>

* Migrate to tuweni-bytes

Signed-off-by: Antoine Toulme <antoine@lunar-ocean.com>

* add changelog

Signed-off-by: Antoine Toulme <antoine@lunar-ocean.com>

* correct reference tests

Signed-off-by: Antoine Toulme <antoine@lunar-ocean.com>

* Initial API changes

Signed-off-by: Antoine Toulme <antoine@lunar-ocean.com>

* more changes

Signed-off-by: Antoine Toulme <antoine@lunar-ocean.com>

* Change APIs for VM ops

Signed-off-by: Antoine Toulme <antoine@lunar-ocean.com>

* Use constant UInt256.ONE

Signed-off-by: Antoine Toulme <antoine@lunar-ocean.com>

* Optimize a bit address <> word transformation

Signed-off-by: Antoine Toulme <antoine@lunar-ocean.com>

* spotless

Signed-off-by: Antoine Toulme <antoine@lunar-ocean.com>
2021-07-17 00:15:27 +02:00
Saravana Perumal Shanmugam
a2767b6adc p2p tls support (#2473)
* Added support for Devp2p-over-tls

Signed-off-by: Saravana Perumal Shanmugam <perusworld@linux.com>
2021-07-02 08:50:08 +12:00
David Mechler
8497b324c7 Create/update/store ethereum node record(ENR) (#1680)
* #1561 - Create/store/update ENR when local node is created

Signed-off-by: David Mechler <david.mechler@consensys.net>

* #1561 - spotlessApply

Signed-off-by: David Mechler <david.mechler@consensys.net>

* Update discovery library to prod version 0.4.1

Signed-off-by: David Mechler <david.mechler@consensys.net>
2020-12-09 14:19:45 -05:00
Antoine Toulme
f41fb97ae4 Add DNS discovery (#1595)
* Add DNS discovery for goerli, rinkeby and mainnet to help speed up discovery of peers

Signed-off-by: Antoine Toulme <antoine@lunar-ocean.com>

* Add final to constant fields

Signed-off-by: Antoine Toulme <antoine@lunar-ocean.com>

Co-authored-by: David Mechler <david.mechler@consensys.net>
2020-11-25 12:16:18 -08:00
Antoine Toulme
b9364ed243 Upgrade to Apache Tuweni 1.2.0 (#1493)
* Upgrade to Apache Tuweni 1.2.0

Signed-off-by: Antoine Toulme <antoine@lunar-ocean.com>

* no jsr305

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

Co-authored-by: Danno Ferrin <danno.ferrin@gmail.com>
2020-11-05 15:40:42 -08:00
matkt
210c85c82e Add dns support (#1247)
This PR add the support to DNS. By default Besu refuses the use of a DNS but it is possible to use it by adding the following flag --Xdns-enabled=true. Adding this flag will resolve the hostname when starting besu and then it won't change

If there is a need for a more dynamic update (eg for permissioning) add also this flag --Xdns-update-enabled = true ( this will query the DNS every time. So you must trust the DNS on which you are looking for the IP)

Signed-off-by: Karim TAAM <karim.t2am@gmail.com>
2020-08-25 19:12:28 +02:00
Trent Mohay
57d0379bf5 Separate NodeKey from implementation (#690)
This change allows the newly defined "SecurityModule" to work against a generic API, while the NodeKey interface adapts these generic types to the types already used throughout Besu (i.e. those defined in Secp256k1).

Signed-off-by: Trent Mohay <trent.mohay@consensys.net>
2020-04-14 15:33:16 +10:00
Danno Ferrin
838f7aa5e0 Fix Gradle 7.0 compatibility issues and build warnings (#288)
Removes as many Gradle 7.0 compatibility issues as possible
* `baseName` -> `archiveBaseName`
* `extension` -> `archiveExtension`
* `destinationDir` -> `destinationDirectory`
* `runtime` -> `runtimeOnly`
* Change some log4j-api and log4j-core dependencies
* Remove an unneeded and outdated plugin (`net.ltgt.apt`)
* tweak the plugin-api change detector's property annotations.

Warnings still exist with one external plugin used for license file
checking that we do not control the source code for.

Signed-off-by: Danno Ferrin <danno.ferrin@gmail.com>
2020-01-13 08:28:50 -07:00
Danno Ferrin
dfad8bff78 Update Dependencies (#281)
Update dependencies to most current version
 - except picocli which is a major version update
Alphabetize dependencies

Signed-off-by: Danno Ferrin <danno.ferrin@gmail.com>
2020-01-01 20:42:13 +13:00
Antoine Toulme
ccefada736 Move to Apache Tuweni Bytes library (#215)
Signed-off-by: Antoine Toulme <antoine@lunar-ocean.com>
Signed-off-by: Danno Ferrin <danno.ferrin@gmail.com>
2019-12-20 12:05:15 +10:00
Joshua Fernandes
bac5c673d3 Adding a spdx license check gradle task (#30)
* adding in spdx-license-identifier & updated check for the same; removing license check from spotless

Signed-off-by: Joshua Fernandes <joshua.fernandes@consensys.net>

* Change CheckSpdxHeader to a task.

Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
2019-09-20 14:59:57 +10:00
Joshua Fernandes
d6a2394e2d Migrating Pantheon to Besu (#1945)
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
2019-09-16 11:14:10 +10:00
Stephen Shelton
3e410b48fc Add UPnP Support (#1334)
Add support for working within Network Address Translation (NAT) environments.

This adds a CLI flag `--nat-method` with two options,  `NONE` (the default and 
current behavior) and `UPNP.`  `--nat-method` will affect what IP address and 
ports are advertised via the P2P discovery and other APIs that report the 
address and port for P2P actions.

`UPNP` is intended for a typical home or small office environment where a 
wireless router or modem provides NAT isolation. 
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
2019-07-06 12:50:52 -06:00
mbaxter
037a6e8527 [PAN-2783] Invert dependency between permissioning and p2p (#1557)
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
2019-06-14 11:19:39 -04:00
Danno Ferrin
cf2acc2a75 Refactor RocksDBStats (#1266)
Move RocksDBStats to it's own module.  This also brings metrics to
metrics:core since none of our other module have nested modules but
they have peer modules.


Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
2019-04-12 21:15:33 -06:00
mbaxter
bb3d494415 [PAN-2363] Connect to peers without explicitly defined tcp ports (#1144)
Most peers discovered on the network only define a single UDP port and have no explicitly defined TCP port. At least some of these peers are listening on the TCP port matching the advertised UDP port so assume the ports are the same and attempt a connection.
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
2019-03-21 08:41:08 +10:00
Michael Connor
27c3ad5f78 Nc 1942 Add account whitelisting and refactor into permissioning package (#460)
* WS sync subscription delay added

* WS sync subscription delay added with unit testing

* WS sync subscription delay added with unit testing

* changed number to a constant in constructor

* Use default from websocket class instead of making new one

* Removed magic numbers

* Added Controller

* Refactor permissioning config and account whitelist into permissioning package

* Refactor permissioning config and account whitelist into permissioning package

* Refactor permissioning config and account whitelist into permissioning package

* Merge branch 'master' of https://github.com/PegaSysEng/pantheon into NC-1942

# Conflicts:
#	consensus/ibft/src/test/java/tech/pegasys/pantheon/consensus/ibft/statemachine/IbftControllerTest.java
#	docs/Getting-Started/ExplorerBlockDetails.png
#	docs/Getting-Started/ExplorerSearch.png
#	docs/Getting-Started/ExplorerSummary.png
#	ethereum/permissioning/src/main/java/tech/pegasys/pantheon/ethereum/permissioning/PermissioningConfiguration.java
#	ethereum/permissioning/src/test/java/tech/pegasys/pantheon/ethereum/permissioning/PermissioningConfigurationTest.java
#	pantheon/src/main/java/tech/pegasys/pantheon/cli/PantheonCommand.java
#	pantheon/src/test/java/tech/pegasys/pantheon/cli/PantheonCommandTest.java

* Merge branch 'master' of https://github.com/PegaSysEng/pantheon into NC-1942

# Conflicts:
#	consensus/ibft/src/test/java/tech/pegasys/pantheon/consensus/ibft/statemachine/IbftControllerTest.java
#	docs/Getting-Started/ExplorerBlockDetails.png
#	docs/Getting-Started/ExplorerSearch.png
#	docs/Getting-Started/ExplorerSummary.png
#	ethereum/permissioning/src/main/java/tech/pegasys/pantheon/ethereum/permissioning/PermissioningConfiguration.java
#	ethereum/permissioning/src/test/java/tech/pegasys/pantheon/ethereum/permissioning/PermissioningConfigurationTest.java
#	pantheon/src/main/java/tech/pegasys/pantheon/cli/PantheonCommand.java
#	pantheon/src/test/java/tech/pegasys/pantheon/cli/PantheonCommandTest.java

* Iron out merge conflict introduced bugs

* Iron out merge conflict introduced bugs

* Iron out merge conflict introduced bugs

* PR Change request actioned

* PR Change request actioned

* PR Change request actioned

* PR Change request actioned

* updated node whitelist acceptance test to conform to refactored permissioning package

* text change

Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
2018-12-20 18:15:23 +10:00
Adrian Sutton
b2ad123443 Begin capturing metrics to better understand Pantheon's behaviour (#326)
Metrics being captured initially:

Total number of peers ever connected to
Total number of peers disconnected, by disconnect reason and whether the disconnect was initiated locally or remotely.
Current number of peers
Timing for processing JSON-RPC requests, broken down by method name.
Generic JVM and process metrics (memory used, heap size, thread count, time spent in GC, file descriptors opened, CPU time etc).
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
2018-11-30 09:56:47 +10:00
Danno Ferrin
d4fff610c6 Dependencies Version upgrade (#303)
Upgrade dependency versions

* All version information is merged into one place
* Upgrade most version to their latest non-test version.
* dependencies are now sorted

Two dependencies were not upgraded:

errorprone - There are new checks that require build or source changes.
vertex - The license to eclipse 2.0 which is not in our current approved license list. 
    The change is trivial but for tracability it should be done alone.

Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
2018-11-26 08:33:40 -07:00
Adrian Sutton
5d3d87c451 Switch back to Xerial Snappy Library (#284)
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
2018-11-20 16:59:11 +10:00
Danno Ferrin
0716e6044b Update Client Version to be ethstats friendly (#258)
Update value returned by web3_clientVersion to be ethstats friendly

* Version part starts with a v
* SNAPSHOT builds report 32 bits of the git hash
* OS and architecture are sniffed out and reported
* JVM version and branding are sniffed out and reported

Example values (not all real):
pantheon/v0.9.0-dev-f800a0b1/osx-x86_64/oracle-java-1.8
pantheon/v0.9.0-dev-27960b57/osx-x86_64/zulu-java-11
pantheon/v0.9.0/linux-arm64/openjdk-java-12
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
2018-11-14 08:08:45 -07:00
Danno Ferrin
42b4a84a58 Snappy compression failures (#257)
Replace the JNI based snappy library with an all Java version.  
This will help work on #251 because the error messages are more reasonable
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
2018-11-13 14:51:33 -07:00
mark-terry
cb01231ac0 [NC-862] License headers applied to non-java files (#93)
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
2018-10-19 07:26:11 +10:00
Chris Mckay
75ce3a4f02 [MINOR] removing executable from files (#14)
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
2018-10-10 14:22:54 +11:00