* create AbstractJsonRpcTest to enable future code reuse in similar tests
Signed-off-by: Pedro Novais <jpvnovais@gmail.com>
Co-authored-by: Antony Denyer <git@antonydenyer.co.uk>
* Revert "ignore the tests that use tessera enclave via docker (#4297)"
This reverts commit 98e214cedc.
Signed-off-by: Sally MacFarlane <sally.macfarlane@consensys.net>
* lock version of tessera and make public
Signed-off-by: Sally MacFarlane <sally.macfarlane@consensys.net>
Signed-off-by: Sally MacFarlane <sally.macfarlane@consensys.net>
* removed constraint with the length of the privacy public key
* refactor to include tessera ec encryptor
* added EC snippet to the tessera json config, still need to replace base64string from web3j
* acceptance tests working after modifying the web3j library to allow secp256r1 keys
* using NACL encryptor by default
* using web3j v4.9.4 and web3j-quorum v4.9.0
Signed-off-by: Miguel Rojo <miguelangel.rojofernandez@mastercard.com>
Co-authored-by: Antony Denyer <git@antonydenyer.co.uk>
* Upgrade OpenTelemetry
Signed-off-by: Antoine Toulme <antoine@lunar-ocean.com>
* remove a single sleep, poll with a for loop instead
Signed-off-by: Antoine Toulme <antoine@lunar-ocean.com>
* use the new approach to send trace requests
Signed-off-by: Antoine Toulme <antoine@lunar-ocean.com>
Co-authored-by: Sally MacFarlane <sally.macfarlane@consensys.net>
* check that the timestamp in fcu payload attributes is greater than the one of the head block
Signed-off-by: Daniel Lehrner <daniel.lehrner@consensys.net>
* added acceptance tests
Signed-off-by: Daniel Lehrner <daniel.lehrner@consensys.net>
* updated EngineForkchoiceUpdated to return INVALID_FORKCHOICE_STATE when finalized block hash or safe block hash are unknown
Signed-off-by: Daniel Lehrner <daniel.lehrner@consensys.net>
* fixed tests and added new ones for invalid forkchoice state and saving safe block
Signed-off-by: Daniel Lehrner <daniel.lehrner@consensys.net>
* Upgrade Errorprone
Upgrade errorprone to 2.13.1. Like all errorprone upgrades there are
new checks requiring code changes.
* Unused methods now cause compilation errors
* fields must be static and final
* Effectively constant booleans must now be returned as true/false.
* longs should not auto-cast to double.
* turn off errorprone javadocs
Signed-off-by: Danno Ferrin <danno.ferrin@gmail.com>
Co-authored-by: Sally MacFarlane <sally.macfarlane@consensys.net>
* Introduces new JsonRPCService that handles both http and websockets
* Removes websocket specific configs
* renames WebSocketRequestHandler to WebSocketMessageHandler to be more in line with websocket semantics.
Signed-off-by: Fabio Di Fabio <fabio.difabio@consensys.net>
Signed-off-by: Justin Florentine <justin+github@florentine.us>
Co-authored-by: Fabio Di Fabio <fabio.difabio@consensys.net>
* 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>
* require 3.1.15 of jnr-posix
* cover more bases with epl license
Signed-off-by: Sally MacFarlane <sally.macfarlane@consensys.net>
Co-authored-by: Stefan Pingel <16143240+pinges@users.noreply.github.com>
* avoid the edge case of long minimum value which gives a negative value when passed into abs()
* changed some Longs to long where they were statically intialized
* replace Lists.emptyList() with Collections.emptyList()
* removed unnecessary eq() invocation and resulting code smell
Signed-off-by: Sally MacFarlane <sally.macfarlane@consensys.net>
* Replace Log4j2 API with SLF4j API
* Replace explicit Log4J2 with util call
* Replace ThreadContext with Slf4J's MDC in test
* Inspect raw request parameter for admin_changeLogLevel
* Add errorprone rule to prevent the creation Log4j2 loggers
Signed-off-by: Diego López León <dieguitoll@gmail.com>
Co-authored-by: Sally MacFarlane <sally.macfarlane@consensys.net>
* Fix json-rpc HTTP tests [#535]
The `o.h.b.e.a.j.JsonRpcHttpServiceTest#exceptionallyHandleJsonSingleRequest` and `o.h.b.e.a.j.JsonRpcHttpServiceTest#exceptionallyHandleJsonBatchRequest` tests were throwing ClassCastException in `o.h.b.e.a.j.JsonRpcHttpService#validateMethodAvailability` which wasn't ever catched, returning status 500 by default, but that wasn't the use case aimed to test. Another test running an exceptional method is `o.h.b.t.a.p.EnclaveErrorAcceptanceTest#whenEnclaveIsDisconnectedGetReceiptReturnsInternalError` which validates an "Internal Error" proper json-rpc response. I changed the first two tests to be consistent with the later one.
* Extract json-rpc HTTP authentication to a handler [#535]
* Replace TimeoutHandler in GraphQLHttpService with Vert.x's impl [#535]
* Extract json-rpc HTTP parser to a handler [#535]
* Refactor json-rpc WS handler [#535]
* Add json-rpc IPC support [#535]
Signed-off-by: Diego López León <dieguitoll@gmail.com>
Signed-off-by: Diego López León <dieguitoll@gmail.com>
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>
* Upgrade EnodeURLImpl builder strategy
* Lookup the local hostname if specifying localhost/loopback
* Add test for valid domain that can be found and can not be found
Signed-off-by: Antony Denyer <git@antonydenyer.co.uk>
Co-authored-by: Alberto Hernandez <albherna@gmail.com>
* added acceptance test for execution engine apis
* removed check of payload id length
Signed-off-by: Daniel Lehrner <daniel.lehrner@consensys.net>
Co-authored-by: Sally MacFarlane <sally.macfarlane@consensys.net>
- This is to provide a clearer way of knowing which
privacyGroupId a private transaction ended up in.
Signed-off-by: Antony Denyer <git@antonydenyer.co.uk>
Co-authored-by: Sally MacFarlane <sally.macfarlane@consensys.net>
* Refactor TransactionPool to accept MiningParameters
* Check for zero GasPrice Frontier Transactions
* if you are not mining your node could fill up with pending transactions.
* make low-or-no-gas transactions viable for local transactions
Signed-off-by: Antony Denyer <git@antonydenyer.co.uk>
Co-authored-by: garyschulte <garyschulte@gmail.com>
* some unit tests
Signed-off-by: Frank Li <b439988l@gmail.com>
* CLI parsing tests
Signed-off-by: Frank Li <b439988l@gmail.com>
* regression tests
Signed-off-by: Frank Li <b439988l@gmail.com>
* fix failing at
Signed-off-by: Frank Li <b439988l@gmail.com>
* refactor -> api to api methods
Signed-off-by: Frank Li <b439988l@gmail.com>
* functionality in
Signed-off-by: Frank Li <b439988l@gmail.com>
* fix override test
Signed-off-by: Frank Li <b439988l@gmail.com>
* fix duplicates test
Signed-off-by: Frank Li <b439988l@gmail.com>
* fix duplicates test
Signed-off-by: Frank Li <b439988l@gmail.com>
* fix failing test and remove unnecessary code
Signed-off-by: Frank Li <b439988l@gmail.com>
* add entry to changelog
Signed-off-by: Frank Li <b439988l@gmail.com>
* fix typo and NPE
Signed-off-by: Frank Li <b439988l@gmail.com>
* action on some items
Signed-off-by: Frank Li <b439988l@gmail.com>
* some refactoring + more tests + implement auth skip for web sockets
Signed-off-by: Frank Li <b439988l@gmail.com>
* refactor unused method
Signed-off-by: Frank Li <b439988l@gmail.com>
* fix test failing
Signed-off-by: Frank Li <b439988l@gmail.com>
* fix wrong variable used
Signed-off-by: Frank Li <b439988l@gmail.com>
* Fix bft acceptance tests
Only set genesis config if it is not already set. Throw if user attempts to verify an empty cluster.
Configure genesis file with appropriate keys for consensus type.
Signed-off-by: Meredith Baxter <meredith.baxter@palm.io>
* Fix SECP256R1AcceptanceTest
Signed-off-by: Meredith Baxter <meredith.baxter@palm.io>
* Refactor to async retrieve blocks, and change peer when retrying to get a block
Signed-off-by: Fabio Di Fabio <fabio.difabio@consensys.net>
* Apply suggested changes
Signed-off-by: Fabio Di Fabio <fabio.difabio@consensys.net>
* Remove deprecated class
Signed-off-by: Fabio Di Fabio <fabio.difabio@consensys.net>
* Add more logs arond block synchronizer
Signed-off-by: Fabio Di Fabio <fabio.difabio@consensys.net>
* First try do download the block from the peer that announced it
Signed-off-by: Fabio Di Fabio <fabio.difabio@consensys.net>
* Avoid redownload non annunced blocks
Signed-off-by: Fabio Di Fabio <fabio.difabio@consensys.net>
* Conditionally log at trace level
Signed-off-by: Fabio Di Fabio <fabio.difabio@consensys.net>
* Use max number of peers when retrying to download a block to try all peers
Signed-off-by: Fabio Di Fabio <fabio.difabio@consensys.net>
* Use the shared Slf4jLambdaHelper, instead of custom helper
Signed-off-by: Fabio Di Fabio <fabio.difabio@consensys.net>
* 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>
* Add option to enforce tx replay protection for local txs
* Only enforce replay protection if the current milestone supports it
* moved changelog entry to next release
Signed-off-by: Meredith Baxter <meredith.baxter@palm.io>
Signed-off-by: Sally MacFarlane <sally.macfarlane@consensys.net>
Co-authored-by: Sally MacFarlane <sally.macfarlane@consensys.net>