EVM/Kernel: update tracer encodings and fix some values
What
Part of #7083 (closed). Follow-up from !13185 (merged).
Next: !13378 (merged)
- We use the canonical option encoding, otherwise we end up in the situation where
NoneandSome("")are indistinguishable. - Instead of asking the handler to return the gas used, use the value in the outcome.
- Use the canonical function to encode a u8 from a boolean instead of reimpleting it, and mark failed transaction (with a outcome but non succesfull) as actually failed.
- The
disable*options of the configuraiton were implemented asenable* - Make error in structLogs an option
Why
- Encoding None as the empty data could end up in the situation where
NoneandSome("")are indistinguishable, which can happen if there is no memory allocated yet in the trace or no result. - At the end of the transaction, the gas used by the handler is reseted, we ended up with no gas consumed.
- There are two situation where a transaction has failed: a. A EVM error happened and the execution returned an outcome. It was considered as succesfull by the trace. b. An unexpected error happened, resulting in no outcome. That was the only occasion where the transaction failed.
- Well, it happens
😄 - See examples: error is null when there are none.
How
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.rstfor the protocol and the environment,CHANGES.rstat the root of the repository for everything else). -
Select suitable reviewers using the Reviewersfield below. -
Select as Assigneethe next person who should take action on that MR
Edited by Pierrick Couderc