eth/tracers: fill the creationMethod in flatCall (#30539)

`flatCallTracer` will now specify the type of a create in the action
via the `creationMethod` field.

---------

Signed-off-by: jsvisa <delweng@gmail.com>
Co-authored-by: Sina Mahmoodi <itz.s1na@gmail.com>
pull/30732/head
Delweng 3 weeks ago committed by GitHub
parent da17f2d65b
commit 229ce6411a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 1
      eth/tracers/internal/tracetest/testdata/call_tracer_flat/big_slow.json
  2. 1
      eth/tracers/internal/tracetest/testdata/call_tracer_flat/callcode_precompiled_fail_hide.json
  3. 1
      eth/tracers/internal/tracetest/testdata/call_tracer_flat/callcode_precompiled_oog.json
  4. 1
      eth/tracers/internal/tracetest/testdata/call_tracer_flat/callcode_precompiled_throw.json
  5. 1
      eth/tracers/internal/tracetest/testdata/call_tracer_flat/create.json
  6. 6
      eth/tracers/internal/tracetest/testdata/call_tracer_flat/create_oog_parity.json
  7. 1
      eth/tracers/internal/tracetest/testdata/call_tracer_flat/gas.json
  8. 1
      eth/tracers/internal/tracetest/testdata/call_tracer_flat/inner_create_oog_outer_throw.json
  9. 2
      eth/tracers/internal/tracetest/testdata/call_tracer_flat/nested_create.json
  10. 2
      eth/tracers/internal/tracetest/testdata/call_tracer_flat/nested_create2_action_gas.json
  11. 2
      eth/tracers/internal/tracetest/testdata/call_tracer_flat/nested_create_action_gas.json
  12. 1
      eth/tracers/internal/tracetest/testdata/call_tracer_flat/nested_create_inerror.json
  13. 1
      eth/tracers/internal/tracetest/testdata/call_tracer_flat/nested_pointer_issue.json
  14. 2
      eth/tracers/internal/tracetest/testdata/call_tracer_flat/selfdestruct.json
  15. 2
      eth/tracers/internal/tracetest/testdata/call_tracer_flat/skip_no_balance_error.json
  16. 9
      eth/tracers/native/call_flat.go

@ -44,6 +44,7 @@
"result": [
{
"action": {
"creationMethod": "create",
"from": "0xf8bda96b67036ee48107f2a0695ea673479dda56",
"gas": "0x231860",
"init": "0x5b620186a05a131560135760016020526000565b600080601f600039601f565b6000f3",

@ -51,6 +51,7 @@
{
"type": "create",
"action": {
"creationMethod": "create",
"from": "0x877bd459c9b7d8576b44e59e09d076c25946f443",
"value": "0x0",
"gas": "0x19f78",

@ -51,6 +51,7 @@
{
"type": "create",
"action": {
"creationMethod": "create",
"from": "0x877bd459c9b7d8576b44e59e09d076c25946f443",
"value": "0x0",
"gas": "0x1a758",

@ -51,6 +51,7 @@
{
"type": "create",
"action": {
"creationMethod": "create",
"from": "0x877bd459c9b7d8576b44e59e09d076c25946f443",
"value": "0x0",
"gas": "0x1a034",

@ -47,6 +47,7 @@
"result": [
{
"action": {
"creationMethod": "create",
"from": "0x13e4acefe6a6700604929946e70e6443e4e73447",
"gas": "0x897be",
"init": "0x606060405260405160208061077c83398101604052808051906020019091905050600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415151561007d57600080fd5b336000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555080600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506001600460006101000a81548160ff02191690831515021790555050610653806101296000396000f300606060405260043610610083576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806305e4382a146100855780631c02708d146100ae5780632e1a7d4d146100c35780635114cb52146100e6578063a37dda2c146100fe578063ae200e7914610153578063b5769f70146101a8575b005b341561009057600080fd5b6100986101d1565b6040518082815260200191505060405180910390f35b34156100b957600080fd5b6100c16101d7565b005b34156100ce57600080fd5b6100e460048080359060200190919050506102eb565b005b6100fc6004808035906020019091905050610513565b005b341561010957600080fd5b6101116105d6565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561015e57600080fd5b6101666105fc565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156101b357600080fd5b6101bb610621565b6040518082815260200191505060405180910390f35b60025481565b60011515600460009054906101000a900460ff1615151415156101f957600080fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614806102a15750600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b15156102ac57600080fd5b6000600460006101000a81548160ff0219169083151502179055506003543073ffffffffffffffffffffffffffffffffffffffff163103600281905550565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614806103935750600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b151561039e57600080fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561048357600060025411801561040757506002548111155b151561041257600080fd5b80600254036002819055506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050151561047e57600080fd5b610510565b600060035411801561049757506003548111155b15156104a257600080fd5b8060035403600381905550600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050151561050f57600080fd5b5b50565b60011515600460009054906101000a900460ff16151514151561053557600080fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614801561059657506003548160035401115b80156105bd575080600354013073ffffffffffffffffffffffffffffffffffffffff163110155b15156105c857600080fd5b806003540160038190555050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600354815600a165627a7a72305820c3b849e8440987ce43eae3097b77672a69234d516351368b03fe5b7de03807910029000000000000000000000000c65e620a3a55451316168d57e268f5702ef56a11",

@ -58,7 +58,8 @@
"from": "0x877bd459c9b7d8576b44e59e09d076c25946f443",
"value": "0x0",
"gas": "0x19ee4",
"init": "0x5a600055600060006000f0505a60015500"
"init": "0x5a600055600060006000f0505a60015500",
"creationMethod": "create"
},
"error": "Out of gas",
"traceAddress": [],
@ -74,7 +75,8 @@
"from": "0x9c5cfe45b15eaff4ad617af4250189e26024a4f8",
"value": "0x0",
"gas": "0x3cb",
"init": "0x"
"init": "0x",
"creationMethod": "create"
},
"result": {
"gasUsed": "0x0",

@ -51,6 +51,7 @@
{
"type": "create",
"action": {
"creationMethod": "create",
"from": "0x877bd459c9b7d8576b44e59e09d076c25946f443",
"value": "0x0",
"gas": "0x1a9c8",

File diff suppressed because one or more lines are too long

@ -51,6 +51,7 @@
{
"type": "create",
"action": {
"creationMethod": "create",
"from": "0x877bd459c9b7d8576b44e59e09d076c25946f443",
"value": "0x0",
"gas": "0x53e90",
@ -71,6 +72,7 @@
{
"type": "create",
"action": {
"creationMethod": "create",
"from": "0x9db7a1baf185a865ffee3824946ccd8958191e5e",
"value": "0x0",
"gas": "0x30b34",

@ -51,6 +51,7 @@
{
"type": "create",
"action": {
"creationMethod": "create",
"from": "0x877bd459c9b7d8576b44e59e09d076c25946f443",
"value": "0x0",
"gas": "0x19ed8",
@ -71,6 +72,7 @@
{
"type": "create",
"action": {
"creationMethod": "create2",
"from": "0x2e8eded627eead210cb6143eb39ef7a3e44e4f00",
"value": "0x0",
"gas": "0x5117",

@ -51,6 +51,7 @@
{
"type": "create",
"action": {
"creationMethod": "create",
"from": "0x877bd459c9b7d8576b44e59e09d076c25946f443",
"value": "0x0",
"gas": "0x19ee4",
@ -67,6 +68,7 @@
{
"type": "create",
"action": {
"creationMethod": "create",
"from": "0x9c5cfe45b15eaff4ad617af4250189e26024a4f8",
"value": "0x0",
"gas": "0x3cb",

@ -77,6 +77,7 @@
},
{
"action": {
"creationMethod": "create",
"from": "0x76554b33410b6d90b7dc889bfed0451ad195f27e",
"gas": "0x25a18",
"init": "0x0000000000000000000000000000000000000000000000000000000000000000",

File diff suppressed because one or more lines are too long

@ -51,6 +51,7 @@
{
"type": "create",
"action": {
"creationMethod": "create",
"from": "0x877bd459c9b7d8576b44e59e09d076c25946f443",
"value": "0x0",
"gas": "0x19ecc",
@ -70,6 +71,7 @@
},
{
"action": {
"creationMethod": "create",
"from": "0x1d99a1a3efa9181f540f9e24fa6e4e08eb7844ca",
"gas": "0x50ac",
"init": "0x5a",

File diff suppressed because one or more lines are too long

@ -297,10 +297,11 @@ func newFlatCreate(input *callFrame) *flatCallFrame {
return &flatCallFrame{
Type: strings.ToLower(vm.CREATE.String()),
Action: flatCallAction{
From: &input.From,
Gas: &input.Gas,
Value: input.Value,
Init: &actionInit,
CreationMethod: strings.ToLower(input.Type.String()),
From: &input.From,
Gas: &input.Gas,
Value: input.Value,
Init: &actionInit,
},
Result: &flatCallResult{
GasUsed: &input.GasUsed,

Loading…
Cancel
Save