Commit Graph

113 Commits

Author SHA1 Message Date
Matilda-Clerke
84cd2660a0 7935: Add E2StoreReader (#8329)
* Refactor to use clock to validate expiry

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

* 7935: Finish unit testing E2StoreReader

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

* Build out E2StoreReader and associated files

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

* Spotless

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

* Add javadoc to new util module classes

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

* Remove unnecessary e2 and era file stuff

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

* Rename files to be era1 specific

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

* Rename e2 package to era1

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

* Spotless

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

* Rename Era1StoreReaderListener to Era1ReaderListener

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

* Use bouncycastle for little endian to long conversion

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

* Rename slot related variables to blockIndex

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

* Spotless

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

* Use Pack.littleEndianToLong with length to avoid using Arrays.concatenate

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

---------

Signed-off-by: Matilda Clerke <matilda.clerke@consensys.net>
2025-03-04 22:18:53 +00:00
Fabio Di Fabio
428a638569 Allow plugins to propose transactions during block creation (#8268)
* Allow plugins to propose transactions during block creation

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

* Apply suggestions from code review

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

* Document AbstractStatefulTransactionSelector

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

* Unit tests for BlockSizeTransactionSelectorTest

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

---------

Signed-off-by: Fabio Di Fabio <fabio.difabio@consensys.net>
2025-02-12 15:59:59 +01: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
Usman Saleem
77183f6d60 javadoc: Adding javadoc for ethstats module (#7269)
* javadoc: Adding javadoc for ethstats module

---------

Signed-off-by: Usman Saleem <usman@usmans.info>
2024-06-27 03:09:00 +00:00
Usman Saleem
2d59f4dd7e feat!: Java 21 for build and runtime (#7177)
* build: Update jacoco version to 0.8.11
* build: Enforce Java 21 and above check for build
* CI: Use Java 21 in Github CI workflows
* CI: Use Java 21 in circleci workflows
* build: Update gradle verification metadata for jacoco 0.8.11
* refactor: Fix javadoc related warnings which are applicable to Java 21
* fix(test): BackwardSyncAlgSpec slightly increase timeout to pass it in CI

---------

Signed-off-by: Usman Saleem <usman@usmans.info>
2024-06-06 15:29:18 +10:00
Usman Saleem
9d27c509be Apply Hyperledger license header (#7029)
-- plugin-api/ util/

Signed-off-by: Usman Saleem <usman@usmans.info>
2024-05-02 20:12:43 +10:00
Usman Saleem
4c3f4b37a2 build - Update license headers formatting (#7017)
Fix headers formatting under: enclave/ evm/ nat/ pki/ util/
---------

Signed-off-by: Usman Saleem <usman@usmans.info>
2024-05-01 00:36:34 +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
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
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