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
Describe the bug JS call tracer used by rosetta-ethereum cannot parse CALL which contains internal failed call(caused by failed CREATE opcode). JS call tracer used by Geth works fine for same CALL.
TLDR
The trace result by JS call tracer (= callTracerLegacy) by Geth. Take a look calls field which contains internal calls in this tx.
There is no to field.
There is error field which contains error message.
I just added a line to trigger failed CREATE opcode by force.
Deploy bytecode 0x608060405234801561001057600080fd5b506108a1806100206000396000f3fe608060405234801561001057600080fd5b5060043610610069576000357c01000000000000000000000000000000000000000000000000000000009004806306fdde031461006e578063160d2ed0146100f1578063262a9dff14610257578063fcf5ed0614610275575b600080fd5b6100766102bf565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100b657808201518184015260208101905061009b565b50505050905090810190601f1680156100e35780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6102556004803603608081101561010757600080fd5b810190808035906020019064010000000081111561012457600080fd5b82018360208201111561013657600080fd5b8035906020019184600183028401116401000000008311171561015857600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050919291929080359060200190929190803590602001906401000000008111156101c557600080fd5b8201836020820111156101d757600080fd5b803590602001918460018302840111640100000000831117156101f957600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f8201169050808301925050505050505091929192908035906020019092919050505061035d565b005b61025f610462565b6040518082815260200191505060405180910390f35b61027d610468565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b60008054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156103555780601f1061032a57610100808354040283529160200191610355565b820191906000526020600020905b81548152906001019060200180831161033857829003601f168201915b505050505081565b818160405161036b9061048e565b8080602001838152602001828103825284818151815260200191508051906020019080838360005b838110156103ae578082015181840152602081019050610393565b50505050905090810190601f1680156103db5780820380516001836020036101000a031916815260200191505b509350505050604051809103906000f0801580156103fd573d6000803e3d6000fd5b50600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550836000908051906020019061045492919061049b565b508260018190555050505050565b60015481565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6103358061054183390190565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106104dc57805160ff191683800117855561050a565b8280016001018555821561050a579182015b828111156105095782518255916020019190600101906104ee565b5b509050610517919061051b565b5090565b61053d91905b80821115610539576000816000905550600101610521565b5090565b9056fe608060405234801561001057600080fd5b506040516103353803806103358339810180604052604081101561003357600080fd5b81019080805164010000000081111561004b57600080fd5b8281019050602081018481111561006157600080fd5b815185600182028301116401000000008211171561007e57600080fd5b50509291906020018051906020019092919050505081600090805190602001906100a99291906100b8565b5080600181905550505061015d565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106100f957805160ff1916838001178555610127565b82800160010185558215610127579182015b8281111561012657825182559160200191906001019061010b565b5b5090506101349190610138565b5090565b61015a91905b8082111561015657600081600090555060010161013e565b5090565b90565b6101c98061016c6000396000f3fe608060405234801561001057600080fd5b5060043610610053576000357c01000000000000000000000000000000000000000000000000000000009004806306fdde0314610058578063262a9dff146100db575b600080fd5b6100606100f9565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100a0578082015181840152602081019050610085565b50505050905090810190601f1680156100cd5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6100e3610197565b6040518082815260200191505060405180910390f35b60008054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561018f5780601f106101645761010080835404028352916020019161018f565b820191906000526020600020905b81548152906001019060200180831161017257829003601f168201915b505050505081565b6001548156fea165627a7a72305820f533e6576b68db195c74bfd2c7cf3342bed686f7be1afd2664c4fbd44a0198ee0029a165627a7a72305820ee16a4449d9a61a2f830b6eb4cabb3539fd5cc525ea6887595e1f11e684d976c0029. This can be obtained by compiling Mom contract.
Call build with parameters. I already created encoded input 0x160d2ed00000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000006400000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000036d6f6d000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000036461750000000000000000000000000000000000000000000000000000000000, so you can send transaction like eth.sendTransaction({from: "0x<sender>", to: "0x<contractAddress>", input: <encodedInput>, gas: ...}).
After you send transaction executing Mom.build method then you can trace it by using debug.traceBlockByHash.
Expected behavior
rosetta-ethereum must parse failed internal CALL (caused by failed CREATE opcode) and return block structure like below.
Below result is produced by fixed version of rosetta-ethereum by myself. Check this out. I only added 3 lines to call debug api for using Geth js call tracer.
Please check the below parsed CALL when use Geth js call tracer.
There is an error message and revert field is false. (CORRECT!)
The result of fetching block from rosetta-ethereum which uses Geth JS tracer is below(IT MUST BE RETURNED LIKE BELOW):
One more thing.
rosetta-ethereum should not handle empty to field as Zero address(0x000...0) because that can be interpreted like
"Oh there was a CALL which someone tried to send transaction to Zero address.".
What was really happened is not that situation. There was empty to field, so above interpretation is wrong.
[Updated]
I think it should be handled as just 0x. That fits the actual context of the situation.
Describe the bug
JS call tracer used by
rosetta-ethereum
cannot parseCALL
which contains internal failed call(caused by failedCREATE
opcode).JS call tracer used by
Geth
works fine for same CALL.TLDR
The trace result by JS call tracer (= callTracerLegacy) by Geth. Take a look
calls
field which contains internal calls in this tx.to
field.error
field which contains error message.BUT JS call tracer by rosetta-ethereum do wrong parse for this CALL like below.
To Reproduce
failed CREATE opcode
by force.0x608060405234801561001057600080fd5b506108a1806100206000396000f3fe608060405234801561001057600080fd5b5060043610610069576000357c01000000000000000000000000000000000000000000000000000000009004806306fdde031461006e578063160d2ed0146100f1578063262a9dff14610257578063fcf5ed0614610275575b600080fd5b6100766102bf565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100b657808201518184015260208101905061009b565b50505050905090810190601f1680156100e35780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6102556004803603608081101561010757600080fd5b810190808035906020019064010000000081111561012457600080fd5b82018360208201111561013657600080fd5b8035906020019184600183028401116401000000008311171561015857600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050919291929080359060200190929190803590602001906401000000008111156101c557600080fd5b8201836020820111156101d757600080fd5b803590602001918460018302840111640100000000831117156101f957600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f8201169050808301925050505050505091929192908035906020019092919050505061035d565b005b61025f610462565b6040518082815260200191505060405180910390f35b61027d610468565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b60008054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156103555780601f1061032a57610100808354040283529160200191610355565b820191906000526020600020905b81548152906001019060200180831161033857829003601f168201915b505050505081565b818160405161036b9061048e565b8080602001838152602001828103825284818151815260200191508051906020019080838360005b838110156103ae578082015181840152602081019050610393565b50505050905090810190601f1680156103db5780820380516001836020036101000a031916815260200191505b509350505050604051809103906000f0801580156103fd573d6000803e3d6000fd5b50600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550836000908051906020019061045492919061049b565b508260018190555050505050565b60015481565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6103358061054183390190565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106104dc57805160ff191683800117855561050a565b8280016001018555821561050a579182015b828111156105095782518255916020019190600101906104ee565b5b509050610517919061051b565b5090565b61053d91905b80821115610539576000816000905550600101610521565b5090565b9056fe608060405234801561001057600080fd5b506040516103353803806103358339810180604052604081101561003357600080fd5b81019080805164010000000081111561004b57600080fd5b8281019050602081018481111561006157600080fd5b815185600182028301116401000000008211171561007e57600080fd5b50509291906020018051906020019092919050505081600090805190602001906100a99291906100b8565b5080600181905550505061015d565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106100f957805160ff1916838001178555610127565b82800160010185558215610127579182015b8281111561012657825182559160200191906001019061010b565b5b5090506101349190610138565b5090565b61015a91905b8082111561015657600081600090555060010161013e565b5090565b90565b6101c98061016c6000396000f3fe608060405234801561001057600080fd5b5060043610610053576000357c01000000000000000000000000000000000000000000000000000000009004806306fdde0314610058578063262a9dff146100db575b600080fd5b6100606100f9565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100a0578082015181840152602081019050610085565b50505050905090810190601f1680156100cd5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6100e3610197565b6040518082815260200191505060405180910390f35b60008054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561018f5780601f106101645761010080835404028352916020019161018f565b820191906000526020600020905b81548152906001019060200180831161017257829003601f168201915b505050505081565b6001548156fea165627a7a72305820f533e6576b68db195c74bfd2c7cf3342bed686f7be1afd2664c4fbd44a0198ee0029a165627a7a72305820ee16a4449d9a61a2f830b6eb4cabb3539fd5cc525ea6887595e1f11e684d976c0029
. This can be obtained by compiling Mom contract.build
with parameters. I already created encoded input0x160d2ed00000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000006400000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000036d6f6d000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000036461750000000000000000000000000000000000000000000000000000000000
, so you can send transaction likeeth.sendTransaction({from: "0x<sender>", to: "0x<contractAddress>", input: <encodedInput>, gas: ...})
.Mom.build
method then you can trace it by usingdebug.traceBlockByHash
.Expected behavior
rosetta-ethereum must parse failed internal
CALL
(caused by failedCREATE
opcode) and return block structure like below.Below result is produced by fixed version of rosetta-ethereum by myself. Check this out. I only added 3 lines to call
debug
api for using Geth js call tracer.Please check the below parsed CALL when use Geth js call tracer.
revert
field isfalse
. (CORRECT!)The result of fetching block from rosetta-ethereum which uses Geth JS tracer is below(IT MUST BE RETURNED LIKE BELOW):
Additional context
I don't have an idea why rosetta-ethereum uses its own call tracer which seems not working correctly.
The text was updated successfully, but these errors were encountered: