eth/tracers: fill the creationMethod in flatCall
~@s1na PTAL, seems CreationMethod is not used anymore, should we remove it?~
Can you please expand on this? Is it not part of the parity tracing response? shouldn't we in that case fill the value rather than remove it?
I have consulted @ziogaschr who wrote the tracer. I think removing CreationMethod is not the way to go. We should instead try to fill the value. This is what he wrote:
So in here https://github.com/ethereum/go-ethereum/blob/2792a54adeb02032f7eace0032755c9225f75fa5/eth/tracers/native/call_flat.go#L298, we have to add CreationMethod: the actual type, which is vm.CREATE or vm.CREATE2
I am sorry for missing this detail, while converting this tracer from the old JS tracers to the newer Go native ones. I can make a PR if you like.
We should instead try to fill the value.
@s1na sorry for the inconvenience, I think I'll buy it.
Filled it with vm.opcode, kindly ask @s1na @ziogaschr to take a look.
BTW, as we use callType for the different call types, how about use the name createType instead of creationMethod?
BTW, as we use
callTypefor the different call types, how about use the namecreateTypeinstead ofcreationMethod?
Thanks @jsvisa. That's indeed a nice idea.
Probably it's preferable to stick with creationMethod for the JSON output, in order to not break compatibility with clients that know how to consume Parity like tracers.
It's totally fine to rename the Go struct's field name though.
eth/tracers/native/call_flat.go:299:45: unnecessary conversion (unconvert)
CreationMethod: strings.ToLower(vm.OpCode(input.Type).String()),
^
please fix the lint issue
@ziogaschr sorry for the delay response, I think this field has not been used before, so rename to createType is ok. @s1na WDYT.
@jsvisa if we want to be compatible with the old OpenEthereum label, then we have to use creationMethod. On the other hand, nobody noticed it was missing...
I think it makes more sense to use the label that was used before, and not create a new tracing format.
@ziogaschr thanks for the advice, seems Parity(legacy OpenEthereum) did include the creationMethod in v3.0.1(but not formal released), and Besu had this field in their codebase tracing/flat/Action.java#L44:
public class Action {
private final String creationMethod;
private final String callType;
private final String from;
private final String gas;
private final String input;
private final String to;
private final String init;
private final String value;
private final String address;
private final String balance;
private final String refundAddress;
private final String author;
private final String rewardType;
So I think the creationMethod is better, reverted back. @s1na @fjl PTAL.
CI was red because a new testcase that was on master (but not pulled in to this PR) was failing. It is so interesting but also in this case useful.
Anyway merged in master changes and fixed that test case. Should be good to go now.