Commit Graph

95 Commits

Author SHA1 Message Date
Gabriel-Trintinalia
559fe71cf3 [minor] Improve message when existing database is different from the configuration (#6534)
Signed-off-by: Gabriel-Trintinalia <gabriel.trintinalia@consensys.net>
2024-02-07 12:32:20 +11:00
Gabriel-Trintinalia
a64ad2b60d [MINOR] Detect DB version mismatch on Startup and gracefully exit #6511 (#6513)
* Halt besu if database mismatches configuration

Signed-off-by: Gabriel-Trintinalia <gabriel.trintinalia@consensys.net>

---------

Signed-off-by: Gabriel-Trintinalia <gabriel.trintinalia@consensys.net>
Co-authored-by: Sally MacFarlane <macfarla.github@gmail.com>
2024-02-05 08:52:29 +10:00
Usman Saleem
c10cb3d3a9 Store trielog as blobdb (#6289)
Store trielog as blobdb to improve performance. 

* Store trie_log_storage as blob
* changelog
* Add gc flag for static data
* Updating plugin-api build.gradle with new hash as SegmentIdentifier interface has introduced new method

Signed-off-by: Usman Saleem <usman@usmans.info>
2024-01-31 19:54:08 +10:00
ahamlat
666f795b63 Improve the high spec flag (#6354)
* Improve the high spec flag, limit it to few column families
* Update changelog
* spotless
* Update the plugin API hash as one of the interfaces was changed\
* Fix failing unit tests

Signed-off-by: Ameziane H <ameziane.hamlat@consensys.net>
Co-authored-by: Sally MacFarlane <macfarla.github@gmail.com>
2024-01-24 09:43:11 -08:00
Fabio Di Fabio
2f1922851b Optimize RocksDB WAL file (#6328)
Signed-off-by: Fabio Di Fabio <fabio.difabio@consensys.net>
2024-01-04 19:03:20 +01:00
garyschulte
d81e1f3042 Add FlatDbStrategy (#5901)
* move FlatDbReader to FlatDbStrategy (including writes), add getNearestTo

Signed-off-by: garyschulte <garyschulte@gmail.com>
2023-09-22 10:51:39 -07:00
garyschulte
4b2ef689c1 Bonsai based reference test worldstate (#5686)
* create a bonsai based reference test worldstate
  -> getOrCreate in BonsaiWorldStateUpdateAccumulator - do not throw if we discover an empty account in a non-null BonsaiValue<Account>
  -> add curentStateRoot to t8n
  -> storageEntriesFrom and streamAccounts implemented in BonsaiWorldStateKeyValueStorage
  -> add endKey version of streamFromKey
* bonsai fix for self-destruct and create2 at the same address and same block

Signed-off-by: garyschulte <garyschulte@gmail.com>
Signed-off-by: Karim TAAM <karim.t2am@gmail.com>
Co-authored-by: Karim TAAM <karim.t2am@gmail.com>
2023-09-13 21:30:18 -07:00
garyschulte
8269b57ee3 Do not create ignorable segments on revert storage-variables (#5830)
* fix the bug that creates the ignorable chain pruner segment, add rocks exception parsing to RocksDBColumnarKeyValueStorage subclasses
* parse rocksdb error for unprintable column family id's

Signed-off-by: garyschulte <garyschulte@gmail.com>
2023-08-31 08:44:17 -07:00
garyschulte
56768060de Promote segmented storage (#5700)
promote segmented storage to plugin-api, implement SegmentedInMemoryKeyValueStorage
Signed-off-by: garyschulte <garyschulte@gmail.com>
2023-07-27 12:51:37 -07:00
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