* Handle INVALID_PARAMS with a 200 http status code
* Change tests to expect INVALID_PARAMS with a 200 http status code
* Add change log entry
* Change test to handle jsonRPC result rather than raised exception
Signed-off-by: Gabriel Fukushima <gabrielfukushima@gmail.com>
Add enforcement of the rule that EOF cannot create prior versions or
legacy EVM code contracts in create opcodes and create transactions.
Signed-off-by: Danno Ferrin <danno.ferrin@swirldslabs.com>
Use WorldStateBonsaiUpdater accounts cache each time we try to get an account from storage. Currently, we use this cache only in some code paths.
Signed-off-by: Karim TAAM <karim.t2am@gmail.com>
Co-authored-by: Ameziane H <ameziane.hamlat@consensys.net>
- 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>
* Add getDefaultSyncModeIfNotSet and clean up method
* Add unit test to prevent a new NPE
Signed-off-by: Gabriel Fukushima <gabrielfukushima@gmail.com>
* Swap lines order to ensure we commit FCU even if payload timestamp is before head timestamp
Signed-off-by: Gabriel Fukushima <gabrielfukushima@gmail.com>
* spotless
Signed-off-by: Gabriel Fukushima <gabrielfukushima@gmail.com>
Signed-off-by: Gabriel Fukushima <gabrielfukushima@gmail.com>
* new type and fix for BesuEventsImplTest
* replace iteration over tx type enums with explicit lists, fixes BesuEventsImplTest
* fixes more tests
* fixes BlockchainQueriesTest by changing the ORDER of transaction types, wtf
Signed-off-by: Justin Florentine <justin+github@florentine.us>
There is a performance regression in the RC version 23.1.0-RC1 compared to 22.10.3 in both engine_getPayloadV1 and engine_forkchoiceUpdatedV1 calls. This regression is related to recent changes in the way we get the protocol specifications. We get the whole block by decoding each single transaction to use only the block header.
Signed-off-by: Karim TAAM <karim.t2am@gmail.com>
Signed-off-by: Ameziane H <ameziane.hamlat@consensys.net>
Add withdrawals validation to EngineNewPayload and dry up tests
Refactor ForkChoiceUpdated as validation is shared
Signed-off-by: Simon Dudley <simon.dudley@consensys.net>
* Calculate block value & optimise block building
* Use block with receipts & keep block validation
* Add test on zero block value
* Use non-static method
* Update copyright
Signed-off-by: Zhenyang Shi <wcgcyx@gmail.com>
Signed-off-by: Zhenyang Shi <wcgcyx@gmail.com>
In order to avoid maintaining two versions of forkchoiceUpdated as much as possible, the validation works for both V1 and V2.
The JSON deserialization allows for withdrawals to be omitted which supports V1 requests, however if shanghai is enabled then we will expect withdrawals in a V1 request.
It would be a bug for a CL to send V1 with a post-shanghai timestamp but null withdrawals.
Signed-off-by: Simon Dudley <simon.dudley@consensys.net>
* Add '--fork=' to EvmTool
Add a CLI '--fork' option to allow code to be evaluated in specific
forks.
Signed-off-by: Danno Ferrin <danno.ferrin@swirldslabs.com>
* use debug rpc endpoint to resync worldstate
* Reset transaction pool state every time the initial sync is done
Signed-off-by: garyschulte <garyschulte@gmail.com>
Co-authored-by: Fabio Di Fabio <fabio.difabio@consensys.net>
* new test file with a block number param that is too long to be a block number
* check for block hash parameter length
* added unit test for safe & finalized
Signed-off-by: Sally MacFarlane <macfarla.github@gmail.com>
* Modify reattemptPendingPeerRequests implementation to not iterate on pending request. This should avoid a lot of unnecessary computation
Signed-off-by: Ameziane H <ameziane.hamlat@consensys.net>
* Fix failed unit tests.
Signed-off-by: Ameziane H <ameziane.hamlat@consensys.net>
* Fix failed unit tests
Iterate over pending requests only if there is a peer with available request capacity
Signed-off-by: Ameziane H <ameziane.hamlat@consensys.net>
* Fix stream implementation (use the same stream several times)
Signed-off-by: Ameziane H <ameziane.hamlat@consensys.net>
* Spotless
Signed-off-by: Ameziane H <ameziane.hamlat@consensys.net>
* Undo reducing method visibility as it is no longer used
Signed-off-by: Ameziane H <ameziane.hamlat@consensys.net>
* use one buffered for each peer and wait to have capacity before sending request
Signed-off-by: Karim TAAM <karim.t2am@gmail.com>
* fix tests
Signed-off-by: Karim TAAM <karim.t2am@gmail.com>
Signed-off-by: Ameziane H <ameziane.hamlat@consensys.net>
Signed-off-by: Karim TAAM <karim.t2am@gmail.com>
Co-authored-by: Karim TAAM <karim.t2am@gmail.com>
Optimize the EOF Functions implementation by not splitting code sections
into separate Bytes object. Instead the EOF evaluation occurs on a
single container space. When a function is called the PC (relative to
container start, not section start) is moved.
EOF lacks PC introspection and absolute jumps, so where "PC=0" starts is
not observable to the code. "PC=0" is still respected in the traces.
Signed-off-by: Danno Ferrin <danno.ferrin@swirldslabs.com>
* Support Shanghai in Reference Tests
Add support for Shanghai in reference tests
* Add Shanghai and Cancun milestones
* Add "withdrawals" and "withdrawalsRoot" to json objects
* Migrate to schedule by block header.
Signed-off-by: Danno Ferrin <danno.ferrin@swirldslabs.com>
* Add pending withdrawal code to test case spec
Signed-off-by: Danno Ferrin <danno.ferrin@swirldslabs.com>
Signed-off-by: Danno Ferrin <danno.ferrin@swirldslabs.com>
Co-authored-by: Sally MacFarlane <macfarla.github@gmail.com>
The previous evmBuilder override would mean that Shanghai evm configuration is reverted back to Paris
Signed-off-by: Simon Dudley <simon.dudley@consensys.net>
* add specific error for block by hash lookup not found
Signed-off-by: Sally MacFarlane <macfarla.github@gmail.com>
Signed-off-by: Sally MacFarlane <macfarla.github@gmail.com>