EVM/Node: struct_logs tracing
What
Part of #7083 (closed).
Previous: !13502 (merged)
Implement the opcode encoding of tracing, following the encoding on the kernel side.
Why
How
The MR is big, but changes are mechanical:
- Implements the string representation of opcodes, this has been done through emacs macros / regexps.
- The encoding of uint64 is needed to represent uint64 values in JSON, in their number representation. Basically in JSON numbers are doubles, their integer part can only be represented in 53 bits. Data_encoding encodes int64 into strings, which is not what is expected from the RPC. This encoding simply encodes values under 2^53 as a number, and those above in a string. If it happens that we have as big as a value and the tooling reading the RPC fails, it means it is not JSON compliant.
- The JSON encoding of the struct_log
- RLP decoding of struct_logs, whose encoding is defined in
etherlink/kernel_evm/evm_execution/src/trace.rs
- Reading the logs from the storage, following the encoding of indexable storage.
- Test helper to check a trace according to a receipt
- The test itself
Manually testing the MR
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 Pierrick Couderc