Commit Graph

86 Commits

Author SHA1 Message Date
Sally MacFarlane
407f84a98b Plugins migrate to junit5 (#5703)
* Migrate util module to JUnit 5.0

Signed-off-by: 7suyash7 <suyashnyn1@gmail.com>

* Migrate plugins to Junit 5.0

Signed-off-by: 7suyash7 <suyashnyn1@gmail.com>

* refactor tests

Signed-off-by: 7suyash7 <suyashnyn1@gmail.com>

* removed file properly

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

---------

Signed-off-by: 7suyash7 <suyashnyn1@gmail.com>
Signed-off-by: Sally MacFarlane <macfarla.github@gmail.com>
Co-authored-by: 7suyash7 <suyashnyn1@gmail.com>
2023-07-18 01:32:24 +10:00
matkt
9f42a3f261 remove v0 version of the database (#5698)
Signed-off-by: Karim TAAM <karim.t2am@gmail.com>
2023-07-13 15:45:33 +02: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
db173ebd98 services - migrate to junit 5 (#5613)
* services to junit5

* removed some junit4 engine imports

* updated some plugins test since these extend from testutil KV storage

* one more form of EPL v2

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

---------

Signed-off-by: Sally MacFarlane <macfarla.github@gmail.com>
2023-06-21 09:12:51 +10:00
matkt
180c75197c Healing Mechanism for Flat Database in Besu (#5319)
The proposed pull request introduces a feature that allows healing of the flat database by streaming the flat database data and validating it by generating a proof from the trie structure. If the proof is found to be invalid, the code traverses the trie to fix the invalid range. To optimize the process and avoid checking the entire flat database, the PR includes enhancements such as tracking the accounts that need to be repaired during SnapSync. By implementing these optimizations, the PR aims to significantly reduce the time and resources required for repairing the flat database.

Signed-off-by: Karim TAAM <karim.t2am@gmail.com>
2023-06-13 16:11:06 +02: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
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
Fabio Di Fabio
9ae1b535a0 Blobdb for static data (#5475)
Signed-off-by: Fabio Di Fabio <fabio.difabio@consensys.net>
2023-06-07 19:06:59 +02:00
Fabio Di Fabio
8bc939d236 Introduce variables storage (#5471)
Signed-off-by: Fabio Di Fabio <fabio.difabio@consensys.net>
2023-06-07 11:02:55 +02:00
garyschulte
b401963a11 Prevent rocksdb segfaults when accessing closed storage (#5527)
* add isClosed check to Transaction decorator to prevent segfaults on shutdown

Signed-off-by: garyschulte <garyschulte@gmail.com>
2023-06-02 11:38:41 -07:00
Matt Whitehead
965e5f79ba Only create DB data dir if it doesn't already exist (#5453)
* Only create DB data dir if it doesn't already exist

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

* Add unit test

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

---------

Signed-off-by: Matthew Whitehead <matthew1001@gmail.com>
Co-authored-by: Matthew Whitehead <matthew1001@gmail.com>
2023-05-18 10:31:30 +10:00
ahamlat
276afeaabf Fix the number of RocksDB log files to the last one week (#5428)
* Fix the number of RocksDB log files to 5 with 100 MB size for each LOG file

Signed-off-by: Ameziane H <ameziane.hamlat@consensys.net
Signed-off-by: Ameziane H <ameziane.hamlat@consensys.net>

* Fix build issue

Signed-off-by: Ameziane H <ameziane.hamlat@consensys.net>

* spotless and add a changelog entry

Signed-off-by: Ameziane H <ameziane.hamlat@consensys.net>

* keep 1 week log files

Signed-off-by: Ameziane H <ameziane.hamlat@consensys.net>

* Update change log and fix the number of files

Signed-off-by: Ameziane H <ameziane.hamlat@consensys.net>

---------

Signed-off-by: Ameziane H <ameziane.hamlat@consensys.net
Signed-off-by: Ameziane H <ameziane.hamlat@consensys.net>
Signed-off-by: ahamlat <ameziane.hamlat@consensys.net>
Co-authored-by: Fabio Di Fabio <fabio.difabio@consensys.net>
2023-05-12 07:31:39 +00:00
ahamlat
d2b23d3f42 Fix RocksDB missing metrics issue (#5426)
Signed-off-by: Ameziane H <ameziane.hamlat@consensys.net>
Co-authored-by: Sally MacFarlane <macfarla.github@gmail.com>
2023-05-04 02:36:40 +00:00
Daniel Lehrner
57b5198b2b additional log to indicate that database can take a while to compact when opening an existing one. (#5359)
Signed-off-by: Daniel Lehrner <daniel.lehrner@consensys.net>
2023-04-21 05:00:31 +10:00
Gabriel Fukushima
d54a1bf27a Rocksdb plugin to support OptimisticTransactionDb and TransactionDb (#5328)
* Refactor to make RocksDBColumnarKeyValueStorage abstract and extend it to optimistic and pessimistic. Atm Forest has a concurrency level that does not cope well with the OptimisticTransactionDB and RocksDB ends up raising a lot of Busy when committing RocksDBTransactions.
A TransactionDB will do conflict checking for all write operations (Put, Delete and Merge), including writes performed outside a Transaction according to RocksDB. This does impact the times we see when syncing so likely not the final solution for Forest. 
Bonsai should continue using OptimisticTransactionDB.

Signed-off-by: Gabriel Fukushima <gabrielfukushima@gmail.com>

---------

Signed-off-by: Gabriel Fukushima <gabrielfukushima@gmail.com>
2023-04-19 13:53:29 +10:00
Gabriel Fukushima
9978cb48a3 Remove RocksDb deprecated option maxBackgroundCompactions (#5339)
* Removing RocksDB option MaxBackgroundCompactions deprecated in version 8.0

Signed-off-by: Gabriel Fukushima <gabrielfukushima@gmail.com>

---------

Signed-off-by: Gabriel Fukushima <gabrielfukushima@gmail.com>
2023-04-18 09:37:12 +10:00
matkt
853c2f076c Bonsai cleaning and robustness (#5123)
Bonsai-safe refactor

Signed-off-by: Karim TAAM <karim.t2am@gmail.com>
Co-authored-by: garyschulte <garyschulte@gmail.com>
2023-03-17 19:13:05 +00:00
Sally MacFarlane
11a4f734a4 [MINOR] text edits to plugins javadoc (#5115)
* light edits and fix to BlockBody type reference
* updated plugin api hash

Signed-off-by: Sally MacFarlane <macfarla.github@gmail.com>
2023-02-21 12:43:07 +10:00
ahamlat
98f68ea1bf Disable RocksDB checksum verification on reads (#5042)
* Add RocksDB readOptions with checksum verification set to false for RocksDB get methods
* Spotless + apply disabling checksum verification for unsegmented RocksDB reads

Signed-off-by: Ameziane H <ameziane.hamlat@consensys.net>
2023-02-03 17:10:12 +01:00
Sally MacFarlane
c9de473a3c kubernetes and errorprone - update versions (#5013)
* update errorprone and kubernetes versions
* fixed errorprone issues in prod cod
* fixed errorprone issues in test code

---------

Signed-off-by: Sally MacFarlane <macfarla.github@gmail.com>
2023-02-01 10:42:36 +10:00
matkt
e36b1f6dbd Fix transaction pool issue (#4964)
* fix transaction pool issue
* add block replay
* support in-memory snapshots

Signed-off-by: Karim TAAM <karim.t2am@gmail.com>
Signed-off-by: garyschulte <garyschulte@gmail.com>
2023-01-22 10:27:55 +01: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
garyschulte
2b17e040e1 Bugfix snapshot transaction segfaults after storage truncation (#4786)
* subscribe snapshot worldstates to parent worldstate storage events like clear and clearFlatDatabase and close as appropriate to avoid segfaults
* fix for direct snapshot creation when using snapshot archive
* ensure we only prune bonsai worldstates if we have more than the configured number of retained states

Signed-off-by: garyschulte <garyschulte@gmail.com>
2022-12-22 14:20:54 -08:00
Zhenyang Shi
13213e2c7d Ignore extra RocksDB column families for experimental features (#4842)
Signed-off-by: Zhenyang Shi <wcgcyx@gmail.com>
2022-12-21 16:28:04 +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
ahamlat
376ce82181 Enable RocksDB bloomFilters (#4682)
* Enable full (non block) bloomFilters with 10 bits per key

Signed-off-by: Ameziane H <ameziane.hamlat@consensys.net
Signed-off-by: Ameziane H <ameziane.hamlat@consensys.net>

* Delete unused constant

Signed-off-by: Ameziane H <ameziane.hamlat@consensys.net
Signed-off-by: Ameziane H <ameziane.hamlat@consensys.net>

* Add ChangeLog

Signed-off-by: Ameziane H <ameziane.hamlat@consensys.net>

* Set RocksDB format version to 5

Signed-off-by: Ameziane H <ameziane.hamlat@consensys.net>

Signed-off-by: Ameziane H <ameziane.hamlat@consensys.net
Signed-off-by: Ameziane H <ameziane.hamlat@consensys.net>
Signed-off-by: ahamlat <ameziane.hamlat@consensys.net>
2022-11-22 14:00:34 +01:00
garyschulte
c2531fb021 Fix for block unavailability during SnapshotTrieLog caching (#4666)
* supplier workaround for Cached snapshots to defer snapshots until the block is added to the chain
* handle cache update when worldstate is fast-syncing
* add additional coverage for SnapshotTrieLogManager caching

Signed-off-by: garyschulte <garyschulte@gmail.com>
Co-authored-by: Sally MacFarlane <macfarla.github@gmail.com>
2022-11-15 12:51:25 +10:00
Jiri Peinlich
2528aacde7 Adding option to debug the potential problems with closing Transaction (#4654)
* Adding option to debug the potential problems with closing Transaction

Signed-off-by: Jiri Peinlich <jiri.peinlich@gmail.com>
Co-authored-by: garyschulte <garyschulte@gmail.com>
2022-11-12 12:36:04 -08:00
garyschulte
b181f99940 stopgap to mitigate off-heap memory leak until refactor in #4641 (#4645)
Signed-off-by: garyschulte <garyschulte@gmail.com>
2022-11-09 23:24:39 -08:00
ahamlat
b50f8660cc Create a specific calculateRootHash method for BonsaiInMemoryWorldState to improve performance (#4568)
* Parallelize some steps in BonsaiPersistedWorldState.calculateRootHash  method
Signed-off-by: Ameziane H <ameziane.hamlat@consensys.net>

* Add synchronized on storage flat database remove and update method

Signed-off-by: Ameziane H <ameziane.hamlat@consensys.net>

* Add synchronized on storage flat database remove and update method

Signed-off-by: Ameziane H <ameziane.hamlat@consensys.net>

* Fix this error org.rocksdb.RocksDBException: unknown WriteBatch tag

Signed-off-by: Ameziane H <ameziane.hamlat@consensys.net>

* create a specific calculateRootHash for BonsaiInMemoryWorldState class

Signed-off-by: Ameziane H <ameziane.hamlat@consensys.net>

* create a specific calculateRootHash for BonsaiInMemoryWorldState class

Signed-off-by: Ameziane H <ameziane.hamlat@consensys.net>

* Fix nullPointerException on Collections.synchronizedSet

Signed-off-by: Ameziane H <ameziane.hamlat@consensys.net>

* Use parallelStreams instead of CompletableFuture API

Signed-off-by: Ameziane H <ameziane.hamlat@consensys.net>

* Modify CHANGELOG.md

Signed-off-by: Ameziane H <ameziane.hamlat@consensys.net>

* spotless and synchronizedSet initializaton

Signed-off-by: garyschulte <garyschulte@gmail.com>

Signed-off-by: Ameziane H <ameziane.hamlat@consensys.net>
Signed-off-by: garyschulte <garyschulte@gmail.com>
Co-authored-by: garyschulte <garyschulte@gmail.com>
Co-authored-by: Sally MacFarlane <macfarla.github@gmail.com>
2022-11-02 18:05:15 +01:00
garyschulte
76d6429cc0 Snapshot based non-persisting MutableWorldState usage (#4531)
* implementation of Bonsai snapshots based BonsaiWorldStateArchive 
  includes: try-with-resources and AutoCloseable WorldState in order to release snapshots when we are done with them

Signed-off-by: garyschulte <garyschulte@gmail.com>
2022-11-01 15:53:25 -07:00
matkt
da9b10767a Snapsync persist state (#4381)
This PR avoids restarting the download of the world state from scratch when restarting Besu

Signed-off-by: Karim TAAM <karim.t2am@gmail.com>
2022-11-01 14:18:15 +01:00
garyschulte
d73ce2116c Bonsai snapshot worldstate (#4409)
* use optimistictransactiondb for mutable isolated snapshots
* plumbing necessary to have a snapshot specific updater.
* snapshot rolling working
* implement AutoCloseable on BonsaiSnapshotWorldState to ensure we can correctly dispose of snapshots
* add snapshot transaction cloning, change snapshot based worldstate to extend persisted worldstate rather than in-memory worldstate

Signed-off-by: garyschulte <garyschulte@gmail.com>
2022-10-13 09:42:27 -07:00
ahamlat
d6e1400937 Add config file support for high spec flag (#4438)
Signed-off-by: Fabio Di Fabio <fabio.difabio@consensys.net>
Co-authored-by: Fabio Di Fabio <fabio.difabio@consensys.net>
2022-09-26 14:05:27 +02:00
ahamlat
8718fa61e0 Create a new flag on RocksDB for high spec hardware to boost performance (#4423)
* Create a new flag on RocksDB (--Xplugin-rocksdb-high-spec-enabled) for high spec hardware to boost performance.
Signed-off-by: Ameziane H <ameziane.hamlat@consensys.net>
2022-09-23 14:09:45 +10:00
Danno Ferrin
d2968509ba Simplify Trie Dependencies (#4259)
Make the ethereum/trie and services/kvstore modules  as slim as possible
by dropping dependencies.

* The ':util' api dependency is removed from kvstore  and added to
   eth module
* Move tries's kvstore dependency to test
* Other dependencies are removed as unused from trie and kvstore

Signed-off-by: Danno Ferrin <danno.ferrin@gmail.com>
2022-08-15 21:24:09 -06:00
ahamlat
49244791f0 Apply RocksDB LZ4 compression and compare the performance/resource metrics after sync. (#4166)
Signed-off-by: Ameziane H <ameziane.hamlat@consensys.net>

Co-authored-by: Fabio Di Fabio <fabio.difabio@consensys.net>
2022-08-03 15:37:18 -04:00
ahamlat
915854cfe1 Update RocksDB default block cache size (#4132)
* Update RocksDB default block cache size.

Signed-off-by: Ameziane H <ameziane.hamlat@consensys.net>
2022-07-19 08:37:53 -07:00
Sally MacFarlane
2751b3cb1c Log message when path unavailable (#4059)
* issue #3986 -  Changed [file path init fail error message] clearer

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

Co-authored-by: Junsu An <anjjunsu@gmail.com>
2022-07-06 09:29:04 +10:00
ahamlat
5702ca090d Apply some RocksDB documentation suggestions to reduce memory usage. (#3985)
Signed-off-by: Ameziane H <ameziane.hamlat@consensys.net>
2022-06-17 10:27:34 -07:00
matkt
1c7c9ed146 fix missing column families (#3940)
Signed-off-by: Karim TAAM <karim.t2am@gmail.com>

Co-authored-by: Sally MacFarlane <sally.macfarlane@consensys.net>
2022-06-06 19:29:33 -06:00
sharad-develop
0efc169005 Added exception message details to error message, when read db fails (#3935)
* Added exception message details to error message, when read db fails
See ##3526

Signed-off-by: Sharad Gulati <sharad.develop@gmail.com>

Co-authored-by: Sally MacFarlane <sally.macfarlane@consensys.net>
2022-06-07 10:13:02 +10:00
Fabio Di Fabio
0fdd55d78e Introduce RocksDbSegmentIdentifier to avoid changing the storege plug… (#3755)
* Introduce RocksDbSegmentIdentifier to avoid changing the storege plugin interface

Signed-off-by: Fabio Di Fabio <fabio.difabio@consensys.net>
2022-05-03 20:54:14 -07:00
garyschulte
23f5e2e933 wrap rocksdb segmenthandles in atomicreference to ensure we do not reference closed handles (#3734)
Signed-off-by: garyschulte <garyschulte@gmail.com>
2022-04-22 17:42:59 +02:00
garyschulte
9619f94489 revert to TransactionDB to resolve 'busy' exception from OptimisticTransactionDB (#3720)
Signed-off-by: garyschulte <garyschulte@gmail.com>
2022-04-14 07:26:52 -07:00
Pedro Novais
fe673431fa update rocksdbjni to v6.29.4 for compatibility with arm64 CPU architecture (#3634)
* update rocksdbjni to v6.29.5 for compatibility with arm64 CPU

Signed-off-by: Pedro Novais <jpvnovais@gmail.com>
Co-authored-by: garyschulte <garyschulte@gmail.com>
2022-04-07 18:13:20 -07: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
fab-10
73a97606ae Disable RocksDB TTL compactions (#3356)
Signed-off-by: Fabio Di Fabio <fabio.difabio@consensys.net>
2022-02-02 12:13:11 +01: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
matkt
ffc8da3971 Fix bonsai getMutable method regression (#2934)
Signed-off-by: Karim TAAM <karim.t2am@gmail.com>
Co-authored-by: Fabio Di Fabio <fabio.difabio@consensys.net>
Co-authored-by: Justin Florentine <justin+github@florentine.us>
2021-10-28 09:37:15 -07:00