EVM/Kernel: fix BLOCKHASH behaviour
Context
Fix #6985 (closed)
As of right now the BLOCKHASH
opcode always return 0. That's actually normal since we're trying to read in the storage at a location where nothing is written at all. This MR fixes that.
The first commit contains some simplification (basically removing dead code).
Manually testing the MR
I've added a simple tezt test with a solidity contract to check that what we retrieve from the RPC by decoding the entire block is the same as what the BLOCKHASH
opcode returns.
dune exec tezt/tests/main.exe -- --file evm_rollup.ml evm blockhash opcode
Checklist
-
Document the interface of any function added or modified (see the coding guidelines) -
Document any change to the user interface, including configuration parameters (see node configuration) -
Provide automatic testing (see the testing guide). -
For new features and bug fixes, add an item in the appropriate changelog ( docs/protocols/alpha.rst
for the protocol and the environment,CHANGES.rst
at the root of the repository for everything else). -
Select suitable reviewers using the Reviewers
field below. -
Select as Assignee
the next person who should take action on that MR
Edited by Rodi-Can Bozman