[evm-tracing-0-1] add debug e2e tests logic implementation#1575
[evm-tracing-0-1] add debug e2e tests logic implementation#1575dmitrylavrenov merged 1 commit intoevm-debug-tracefrom
Conversation
a374702 to
b1698b4
Compare
|
@MOZGIII Please, check the example list of debug RPCs for Ethereum in the PR's description. There are some differences between them in implementations: request/response types, supported tracers, even disable/enable terminology usage like The question is: should we take into account current Moonbeam implementation for e2e test logic to avoid "possible" incompatibility (otherwise, not sure if everything will work as expected without additional moonbeam ported code changes due to having different debug RPC implementations) ? Another idea - just refer to geth source code and do everything according to this implementation later fixing moonbeam ported code if it would required. |
|
For the E2E, let's try to write up a clear spec and test cases, with comments on what options are available and what we base them on; it is unclear as to what exact tracer format we'd want to use - so I suggest we simply use implement multiple E2E tests checking all variants. In essence, the main differences are often at the RPC formats, and there's no reason why we couldn't do some smart translation at struct parsing to support all variants, as in |
|
Essentially, the scope of the implementation for something like this should be defined here - at the test. I propose the we cover the following basic APIs:
The idea would be to have this loosely - reasonably loosely - follow the geth implementation; pretty sure the is the same goal that moonbeam had for their design. The way we can test this, in practice, in via a block explorer - like blockscout. This could be a good addition to the e2e tests - as essentially this is what we want to support (one of the main use-cases). In the e2e tests, we should capture the request / response of the corresponding calls made to the geth node, and base our test scenarios on that (i.e. for the same contracts / calls the outputs should be the same, excluding things like block number, time and random stuff) |
We could borrow the moonbeam end-to-end test scenarios / scenario ideas if it is hard to make up our own. Whether we should take their request/response samples instead of creating our own - that's debatable. I wouldn't trust they did it correctly in the first place.
I think we should look at both places, and everywhere else; but most of all - what the consumers of these APIs usually expect. What matters is that we make the API usable, in the sense that real users can rely on it. It's not our API design, it is a compatibility layer - so we don't have to design the interface, just implement (a subset of) it. |
1a552a7 to
89186c3
Compare
7bc108b to
1d1e43a
Compare
1e6df3f to
412f2ec
Compare
MOZGIII
left a comment
There was a problem hiding this comment.
Seems like the hooks fail... I wonder why is that.
What do you mean by the hooks fail? It should fail until we merge the rest PRs |
c29a00d to
8015673
Compare
The tests wait for a condition that never happens? Shouldn't they just fail immediately after an assertion fails? I.e. when an RPC request fails with an error? |
The tests wait for a condition that node is running. The current version doesn't have evm tracing related cli params. So, the node pid is not available to continue tests logic. It happens with any tests if we pass invalid cli params. Maybe, we should restrict it somehow at e2e tests logic ? |
|
I see; if we pass invalid cli args and the node crashes we probably should abort the test and mark it as crashed; I'll implement it |
ff3f91a to
3f3ff09
Compare
8015673 to
a69a995
Compare
quasiyoke
left a comment
There was a problem hiding this comment.
Reviewed and ran tests. Took runtime overrides from the Docker image moonbeam-tracing. Node launch arguments had to be changed:
args: [
...
"--wasm-runtime-overrides=<OVERRIDES_DIR>",
"--public-addr=/ip4/0.0.0.0/tcp/9944",
],Also changed the chain ID:
defineChain({
id: 0x501,Launched with the following command:
HUMANODE_PEER_PATH=<PATH> ./run-tests evm-tracingSources — LGTM.
* Add CI check for build with evm-tracing feature * Add evm-tracing feature to humanode-runtime * [evm-tracing-0] add evm-tracing test suite to e2e ts tests (#1574) * Add build for evm-tracing at e2e code job * Skip bash tests for evm-tracing test suite * Add template for evm-tracing test suite * [evm-tracing-0-1] add debug e2e tests logic implementation (#1575) * [evm-tracing-1] runtime level implementation (#1544) Runtime level implementation * [evm-tracing-2] сlient-side implementation (#1565) Client-side implementation * [evm-tracing-3] implement RPC side (#1568) Implement RPC side * [evm-tracing-4] cli part implementation (#1572) * [evm-tracing] Add more e2e tests (#1622)
The example list of different existing debug RPC methods for Ethereum:- https://therpc.io/docs/ethereum/debug-methods/debug_traceCall- https://www.chainnodes.org/docs/ethereum/debug_traceCall- https://docs.chainstack.com/reference/ethereum-tracecall- https://geth.ethereum.org/docs/interacting-with-geth/rpc/ns-debug#debugtracecallThe team has agreed on using moonbeam as a base code for implementing EVM tracing related tests.
The following basic tests have been implemented:
Tested over moonbeam-peer in dev mode with moonbase-runtime-3800-substitute-tracing.wasm overrides
