You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a tracking issue created as a result of #242. We analyzed this scope with @fvictorio, split it into smaller submodule, uncovered their dependencies and came up with an execution plan.
Decoding the returndata of failed evm calls when possible
Submodules
The submodules are these:
Codebase model: An internal model of the codebase and compilation output that can be used to back all the runtime analysis that we need to do. This is found here in Hardhat. A 1:1 port would be Hard to express in Rust, and at the same time, there are multiple optimization opportunities.
build-info to codebase model: A module that given a build-info (i.e. compilation input & output pair), constructs the model described above.
Contract identifier: A module that tries to identify which contract is being run in a certain evm call. Due to linked libraries, immutable variables inlining, and constructor parameters being appended to the bytecode, this is not a straightforward search. The most recent TS implementation of this is here
EVM Trace Generation: A module that creates a static low-level trace of the execution of an EVM call. This has no knowledge of Solidity. It has already been implemented by @Wodann
Raw stack traces generation: A module that naively applies source maps to the EVM trace to generate a Solidity stack trace.
Stack traces improver: A module that takes the naive solidity stack trace and improves them to be either more correct or meaningful. This is necessary due to the source maps generated by solidity being unreliable.
Stack trace format: A format (i.e. data structure) that can be used to represent raw and improved stack traces. We can consider having two of them though. This can be ported 1:1 from Hardhat Network, as the format we used there has a mixture of responsibilities that we agreed was a mistake. It includes information about the returndata decoding result, and about any inferred error.
Error inferred: A module that tries to detect common error cases in failed evm calls.
Return data decoding: A module that tries to decode the returndata of a failed evm call. It should support revert reasons, custom errros and panics.
EDR-to-JS format: We need to define a json format to return information about stack traces, decoded returndatas and any inferred error. It can potentially be returned by any JSON-RPC request that executes EVM code. Note that this may also affect how we handle the UI.
JS error construction: A javascript module that given the EDR-to-JS format explained above, creates a JavaScript Error object with the appropriate stack trace and information.
Definition of done
We need to implement a test runner that can run the stack traces tests, in Rust.
The test runner can assume that the js one compiled all the test contracts.
All the stack traces tests should pass, with all the solc configurations that we have, not just the default.
We should integrate the edr_solidity module into the provider and its js wrapper, so that if a failure happens, we throw the same kind of js Error than Hardhat Network.
We need to define a way to validate the above item.
The text was updated successfully, but these errors were encountered:
This is a tracking issue created as a result of #242. We analyzed this scope with @fvictorio, split it into smaller submodule, uncovered their dependencies and came up with an execution plan.
Tasks
returndata
decoding #250returndata
and inferred errors. #263Error
s that include Solidity stack traces, decodedreturnadta
and inferred errors information. #264Features withing scope
returndata
of failed evm calls when possibleSubmodules
The submodules are these:
returndata
decoding result, and about any inferred error.returndata
of a failed evm call. It should support revert reasons, custom errros and panics.returndata
s and any inferred error. It can potentially be returned by any JSON-RPC request that executes EVM code. Note that this may also affect how we handle the UI.Error
object with the appropriate stack trace and information.Definition of done
edr_solidity
module into the provider and its js wrapper, so that if a failure happens, we throw the same kind of jsError
than Hardhat Network.The text was updated successfully, but these errors were encountered: