* 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>
* 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>
Fix a variety of issues found during the fuzzing sprint.
* Validate type length matches code length
* Remove JUMPF from shanghai
* check retf output size
* handle zero length types and code better
* Fix table error on RETURNDATACOPY
* RJUMPV byte should be unsigned
* RJUMPV stack validation fix and more tests
* dead code detection via counting considered bytes
* EVMTool EOF Fuzzing support- remove all alphanumerics (punctuation) and comment lines from code in CLI
Signed-off-by: Danno Ferrin <danno.ferrin@swirldslabs.com>
Add two new development networks and forks, `FutureEips` for EIPs not yet
scheduled for a fork and `ExperimentalEips` for EIPs and other work not yet
accepted to a public network. Two new fork-named networks are added
like the `dev` network to facilitate easy local development.
These replace the deprecated `Shandong` network and fork.
Signed-off-by: Danno Ferrin <danno.ferrin@swirldslabs.com>
Create AbstractEngineNewPayload and AbstractEngineForkchoiceUpdated, extending with V1 and V2 versions.
(AbstractEngineGetPayload and V2 was already introduced in a483f79cc8)
Signed-off-by: Simon Dudley <simon.dudley@consensys.net>
When Integration tests were migrated to JUnit 5 the gradle configuration was not added.
Fix various tests that had broken in the meantime:
- NPEs when EnclaveEncryptorType was introduced
- Account for new future nonce restrictions in the txpool
Signed-off-by: Simon Dudley <simon.dudley@consensys.net>
Co-authored-by: Danno Ferrin <danno.ferrin@swirldslabs.com>
Co-authored-by: Simon Dudley <simon.dudley@consensys.net>
Remove the Ropsten, Kiln, Shandong, and Astor network definitions from
the built-in network list. Includes tendrils depending on and testing
such configurations.
Signed-off-by: Danno Ferrin <danno.ferrin@swirldslabs.com>
* Optimize Sstore operation, get current value and original value only once.
Signed-off-by: Ameziane H <ameziane.hamlat@consensys.net>
* Fix javadoc.
Signed-off-by: Ameziane H <ameziane.hamlat@consensys.net>
* refactoring (add a supplier implementation to better support all the forks)
Signed-off-by: Ameziane H <ameziane.hamlat@consensys.net>
* delete unnecessary parameters, add final for some fields and modify CHANGELOG.md
Signed-off-by: Ameziane H <ameziane.hamlat@consensys.net>
* add a missing parameter in Javadoc
Signed-off-by: Ameziane H <ameziane.hamlat@consensys.net>
Signed-off-by: Ameziane H <ameziane.hamlat@consensys.net>
* Add post-run allocation output to EVMTool
Add a CLI flag --json-alloc that will output the post-execution state of
the allocations the EVM Tool executed in. As well as post-execution
state for state-tests.
Signed-off-by: Danno Ferrin <danno.ferrin@swirldslabs.com>
* subscribe snapshot worldstates to parent worldstate storage events like clear and clearFlatDatabase and close as appropriate to avoid segfaults
* fix for direct snapshot creation when using snapshot archive
* ensure we only prune bonsai worldstates if we have more than the configured number of retained states
Signed-off-by: garyschulte <garyschulte@gmail.com>
* Add failing test for deploying invalid contract
Signed-off-by: Diego López León <dieguitoll@gmail.com>
Signed-off-by: Diego López León <dieguitoll@gmail.com>
* Validate contractCode from frame
Signed-off-by: Diego López León <dieguitoll@gmail.com>
Signed-off-by: Diego López León <dieguitoll@gmail.com>
* Only receive frame output data in ContractValidationRule#validate
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: Diego López León <dieguitoll@gmail.com>
Signed-off-by: Diego López León <dieguitoll@gmail.com>
Implement CALLF, RETF, and JUMPF operations. This introduces the
notion of "code sections" into the code. For legacy code section zero
consists of all of the code and is the only code section. Also
implements EIP specified code validation to ensure validated EOF code
won't use CALLF or JUMPF to a non-existent section.
Signed-off-by: Danno Ferrin <danno.ferrin@swirldslabs.com>
* Remove opSize field from Operation
With the introduction of RJUMPV, operations don't have fixed size anymore. This field isn't used anyware in the code so it's safe to delete it
Signed-off-by: Diego López León <dieguitoll@gmail.com>
* Add comments
Signed-off-by: Diego López León <dieguitoll@gmail.com>
* Add some EIP-3670 and EIP-3540 tests
Signed-off-by: Diego López León <dieguitoll@gmail.com>
* Replace jumpdest bitmap with BitSet
Signed-off-by: Diego López León <dieguitoll@gmail.com>
* Implement EIP-4200: EOF - Static relative jumps
Signed-off-by: Diego López León <dieguitoll@gmail.com>
Signed-off-by: Diego López León <dieguitoll@gmail.com>
Implement shanghaiTime including TimestampSchedule and associated infrastructure code.
TimestampSchedule sits alongside the pre and post ProtocolSchedules in TransitionProtocolSchedule.
Introduces getByTimestamp, wrapped inside getByBlockHeader (to also support getByBlockNumber).
General call pattern followed is that if a given timestamp precedes the first timestamp in the schedule, i.e. a pre-shanghai block, then delegate to the appropriate pre or post merge ProtocolSchedule to get by block instead.
cancunTime and a placeholder cancunDefinition has also been implemented in order to effectively test fork order logic.
Signed-off-by: Simon Dudley <simon.dudley@consensys.net>
Co-authored-by: Jiri Peinlich <jiri.peinlich@gmail.com>
Co-authored-by: Simon Dudley <simon.dudley@consensys.net>
Co-authored-by: Jason Frame <jason.frame@consensys.net>