For AccountUpdate, Cancel, and Anchoring tx types, state_transition.go calls the CaptureStart and CaptureEnd as if they are simple value transfer with value == 0 and from == to.
Add JSON testdata and makeTest scripts
The tests are created against the node with #16 applied, and then manually inspected.
Types of changes
Please put an x in the boxes related to your change.
Proposed changes
callTracer
node/cn/tracers/native
to avoid import cycle.CallFrame
is converted to JSON inGetResult
(for RPC)revertReason
field (https://github.com/ethereum/go-ethereum/commit/ff1f49245d641a7268ade38cf512bdc7b26f9b7c)gasUsed
field includes intrinsic gas (https://github.com/ethereum/go-ethereum/commit/0f4942214d76385c52c7917212331c9bad8b3566)gas
field includes intrinsic gas (https://github.com/ethereum/go-ethereum/commit/0b76eb3708626fbd2eb9c1b58d7b4eac6a5eec15)prestateTracer
Types of changes
Please put an x in the boxes related to your change.
Checklist
I have read the CLA Document and I hereby sign the CLA
in first time contribute$ make test
)Related issues
Further comments
Notable changes of callTrace
output
field is omitted if empty.value
field is sometimes omitted if it equals zero, but sometimes "0x0" is shown.time
field is deleted.gas
andgasUsed
values agree with transaction and receipts.revertReason
field.reverted.message
field don't need change.The DELEGATECALL trace inherits the caller's
value
, to match with EVM semantic.output: "0x", to: "0x3d0c6d64907b2ef39e73aa8b08ad8da9b03b9140",
type: "DELEGATECALL"
type: "DELEGATECALL",
value: "0xaa87bee538000" }],
Precompile invocations are now shown
calls: [{
from: "0x813c4bd8a12e427f08e9982c958e0a6d4e05c56f",
gas: "0x18c",
gasUsed: "0x48",
input: "0x998877665544332211",
output: "0x1c32777581417de40ff9f685335ce161c493e2528c39742c5327198b95b07320",
to: "0x0000000000000000000000000000000000000002",
type: "STATICCALL"
}], from: "0x7f0546832758f61410e81a94d7a07d55b1dfd278",
gas: "0x6ad",
gas: "0x7fc5", gasUsed: "0x7fc5", input: "0x9fb83711000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000099988776655443322110000000000000000000000000000000000000000000000",
output: "0x", to: "0x813c4bd8a12e427f08e9982c958e0a6d4e05c56f", type: "CALL", value: "0x0" }
Early validation errors (e.g. max call depth exceeded, contract address collision) are now shown
error: "internal failure",
error: "contract address collision", from: "0xafe64e2883b6fe56fbdddeef1536e034f2fe6c11",
gas: "0x2c2618", gasUsed: "0x2c2618", input: "0x608060405234801561000f575f80fd5b506040516101523803806101528339818101604052810190610031919061007d565b60648161003e91906100d5565b905050610108565b5f80fd5b5f819050919050565b61005c8161004a565b8114610066575f80fd5b50565b5f8151905061007781610053565b92915050565b5f6020828403121561009257610091610046565b5b5f61009f84828501610069565b91505092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f6100df8261004a565b91506100ea8361004a565b9250828203905081811115610102576101016100a8565b5b92915050565b603e806101145f395ff3fe60806040525f80fdfea26469706673582212201f37d242bfef7d838ebdb95c50545173bfdb701116ab06c42a6beb267ab5623864736f6c634300081a0033000000000000000000000000000000000000000000000000000000000000007b", type: "CREATE2", value: "0x0" }], }
All necessary trace fields are shown for non-EVM Tx Types (i.e. AccountUpdate, Cancel, ChainDataAnchoring)
from: "0x7f0546832758f61410e81a94d7a07d55b1dfd278",
gas: "0xcd14", gasUsed: "0xa028",
type: "",
input: "0x",
to: "0x7f0546832758f61410e81a94d7a07d55b1dfd278",
type: "CALL", value: "0x0" }