Commit Graph

104 Commits

Author SHA1 Message Date
Stefan Pingel
630ac85541 Close Sockets after testing for availablity (#6516)
Signed-off-by: stefan.pingel@consensys.net <stefan.pingel@consensys.net>
2024-02-02 17:45:57 +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
garyschulte
8972d6707c info level log for pipeline abort (#6459)
* info level log for pipeline abort
* add depth protection

Signed-off-by: garyschulte <garyschulte@gmail.com>
2024-01-30 12:42:31 -08:00
Sally MacFarlane
0c122732c6 removed vintage junit dependency (#6296)
Signed-off-by: Sally MacFarlane <macfarla.github@gmail.com>
2023-12-14 11:53:37 +01:00
Fabio Di Fabio
636ad8a65a Force tx replacement price bump to zero when zero base fee market is configured (#6079)
Signed-off-by: Fabio Di Fabio <fabio.difabio@consensys.net>
2023-11-08 15:26:22 +01:00
Danno Ferrin
03ff688043 Changes to allow evmtool t8n-server to work with execution-spec-tests (#5701)
An omnibus of minor changes needed for t8n-server to work with the EFs
new execution-spec-tests framework

* Reduce logging output
* Fix json library mismatch between t8n and t8n-server
* Add hook to enumerate supported forks
* temporarily map Shanghai+6780 to Cancun
* add to main distro under 'evmtool' name
* No longer support the "protected" attribute in TXes

Signed-off-by: Danno Ferrin <danno.ferrin@swirldslabs.com>
2023-07-18 17:47:54 -06:00
Suyash Nayan
cb12a2c410 Migrate util module to JUnit 5.0 (#5581)
Signed-off-by: 7suyash7 <suyashnyn1@gmail.com>
Co-authored-by: Sally MacFarlane <macfarla.github@gmail.com>
2023-06-12 14:25:40 +10:00
Stefan Pingel
534a369574 Move connect decision into protocol layer (#4759)
Move the decision making for connecting or not connecting to peers into the eth layer. Future changes will take advantage if this to improve peering.

Signed-off-by: Stefan <stefan.pingel@consensys.net>

---------

Signed-off-by: Stefan <stefan.pingel@consensys.net>
Signed-off-by: Sally MacFarlane <macfarla.github@gmail.com>
Co-authored-by: Sally MacFarlane <macfarla.github@gmail.com>
2023-04-14 09:28:29 +10:00
Fabio Di Fabio
97fb61df94 Add javadoc (#5329)
Signed-off-by: Fabio Di Fabio <fabio.difabio@consensys.net>
2023-04-12 06:53:00 +10:00
Fabio Di Fabio
a9b906cba5 Log jemalloc presence and version at startup (#4738)
Signed-off-by: Fabio Di Fabio <fabio.difabio@consensys.net>
2023-04-11 15:49:59 +02:00
Danno Ferrin
3e35dba092 Reduce Log4J API Exposures (#5189)
Reduce the number of places that expose Log4J classes as a part of the
interfaces for methods and classes. While Log4j remains the default we
still need to be able to function when the Log4J jars are removed from
the classpath.

Signed-off-by: Danno Ferrin <danno.ferrin@swirldslabs.com>
2023-03-11 15:12:10 -06:00
Diego López León
66c757dfa3 Update SLF4J version (#4587)
* Bump SLF4J version and replace helper for lambdas

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

* Remove unnecessary toString calls

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

* Replace unnecessaryy lambdas for constant references

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

---------

Signed-off-by: Diego López León <dieguitoll@gmail.com>
2023-02-28 08:10:09 -03:00
Usman Saleem
9eb32836b7 Fix javadocs to allow build to pass in JDK 17 (#4834)
- Added missing javadocs so that javadoc doclint passes against JDK 17 (invoke by Besu gradle build).
- Exclude following packages from javadoc lint:
org.hyperledger.besu.privacy.contracts.generated
org.hyperledger.besu.tests.acceptance.*
- Temporarily exclude ethereum and evm submodule for doc lint checks.
- Run the javadoc task using GitHub actions (use Java 17) to report any javadoc errors during the PR builds
- Updating plugin-api build.gradle with new hash as javadoc comments caused it to change

Signed-off-by: Usman Saleem <usman@usmans.info>
2023-01-18 22:51:00 +10:00
Daniel Lehrner
49f32ca22d Prints configuration overview (#4451)
* print configuration overview at startup

Signed-off-by: Daniel Lehrner <daniel.lehrner@consensys.net>
2022-11-22 14:41:06 +01:00
Gabriel Camargo Fukushima
42260fd56b Add port conflict exception (#4565)
Signed-off-by: Gabriel Fukushima <gabrielfukushima@gmail.com>
2022-11-02 15:42:16 +10:00
mark-terry
aa849839b8 Reduced logging level on Subscriber error callback. (#4485)
Signed-off-by: mark-terry <mark.terry@consensys.net>

Signed-off-by: mark-terry <mark.terry@consensys.net>
Co-authored-by: Sally MacFarlane <macfarla.github@gmail.com>
2022-10-07 12:12:57 +10:00
mustafauzunn
817c1cbc24 Java modules support (#4468)
Add java module info to the manifests of the following  libraries used by the Besu EVM

./crypto - org.hyperledger.besu.internal.Crypto
./ethereum/rlp - org.hyperledger.besu.internal.Rlp
./util - org.hyperledger.besu.internal.Util
./datatypes - org.hyperledger.besu.Datatypes
./evm - org.hyperledger.besu.Evm
./plugin-api - org.hyperledger.besu.PluginApi

Signed-off-by: Mustafa Uzun <mustafa.uzun@limechain.tech>
2022-10-04 03:45:44 +02:00
Matt Nelson
86c308096b Fixing sub logging and moving stack trace to debug. (#4334)
* Fixing sub logging and moving stack trace to debug.

Signed-off-by: Matt Nelson <matt.nelson@consensys.net>
Co-authored-by: Matt Nelson <matt.nelson@Matts-MacBook-Pro.local>
2022-08-31 16:32:35 -04:00
Danno Ferrin
d0c71c3bdc Remove Sonar Integration (#4135)
Sonar has been removed from the build workflow. This PR removes all
configuration and code markings that were used to facilitate it.

Signed-off-by: Danno Ferrin <danno.ferrin@gmail.com>
2022-07-21 23:28:20 +01:00
mbaxter
645fdd08ee [Issue 3867] Make eth subprotocol message size limit configurable (#4002)
Signed-off-by: Meredith Baxter <meredith.baxter@palm.io>
2022-06-22 23:12:08 -06: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
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
Jiri Peinlich
0fce76cc9f Batching backward sync (#3532)
* Backward sync now batches requests

Signed-off-by: Jiri Peinlich <jiri.peinlich@gmail.com>
2022-03-18 10:07:04 -07:00
garyschulte
3b5dafbfa0 Warn if consensus client doesn't call transition configuration endpoint within 120 seconds (#3569)
* add qos timer to engine_exchangeTransitionConfiguration

Signed-off-by: garyschulte <garyschulte@gmail.com>
Co-authored-by: Justin Florentine <justin+github@florentine.us>
2022-03-12 12:03:20 -08:00
Stefan Pingel
cd281946c8 fixed method name and some 'finals' (#3370)
Signed-off-by: Stefan Pingel <stefan.pingel@consensys.net>
2022-02-03 22:52:58 +01:00
garyschulte
b3e1b5f86c backport merge updates to main (#3341)
* backport merge updates to main

Signed-off-by: garyschulte <garyschulte@gmail.com>
2022-01-27 22:17:21 -08: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
George Patterson
c25483c29f Validate that blockperiodseconds is set to a positive integer (#3186)
Implemented getPositiveInt function in JsonUtil to validate a JSON positive number value. Using this function, the blockperiodseconds should now be validated whenever retrieved from the genesis config, including transitions.

Signed-off-by: George Patterson <g-patt@outlook.com>
2022-01-05 01:28:46 +00:00
Danno Ferrin
ed9d64d9cb Version upgrades for 22Q1 (#3217)
* lots of errorprone fixes
* some license updates
* some mockito updates
* upgrade the rocksdb version
* Prometheus left at 0.9.0 as 0.10.0+ introduces OpenMetrics 
  related changes that break unit tests.

Signed-off-by: Danno Ferrin <danno.ferrin@gmail.com>
2021-12-24 16:02:07 -07:00
Simon Dudley
6ad73e6375 QBFT migration: Create migrating mining coordinator (#3097)
Create MigratingMiningCoordinator, a schedulable mining coordinator that will switch between mining coordinators based on the consensus schedule.

https://github.com/hyperledger/besu/issues/2999

Signed-off-by: Simon Dudley <simon.dudley@consensys.net>
2021-12-07 01:41:37 +00: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
Danno Ferrin
55f7c502d3 Extract RollingFileReader and RollingFileWriter (#1614)
Extract RollingFileReader and RollingFileWriter to the utility package.

Signed-off-by: Danno Ferrin <danno.ferrin@gmail.com>
2020-11-30 21:18:08 -07:00
mark-terry
e783dd7294 Added zero gasPrice validation for Quorum compatibility mode. (#1554)
* Added zero gasPrice validation + configuration checks for GoQuorum compatibility mode.

Signed-off-by: Mark Terry <mark.terry@consensys.net>
2020-11-16 13:25:04 +10: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
Danno Ferrin
223d6457f9 Update GraalVM detection in Platform Detector (#1286)
How the GraalVM reports itself in the vendor and vm flags has evolved in
newer version.  Report GraalVM if it is seen in either string.

Signed-off-by: Danno Ferrin <danno.ferrin@gmail.com>
2020-08-07 15:41:21 -06:00
matkt
c8e23c970e Add ethstats support (#1239)
Signed-off-by: Karim TAAM <karim.t2am@gmail.com>
2020-08-04 09:54:20 +02:00
Ratan (Rai) Sur
c231d0e704 Migrate some OptionalInt's to Optional<Integer>s (#1242)
Signed-off-by: Ratan Rai Sur <ratan.r.sur@gmail.com>
2020-07-23 11:35:33 -05:00
Ratan (Rai) Sur
78f203d8a3 Copy Subscribers to Prevent Unwanted Recursion (#1169)
Occasionally, a callback given to a subscriber will complete a future 
which then runs another task which adds another callback to the 
subscriber list of the same type. By the time the first callback is 
finished, the new callback (which presumably wants another "real" 
instance of the event to happen) could be next up in the list of the 
first's subscribers callback iteration. This takes a snapshot of the 
subscribers when the desired event happens so there's no risk of 
following down the rabbit hole.

I collected some rough data about the size of the subscriber lists to 
see the penalty for copying them and I found that by the time a full 
sync began or a fast sync had started downloading headers, the maximum 
subscribers any one Subscribers class had was 7.

Signed-off-by: Ratan Rai Sur <ratan.r.sur@gmail.com>
2020-07-08 10:42:55 -05:00
Danno Ferrin
256e5c914d Errorprone version upgrade (#1096)
Upgrade to ErrorProne 2.4.0

* public constructors on abstract classes are removed
* Javadoc must have meaningfull documentation
* lambdas should not be variables
* Added to the list of confusing inner class names (Entry and Type)
* no assert keyword in tests
* Obsolete JDK classes produce errors now

Signed-off-by: Danno Ferrin <danno.ferrin@gmail.com>
2020-06-17 10:34:56 -06:00
Abdelhamid Bakhta
8589177e49 Fix EIP-2124 Fork identifier for chain compatibility checks. (#1050)
Before this pull request Besu was using the latest known fork id to create status message for Ethereum P2P protocol handshake.
This latest known fork id was created based on a list of forks retrieved from the Genesis.
For private networks it is possible that all fork blocks number are set to 0.
The algorithm to compute the valid fork hashes excludes 0 values.
As a result, the list was empty and the `getLatestForkId` was returning `null`. This is an issue when you support capabilities >= to Eth/64 sub protocol because other peers expect the fork id value in the `RLP` encoded message.
Moreover, the algorithm to compute the fork id should be aware of the chain head number and update `CRC` value only for fork blocks below the current head.
This pull request fixes this issue by fetching the chain head number and update accordingly the `CRC` value.
Unit tests have been extended to cover an exhaustive list of possible combinations on named networks (`goerli`, `rinkeby`, `ropsten` and `mainnet`).

Signed-off-by: Abdelhamid Bakhta <abdelhamid.bakhta@consensys.net>
2020-06-09 17:59:35 +02:00
Ratan Rai Sur
fbdd5301b0 Replace FutureUtil method with standard library equivalent (#390)
Signed-off-by: Ratan Rai Sur <ratan.r.sur@gmail.com>
2020-04-03 13:54:10 -04:00
Antoine Toulme
b9c6c4b3cc Add eth65 support (#608)
* Add eth65 support

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

* Fix integration tests

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

* Fix acceptance tests

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

* add acceptance test that checks that transactions are gossiped between peers

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

* Update ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/messages/LimitedNewPooledTransactionHashesMessages.java

Co-Authored-By: Danno Ferrin <danno.ferrin@shemnon.com>
Signed-off-by: Antoine Toulme <antoine@lunar-ocean.com>

* code review comments

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

* Code review changes

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

* Reviewing diffs

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

* smaller synchronized blocks

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

Co-authored-by: Danno Ferrin <danno.ferrin@shemnon.com>
2020-04-01 11:16:09 -07: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
e493b91742 Restore "FieldCanBeFinal" errorprone check (#287)
This was turned off a number of months ago because of long build times.
However it appears either because of code structure changes or fixed
errorprone that this finishes in a reasonable time now.

Code that violated this check is also fixed.

Signed-off-by: Danno Ferrin <danno.ferrin@gmail.com>
2020-01-02 10:27:54 -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
Ratan Rai Sur
271d578956 Log Event Streaming for Plugin API (#186)
Signed-off-by: Ratan Rai Sur <ratan.r.sur@gmail.com>
2019-11-13 17:03:38 -05: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
mbaxter
684a01e202 [PAN-3140] Expand p2p config options (#1940)
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
2019-09-13 16:14:07 -04:00