* Don't cache protocol spec in block creator
Don't cache the protocol spec in the block creator. With the new
shanghaiTimestamp the correct spec may be a function of the timestamp
not just the block number. So every time we are asked to build a block
re-query the spec.
Signed-off-by: Danno Ferrin <danno.ferrin@swirldslabs.com>
* add withdrawalRoot computation
Signed-off-by: Jason Frame <jason.frame@consensys.net>
* include withdrawalsRoot and withdrawals when creating block
Signed-off-by: Jason Frame <jason.frame@consensys.net>
* validate withdrawals when validation mainnet blocks
Signed-off-by: Jason Frame <jason.frame@consensys.net>
* Fix invalid withdrawals root during backwards sync
Add withdrawalsRoot as part of BodyIdentifier
Add comment to avoid new issues when adding new fields to BlockBody
Signed-off-by: Jason Frame <jason.frame@consensys.net>
* Include withdrawalsRoot when creating new header in EngineNewPayload
Signed-off-by: Jason Frame <jason.frame@consensys.net>
* Use empty trie hash in genesis for withdrawalsRoot if shanghai is enabled at genesis
Signed-off-by: Jason Frame <jason.frame@consensys.net>
* Revert testing changes to AbstractEngineNewPayload
Signed-off-by: Jason Frame <jason.frame@consensys.net>
* Fix BesuController tests failing after GenesisState change
Signed-off-by: Jason Frame <jason.frame@consensys.net>
* Missing withdrawals wiring in BlockProcessor
Add empty withdrawals in GenesisState for shanghai at genesis
Signed-off-by: Simon Dudley <simon.dudley@consensys.net>
Signed-off-by: Jason Frame <jason.frame@consensys.net>
Co-authored-by: Simon Dudley <simon.dudley@consensys.net>
* Add option to limit requests in a single batch
Signed-off-by: Gabriel Trintinalia <gabriel.trintinalia@gmail.com>
* Change changelog
Signed-off-by: Gabriel Trintinalia <gabriel.trintinalia@gmail.com>
* Set default max batch size to one
Signed-off-by: Gabriel Trintinalia <gabriel.trintinalia@gmail.com>
* Update changelog
Signed-off-by: Gabriel Trintinalia <gabriel.trintinalia@gmail.com>
* Fix max rpc batch size for unit tests
Signed-off-by: Gabriel Trintinalia <gabriel.trintinalia@gmail.com>
* Change variable name
Signed-off-by: Gabriel Trintinalia <gabriel.trintinalia@gmail.com>
Signed-off-by: Gabriel Trintinalia <gabriel.trintinalia@gmail.com>
* 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>