* create separate signature class for code delegations as they have different bound checks
Signed-off-by: Daniel Lehrner <daniel.lehrner@consensys.net>
* test if increasing xmx let's failing acceptance test pass
Signed-off-by: Daniel Lehrner <daniel.lehrner@consensys.net>
* javadoc
Signed-off-by: Sally MacFarlane <macfarla.github@gmail.com>
---------
Signed-off-by: Daniel Lehrner <daniel.lehrner@consensys.net>
Signed-off-by: Sally MacFarlane <macfarla.github@gmail.com>
Co-authored-by: Sally MacFarlane <macfarla.github@gmail.com>
* wrapped WorldUpdater into `EVMWorldupdater` to remove the authority code injection from the implementation of the actual world updaters
Signed-off-by: Daniel Lehrner <daniel.lehrner@consensys.net>
* add CHANGELOG entry
Signed-off-by: Daniel Lehrner <daniel.lehrner@consensys.net>
* first draft for 7702 v2
Signed-off-by: Daniel Lehrner <daniel.lehrner@consensys.net>
* change return value of DelegatedCodeGasCostHelper
Signed-off-by: Daniel Lehrner <daniel.lehrner@consensys.net>
* fix upfront gas cost calculation, fix setting code multiple times in MutableDelegatedCodeAccount
Signed-off-by: Daniel Lehrner <daniel.lehrner@consensys.net>
* fix gas refund for delegated code when account already exists, added gas cost deduction for code delegation resolution to ExtCodeSizeOperation
Signed-off-by: Daniel Lehrner <daniel.lehrner@consensys.net>
* allow accounts with delegated code to send transactions
Signed-off-by: Daniel Lehrner <daniel.lehrner@consensys.net>
* add refund for already existing account after nonce check
Signed-off-by: Daniel Lehrner <daniel.lehrner@consensys.net>
* resolve delegated code only the first time to avoid delegation loops
Signed-off-by: Daniel Lehrner <daniel.lehrner@consensys.net>
* handle invalid authorization signatures properly
Signed-off-by: Daniel Lehrner <daniel.lehrner@consensys.net>
* refactored CodeDelegationProcessor to compute authorizer of a code delegation after the chain id check
Signed-off-by: Daniel Lehrner <daniel.lehrner@consensys.net>
* fix canSetDelegatedCode method by checking code how it is in the trie and not the resolved code
Signed-off-by: Daniel Lehrner <daniel.lehrner@consensys.net>
* optimize code hash calculation for empty code, fix check for empty code delegation list
Signed-off-by: Daniel Lehrner <daniel.lehrner@consensys.net>
* check the all code delegation signatures hava a valid s value
Signed-off-by: Daniel Lehrner <daniel.lehrner@consensys.net>
* rename encoder & decoder, handle invalid signature values in T8nExecutor
Signed-off-by: Daniel Lehrner <daniel.lehrner@consensys.net>
* create the signatures for code delegation authorizations in T8nExecutor without checking if they are valid to test them later during the tx execution
Signed-off-by: Daniel Lehrner <daniel.lehrner@consensys.net>
* check that recid is either 0 or 1
Signed-off-by: Daniel Lehrner <daniel.lehrner@consensys.net>
* fixed acceptance tests, renamed the the remaining instances of set code to code delegation
Signed-off-by: Daniel Lehrner <daniel.lehrner@consensys.net>
* fix delegate encoder & encoder unit tests
Signed-off-by: Daniel Lehrner <daniel.lehrner@consensys.net>
* spotless
Signed-off-by: Daniel Lehrner <daniel.lehrner@consensys.net>
* changed empty check for delegated accounts, fixed test
Signed-off-by: Daniel Lehrner <daniel.lehrner@consensys.net>
* fix hasDelegatedCode method when code is null
Signed-off-by: Daniel Lehrner <daniel.lehrner@consensys.net>
* run acceptance tests without deamon
Signed-off-by: Daniel Lehrner <daniel.lehrner@consensys.net>
* disable CodeDelegationTransactionAcceptanceTest to check if it is causing the stuck ci pipeline
Signed-off-by: Daniel Lehrner <daniel.lehrner@consensys.net>
* check if shouldTransferAllEthOfAuthorizerToSponsor is causing pipeline to stall
Signed-off-by: Daniel Lehrner <daniel.lehrner@consensys.net>
* check if shouldCheckNonceAfterNonceIncreaseOfSender is causing pipeline to stall
Signed-off-by: Daniel Lehrner <daniel.lehrner@consensys.net>
* check if closing the cluster after every test is causing pipeline to stall
Signed-off-by: Daniel Lehrner <daniel.lehrner@consensys.net>
* spotless
Signed-off-by: Daniel Lehrner <daniel.lehrner@consensys.net>
---------
Signed-off-by: Daniel Lehrner <daniel.lehrner@consensys.net>
Co-authored-by: Danno Ferrin <danno@numisight.com>
* 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>
For tests that have a native/java switch ensure that the java path gets
the same tests native paths do.
Co-authored-by: Sally MacFarlane <macfarla.github@gmail.com>
Signed-off-by: Danno Ferrin <danno@numisight.com>
Optimistic transaction parallelization execution during block processing to improve the performances. This feature can enabled with a flag --Xbonsai-parallel-tx-processing-enabled=true
Signed-off-by: Karim Taam <karim.t2am@gmail.com>
Co-authored-by: Ameziane H <ameziane.hamlat@consensys.net>
Co-authored-by: garyschulte <garyschulte@gmail.com>
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>
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>
* Add RockDB Subcommand for printing usage per column family
Signed-off-by: Simon Dudley <simon.dudley@consensys.net>
* changed output to follow a MD table notation.
Signed-off-by: Gabriel Fukushima <gabrielfukushima@gmail.com>
---------
Signed-off-by: Gabriel Fukushima <gabrielfukushima@gmail.com>
Co-authored-by: Gabriel Fukushima <gabrielfukushima@gmail.com>
Upgrade bouncy castle to v1.75. This involved a change in maven
coordinates for other modules.
Signed-off-by: Danno Ferrin <danno.ferrin@swirldslabs.com>
* add new class to reflection config
* move CLI output to be system-err oriented
* make logger in evmtool nop
* exclude some problematic jars from compilation
- mixed versions of bouncy castle
- netty initializations of log4j
* Standardize JSON ObjectMapper Construction
* Add some manual mappings
* Directly instantiate crypto algorithms where appropriate
Signed-off-by: Danno Ferrin <danno.ferrin@swirldslabs.com>
* 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>
Refactor crypto, datatypes, and plugin-api to reduce plugin APIs in the EVM.
Split crypto into crypto services and crypto algorithms
Reverse the dependency between datatyps and plugin-api.
Remove plugin Hash and Address types (use datatypes)
Move PublicKey and Quantity into datatypes.
Lots of changes to imports and build files, and some fromPlugin calls removed.
Signed-off-by: Danno Ferrin <danno.ferrin@swirldslabs.com>
Signed-off-by: Danno Ferrin <danno.ferrin@shemnon.com>
Co-authored-by: Justin Florentine <justin+github@florentine.us>
Changes and config to support using GraalVM AOT to compile and
execute evmTool as an alternate configuration.
While not as long-term performant the startup time
makes filling reference tests with Besu reasonable.
Signed-off-by: Danno Ferrin <danno.ferrin@swirldslabs.com>
- 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>
Increate the speed of ModExp gas calculations by using primitive types.
Use a native lib for modexp precompile.
Signed-off-by: Danno Ferrin <danno.ferrin@swirldslabs.com>
* Native modexp
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>
* 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>
* Fix two operand stack tests
Signed-off-by: Diego López León <dieguitoll@gmail.com>
* Remove unreachable assert
Signed-off-by: Diego López León <dieguitoll@gmail.com>
* Replace expected annotation field with assert
Signed-off-by: Diego López León <dieguitoll@gmail.com>
* Extract variables to let only a single call for assert
Signed-off-by: Diego López León <dieguitoll@gmail.com>
Co-authored-by: Sally MacFarlane <sally.macfarlane@consensys.net>
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>
* 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>
The NodeKeyTest might fail in case the SignatureAlgorithmFactory has an
instance already set from some previous test.
Signed-off-by: Jiri Peinlich <jiri.peinlich@gmail.com>
Co-authored-by: Sally MacFarlane <sally.macfarlane@consensys.net>
* Gradle 7.2 upgrade / Java 17 Build Support
* Upgrade to Gradle 7.2, which supports Java 17
* Regenerate gradlew script and wrapper (as recommended)
* Suppress the removal warning for `AccessController` for now
* Update the JMH version to get rid of Gradle deprecation warning
* Add spotless `targetExcludes` so it won't re-format submodules
Signed-off-by: Danno Ferrin <danno.ferrin@gmail.com>
* 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>
* don't set SECP256R1 as signature algorithm instance in the tests, only use it when the nodes are started as their own processes
Signed-off-by: Daniel Lehrner <daniel@io.builders>
* renamed some variables for better readability
Signed-off-by: Daniel Lehrner <daniel@io.builders>
Fetching the hash from the java security providers is often longer than
the hashing itself, so we should cache results from the providers in a
reusable fashion.
Signed-off-by: Danno Ferrin <danno.ferrin@gmail.com>
Remove all but 4 log4j2.xml config files
* The main config for the besu CLI app
* The config for the evmTool CLI app
* The config for acceptance tests
* A config in testUtil
If any tests depend on a log4j file they should import testutil.
Signed-off-by: Danno Ferrin <danno.ferrin@gmail.com>
Adding the Log4j "jul" (java.util.logging) adapter resulted in many
messages like this at startup:
`main INFO Registered Log4j as the java.util.logging.LogManager.`
These come from the Log4j status logger. We can get rid of those by
setting the status attribute on all configurations to a higher logging
level. WARN is the next higher level.
Signed-off-by: Danno Ferrin <danno.ferrin@gmail.com>