EVM/Node: propagate the revert reason through the RPC
What
Needs !11897 (merged)
Fixes #6744 (closed), #6752 (closed)
Also refactor services.ml to remove the repeated patterns, to make the core code a bit more readable.
Why
Tooling uses the reverts to check in a contract call will fail before injecting them. In particular these reverts contains a message for the user or the tooling to know why it failed (it's basically an exception). Without this patch, they receive a cryptic error message.
How
From what I understood, tools expects revert message to be in the data field of the error object.
Manually testing the MR
-
find a manual test with some tooling showing that the revert reason is correctly handled and reflected Testing it and witnessing it is the correct behavior can be a bit tricky. My suggestion would be to use the first scenario -
add instructions
-
-
write an E2E test with a reverting call
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