* Add Shandong gas calculator to support EIP-3860
Signed-off-by: Diego López León <dieguitoll@gmail.com>
Signed-off-by: Diego López León <dieguitoll@gmail.com>
* add unit tests for Shandong gas calculator
Signed-off-by: lukelee-sl <luke.lee@swirldslabs.com>
Signed-off-by: Diego López León <dieguitoll@gmail.com>
Signed-off-by: Diego López León <dieguitoll@gmail.com>
Signed-off-by: lukelee-sl <luke.lee@swirldslabs.com>
Co-authored-by: lukelee-sl <luke.lee@swirldslabs.com>
The idea behind this commit is to preload asynchronously account nodes and storage nodes from the database during the transaction processing to use these nodes during the calculate root hash step.
We've created two caches, one for account nodes and one for storage nodes. The size of these caches is 100k for accounts and 200k for storage. We've tested other values but this configuration is the one that works better.
We also use exporter cache metrics as Prometheus metrics to check cache efficiency.
Signed-off-by: Karim TAAM <karim.t2am@gmail.com>
Co-authored-by: Ameziane H <ameziane.hamlat@consensys.net>
* use snapshots for in-memory copies of layered worldstate
* ensure we close snapshot storage used for layered world state copies
* wrap access to CachedSnapshotWorldState in Optional.ofNullable to prevent NPE when trying to close from AbstractTrieLogManager
Signed-off-by: garyschulte <garyschulte@gmail.com>
* aggresively seeking out other places to defend from this
Signed-off-by: Justin Florentine <justin+github@florentine.us>
Co-authored-by: Justin Florentine <justin+github@florentine.us>
* Remove log statements that are keeping references to objects for too much time
Improvement in terms of reducing java heap used,
since the logs were keeping reference to blocks sent by newPayload,
that causes high memory consumption during initial sync,
and could be one of the causes that prevent to complete snap sync on low spec machines.
Exceptions are also logged by the backward sync, so there is no loss of information.
Signed-off-by: Fabio Di Fabio <fabio.difabio@consensys.net>
Implement "Small" EOF - EIP-3540 (container) and EIP-3670 (validation).
Make code an interface so EOF specific features are compartmentalized,
including an 'invalid' code type representing a code block that didn't
pass validation, CodeV1 for EOF1, and CodeV0 which represents pre-EOF
code. EVMs track a maximum supported EOF version (where 0 is pre-eof)and
code is generated from a CodeFactory taking in context (is it a CREATE
operation and max code size) for the validation.
Includes spec versions for "Shanghai" and transient testnet "Shandong".
"Small" EOF is only activated in Shandong.
Signed-off-by: Danno Ferrin <danno.ferrin@swirldslabs.com>
* add isPersistable(), copy worldstate in mainnetblockvalidator if it is not
* only copy the mutable worldstate if it is not persistable in abstract block creator
Signed-off-by: garyschulte <garyschulte@gmail.com>
* 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>
* Revert "Revert "Upgrade OpenTelemetry (#3675)" (#4031)"
This reverts commit 17de636fe2.
Signed-off-by: Antoine Toulme <antoine@lunar-ocean.com>
* Make sure we don't initialize the OpenTelemetry global singleton by mistake
Signed-off-by: Antoine Toulme <antoine@lunar-ocean.com>
* disable global otel singleton explicitly
Signed-off-by: Antoine Toulme <antoine@lunar-ocean.com>
* make sure to set GlobalOpenTelemetry at most once to avoid test failures
Signed-off-by: Antoine Toulme <antoine@lunar-ocean.com>
* reset for tests
Signed-off-by: Antoine Toulme <antoine@lunar-ocean.com>
* fix changelog
Signed-off-by: Antoine Toulme <antoine@lunar-ocean.com>
Signed-off-by: Antoine Toulme <antoine@lunar-ocean.com>
* Rename fastSyncEnabled to fullSyncDisabled and pass syncConfig down instead of boolean
Signed-off-by: Gabriel Trintinalia <gabriel.trintinalia@gmail.com>
* Fix tests references
Signed-off-by: Gabriel Trintinalia <gabriel.trintinalia@gmail.com>
* Fix class references
Signed-off-by: Gabriel Trintinalia <gabriel.trintinalia@gmail.com>
Signed-off-by: Gabriel Trintinalia <gabriel.trintinalia@gmail.com>
WorldStateUpdater commit method is one of the most consuming methods during block processing (engine_newPayloadV1 call). This PR will focus on parallelizing some parts of this method to make it faster.
Signed-off-by: Ameziane H <ameziane.hamlat@consensys.net>
Signed-off-by: Karim TAAM <karim.t2am@gmail.com>
Signed-off-by: Gabriel Trintinalia <gabriel.trintinalia@consensys.net>
Signed-off-by: Gabriel Trintinalia <gabriel.trintinalia@consensys.net>
Co-authored-by: Gabriel Trintinalia <gabriel.trintinalia@consensys.net>
Signed-off-by: Gabriel Trintinalia <gabriel.trintinalia@consensys.net>
Signed-off-by: Gabriel Trintinalia <gabriel.trintinalia@consensys.net>
Co-authored-by: Gabriel Trintinalia <gabriel.trintinalia@consensys.net>
There was a change in error codes in Java DER decoding between Java 17
and Java 11. Tests depend on Java 11 error. Use JUnit5 facilities to
ensure the test works proeprly on both with the same codebase.
Signed-off-by: Danno Ferrin <danno.ferrin@swirldslabs.com>
Add a flag to MainnetTransactionProcessor to add the miningBeneficiary
to the list of pre-warmed addresses.
Have shandong fork set this flag to true by default.
Signed-off-by: Danno Ferrin <danno.ferrin@swirldslabs.com>
* Add Shandong network and fork
Add the transient Shandong fork and network definitions. For Shanghai
fork testing. Besu doesn't sync, but it does connect.
Signed-off-by: Danno Ferrin <danno.ferrin@swirldslabs.com>
* 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>
* 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>
Due to subtle differences between Bytes32 and UInt256 the changes failed
burn-in testing and are being reverted.
Signed-off-by: Danno Ferrin <danno.ferrin@swirldslabs.com>
Signed-off-by: Danno Ferrin <danno.ferrin@swirldslabs.com>
`BlockchainTests/ValidBlocks/bcEIP1559/feeCap.json` performs 16 transactions for the same sender, that's ~4% of the default pool size (i.e. 4096)
Signed-off-by: Diego López León <dieguitoll@gmail.com>