From ef29d1ec836488ee439fe1a0ec9ce22e78c0bc09 Mon Sep 17 00:00:00 2001 From: Ganesh Vanahalli Date: Fri, 15 Nov 2024 20:33:28 +0530 Subject: [PATCH 1/4] Utilize BalanceChangeReason in tracing --- core/tracing/hooks.go | 94 +++++++++++++++++++ .../internal/tracetest/calltrace_test.go | 14 ++- .../testdata/call_tracer/blob_tx.json | 22 ++++- .../testdata/call_tracer/create.json | 16 +++- .../testdata/call_tracer/deep_calls.json | 24 ++++- .../testdata/call_tracer/delegatecall.json | 22 ++++- .../inner_create_oog_outer_throw.json | 18 +++- .../testdata/call_tracer/inner_instafail.json | 46 ++++++--- .../call_tracer/inner_revert_reason.json | 20 ++++ .../call_tracer/inner_throw_outer_revert.json | 36 ++++++- .../tracetest/testdata/call_tracer/oog.json | 16 +++- .../testdata/call_tracer/revert.json | 24 ++++- .../testdata/call_tracer/revert_reason.json | 24 ++++- .../testdata/call_tracer/selfdestruct.json | 36 ++++++- .../testdata/call_tracer/simple.json | 34 ++++++- .../testdata/call_tracer/simple_onlytop.json | 36 ++++++- .../tracetest/testdata/call_tracer/throw.json | 18 +++- .../call_tracer_withLog/calldata.json | 34 ++++++- .../call_tracer_withLog/delegatecall.json | 22 ++++- .../frontier_create_outofstorage.json | 36 +++++-- .../call_tracer_withLog/multi_contracts.json | 58 +++++++++++- .../call_tracer_withLog/multilogs.json | 90 ++++++++++++------ .../testdata/call_tracer_withLog/notopic.json | 46 ++++++++- .../testdata/call_tracer_withLog/simple.json | 22 ++++- .../call_tracer_withLog/tx_failed.json | 28 +++++- .../tx_partial_failed.json | 22 ++++- .../call_tracer_withLog/with_onlyTopCall.json | 34 ++++++- eth/tracers/js/goja.go | 1 + eth/tracers/js/tracer_arbitrum.go | 18 ++++ eth/tracers/native/call.go | 7 ++ eth/tracers/native/call_flat.go | 7 ++ eth/tracers/native/gen_callframe_json.go | 6 ++ eth/tracers/native/tracer_arbitrum.go | 29 ++++++ 33 files changed, 875 insertions(+), 85 deletions(-) diff --git a/core/tracing/hooks.go b/core/tracing/hooks.go index 8235f08f85..399d52b49b 100644 --- a/core/tracing/hooks.go +++ b/core/tracing/hooks.go @@ -232,8 +232,102 @@ const ( // account within the same tx (captured at end of tx). // Note it doesn't account for a self-destruct which appoints itself as recipient. BalanceDecreaseSelfdestructBurn BalanceChangeReason = 14 + + // Arbitrum specific + BalanceIncreaseDeposit BalanceChangeReason = 15 + BalanceDecreaseWithdrawToL1 BalanceChangeReason = 16 + BalanceIncreaseL1PosterFee BalanceChangeReason = 17 + BalanceIncreaseInfraFee BalanceChangeReason = 18 + BalanceIncreaseNetworkFee BalanceChangeReason = 19 + BalanceIncreaseRetryTxPrepaid BalanceChangeReason = 20 + BalanceDecreaseRetryTxUndoRefund BalanceChangeReason = 21 + + BalanceChangeTransferRetryTxToEscrow BalanceChangeReason = 22 + BalanceChangeTransferRetryTxFromEscrow BalanceChangeReason = 23 + + BalanceChangeTransferRetryableToFeeRefundAddr BalanceChangeReason = 24 + BalanceChangeTransferRetryableToEscrow BalanceChangeReason = 25 + + BalanceChangeTransferRetryableToInfra BalanceChangeReason = 26 + BalanceChangeTransferRetryableFromInfra BalanceChangeReason = 27 + BalanceChangeTransferRetryableToNetwork BalanceChangeReason = 28 + BalanceChangeTransferRetryableFromNetwork BalanceChangeReason = 29 + + BalanceChangeTransferBatchposterReward BalanceChangeReason = 30 + BalanceChangeTransferBatchposterRefund BalanceChangeReason = 31 + + // Stylus + BalanceChangeTransferActivationFee BalanceChangeReason = 32 + BalanceChangeTransferActivationReimburse BalanceChangeReason = 33 ) +func (b BalanceChangeReason) String(prev, new *big.Int) string { + var reason string + + prependString := func() string { + if prev == nil || new == nil { + return "" + } + if new.Cmp(prev) == 1 { + return "balance increase due to a " + } else if new.Cmp(prev) == -1 { + return "balance decrease due to a " + } + return "" + } + + switch b { + case BalanceChangeTransfer: + reason = prependString() + "transfer via a call" + case BalanceIncreaseDeposit: + reason = "balance increase via a deposit" + case BalanceDecreaseWithdrawToL1: + reason = "balance decrease via a withdrawal to L1" + case BalanceIncreaseL1PosterFee: + reason = "balance increase via a fee collection for L1 posting" + case BalanceIncreaseInfraFee: + reason = "balance increase via a fee collection by infrastructure fee account" + case BalanceIncreaseNetworkFee: + reason = "balance increase via a fee collection by network fee account" + // ArbitrumRetryTx + case BalanceIncreaseRetryTxPrepaid: + reason = "balance increase by prepaid value for a tx of ArbitrumRetryTx type" + case BalanceDecreaseRetryTxUndoRefund: + reason = "balance decrease by undoing Geth's refund for a tx of ArbitrumRetryTx type" + case BalanceChangeTransferRetryTxToEscrow: + reason = prependString() + "transfer to escrow in a tx of ArbitrumRetryTx type" + case BalanceChangeTransferRetryTxFromEscrow: + reason = prependString() + "transfer from escrow in a tx of ArbitrumRetryTx type" + // ArbitrumSubmitRetryableTx + case BalanceChangeTransferRetryableToFeeRefundAddr: + reason = prependString() + "transfer to FeeRefundAddr in a tx of ArbitrumSubmitRetryableTx type" + case BalanceChangeTransferRetryableToEscrow: + reason = prependString() + "transfer to escrow in a tx of ArbitrumSubmitRetryableTx type" + case BalanceChangeTransferRetryableToInfra: + reason = prependString() + "transfer to infrastructure fee account in a tx of ArbitrumSubmitRetryableTx type" + case BalanceChangeTransferRetryableFromInfra: + reason = prependString() + "transfer from infrastructure fee account in a tx of ArbitrumSubmitRetryableTx type" + case BalanceChangeTransferRetryableToNetwork: + reason = prependString() + "transfer to network fee account in a tx of ArbitrumSubmitRetryableTx type" + case BalanceChangeTransferRetryableFromNetwork: + reason = prependString() + "transfer from network fee account in a tx of ArbitrumSubmitRetryableTx type" + // Batchposter + case BalanceChangeTransferBatchposterReward: + reason = prependString() + "transfer from L1PricerFundsPoolAddress as batchPosterReward" + case BalanceChangeTransferBatchposterRefund: + reason = prependString() + "transfer from L1PricerFundsPoolAddress as batchPosterRefund" + // Stylus + case BalanceChangeTransferActivationFee: + reason = prependString() + "transfer of activation fee to network fee account" + case BalanceChangeTransferActivationReimburse: + reason = prependString() + "transfer of reimburse amount after charging the activation fee" + default: + reason = "unspecified" + } + + return reason +} + // GasChangeReason is used to indicate the reason for a gas change, useful // for tracing and reporting. // diff --git a/eth/tracers/internal/tracetest/calltrace_test.go b/eth/tracers/internal/tracetest/calltrace_test.go index a682cf06af..3c4884ecf5 100644 --- a/eth/tracers/internal/tracetest/calltrace_test.go +++ b/eth/tracers/internal/tracetest/calltrace_test.go @@ -53,11 +53,19 @@ type arbitrumTransfer struct { Value string `json:"value"` } +type balanceChange struct { + Addr string `json:"addr"` + Prev string `json:"prev"` + New string `json:"new"` + Reason string `json:"reason"` +} + // callTrace is the result of a callTracer run. type callTrace struct { // Arbitrum: we add these here due to the tracer returning the top frame BeforeEVMTransfers *[]arbitrumTransfer `json:"beforeEVMTransfers,omitempty"` AfterEVMTransfers *[]arbitrumTransfer `json:"afterEVMTransfers,omitempty"` + BalanceChanges *[]balanceChange `json:"balanceChanges,omitempty"` From common.Address `json:"from"` Gas *hexutil.Uint64 `json:"gas"` @@ -301,13 +309,13 @@ func TestInternals(t *testing.T) { byte(vm.CALL), }, tracer: mkTracer("callTracer", nil), - want: fmt.Sprintf(`{"beforeEVMTransfers":[{"purpose":"feePayment","from":"%s","to":null,"value":"0x13880"}],"afterEVMTransfers":[{"purpose":"gasRefund","from":null,"to":"%s","value":"0xe3a8"},{"purpose":"tip","from":null,"to":"0x0000000000000000000000000000000000000000","value":"0x54d8"}],"from":"%s","gas":"0x13880","gasUsed":"0x54d8","to":"0x00000000000000000000000000000000deadbeef","input":"0x","calls":[{"from":"0x00000000000000000000000000000000deadbeef","gas":"0xe01a","gasUsed":"0x0","to":"0x00000000000000000000000000000000000000ff","input":"0x","value":"0x0","type":"CALL"}],"value":"0x0","type":"CALL"}`, origin.Hex(), origin.Hex(), originHex), + want: fmt.Sprintf(`{"beforeEVMTransfers":[{"purpose":"feePayment","from":"%s","to":null,"value":"0x13880"}],"afterEVMTransfers":[{"purpose":"gasRefund","from":null,"to":"%s","value":"0xe3a8"},{"purpose":"tip","from":null,"to":"0x0000000000000000000000000000000000000000","value":"0x54d8"}],"balanceChanges":[{"addr":"%s","prev":"0x1c6bf52634000","new":"0x1c6bf52620780","reason":"unspecified"},{"addr":"%s","prev":"0x1c6bf52620780","new":"0x1c6bf5262eb28","reason":"unspecified"},{"addr":"0x0000000000000000000000000000000000000000","prev":"0x0","new":"0x54d8","reason":"unspecified"}],"from":"%s","gas":"0x13880","gasUsed":"0x54d8","to":"0x00000000000000000000000000000000deadbeef","input":"0x","calls":[{"from":"0x00000000000000000000000000000000deadbeef","gas":"0xe01a","gasUsed":"0x0","to":"0x00000000000000000000000000000000000000ff","input":"0x","value":"0x0","type":"CALL"}],"value":"0x0","type":"CALL"}`, origin.Hex(), origin.Hex(), origin.Hex(), origin.Hex(), originHex), }, { name: "Stack depletion in LOG0", code: []byte{byte(vm.LOG3)}, tracer: mkTracer("callTracer", json.RawMessage(`{ "withLog": true }`)), - want: fmt.Sprintf(`{"beforeEVMTransfers":[{"purpose":"feePayment","from":"%s","to":null,"value":"0x13880"}],"afterEVMTransfers":[{"purpose":"gasRefund","from":null,"to":"%s","value":"0x0"},{"purpose":"tip","from":null,"to":"0x0000000000000000000000000000000000000000","value":"0x13880"}],"from":"%s","gas":"0x13880","gasUsed":"0x13880","to":"0x00000000000000000000000000000000deadbeef","input":"0x","error":"stack underflow (0 \u003c=\u003e 5)","value":"0x0","type":"CALL"}`, origin.Hex(), origin.Hex(), originHex), + want: fmt.Sprintf(`{"beforeEVMTransfers":[{"purpose":"feePayment","from":"%s","to":null,"value":"0x13880"}],"afterEVMTransfers":[{"purpose":"gasRefund","from":null,"to":"%s","value":"0x0"},{"purpose":"tip","from":null,"to":"0x0000000000000000000000000000000000000000","value":"0x13880"}],"balanceChanges":[{"addr":"%s","prev":"0x1c6bf52634000","new":"0x1c6bf52620780","reason":"unspecified"},{"addr":"0x0000000000000000000000000000000000000000","prev":"0x0","new":"0x13880","reason":"unspecified"}],"from":"%s","gas":"0x13880","gasUsed":"0x13880","to":"0x00000000000000000000000000000000deadbeef","input":"0x","error":"stack underflow (0 \u003c=\u003e 5)","value":"0x0","type":"CALL"}`, origin.Hex(), origin.Hex(), origin.Hex(), originHex), }, { name: "Mem expansion in LOG0", @@ -320,7 +328,7 @@ func TestInternals(t *testing.T) { byte(vm.LOG0), }, tracer: mkTracer("callTracer", json.RawMessage(`{ "withLog": true }`)), - want: fmt.Sprintf(`{"beforeEVMTransfers":[{"purpose":"feePayment","from":"%s","to":null,"value":"0x13880"}],"afterEVMTransfers":[{"purpose":"gasRefund","from":null,"to":"%s","value":"0xdce2"},{"purpose":"tip","from":null,"to":"0x0000000000000000000000000000000000000000","value":"0x5b9e"}],"from":"%s","gas":"0x13880","gasUsed":"0x5b9e","to":"0x00000000000000000000000000000000deadbeef","input":"0x","logs":[{"address":"0x00000000000000000000000000000000deadbeef","topics":[],"data":"0x000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000","position":"0x0"}],"value":"0x0","type":"CALL"}`, origin.Hex(), origin.Hex(), originHex), + want: fmt.Sprintf(`{"beforeEVMTransfers":[{"purpose":"feePayment","from":"%s","to":null,"value":"0x13880"}],"afterEVMTransfers":[{"purpose":"gasRefund","from":null,"to":"%s","value":"0xdce2"},{"purpose":"tip","from":null,"to":"0x0000000000000000000000000000000000000000","value":"0x5b9e"}],"balanceChanges":[{"addr":"%s","prev":"0x1c6bf52634000","new":"0x1c6bf52620780","reason":"unspecified"},{"addr":"%s","prev":"0x1c6bf52620780","new":"0x1c6bf5262e462","reason":"unspecified"},{"addr":"0x0000000000000000000000000000000000000000","prev":"0x0","new":"0x5b9e","reason":"unspecified"}],"from":"%s","gas":"0x13880","gasUsed":"0x5b9e","to":"0x00000000000000000000000000000000deadbeef","input":"0x","logs":[{"address":"0x00000000000000000000000000000000deadbeef","topics":[],"data":"0x000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000","position":"0x0"}],"value":"0x0","type":"CALL"}`, origin.Hex(), origin.Hex(), origin.Hex(), origin.Hex(), originHex), }, { // Leads to OOM on the prestate tracer diff --git a/eth/tracers/internal/tracetest/testdata/call_tracer/blob_tx.json b/eth/tracers/internal/tracetest/testdata/call_tracer/blob_tx.json index 9b48434e11..9ab4b97502 100644 --- a/eth/tracers/internal/tracetest/testdata/call_tracer/blob_tx.json +++ b/eth/tracers/internal/tracetest/testdata/call_tracer/blob_tx.json @@ -56,8 +56,7 @@ }, "input": "0x03f8b1820539806485174876e800825208940c2c51a0990aee1d73c1228de1586883415575088080c083020000f842a00100c9fbdf97f747e85847b4f3fff408f89c26842f77c882858bf2c89923849aa00138e3896f3c27f2389147507f8bcec52028b0efca6ee842ed83c9158873943880a0dbac3f97a532c9b00e6239b29036245a5bfbb96940b9d848634661abee98b945a03eec8525f261c2e79798f7b45a5d6ccaefa24576d53ba5023e919b86841c0675", "result": { - "beforeEVMTransfers": - [ + "beforeEVMTransfers": [ { "purpose": "feePayment", "from": "0x0c2c51a0990AeE1d73C1228de158688341557508", @@ -65,8 +64,7 @@ "value": "0x2de364958" } ], - "afterEVMTransfers": - [ + "afterEVMTransfers": [ { "purpose": "gasRefund", "from": null, @@ -80,6 +78,20 @@ "value": "0x200b20" } ], + "balanceChanges": [ + { + "addr": "0x0c2c51a0990AeE1d73C1228de158688341557508", + "prev": "0xde0b6b3a7640000", + "new": "0xde0b6b0c92db6a8", + "reason": "unspecified" + }, + { + "addr": "0x0000000000000000000000000000000000000000", + "prev": "0x272e0528", + "new": "0x274e1048", + "reason": "unspecified" + } + ], "from": "0x0c2c51a0990aee1d73c1228de158688341557508", "gas": "0x5208", "gasUsed": "0x5208", @@ -88,4 +100,4 @@ "value": "0x0", "type": "CALL" } -} +} \ No newline at end of file diff --git a/eth/tracers/internal/tracetest/testdata/call_tracer/create.json b/eth/tracers/internal/tracetest/testdata/call_tracer/create.json index 903ff57c57..5582ff2088 100644 --- a/eth/tracers/internal/tracetest/testdata/call_tracer/create.json +++ b/eth/tracers/internal/tracetest/testdata/call_tracer/create.json @@ -68,6 +68,20 @@ "value": "0x2a0383e2a65c00" } ], + "balanceChanges": [ + { + "addr": "0x13e4ACeFE6a6700604929946E70E6443E4E73447", + "prev": "0xcf3e0938579f000", + "new": "0xcc9dd0fa2d39400", + "reason": "unspecified" + }, + { + "addr": "0xD049bfd667cB46Aa3Ef5Df0dA3e57DB3Be39E511", + "prev": "0x0", + "new": "0x2a0383e2a65c00", + "reason": "unspecified" + } + ], "from": "0x13e4acefe6a6700604929946e70e6443e4e73447", "gas": "0x897be", "gasUsed": "0x897be", @@ -77,4 +91,4 @@ "type": "CREATE", "value": "0x0" } -} +} \ No newline at end of file diff --git a/eth/tracers/internal/tracetest/testdata/call_tracer/deep_calls.json b/eth/tracers/internal/tracetest/testdata/call_tracer/deep_calls.json index a5cca5d434..af173c0416 100644 --- a/eth/tracers/internal/tracetest/testdata/call_tracer/deep_calls.json +++ b/eth/tracers/internal/tracetest/testdata/call_tracer/deep_calls.json @@ -131,7 +131,27 @@ "value": "0x700fefccd9800" } ], - "calls": [ + "balanceChanges": [ + { + "addr": "0x70C9217D814985faEF62B124420F8dFbdDD96433", + "prev": "0x4ef436dcbda6cd4a", + "new": "0x4ee2736385c64d4a", + "reason": "unspecified" + }, + { + "addr": "0x70C9217D814985faEF62B124420F8dFbdDD96433", + "prev": "0x4ee2736385c64d4a", + "new": "0x4eed35ddc0d9354a", + "reason": "unspecified" + }, + { + "addr": "0x1977C248e1014Cc103929Dd7f154199C916E39Ec", + "prev": "0x0", + "new": "0x700fefccd9800", + "reason": "unspecified" + } + ], + "calls": [ { "from": "0xc212e03b9e060e36facad5fd8f4435412ca22e6b", "gas": "0x31217", @@ -428,4 +448,4 @@ "type": "CALL", "value": "0x0" } -} +} \ No newline at end of file diff --git a/eth/tracers/internal/tracetest/testdata/call_tracer/delegatecall.json b/eth/tracers/internal/tracetest/testdata/call_tracer/delegatecall.json index 26788a6ce4..ba30db78e1 100644 --- a/eth/tracers/internal/tracetest/testdata/call_tracer/delegatecall.json +++ b/eth/tracers/internal/tracetest/testdata/call_tracer/delegatecall.json @@ -84,6 +84,26 @@ "value": "0x371a55e8d6800" } ], + "balanceChanges": [ + { + "addr": "0xA529806c67cc6486d4D62024471772F47F6FD672", + "prev": "0x67820e39ac8fe9800", + "new": "0x6774bb9ec2a789800", + "reason": "unspecified" + }, + { + "addr": "0xA529806c67cc6486d4D62024471772F47F6FD672", + "prev": "0x6774bb9ec2a789800", + "new": "0x6781d71f56a713000", + "reason": "unspecified" + }, + { + "addr": "0x5659922cE141EedBC2733678f9806c77b4eEBEE8", + "prev": "0x0", + "new": "0x371a55e8d6800", + "reason": "unspecified" + } + ], "calls": [ { "calls": [ @@ -116,4 +136,4 @@ "type": "CALL", "value": "0x0" } -} +} \ No newline at end of file diff --git a/eth/tracers/internal/tracetest/testdata/call_tracer/inner_create_oog_outer_throw.json b/eth/tracers/internal/tracetest/testdata/call_tracer/inner_create_oog_outer_throw.json index 41d541761f..e6cd118fe1 100644 --- a/eth/tracers/internal/tracetest/testdata/call_tracer/inner_create_oog_outer_throw.json +++ b/eth/tracers/internal/tracetest/testdata/call_tracer/inner_create_oog_outer_throw.json @@ -76,7 +76,21 @@ "value": "0x2aa1efb94e0000" } ], - "calls": [ + "balanceChanges": [ + { + "addr": "0xE4A13Bc304682a903e9472F469C33801dd18d9E8", + "prev": "0x33c763c929f62c4f", + "new": "0x339cc1d970a82c4f", + "reason": "unspecified" + }, + { + "addr": "0x1585936b53834b021f68CC13eEeFdEc2EfC8e724", + "prev": "0x0", + "new": "0x2aa1efb94e0000", + "reason": "unspecified" + } + ], + "calls": [ { "error": "contract creation code storage out of gas", "from": "0x1d3ddf7caf024f253487e18bc4a15b1a360c170a", @@ -96,4 +110,4 @@ "type": "CALL", "value": "0x0" } -} +} \ No newline at end of file diff --git a/eth/tracers/internal/tracetest/testdata/call_tracer/inner_instafail.json b/eth/tracers/internal/tracetest/testdata/call_tracer/inner_instafail.json index 460c3d91b8..5053749511 100644 --- a/eth/tracers/internal/tracetest/testdata/call_tracer/inner_instafail.json +++ b/eth/tracers/internal/tracetest/testdata/call_tracer/inner_instafail.json @@ -72,22 +72,44 @@ "value": "0x216e3433f7200" } ], - "type": "CALL", + "balanceChanges": [ + { + "addr": "0x66fdfd05e46126A07465aD24e40cc0597BC1ef31", + "prev": "0x229ebbb36c3e0f20", + "new": "0x229589d6991e3d20", + "reason": "unspecified" + }, + { + "addr": "0x66fdfd05e46126A07465aD24e40cc0597BC1ef31", + "prev": "0x229589d6991e3d20", + "new": "0x229ca4d028fe9d20", + "reason": "unspecified" + }, + { + "addr": "0xc822ef32e6d26E170B70Cf761e204c1806265914", + "prev": "0x0", + "new": "0x216e3433f7200", + "reason": "unspecified" + } + ], + "type": "CALL", "from": "0x66fdfd05e46126a07465ad24e40cc0597bc1ef31", "to": "0x6c06b16512b332e6cd8293a2974872674716ce18", "value": "0x0", "gas": "0x1f97e", "gasUsed": "0x72de", "input": "0x2e1a7d4d00000000000000000000000000000000000000000000000014d1120d7b160000", - "calls": [{ - "from":"0x6c06b16512b332e6cd8293a2974872674716ce18", - "gas":"0x8fc", - "gasUsed":"0x0", - "to":"0x66fdfd05e46126a07465ad24e40cc0597bc1ef31", - "input":"0x", - "error":"insufficient balance for transfer", - "value":"0x14d1120d7b160000", - "type":"CALL" - }] + "calls": [ + { + "from": "0x6c06b16512b332e6cd8293a2974872674716ce18", + "gas": "0x8fc", + "gasUsed": "0x0", + "to": "0x66fdfd05e46126a07465ad24e40cc0597bc1ef31", + "input": "0x", + "error": "insufficient balance for transfer", + "value": "0x14d1120d7b160000", + "type": "CALL" + } + ] } -} +} \ No newline at end of file diff --git a/eth/tracers/internal/tracetest/testdata/call_tracer/inner_revert_reason.json b/eth/tracers/internal/tracetest/testdata/call_tracer/inner_revert_reason.json index 2e06a33f5f..f52d7875fc 100644 --- a/eth/tracers/internal/tracetest/testdata/call_tracer/inner_revert_reason.json +++ b/eth/tracers/internal/tracetest/testdata/call_tracer/inner_revert_reason.json @@ -72,6 +72,26 @@ "value": "0x15bd3c0591000" } ], + "balanceChanges": [ + { + "addr": "0x3623191d4CCfBbdf09E8EBf6382A1F8257417bC1", + "prev": "0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7", + "new": "0xffffffffffffffffffffffffffffffffffffffffffffffffffdc075dbba62ff7", + "reason": "unspecified" + }, + { + "addr": "0x3623191d4CCfBbdf09E8EBf6382A1F8257417bC1", + "prev": "0xffffffffffffffffffffffffffffffffffffffffffffffffffdc075dbba62ff7", + "new": "0xfffffffffffffffffffffffffffffffffffffffffffffffffffe2a6eef87c3f7", + "reason": "unspecified" + }, + { + "addr": "0x0000000000000000000000000000000000000000", + "prev": "0x0", + "new": "0x15bd3c0591000", + "reason": "unspecified" + } + ], "from": "0x3623191d4ccfbbdf09e8ebf6382a1f8257417bc1", "gas": "0x2dc6c0", "gasUsed": "0x25590", diff --git a/eth/tracers/internal/tracetest/testdata/call_tracer/inner_throw_outer_revert.json b/eth/tracers/internal/tracetest/testdata/call_tracer/inner_throw_outer_revert.json index 9ebd222e29..01b9f9e59f 100644 --- a/eth/tracers/internal/tracetest/testdata/call_tracer/inner_throw_outer_revert.json +++ b/eth/tracers/internal/tracetest/testdata/call_tracer/inner_throw_outer_revert.json @@ -79,7 +79,39 @@ "value": "0x25ed5d81941000" } ], - "calls": [ + "balanceChanges": [ + { + "addr": "0xd4FCAb9f0a6DC0493Af47C864f6f17A8a5e2E826", + "prev": "0x2a2dd979a35cf000", + "new": "0x2a075a1372644400", + "reason": "unspecified" + }, + { + "addr": "0xd4FCAb9f0a6DC0493Af47C864f6f17A8a5e2E826", + "prev": "0x2a075a1372644400", + "new": "0x1b7500a39c3b4400", + "reason": "balance decrease due to a transfer via a call" + }, + { + "addr": "0x33056b5DcaC09a9b4BeCad0E1dcf92c19Bd0AF76", + "prev": "0x0", + "new": "0xe92596fd6290000", + "reason": "balance increase due to a transfer via a call" + }, + { + "addr": "0xd4FCAb9f0a6DC0493Af47C864f6f17A8a5e2E826", + "prev": "0x2a075a1372644400", + "new": "0x2a07ec1c21c8e000", + "reason": "unspecified" + }, + { + "addr": "0x00d8Ae40D9a06d0E7a2877B62E32eB959Afbe16D", + "prev": "0x0", + "new": "0x25ed5d81941000", + "reason": "unspecified" + } + ], + "calls": [ { "error": "invalid opcode: INVALID", "from": "0x33056b5dcac09a9b4becad0e1dcf92c19bd0af76", @@ -100,4 +132,4 @@ "type": "CALL", "value": "0xe92596fd6290000" } -} +} \ No newline at end of file diff --git a/eth/tracers/internal/tracetest/testdata/call_tracer/oog.json b/eth/tracers/internal/tracetest/testdata/call_tracer/oog.json index 8f11c63911..d3afcb2e32 100644 --- a/eth/tracers/internal/tracetest/testdata/call_tracer/oog.json +++ b/eth/tracers/internal/tracetest/testdata/call_tracer/oog.json @@ -70,6 +70,20 @@ "value": "0x49874422212000" } ], + "balanceChanges": [ + { + "addr": "0x94194BC2aaF494501D7880B61274A169f6502A54", + "prev": "0xea8c39a876d19888d", + "new": "0xea87a13434af8688d", + "reason": "unspecified" + }, + { + "addr": "0xD049bfd667cB46Aa3Ef5Df0dA3e57DB3Be39E511", + "prev": "0x0", + "new": "0x49874422212000", + "reason": "unspecified" + } + ], "error": "out of gas", "from": "0x94194bc2aaf494501d7880b61274a169f6502a54", "gas": "0xca1d", @@ -79,4 +93,4 @@ "type": "CALL", "value": "0x0" } -} +} \ No newline at end of file diff --git a/eth/tracers/internal/tracetest/testdata/call_tracer/revert.json b/eth/tracers/internal/tracetest/testdata/call_tracer/revert.json index 1ea1a8a55a..9a2da5ba64 100644 --- a/eth/tracers/internal/tracetest/testdata/call_tracer/revert.json +++ b/eth/tracers/internal/tracetest/testdata/call_tracer/revert.json @@ -68,7 +68,27 @@ "value": "0x2954557199e00" } ], - "error": "execution reverted", + "balanceChanges": [ + { + "addr": "0x0f6cEF2b7FbB504782e35AA82a2207e816a2B7a9", + "prev": "0x2a3fc32bcc019283", + "new": "0x29354f1185da1283", + "reason": "unspecified" + }, + { + "addr": "0x0f6cEF2b7FbB504782e35AA82a2207e816a2B7a9", + "prev": "0x29354f1185da1283", + "new": "0x2a3d2de674e7f483", + "reason": "unspecified" + }, + { + "addr": "0xF4D8e706CfB25c0DECBbDd4D2E2Cc10C66376a3F", + "prev": "0x0", + "new": "0x2954557199e00", + "reason": "unspecified" + } + ], + "error": "execution reverted", "from": "0x0f6cef2b7fbb504782e35aa82a2207e816a2b7a9", "gas": "0x2dc6c0", "gasUsed": "0x719b", @@ -77,4 +97,4 @@ "type": "CALL", "value": "0x0" } -} +} \ No newline at end of file diff --git a/eth/tracers/internal/tracetest/testdata/call_tracer/revert_reason.json b/eth/tracers/internal/tracetest/testdata/call_tracer/revert_reason.json index 610ecc9b4a..73c2d4dc2c 100644 --- a/eth/tracers/internal/tracetest/testdata/call_tracer/revert_reason.json +++ b/eth/tracers/internal/tracetest/testdata/call_tracer/revert_reason.json @@ -27,7 +27,7 @@ "byzantiumBlock": 0, "constantinopleBlock": 0, "petersburgBlock": 0, - "IstanbulBlock": 1561651, + "IstanbulBlock": 1561651, "chainId": 5, "daoForkSupport": true, "eip150Block": 0, @@ -73,6 +73,26 @@ "value": "0x198f3fb76000" } ], + "balanceChanges": [ + { + "addr": "0xf7579c3d8A669C89d5Ed246a22Eb6db8F6feDbf1", + "prev": "0x57af9d6b3df812900", + "new": "0x57aecbaaacc488900", + "reason": "unspecified" + }, + { + "addr": "0xf7579c3d8A669C89d5Ed246a22Eb6db8F6feDbf1", + "prev": "0x57aecbaaacc488900", + "new": "0x57af9bd249fc9c900", + "reason": "unspecified" + }, + { + "addr": "0x0000000000000000000000000000000000000000", + "prev": "0x0", + "new": "0x198f3fb76000", + "reason": "unspecified" + } + ], "error": "execution reverted", "from": "0xf7579c3d8a669c89d5ed246a22eb6db8f6fedbf1", "gas": "0x2dc6c0", @@ -84,4 +104,4 @@ "output": "0x08c379a00000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000001e53656c662d64656c65676174696f6e20697320646973616c6c6f7765642e0000", "revertReason": "Self-delegation is disallowed." } -} +} \ No newline at end of file diff --git a/eth/tracers/internal/tracetest/testdata/call_tracer/selfdestruct.json b/eth/tracers/internal/tracetest/testdata/call_tracer/selfdestruct.json index eb16322eae..03eca774de 100644 --- a/eth/tracers/internal/tracetest/testdata/call_tracer/selfdestruct.json +++ b/eth/tracers/internal/tracetest/testdata/call_tracer/selfdestruct.json @@ -80,7 +80,39 @@ "value": "0x0" } ], - "calls": [ + "balanceChanges": [ + { + "addr": "0xb436ba50D378D4BBC8660d312A13dF6af6E89dFB", + "prev": "0x1780d77678137ac1b775", + "new": "0x1780d76ce070bddcf775", + "reason": "unspecified" + }, + { + "addr": "0x000000000000000000000000000000000000dEaD", + "prev": "0x0", + "new": "0x4d87094125a369d9bd5", + "reason": "unspecified" + }, + { + "addr": "0x3b873A919aA0512D5A0F09E6dCCEaA4a6727faFE", + "prev": "0x4d87094125a369d9bd5", + "new": "0x0", + "reason": "unspecified" + }, + { + "addr": "0xb436ba50D378D4BBC8660d312A13dF6af6E89dFB", + "prev": "0x1780d76ce070bddcf775", + "new": "0x1780d7736b3612e45375", + "reason": "unspecified" + }, + { + "addr": "0x1585936b53834b021f68CC13eEeFdEc2EfC8e724", + "prev": "0x0", + "new": "0x30cdd67dd6400", + "reason": "unspecified" + } + ], + "calls": [ { "from": "0x3b873a919aa0512d5a0f09e6dcceaa4a6727fafe", "gas": "0x0", @@ -99,4 +131,4 @@ "type": "CALL", "value": "0x0" } -} +} \ No newline at end of file diff --git a/eth/tracers/internal/tracetest/testdata/call_tracer/simple.json b/eth/tracers/internal/tracetest/testdata/call_tracer/simple.json index 92f7a68a18..f834c10b0a 100644 --- a/eth/tracers/internal/tracetest/testdata/call_tracer/simple.json +++ b/eth/tracers/internal/tracetest/testdata/call_tracer/simple.json @@ -79,6 +79,38 @@ "value": "0x420eed1bd6c00" } ], + "balanceChanges": [ + { + "addr": "0xb436ba50D378D4BBC8660d312A13dF6af6E89dFB", + "prev": "0x1780d77678137ac1b775", + "new": "0x1780d76ce070bddcf775", + "reason": "unspecified" + }, + { + "addr": "0x3b873A919aA0512D5A0F09E6dCCEaA4a6727faFE", + "prev": "0x4d87094125a369d9bd5", + "new": "0x4d869a3b70062eb9bd5", + "reason": "balance decrease due to a transfer via a call" + }, + { + "addr": "0x0024F658a46FBB89d8Ac105e98D7ac7cbBaF27C5", + "prev": "0x0", + "new": "0x6f05b59d3b20000", + "reason": "balance increase due to a transfer via a call" + }, + { + "addr": "0xb436ba50D378D4BBC8660d312A13dF6af6E89dFB", + "prev": "0x1780d76ce070bddcf775", + "new": "0x1780d7725724a9044b75", + "reason": "unspecified" + }, + { + "addr": "0x1585936b53834b021f68CC13eEeFdEc2EfC8e724", + "prev": "0x0", + "new": "0x420eed1bd6c00", + "reason": "unspecified" + } + ], "calls": [ { "from": "0x3b873a919aa0512d5a0f09e6dcceaa4a6727fafe", @@ -99,4 +131,4 @@ "type": "CALL", "value": "0x0" } -} +} \ No newline at end of file diff --git a/eth/tracers/internal/tracetest/testdata/call_tracer/simple_onlytop.json b/eth/tracers/internal/tracetest/testdata/call_tracer/simple_onlytop.json index deb7d5cddf..1ed4a6839c 100644 --- a/eth/tracers/internal/tracetest/testdata/call_tracer/simple_onlytop.json +++ b/eth/tracers/internal/tracetest/testdata/call_tracer/simple_onlytop.json @@ -57,7 +57,7 @@ }, "input": "0xf88b8271908506fc23ac0083015f90943b873a919aa0512d5a0f09e6dcceaa4a6727fafe80a463e4bff40000000000000000000000000024f658a46fbb89d8ac105e98d7ac7cbbaf27c52aa0bdce0b59e8761854e857fe64015f06dd08a4fbb7624f6094893a79a72e6ad6bea01d9dde033cff7bb235a3163f348a6d7ab8d6b52bc0963a95b91612e40ca766a4", "tracerConfig": { - "onlyTopCall": true + "onlyTopCall": true }, "result": { "beforeEVMTransfers": [ @@ -82,6 +82,38 @@ "value": "0x420eed1bd6c00" } ], + "balanceChanges": [ + { + "addr": "0xb436ba50D378D4BBC8660d312A13dF6af6E89dFB", + "prev": "0x1780d77678137ac1b775", + "new": "0x1780d76ce070bddcf775", + "reason": "unspecified" + }, + { + "addr": "0x3b873A919aA0512D5A0F09E6dCCEaA4a6727faFE", + "prev": "0x4d87094125a369d9bd5", + "new": "0x4d869a3b70062eb9bd5", + "reason": "balance decrease due to a transfer via a call" + }, + { + "addr": "0x0024F658a46FBB89d8Ac105e98D7ac7cbBaF27C5", + "prev": "0x0", + "new": "0x6f05b59d3b20000", + "reason": "balance increase due to a transfer via a call" + }, + { + "addr": "0xb436ba50D378D4BBC8660d312A13dF6af6E89dFB", + "prev": "0x1780d76ce070bddcf775", + "new": "0x1780d7725724a9044b75", + "reason": "unspecified" + }, + { + "addr": "0x1585936b53834b021f68CC13eEeFdEc2EfC8e724", + "prev": "0x0", + "new": "0x420eed1bd6c00", + "reason": "unspecified" + } + ], "from": "0xb436ba50d378d4bbc8660d312a13df6af6e89dfb", "gas": "0x15f90", "gasUsed": "0x9751", @@ -91,4 +123,4 @@ "type": "CALL", "value": "0x0" } -} +} \ No newline at end of file diff --git a/eth/tracers/internal/tracetest/testdata/call_tracer/throw.json b/eth/tracers/internal/tracetest/testdata/call_tracer/throw.json index 4bdfbd349b..f111654b91 100644 --- a/eth/tracers/internal/tracetest/testdata/call_tracer/throw.json +++ b/eth/tracers/internal/tracetest/testdata/call_tracer/throw.json @@ -71,7 +71,21 @@ "to": "0x294e5d6c39A36Ce38aF1DCA70c1060f78Dee8070", "value": "0x11c37937e08000" } - ], + ], + "balanceChanges": [ + { + "addr": "0x70C9217D814985faEF62B124420F8dFbdDD96433", + "prev": "0x4ecd70668f5d854a", + "new": "0x4ebbaced577d054a", + "reason": "unspecified" + }, + { + "addr": "0x294e5d6c39A36Ce38aF1DCA70c1060f78Dee8070", + "prev": "0x0", + "new": "0x11c37937e08000", + "reason": "unspecified" + } + ], "error": "invalid jump destination", "from": "0x70c9217d814985faef62b124420f8dfbddd96433", "gas": "0x3d090", @@ -81,4 +95,4 @@ "type": "CALL", "value": "0x0" } -} +} \ No newline at end of file diff --git a/eth/tracers/internal/tracetest/testdata/call_tracer_withLog/calldata.json b/eth/tracers/internal/tracetest/testdata/call_tracer_withLog/calldata.json index 53d561f395..bddcb379d7 100644 --- a/eth/tracers/internal/tracetest/testdata/call_tracer_withLog/calldata.json +++ b/eth/tracers/internal/tracetest/testdata/call_tracer_withLog/calldata.json @@ -98,6 +98,38 @@ "value": "0x119b54eb98e126" } ], + "balanceChanges": [ + { + "addr": "0x4F5777744b500616697CB655DCb02ee6CD51DeB5", + "prev": "0xb0983f1b83eec290", + "new": "0xb0767db57cd070aa", + "reason": "unspecified" + }, + { + "addr": "0x4F5777744b500616697CB655DCb02ee6CD51DeB5", + "prev": "0xb0767db57cd070aa", + "new": "0x25af5ab0f2e870aa", + "reason": "balance decrease due to a transfer via a call" + }, + { + "addr": "0x200Edd17F30485A8735878661960Cd7a9A95733F", + "prev": "0x0", + "new": "0x8ac7230489e80000", + "reason": "balance increase due to a transfer via a call" + }, + { + "addr": "0x4F5777744b500616697CB655DCb02ee6CD51DeB5", + "prev": "0x25af5ab0f2e870aa", + "new": "0x25bf80c20e6de16a", + "reason": "unspecified" + }, + { + "addr": "0xf8b483DbA2c3B7176a3Da549ad41A48BB3121069", + "prev": "0x16969a0ba2c2d384d07", + "new": "0x16969b2558118d12e2d", + "reason": "unspecified" + } + ], "from": "0x4f5777744b500616697cb655dcb02ee6cd51deb5", "gas": "0x33085", "gasUsed": "0x1a9e5", @@ -136,4 +168,4 @@ "value": "0x8ac7230489e80000", "type": "CALL" } -} +} \ No newline at end of file diff --git a/eth/tracers/internal/tracetest/testdata/call_tracer_withLog/delegatecall.json b/eth/tracers/internal/tracetest/testdata/call_tracer_withLog/delegatecall.json index 288043d3da..6cc597a4bc 100644 --- a/eth/tracers/internal/tracetest/testdata/call_tracer_withLog/delegatecall.json +++ b/eth/tracers/internal/tracetest/testdata/call_tracer_withLog/delegatecall.json @@ -155,6 +155,26 @@ "value": "0xb9e774e8d5800" } ], + "balanceChanges": [ + { + "addr": "0x3dE712784baf97260455aE25fb74f574EC9c1add", + "prev": "0x23c8352f33854625", + "new": "0x23a1b9aeec0e8625", + "reason": "unspecified" + }, + { + "addr": "0x3dE712784baf97260455aE25fb74f574EC9c1add", + "prev": "0x23a1b9aeec0e8625", + "new": "0x23bc96b7e4f7ee25", + "reason": "unspecified" + }, + { + "addr": "0x61C808D82A3Ac53231750daDc13c777b59310bD9", + "prev": "0x90a7af5d4755984561", + "new": "0x90a7bafbbea4259d61", + "reason": "unspecified" + } + ], "from": "0x3de712784baf97260455ae25fb74f574ec9c1add", "gas": "0x84398", "gasUsed": "0x27ec3", @@ -432,4 +452,4 @@ "value": "0x0", "type": "CALL" } -} +} \ No newline at end of file diff --git a/eth/tracers/internal/tracetest/testdata/call_tracer_withLog/frontier_create_outofstorage.json b/eth/tracers/internal/tracetest/testdata/call_tracer_withLog/frontier_create_outofstorage.json index b2e1ea79cd..b97ea4acb6 100644 --- a/eth/tracers/internal/tracetest/testdata/call_tracer_withLog/frontier_create_outofstorage.json +++ b/eth/tracers/internal/tracetest/testdata/call_tracer_withLog/frontier_create_outofstorage.json @@ -77,8 +77,7 @@ "withLog": true }, "result": { - "beforeEVMTransfers": - [ + "beforeEVMTransfers": [ { "purpose": "feePayment", "from": "0x0047A8033CC6d6Ca2ED5044674Fd421F44884dE8", @@ -86,8 +85,7 @@ "value": "0x13fbe85edc90000" } ], - "afterEVMTransfers": - [ + "afterEVMTransfers": [ { "purpose": "gasRefund", "from": null, @@ -101,6 +99,26 @@ "value": "0x6a8fb3d104cc00" } ], + "balanceChanges": [ + { + "addr": "0x0047A8033CC6d6Ca2ED5044674Fd421F44884dE8", + "prev": "0x44f5ced08fe37cf7", + "new": "0x43b6104aa21a7cf7", + "reason": "unspecified" + }, + { + "addr": "0x0047A8033CC6d6Ca2ED5044674Fd421F44884dE8", + "prev": "0x43b6104aa21a7cf7", + "new": "0x448b3f1cbedeb0f7", + "reason": "unspecified" + }, + { + "addr": "0xe48430c4E88A929bBa0eE3DCe284866a9937b609", + "prev": "0x26758774d51d8677a", + "new": "0x267c3070122dd337a", + "reason": "unspecified" + } + ], "from": "0x0047a8033cc6d6ca2ed5044674fd421f44884de8", "gas": "0x1b7740", "gasUsed": "0x9274f", @@ -195,12 +213,14 @@ "type": "CALL" } ], - "logs":[ + "logs": [ { "address": "0xf631e3b3aafa084bc51c714825aacf505d2059be", - "topics": ["0x1f28d876aff267c3302a63cd25ebcca53e6f60691049df42275b6d06ab455c67"], - "data":"0x55bc8431ce52389ac668a9b14a0943290cb7263732251186e960bc8b249b5f32000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000e00000000000000000000000000000000000000000000000000000000000030d41000000000000000000000000000000000000000000000000000000000000000355524c0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004c6a736f6e2868747470733a2f2f6170692e6b72616b656e2e636f6d2f302f7075626c69632f5469636b65723f706169723d455448584254292e726573756c742e58455448585842542e632e300000000000000000000000000000000000000000", - "position":"0x3" + "topics": [ + "0x1f28d876aff267c3302a63cd25ebcca53e6f60691049df42275b6d06ab455c67" + ], + "data": "0x55bc8431ce52389ac668a9b14a0943290cb7263732251186e960bc8b249b5f32000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000e00000000000000000000000000000000000000000000000000000000000030d41000000000000000000000000000000000000000000000000000000000000000355524c0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004c6a736f6e2868747470733a2f2f6170692e6b72616b656e2e636f6d2f302f7075626c69632f5469636b65723f706169723d455448584254292e726573756c742e58455448585842542e632e300000000000000000000000000000000000000000", + "position": "0x3" } ], "value": "0x0", diff --git a/eth/tracers/internal/tracetest/testdata/call_tracer_withLog/multi_contracts.json b/eth/tracers/internal/tracetest/testdata/call_tracer_withLog/multi_contracts.json index df7f7a8318..a5a42a26e7 100644 --- a/eth/tracers/internal/tracetest/testdata/call_tracer_withLog/multi_contracts.json +++ b/eth/tracers/internal/tracetest/testdata/call_tracer_withLog/multi_contracts.json @@ -320,6 +320,62 @@ "value": "0xe25384e63aa600" } ], + "balanceChanges": [ + { + "addr": "0xBe3aE5Cb97c253DdA67181C6E34E43F5C275E08b", + "prev": "0x167d285b38143c04f", + "new": "0x1669ba8ea2f6b004f", + "reason": "unspecified" + }, + { + "addr": "0x6e715Ab4F598eACF0016b9b35Ef33e4141844CcC", + "prev": "0x4563918244f400000", + "new": "0x0", + "reason": "balance decrease due to a transfer via a call" + }, + { + "addr": "0xAD3Ecf23c0c8983B07163708be6d763b5F056193", + "prev": "0x0", + "new": "0x4563918244f400000", + "reason": "balance increase due to a transfer via a call" + }, + { + "addr": "0xAD3Ecf23c0c8983B07163708be6d763b5F056193", + "prev": "0x4563918244f400000", + "new": "0x22b1c8c1227a00001", + "reason": "balance decrease due to a transfer via a call" + }, + { + "addr": "0x6e715Ab4F598eACF0016b9b35Ef33e4141844CcC", + "prev": "0x0", + "new": "0x22b1c8c12279fffff", + "reason": "balance increase due to a transfer via a call" + }, + { + "addr": "0xAD3Ecf23c0c8983B07163708be6d763b5F056193", + "prev": "0x22b1c8c1227a00001", + "new": "0x2", + "reason": "balance decrease due to a transfer via a call" + }, + { + "addr": "0x6e715Ab4F598eACF0016b9b35Ef33e4141844CcC", + "prev": "0x22b1c8c12279fffff", + "new": "0x4563918244f3ffffe", + "reason": "balance increase due to a transfer via a call" + }, + { + "addr": "0xBe3aE5Cb97c253DdA67181C6E34E43F5C275E08b", + "prev": "0x1669ba8ea2f6b004f", + "new": "0x166f0322e9b091a4f", + "reason": "unspecified" + }, + { + "addr": "0xEA674fdDe714fd979de3EdF0F56AA9716B898ec8", + "prev": "0x4ab3566739e7b24371", + "new": "0x4ab438babecdece971", + "reason": "unspecified" + } + ], "from": "0xbe3ae5cb97c253dda67181c6e34e43f5c275e08b", "gas": "0x3567e0", "gasUsed": "0x26e1ef", @@ -2346,4 +2402,4 @@ "value": "0x0", "type": "CALL" } -} +} \ No newline at end of file diff --git a/eth/tracers/internal/tracetest/testdata/call_tracer_withLog/multilogs.json b/eth/tracers/internal/tracetest/testdata/call_tracer_withLog/multilogs.json index 55848ae7ab..44a502617a 100644 --- a/eth/tracers/internal/tracetest/testdata/call_tracer_withLog/multilogs.json +++ b/eth/tracers/internal/tracetest/testdata/call_tracer_withLog/multilogs.json @@ -188,6 +188,38 @@ "value": "0x1b3dd214f1b8c00" } ], + "balanceChanges": [ + { + "addr": "0x3FcB0342353c541E210013AadDc2E740b9A33D08", + "prev": "0x6a0e4be198f18400", + "new": "0x67f963ad0ca28400", + "reason": "unspecified" + }, + { + "addr": "0x3FcB0342353c541E210013AadDc2E740b9A33D08", + "prev": "0x67f963ad0ca28400", + "new": "0x6481360022c98400", + "reason": "balance decrease due to a transfer via a call" + }, + { + "addr": "0x350e0fFC780a6a75B44Cc52E1fF9092870668945", + "prev": "0xe37111b7c79406c0", + "new": "0xe6e93f64b16d06c0", + "reason": "balance increase due to a transfer via a call" + }, + { + "addr": "0x3FcB0342353c541E210013AadDc2E740b9A33D08", + "prev": "0x6481360022c98400", + "new": "0x64e241135ffcf800", + "reason": "unspecified" + }, + { + "addr": "0x2a65Aca4D5fC5B5C859090a6c34d164135398226", + "prev": "0x44dc051cccdfd2e132", + "new": "0x44ddb8f9ee2eee6d32", + "reason": "unspecified" + } + ], "from": "0x3fcb0342353c541e210013aaddc2e740b9a33d08", "gas": "0x2dc6c0", "gasUsed": "0x2570bf", @@ -377,7 +409,7 @@ "0xcacb62d8acea4678658eb5dc4aaa889b34d893b967c96a5f8c066e6549fa3f42" ], "data": "0x000000000000000000000000000000000000000000000000000000000000034200000000000000000000000000000000000000000000000000000000000000380000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003fcb0342353c541e210013aaddc2e740b9a33d08fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffefefe0000000000000000000000000000000000000000000000000011c37937e08000", - "position": "0x0" + "position": "0x0" }, { "address": "0x350e0ffc780a6a75b44cc52e1ff9092870668945", @@ -385,7 +417,7 @@ "0xcacb62d8acea4678658eb5dc4aaa889b34d893b967c96a5f8c066e6549fa3f42" ], "data": "0x00000000000000000000000000000000000000000000000000000000000002fe00000000000000000000000000000000000000000000000000000000000000370000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003fcb0342353c541e210013aaddc2e740b9a33d08ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa0a0a00000000000000000000000000000000000000000000000000011c37937e08000", - "position": "0x0" + "position": "0x0" }, { "address": "0x350e0ffc780a6a75b44cc52e1ff9092870668945", @@ -393,7 +425,7 @@ "0xcacb62d8acea4678658eb5dc4aaa889b34d893b967c96a5f8c066e6549fa3f42" ], "data": "0x000000000000000000000000000000000000000000000000000000000000034200000000000000000000000000000000000000000000000000000000000000370000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003fcb0342353c541e210013aaddc2e740b9a33d08ffffffffffffffffffffffffffffffffffffffffffffffffffffffffff5b5b5b0000000000000000000000000000000000000000000000000011c37937e08000", - "position": "0x0" + "position": "0x0" }, { "address": "0x350e0ffc780a6a75b44cc52e1ff9092870668945", @@ -401,7 +433,7 @@ "0xcacb62d8acea4678658eb5dc4aaa889b34d893b967c96a5f8c066e6549fa3f42" ], "data": "0x00000000000000000000000000000000000000000000000000000000000002fe00000000000000000000000000000000000000000000000000000000000000390000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003fcb0342353c541e210013aaddc2e740b9a33d08ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffbababa0000000000000000000000000000000000000000000000000011c37937e08000", - "position": "0x0" + "position": "0x0" }, { "address": "0x350e0ffc780a6a75b44cc52e1ff9092870668945", @@ -409,7 +441,7 @@ "0xcacb62d8acea4678658eb5dc4aaa889b34d893b967c96a5f8c066e6549fa3f42" ], "data": "0x000000000000000000000000000000000000000000000000000000000000034200000000000000000000000000000000000000000000000000000000000000390000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003fcb0342353c541e210013aaddc2e740b9a33d08ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000000000000000000000000000000000000000000000000011c37937e08000", - "position": "0x0" + "position": "0x0" }, { "address": "0x350e0ffc780a6a75b44cc52e1ff9092870668945", @@ -417,7 +449,7 @@ "0xcacb62d8acea4678658eb5dc4aaa889b34d893b967c96a5f8c066e6549fa3f42" ], "data": "0x00000000000000000000000000000000000000000000000000000000000002fe00000000000000000000000000000000000000000000000000000000000000360000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003fcb0342353c541e210013aaddc2e740b9a33d08ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffeaeaea0000000000000000000000000000000000000000000000000011c37937e08000", - "position": "0x0" + "position": "0x0" }, { "address": "0x350e0ffc780a6a75b44cc52e1ff9092870668945", @@ -425,7 +457,7 @@ "0xcacb62d8acea4678658eb5dc4aaa889b34d893b967c96a5f8c066e6549fa3f42" ], "data": "0x000000000000000000000000000000000000000000000000000000000000034200000000000000000000000000000000000000000000000000000000000000360000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003fcb0342353c541e210013aaddc2e740b9a33d08ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa9a9a90000000000000000000000000000000000000000000000000011c37937e08000", - "position": "0x0" + "position": "0x0" }, { "address": "0x350e0ffc780a6a75b44cc52e1ff9092870668945", @@ -433,7 +465,7 @@ "0xcacb62d8acea4678658eb5dc4aaa889b34d893b967c96a5f8c066e6549fa3f42" ], "data": "0x00000000000000000000000000000000000000000000000000000000000002fe000000000000000000000000000000000000000000000000000000000000003a0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003fcb0342353c541e210013aaddc2e740b9a33d08ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffb9b9b90000000000000000000000000000000000000000000000000011c37937e08000", - "position": "0x0" + "position": "0x0" }, { "address": "0x350e0ffc780a6a75b44cc52e1ff9092870668945", @@ -441,7 +473,7 @@ "0xcacb62d8acea4678658eb5dc4aaa889b34d893b967c96a5f8c066e6549fa3f42" ], "data": "0x0000000000000000000000000000000000000000000000000000000000000342000000000000000000000000000000000000000000000000000000000000003a0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003fcb0342353c541e210013aaddc2e740b9a33d08fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffbfbfb0000000000000000000000000000000000000000000000000011c37937e08000", - "position": "0x0" + "position": "0x0" }, { "address": "0x350e0ffc780a6a75b44cc52e1ff9092870668945", @@ -449,7 +481,7 @@ "0xcacb62d8acea4678658eb5dc4aaa889b34d893b967c96a5f8c066e6549fa3f42" ], "data": "0x00000000000000000000000000000000000000000000000000000000000002fe00000000000000000000000000000000000000000000000000000000000000350000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003fcb0342353c541e210013aaddc2e740b9a33d08fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffefefe0000000000000000000000000000000000000000000000000011c37937e08000", - "position": "0x0" + "position": "0x0" }, { "address": "0x350e0ffc780a6a75b44cc52e1ff9092870668945", @@ -457,7 +489,7 @@ "0xcacb62d8acea4678658eb5dc4aaa889b34d893b967c96a5f8c066e6549fa3f42" ], "data": "0x000000000000000000000000000000000000000000000000000000000000034200000000000000000000000000000000000000000000000000000000000000350000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003fcb0342353c541e210013aaddc2e740b9a33d08fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffefefe0000000000000000000000000000000000000000000000000011c37937e08000", - "position": "0x0" + "position": "0x0" }, { "address": "0x350e0ffc780a6a75b44cc52e1ff9092870668945", @@ -465,7 +497,7 @@ "0xcacb62d8acea4678658eb5dc4aaa889b34d893b967c96a5f8c066e6549fa3f42" ], "data": "0x00000000000000000000000000000000000000000000000000000000000002fe000000000000000000000000000000000000000000000000000000000000003b0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003fcb0342353c541e210013aaddc2e740b9a33d08ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffbababa0000000000000000000000000000000000000000000000000011c37937e08000", - "position": "0x0" + "position": "0x0" }, { "address": "0x350e0ffc780a6a75b44cc52e1ff9092870668945", @@ -473,7 +505,7 @@ "0xcacb62d8acea4678658eb5dc4aaa889b34d893b967c96a5f8c066e6549fa3f42" ], "data": "0x0000000000000000000000000000000000000000000000000000000000000342000000000000000000000000000000000000000000000000000000000000003b0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003fcb0342353c541e210013aaddc2e740b9a33d08ffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6363630000000000000000000000000000000000000000000000000011c37937e08000", - "position": "0x0" + "position": "0x0" }, { "address": "0x350e0ffc780a6a75b44cc52e1ff9092870668945", @@ -481,7 +513,7 @@ "0xcacb62d8acea4678658eb5dc4aaa889b34d893b967c96a5f8c066e6549fa3f42" ], "data": "0x00000000000000000000000000000000000000000000000000000000000002fe00000000000000000000000000000000000000000000000000000000000000340000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003fcb0342353c541e210013aaddc2e740b9a33d08ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000000000000000000000000000000000000000000000000011c37937e08000", - "position": "0x0" + "position": "0x0" }, { "address": "0x350e0ffc780a6a75b44cc52e1ff9092870668945", @@ -489,7 +521,7 @@ "0xcacb62d8acea4678658eb5dc4aaa889b34d893b967c96a5f8c066e6549fa3f42" ], "data": "0x000000000000000000000000000000000000000000000000000000000000034200000000000000000000000000000000000000000000000000000000000000340000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003fcb0342353c541e210013aaddc2e740b9a33d08fffffffffffffffffffffffffffffffffffffffffffffffffffffffffff9f9f90000000000000000000000000000000000000000000000000011c37937e08000", - "position": "0x0" + "position": "0x0" }, { "address": "0x350e0ffc780a6a75b44cc52e1ff9092870668945", @@ -497,7 +529,7 @@ "0xcacb62d8acea4678658eb5dc4aaa889b34d893b967c96a5f8c066e6549fa3f42" ], "data": "0x00000000000000000000000000000000000000000000000000000000000002fe000000000000000000000000000000000000000000000000000000000000003c0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003fcb0342353c541e210013aaddc2e740b9a33d08ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffeaeaea0000000000000000000000000000000000000000000000000011c37937e08000", - "position": "0x0" + "position": "0x0" }, { "address": "0x350e0ffc780a6a75b44cc52e1ff9092870668945", @@ -505,7 +537,7 @@ "0xcacb62d8acea4678658eb5dc4aaa889b34d893b967c96a5f8c066e6549fa3f42" ], "data": "0x0000000000000000000000000000000000000000000000000000000000000342000000000000000000000000000000000000000000000000000000000000003c0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003fcb0342353c541e210013aaddc2e740b9a33d08ffffffffffffffffffffffffffffffffffffffffffffffffffffffffff9c9c9c0000000000000000000000000000000000000000000000000011c37937e08000", - "position": "0x0" + "position": "0x0" }, { "address": "0x350e0ffc780a6a75b44cc52e1ff9092870668945", @@ -513,7 +545,7 @@ "0xcacb62d8acea4678658eb5dc4aaa889b34d893b967c96a5f8c066e6549fa3f42" ], "data": "0x00000000000000000000000000000000000000000000000000000000000002fe00000000000000000000000000000000000000000000000000000000000000330000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003fcb0342353c541e210013aaddc2e740b9a33d08fffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8f8f80000000000000000000000000000000000000000000000000011c37937e08000", - "position": "0x0" + "position": "0x0" }, { "address": "0x350e0ffc780a6a75b44cc52e1ff9092870668945", @@ -521,7 +553,7 @@ "0xcacb62d8acea4678658eb5dc4aaa889b34d893b967c96a5f8c066e6549fa3f42" ], "data": "0x000000000000000000000000000000000000000000000000000000000000034200000000000000000000000000000000000000000000000000000000000000330000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003fcb0342353c541e210013aaddc2e740b9a33d08ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000000000000000000000000000000000000000000000000011c37937e08000", - "position": "0x0" + "position": "0x0" }, { "address": "0x350e0ffc780a6a75b44cc52e1ff9092870668945", @@ -529,7 +561,7 @@ "0xcacb62d8acea4678658eb5dc4aaa889b34d893b967c96a5f8c066e6549fa3f42" ], "data": "0x00000000000000000000000000000000000000000000000000000000000002fe000000000000000000000000000000000000000000000000000000000000003d0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003fcb0342353c541e210013aaddc2e740b9a33d08fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffdfdfd0000000000000000000000000000000000000000000000000011c37937e08000", - "position": "0x0" + "position": "0x0" }, { "address": "0x350e0ffc780a6a75b44cc52e1ff9092870668945", @@ -537,7 +569,7 @@ "0xcacb62d8acea4678658eb5dc4aaa889b34d893b967c96a5f8c066e6549fa3f42" ], "data": "0x0000000000000000000000000000000000000000000000000000000000000342000000000000000000000000000000000000000000000000000000000000003d0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003fcb0342353c541e210013aaddc2e740b9a33d08ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000000000000000000000000000000000000000000000000011c37937e08000", - "position": "0x0" + "position": "0x0" }, { "address": "0x350e0ffc780a6a75b44cc52e1ff9092870668945", @@ -545,7 +577,7 @@ "0xcacb62d8acea4678658eb5dc4aaa889b34d893b967c96a5f8c066e6549fa3f42" ], "data": "0x00000000000000000000000000000000000000000000000000000000000002fe00000000000000000000000000000000000000000000000000000000000000320000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003fcb0342353c541e210013aaddc2e740b9a33d08ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000000000000000000000000000000000000000000000000011c37937e08000", - "position": "0x0" + "position": "0x0" }, { "address": "0x350e0ffc780a6a75b44cc52e1ff9092870668945", @@ -553,7 +585,7 @@ "0xcacb62d8acea4678658eb5dc4aaa889b34d893b967c96a5f8c066e6549fa3f42" ], "data": "0x000000000000000000000000000000000000000000000000000000000000034200000000000000000000000000000000000000000000000000000000000000320000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003fcb0342353c541e210013aaddc2e740b9a33d08fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffcfcfc0000000000000000000000000000000000000000000000000011c37937e08000", - "position": "0x0" + "position": "0x0" }, { "address": "0x350e0ffc780a6a75b44cc52e1ff9092870668945", @@ -561,7 +593,7 @@ "0xcacb62d8acea4678658eb5dc4aaa889b34d893b967c96a5f8c066e6549fa3f42" ], "data": "0x00000000000000000000000000000000000000000000000000000000000002fe000000000000000000000000000000000000000000000000000000000000003e0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003fcb0342353c541e210013aaddc2e740b9a33d08fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffdfdfd0000000000000000000000000000000000000000000000000011c37937e08000", - "position": "0x0" + "position": "0x0" }, { "address": "0x350e0ffc780a6a75b44cc52e1ff9092870668945", @@ -569,7 +601,7 @@ "0xcacb62d8acea4678658eb5dc4aaa889b34d893b967c96a5f8c066e6549fa3f42" ], "data": "0x0000000000000000000000000000000000000000000000000000000000000342000000000000000000000000000000000000000000000000000000000000003e0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003fcb0342353c541e210013aaddc2e740b9a33d08ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000000000000000000000000000000000000000000000000011c37937e08000", - "position": "0x0" + "position": "0x0" }, { "address": "0x350e0ffc780a6a75b44cc52e1ff9092870668945", @@ -577,7 +609,7 @@ "0xcacb62d8acea4678658eb5dc4aaa889b34d893b967c96a5f8c066e6549fa3f42" ], "data": "0x00000000000000000000000000000000000000000000000000000000000002fd00000000000000000000000000000000000000000000000000000000000000380000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003fcb0342353c541e210013aaddc2e740b9a33d08ffffffffffffffffffffffffffffffffffffffffffffffffffffffffff4d4e530000000000000000000000000000000000000000000000000011c37937e08000", - "position": "0x0" + "position": "0x0" }, { "address": "0x350e0ffc780a6a75b44cc52e1ff9092870668945", @@ -585,7 +617,7 @@ "0xcacb62d8acea4678658eb5dc4aaa889b34d893b967c96a5f8c066e6549fa3f42" ], "data": "0x000000000000000000000000000000000000000000000000000000000000034300000000000000000000000000000000000000000000000000000000000000380000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003fcb0342353c541e210013aaddc2e740b9a33d08ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000000000000000000000000000000000000000000000000011c37937e08000", - "position": "0x0" + "position": "0x0" }, { "address": "0x350e0ffc780a6a75b44cc52e1ff9092870668945", @@ -593,10 +625,10 @@ "0xcacb62d8acea4678658eb5dc4aaa889b34d893b967c96a5f8c066e6549fa3f42" ], "data": "0x00000000000000000000000000000000000000000000000000000000000002fd00000000000000000000000000000000000000000000000000000000000000370000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003fcb0342353c541e210013aaddc2e740b9a33d08ffffffffffffffffffffffffffffffffffffffffffffffffffffffffff4f494b0000000000000000000000000000000000000000000000000011c37937e08000", - "position": "0x0" + "position": "0x0" } ], "value": "0x3782dace9d90000", "type": "CALL" } -} +} \ No newline at end of file diff --git a/eth/tracers/internal/tracetest/testdata/call_tracer_withLog/notopic.json b/eth/tracers/internal/tracetest/testdata/call_tracer_withLog/notopic.json index f2316eb1b9..94e1148a8c 100644 --- a/eth/tracers/internal/tracetest/testdata/call_tracer_withLog/notopic.json +++ b/eth/tracers/internal/tracetest/testdata/call_tracer_withLog/notopic.json @@ -123,6 +123,50 @@ "value": "0xb30d0148e0600" } ], + "balanceChanges": [ + { + "addr": "0x6412Becf35cc7e2A9E7e47966E443F295e1E4F4a", + "prev": "0xfb5dbfc0d448e70", + "new": "0xfa6f01b59360e70", + "reason": "unspecified" + }, + { + "addr": "0x6412Becf35cc7e2A9E7e47966E443F295e1E4F4a", + "prev": "0xfa6f01b59360e70", + "new": "0xb7d1fb240980e70", + "reason": "balance decrease due to a transfer via a call" + }, + { + "addr": "0x50739060a2C32dc076E507aE1A893aAB28eCFe68", + "prev": "0x6a8ecefb09f7c4141", + "new": "0x6ad16c019b81a4141", + "reason": "balance increase due to a transfer via a call" + }, + { + "addr": "0x50739060a2C32dc076E507aE1A893aAB28eCFe68", + "prev": "0x6ad16c019b81a4141", + "new": "0x6acff22b6b6ddeaed", + "reason": "balance decrease due to a transfer via a call" + }, + { + "addr": "0x88e1315687AeC48a72786c6B3b3F075208B62713", + "prev": "0x24b9f2c5dc266dc6", + "new": "0x24d19028dd62c41a", + "reason": "balance increase due to a transfer via a call" + }, + { + "addr": "0x6412Becf35cc7e2A9E7e47966E443F295e1E4F4a", + "prev": "0xb7d1fb240980e70", + "new": "0xb80dac2e0188870", + "reason": "unspecified" + }, + { + "addr": "0x61C808D82A3Ac53231750daDc13c777b59310bD9", + "prev": "0x12f621ea72fef44f848", + "new": "0x12f6229d80003d2fe48", + "reason": "unspecified" + } + ], "from": "0x6412becf35cc7e2a9e7e47966e443f295e1e4f4a", "gas": "0x30d40", "gasUsed": "0x249eb", @@ -307,4 +351,4 @@ "value": "0x429d069189e0000", "type": "CALL" } -} +} \ No newline at end of file diff --git a/eth/tracers/internal/tracetest/testdata/call_tracer_withLog/simple.json b/eth/tracers/internal/tracetest/testdata/call_tracer_withLog/simple.json index 82d0596304..4dc0c107cc 100644 --- a/eth/tracers/internal/tracetest/testdata/call_tracer_withLog/simple.json +++ b/eth/tracers/internal/tracetest/testdata/call_tracer_withLog/simple.json @@ -84,6 +84,26 @@ "value": "0x90886d609c400" } ], + "balanceChanges": [ + { + "addr": "0xD1220A0cf47c7B9Be7A2E6BA89F429762e7b9aDb", + "prev": "0x14203bee2ea6fbe8c", + "new": "0x141e8f2e2dc857a8c", + "reason": "unspecified" + }, + { + "addr": "0xD1220A0cf47c7B9Be7A2E6BA89F429762e7b9aDb", + "prev": "0x141e8f2e2dc857a8c", + "new": "0x141fab65c1465fa8c", + "reason": "unspecified" + }, + { + "addr": "0xe2fE6B13287f28E193333fDfe7Fedf2f6Df6124A", + "prev": "0x2717a9c870a286f4350", + "new": "0x2717aa58f90fe790750", + "reason": "unspecified" + } + ], "from": "0xd1220a0cf47c7b9be7a2e6ba89f429762e7b9adb", "gas": "0x24d45", "gasUsed": "0xc6a5", @@ -104,4 +124,4 @@ "value": "0x0", "type": "CALL" } -} +} \ No newline at end of file diff --git a/eth/tracers/internal/tracetest/testdata/call_tracer_withLog/tx_failed.json b/eth/tracers/internal/tracetest/testdata/call_tracer_withLog/tx_failed.json index 730fea23e1..fd60e54554 100644 --- a/eth/tracers/internal/tracetest/testdata/call_tracer_withLog/tx_failed.json +++ b/eth/tracers/internal/tracetest/testdata/call_tracer_withLog/tx_failed.json @@ -158,6 +158,32 @@ "value": "0x81fc72632f7340" } ], + "balanceChanges": [ + { + "addr": "0xe6002189a74B43e6868b20C1311Bc108E38AaC57", + "prev": "0x29129264d1ae4848b", + "new": "0x290a729dab7b5114b", + "reason": "unspecified" + }, + { + "addr": "0xBB9bc244D798123fDe783fCc1C72d3Bb8C189413", + "prev": "0x53d2c8df046dd3db5", + "new": "0x51cfa87ca63cad105", + "reason": "balance decrease due to a transfer via a call" + }, + { + "addr": "0x10abb5EfEcdC09581f8b7cb95791FE2936790b4E", + "prev": "0x81f158e2814b4ab624c", + "new": "0x81f35c02e3a97bdcefc", + "reason": "balance increase due to a transfer via a call" + }, + { + "addr": "0xEA674fdDe714fd979de3EdF0F56AA9716B898ec8", + "prev": "0x1601bbe4c58ec73210", + "new": "0x16023de137f1f6a550", + "reason": "unspecified" + } + ], "from": "0xe6002189a74b43e6868b20c1311bc108e38aac57", "gas": "0xaae60", "gasUsed": "0xaae60", @@ -263,4 +289,4 @@ "value": "0x0", "type": "CALL" } -} +} \ No newline at end of file diff --git a/eth/tracers/internal/tracetest/testdata/call_tracer_withLog/tx_partial_failed.json b/eth/tracers/internal/tracetest/testdata/call_tracer_withLog/tx_partial_failed.json index 8a46028598..208c21de94 100644 --- a/eth/tracers/internal/tracetest/testdata/call_tracer_withLog/tx_partial_failed.json +++ b/eth/tracers/internal/tracetest/testdata/call_tracer_withLog/tx_partial_failed.json @@ -96,6 +96,26 @@ "value": "0xbcd242cec0800" } ], + "balanceChanges": [ + { + "addr": "0x01115b41bD2731353dd3e6Abf44818FDc035aAf1", + "prev": "0x16d99e16e809000", + "new": "0x15f63e6db669000", + "reason": "unspecified" + }, + { + "addr": "0x01115b41bD2731353dd3e6Abf44818FDc035aAf1", + "prev": "0x15f63e6db669000", + "new": "0x161ccbd41948800", + "reason": "unspecified" + }, + { + "addr": "0x61C808D82A3Ac53231750daDc13c777b59310bD9", + "prev": "0x6a636960e34bd696f4", + "new": "0x6a63752e0778c29ef4", + "reason": "unspecified" + } + ], "from": "0x01115b41bd2731353dd3e6abf44818fdc035aaf1", "gas": "0x30d40", "gasUsed": "0x288c9", @@ -127,4 +147,4 @@ "value": "0x0", "type": "CALL" } -} +} \ No newline at end of file diff --git a/eth/tracers/internal/tracetest/testdata/call_tracer_withLog/with_onlyTopCall.json b/eth/tracers/internal/tracetest/testdata/call_tracer_withLog/with_onlyTopCall.json index 50b3b0b276..97b9db76ea 100644 --- a/eth/tracers/internal/tracetest/testdata/call_tracer_withLog/with_onlyTopCall.json +++ b/eth/tracers/internal/tracetest/testdata/call_tracer_withLog/with_onlyTopCall.json @@ -99,6 +99,38 @@ "value": "0x119b54eb98e126" } ], + "balanceChanges": [ + { + "addr": "0x4F5777744b500616697CB655DCb02ee6CD51DeB5", + "prev": "0xb0983f1b83eec290", + "new": "0xb0767db57cd070aa", + "reason": "unspecified" + }, + { + "addr": "0x4F5777744b500616697CB655DCb02ee6CD51DeB5", + "prev": "0xb0767db57cd070aa", + "new": "0x25af5ab0f2e870aa", + "reason": "balance decrease due to a transfer via a call" + }, + { + "addr": "0x200Edd17F30485A8735878661960Cd7a9A95733F", + "prev": "0x0", + "new": "0x8ac7230489e80000", + "reason": "balance increase due to a transfer via a call" + }, + { + "addr": "0x4F5777744b500616697CB655DCb02ee6CD51DeB5", + "prev": "0x25af5ab0f2e870aa", + "new": "0x25bf80c20e6de16a", + "reason": "unspecified" + }, + { + "addr": "0xf8b483DbA2c3B7176a3Da549ad41A48BB3121069", + "prev": "0x16969a0ba2c2d384d07", + "new": "0x16969b2558118d12e2d", + "reason": "unspecified" + } + ], "from": "0x4f5777744b500616697cb655dcb02ee6cd51deb5", "gas": "0x33085", "gasUsed": "0x1a9e5", @@ -108,4 +140,4 @@ "value": "0x8ac7230489e80000", "type": "CALL" } -} +} \ No newline at end of file diff --git a/eth/tracers/js/goja.go b/eth/tracers/js/goja.go index 8a0765c27e..fab4ac5e78 100644 --- a/eth/tracers/js/goja.go +++ b/eth/tracers/js/goja.go @@ -230,6 +230,7 @@ func newJsTracer(code string, ctx *tracers.Context, cfg json.RawMessage) (*trace OnExit: t.OnExit, OnOpcode: t.OnOpcode, OnFault: t.OnFault, + OnBalanceChange: t.OnBalanceChange, CaptureArbitrumTransfer: t.CaptureArbitrumTransfer, CaptureStylusHostio: t.CaptureStylusHostio, }, diff --git a/eth/tracers/js/tracer_arbitrum.go b/eth/tracers/js/tracer_arbitrum.go index db59809ac6..49fcaeeb40 100644 --- a/eth/tracers/js/tracer_arbitrum.go +++ b/eth/tracers/js/tracer_arbitrum.go @@ -21,6 +21,7 @@ import ( "github.com/dop251/goja" "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/tracing" ) func (jst *jsTracer) CaptureArbitrumTransfer( @@ -69,3 +70,20 @@ func (jst *jsTracer) CaptureStylusHostio(name string, args, outs []byte, startIn jst.err = wrapError("hostio", err) } } + +func (jst *jsTracer) OnBalanceChange(addr common.Address, prev, new *big.Int, reason tracing.BalanceChangeReason) { + traceBalanceChange, ok := goja.AssertFunction(jst.obj.Get("onBalanceChange")) + if !ok { + return + } + + balanceChange := jst.vm.NewObject() + balanceChange.Set("addr", addr.String()) + balanceChange.Set("prev", prev) + balanceChange.Set("new", new) + balanceChange.Set("reason", reason.String(prev, new)) + + if _, err := traceBalanceChange(jst.obj, balanceChange); err != nil { + jst.err = wrapError("onBalanceChange", err) + } +} diff --git a/eth/tracers/native/call.go b/eth/tracers/native/call.go index 05690c3aa4..0bb08049e5 100644 --- a/eth/tracers/native/call.go +++ b/eth/tracers/native/call.go @@ -50,6 +50,7 @@ type callFrame struct { // Arbitrum: we add these here due to the tracer returning the top frame BeforeEVMTransfers *[]arbitrumTransfer `json:"beforeEVMTransfers,omitempty"` AfterEVMTransfers *[]arbitrumTransfer `json:"afterEVMTransfers,omitempty"` + BalanceChanges *[]balanceChange `json:"balanceChanges,omitempty"` Type vm.OpCode `json:"-"` From common.Address `json:"from"` @@ -114,6 +115,9 @@ type callTracer struct { beforeEVMTransfers []arbitrumTransfer afterEVMTransfers []arbitrumTransfer + // Arbitrum: capture balance changes + balanceChanges []balanceChange + callstack []callFrame config callTracerConfig gasLimit uint64 @@ -141,6 +145,7 @@ func newCallTracer(ctx *tracers.Context, cfg json.RawMessage) (*tracers.Tracer, OnEnter: t.OnEnter, OnExit: t.OnExit, OnLog: t.OnLog, + OnBalanceChange: t.OnBalanceChange, CaptureArbitrumTransfer: t.CaptureArbitrumTransfer, }, GetResult: t.GetResult, @@ -160,6 +165,7 @@ func newCallTracerObject(ctx *tracers.Context, cfg json.RawMessage) (*callTracer return &callTracer{ beforeEVMTransfers: []arbitrumTransfer{}, afterEVMTransfers: []arbitrumTransfer{}, + balanceChanges: []balanceChange{}, callstack: make([]callFrame, 0, 1), config: config, }, nil @@ -275,6 +281,7 @@ func (t *callTracer) GetResult() (json.RawMessage, error) { call := t.callstack[0] call.BeforeEVMTransfers = &t.beforeEVMTransfers call.AfterEVMTransfers = &t.afterEVMTransfers + call.BalanceChanges = &t.balanceChanges res, err := json.Marshal(call) if err != nil { diff --git a/eth/tracers/native/call_flat.go b/eth/tracers/native/call_flat.go index 45f81cf1c1..6eeaedbec0 100644 --- a/eth/tracers/native/call_flat.go +++ b/eth/tracers/native/call_flat.go @@ -63,6 +63,7 @@ type flatCallFrame struct { // Arbitrum: we add these here due to the tracer returning the top frame BeforeEVMTransfers *[]arbitrumTransfer `json:"beforeEVMTransfers,omitempty"` AfterEVMTransfers *[]arbitrumTransfer `json:"afterEVMTransfers,omitempty"` + BalanceChanges *[]balanceChange `json:"balanceChanges,omitempty"` Action flatCallAction `json:"action"` BlockHash *common.Hash `json:"blockHash"` @@ -120,6 +121,9 @@ type flatCallTracer struct { beforeEVMTransfers []arbitrumTransfer afterEVMTransfers []arbitrumTransfer + // Arbitrum: capture balance changes + balanceChanges []balanceChange + tracer *callTracer config flatCallTracerConfig ctx *tracers.Context // Holds tracer context data @@ -155,6 +159,7 @@ func newFlatCallTracer(ctx *tracers.Context, cfg json.RawMessage) (*tracers.Trac OnTxEnd: ft.OnTxEnd, OnEnter: ft.OnEnter, OnExit: ft.OnExit, + OnBalanceChange: ft.OnBalanceChange, CaptureArbitrumTransfer: ft.CaptureArbitrumTransfer, }, Stop: ft.Stop, @@ -224,6 +229,7 @@ func (t *flatCallTracer) GetResult() (json.RawMessage, error) { call := t.tracer.callstack[0] call.BeforeEVMTransfers = &t.beforeEVMTransfers call.AfterEVMTransfers = &t.afterEVMTransfers + call.BalanceChanges = &t.balanceChanges flat, err := flatFromNested(&call, []int{}, t.config.ConvertParityErrors, t.ctx) if err != nil { @@ -263,6 +269,7 @@ func flatFromNested(input *callFrame, traceAddress []int, convertErrs bool, ctx frame.BeforeEVMTransfers = input.BeforeEVMTransfers frame.AfterEVMTransfers = input.AfterEVMTransfers + frame.BalanceChanges = input.BalanceChanges frame.TraceAddress = traceAddress frame.Error = input.Error frame.Subtraces = len(input.Calls) diff --git a/eth/tracers/native/gen_callframe_json.go b/eth/tracers/native/gen_callframe_json.go index ceb652b32e..2df0d730ff 100644 --- a/eth/tracers/native/gen_callframe_json.go +++ b/eth/tracers/native/gen_callframe_json.go @@ -18,6 +18,7 @@ func (c callFrame) MarshalJSON() ([]byte, error) { type callFrame0 struct { BeforeEVMTransfers *[]arbitrumTransfer `json:"beforeEVMTransfers,omitempty"` AfterEVMTransfers *[]arbitrumTransfer `json:"afterEVMTransfers,omitempty"` + BalanceChanges *[]balanceChange `json:"balanceChanges,omitempty"` Type vm.OpCode `json:"-"` From common.Address `json:"from"` Gas hexutil.Uint64 `json:"gas"` @@ -35,6 +36,7 @@ func (c callFrame) MarshalJSON() ([]byte, error) { var enc callFrame0 enc.BeforeEVMTransfers = c.BeforeEVMTransfers enc.AfterEVMTransfers = c.AfterEVMTransfers + enc.BalanceChanges = c.BalanceChanges enc.Type = c.Type enc.From = c.From enc.Gas = hexutil.Uint64(c.Gas) @@ -56,6 +58,7 @@ func (c *callFrame) UnmarshalJSON(input []byte) error { type callFrame0 struct { BeforeEVMTransfers *[]arbitrumTransfer `json:"beforeEVMTransfers,omitempty"` AfterEVMTransfers *[]arbitrumTransfer `json:"afterEVMTransfers,omitempty"` + BalanceChanges *[]balanceChange `json:"balanceChanges,omitempty"` Type *vm.OpCode `json:"-"` From *common.Address `json:"from"` Gas *hexutil.Uint64 `json:"gas"` @@ -79,6 +82,9 @@ func (c *callFrame) UnmarshalJSON(input []byte) error { if dec.AfterEVMTransfers != nil { c.AfterEVMTransfers = dec.AfterEVMTransfers } + if dec.BalanceChanges != nil { + c.BalanceChanges = dec.BalanceChanges + } if dec.Type != nil { c.Type = *dec.Type } diff --git a/eth/tracers/native/tracer_arbitrum.go b/eth/tracers/native/tracer_arbitrum.go index 5134b5f099..ee5c23fae7 100644 --- a/eth/tracers/native/tracer_arbitrum.go +++ b/eth/tracers/native/tracer_arbitrum.go @@ -20,6 +20,7 @@ import ( "math/big" "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/tracing" ) type arbitrumTransfer struct { @@ -74,6 +75,34 @@ func (t *flatCallTracer) CaptureArbitrumTransfer(from, to *common.Address, value } } +type balanceChange struct { + Addr string `json:"addr"` + Prev string `json:"prev"` + New string `json:"new"` + Reason string `json:"reason"` +} + +func (t *callTracer) OnBalanceChange(addr common.Address, prev, new *big.Int, reason tracing.BalanceChangeReason) { + t.balanceChanges = append(t.balanceChanges, balanceChange{ + Addr: addr.String(), + Prev: bigToHex(prev), + New: bigToHex(new), + Reason: reason.String(prev, new), + }) +} + +func (t *flatCallTracer) OnBalanceChange(addr common.Address, prev, new *big.Int, reason tracing.BalanceChangeReason) { + if t.interrupt.Load() { + return + } + t.balanceChanges = append(t.balanceChanges, balanceChange{ + Addr: addr.String(), + Prev: bigToHex(prev), + New: bigToHex(new), + Reason: reason.String(prev, new), + }) +} + func bigToHex(n *big.Int) string { if n == nil { return "" From 23b7093706c4132d89379b2bf70bdace2dd20a0e Mon Sep 17 00:00:00 2001 From: Ganesh Vanahalli Date: Mon, 18 Nov 2024 16:38:15 +0530 Subject: [PATCH 2/4] refine balanceChangeReason and replace CaptureArbitrumTransfer purpose with balanceChangeReason --- core/state_transition.go | 8 +-- core/tracing/hooks.go | 69 +++++++++++-------- .../internal/tracetest/calltrace_test.go | 6 +- .../testdata/call_tracer/blob_tx.json | 10 +-- .../testdata/call_tracer/create.json | 10 +-- .../testdata/call_tracer/deep_calls.json | 12 ++-- .../testdata/call_tracer/delegatecall.json | 12 ++-- .../inner_create_oog_outer_throw.json | 10 +-- .../testdata/call_tracer/inner_instafail.json | 12 ++-- .../call_tracer/inner_revert_reason.json | 12 ++-- .../call_tracer/inner_throw_outer_revert.json | 16 ++--- .../tracetest/testdata/call_tracer/oog.json | 10 +-- .../testdata/call_tracer/revert.json | 12 ++-- .../testdata/call_tracer/revert_reason.json | 12 ++-- .../testdata/call_tracer/selfdestruct.json | 14 ++-- .../testdata/call_tracer/simple.json | 16 ++--- .../testdata/call_tracer/simple_onlytop.json | 16 ++--- .../tracetest/testdata/call_tracer/throw.json | 10 +-- .../call_tracer_withLog/calldata.json | 16 ++--- .../call_tracer_withLog/delegatecall.json | 12 ++-- .../frontier_create_outofstorage.json | 12 ++-- .../call_tracer_withLog/multi_contracts.json | 24 +++---- .../call_tracer_withLog/multilogs.json | 16 ++--- .../testdata/call_tracer_withLog/notopic.json | 20 +++--- .../testdata/call_tracer_withLog/simple.json | 12 ++-- .../call_tracer_withLog/tx_failed.json | 14 ++-- .../tx_partial_failed.json | 12 ++-- .../call_tracer_withLog/with_onlyTopCall.json | 16 ++--- eth/tracers/js/tracer_arbitrum.go | 4 +- eth/tracers/native/mux.go | 4 +- eth/tracers/native/tracer_arbitrum.go | 10 ++- 31 files changed, 224 insertions(+), 215 deletions(-) diff --git a/core/state_transition.go b/core/state_transition.go index 8c01b2c285..ff3b7ba023 100644 --- a/core/state_transition.go +++ b/core/state_transition.go @@ -310,7 +310,7 @@ func (st *StateTransition) buyGas() error { // Arbitrum: record fee payment if tracer := st.evm.Config.Tracer; tracer != nil && tracer.CaptureArbitrumTransfer != nil { - tracer.CaptureArbitrumTransfer(&st.msg.From, nil, mgval, true, "feePayment") + tracer.CaptureArbitrumTransfer(&st.msg.From, nil, mgval, true, tracing.BalanceDecreaseGasBuy) } return nil @@ -529,7 +529,7 @@ func (st *StateTransition) TransitionDb() (*ExecutionResult, error) { // Arbitrum: record the tip if tracer := st.evm.Config.Tracer; tracer != nil && !st.evm.ProcessingHook.DropTip() && tracer.CaptureArbitrumTransfer != nil { - tracer.CaptureArbitrumTransfer(nil, &tipReceipient, tipAmount, false, "tip") + tracer.CaptureArbitrumTransfer(nil, &tipReceipient, tipAmount, false, tracing.BalanceIncreaseRewardTransactionFee) } st.evm.ProcessingHook.EndTxHook(st.gasRemaining, vmerr == nil) @@ -539,7 +539,7 @@ func (st *StateTransition) TransitionDb() (*ExecutionResult, error) { suicides := st.evm.StateDB.GetSelfDestructs() for i, address := range suicides { balance := st.evm.StateDB.GetBalance(address) - tracer.CaptureArbitrumTransfer(&suicides[i], nil, balance.ToBig(), false, "selfDestruct") + tracer.CaptureArbitrumTransfer(&suicides[i], nil, balance.ToBig(), false, tracing.BalanceDecreaseSelfdestruct) } } @@ -583,7 +583,7 @@ func (st *StateTransition) refundGas(refundQuotient uint64) uint64 { // Arbitrum: record the gas refund if tracer := st.evm.Config.Tracer; tracer != nil && tracer.CaptureArbitrumTransfer != nil { - tracer.CaptureArbitrumTransfer(nil, &st.msg.From, remaining.ToBig(), false, "gasRefund") + tracer.CaptureArbitrumTransfer(nil, &st.msg.From, remaining.ToBig(), false, tracing.BalanceIncreaseGasReturn) } // Also return remaining gas to the block gas counter so it is diff --git a/core/tracing/hooks.go b/core/tracing/hooks.go index 399d52b49b..fd39bfa723 100644 --- a/core/tracing/hooks.go +++ b/core/tracing/hooks.go @@ -147,7 +147,7 @@ type ( // LogHook is called when a log is emitted. LogHook = func(log *types.Log) - CaptureArbitrumTransferHook = func(from, to *common.Address, value *big.Int, before bool, purpose string) + CaptureArbitrumTransferHook = func(from, to *common.Address, value *big.Int, before bool, reason BalanceChangeReason) CaptureArbitrumStorageGetHook = func(key common.Hash, depth int, before bool) CaptureArbitrumStorageSetHook = func(key, value common.Hash, depth int, before bool) @@ -262,67 +262,78 @@ const ( ) func (b BalanceChangeReason) String(prev, new *big.Int) string { + // When both prev and new are nil, we only return the main reason without specifying if the balance incrased or decreased + // useful for CaptureArbitrumTransfer var reason string - prependString := func() string { - if prev == nil || new == nil { - return "" - } + if prev != nil && new != nil { if new.Cmp(prev) == 1 { - return "balance increase due to a " + reason = "balance increase due to " } else if new.Cmp(prev) == -1 { - return "balance decrease due to a " + reason = "balance decrease due to " } - return "" + } else if new != nil { + reason = "balance increase due to " + } else if prev != nil { + reason = "balance decrease due to " } + // Append main reason for the balance change switch b { + case BalanceIncreaseRewardTransactionFee: + reason += "payment of transaction tip" + case BalanceDecreaseGasBuy: + reason += "purchase of gas for execution of a transaction" + case BalanceIncreaseGasReturn: + reason += "refund for unused gas at the end of execution" case BalanceChangeTransfer: - reason = prependString() + "transfer via a call" + reason += "transfer via a call" + case BalanceDecreaseSelfdestruct: + reason += "selfDestruct" case BalanceIncreaseDeposit: - reason = "balance increase via a deposit" + reason += "deposit" case BalanceDecreaseWithdrawToL1: - reason = "balance decrease via a withdrawal to L1" + reason += "withdrawal to L1" case BalanceIncreaseL1PosterFee: - reason = "balance increase via a fee collection for L1 posting" + reason += "fee collection for L1 posting" case BalanceIncreaseInfraFee: - reason = "balance increase via a fee collection by infrastructure fee account" + reason += "fee collection by infrastructure fee account" case BalanceIncreaseNetworkFee: - reason = "balance increase via a fee collection by network fee account" + reason += "fee collection by network fee account" // ArbitrumRetryTx case BalanceIncreaseRetryTxPrepaid: - reason = "balance increase by prepaid value for a tx of ArbitrumRetryTx type" + reason += "deposit of prepaid value in a tx of ArbitrumRetryTx type" case BalanceDecreaseRetryTxUndoRefund: - reason = "balance decrease by undoing Geth's refund for a tx of ArbitrumRetryTx type" + reason += "undoing of Geth's refund for a tx of ArbitrumRetryTx type" case BalanceChangeTransferRetryTxToEscrow: - reason = prependString() + "transfer to escrow in a tx of ArbitrumRetryTx type" + reason += "transfer to escrow in a tx of ArbitrumRetryTx type" case BalanceChangeTransferRetryTxFromEscrow: - reason = prependString() + "transfer from escrow in a tx of ArbitrumRetryTx type" + reason += "transfer from escrow in a tx of ArbitrumRetryTx type" // ArbitrumSubmitRetryableTx case BalanceChangeTransferRetryableToFeeRefundAddr: - reason = prependString() + "transfer to FeeRefundAddr in a tx of ArbitrumSubmitRetryableTx type" + reason += "transfer to FeeRefundAddr in a tx of ArbitrumSubmitRetryableTx type" case BalanceChangeTransferRetryableToEscrow: - reason = prependString() + "transfer to escrow in a tx of ArbitrumSubmitRetryableTx type" + reason += "transfer to escrow in a tx of ArbitrumSubmitRetryableTx type" case BalanceChangeTransferRetryableToInfra: - reason = prependString() + "transfer to infrastructure fee account in a tx of ArbitrumSubmitRetryableTx type" + reason += "transfer to infrastructure fee account in a tx of ArbitrumSubmitRetryableTx type" case BalanceChangeTransferRetryableFromInfra: - reason = prependString() + "transfer from infrastructure fee account in a tx of ArbitrumSubmitRetryableTx type" + reason += "transfer from infrastructure fee account in a tx of ArbitrumSubmitRetryableTx type" case BalanceChangeTransferRetryableToNetwork: - reason = prependString() + "transfer to network fee account in a tx of ArbitrumSubmitRetryableTx type" + reason += "transfer to network fee account in a tx of ArbitrumSubmitRetryableTx type" case BalanceChangeTransferRetryableFromNetwork: - reason = prependString() + "transfer from network fee account in a tx of ArbitrumSubmitRetryableTx type" + reason += "transfer from network fee account in a tx of ArbitrumSubmitRetryableTx type" // Batchposter case BalanceChangeTransferBatchposterReward: - reason = prependString() + "transfer from L1PricerFundsPoolAddress as batchPosterReward" + reason += "transfer from L1PricerFundsPoolAddress as batchPosterReward" case BalanceChangeTransferBatchposterRefund: - reason = prependString() + "transfer from L1PricerFundsPoolAddress as batchPosterRefund" + reason += "transfer from L1PricerFundsPoolAddress as batchPosterRefund" // Stylus case BalanceChangeTransferActivationFee: - reason = prependString() + "transfer of activation fee to network fee account" + reason += "transfer of activation fee to network fee account" case BalanceChangeTransferActivationReimburse: - reason = prependString() + "transfer of reimburse amount after charging the activation fee" + reason += "transfer of reimburse amount after charging the activation fee" default: - reason = "unspecified" + return "unspecified" } return reason diff --git a/eth/tracers/internal/tracetest/calltrace_test.go b/eth/tracers/internal/tracetest/calltrace_test.go index 3c4884ecf5..af40b347f3 100644 --- a/eth/tracers/internal/tracetest/calltrace_test.go +++ b/eth/tracers/internal/tracetest/calltrace_test.go @@ -309,13 +309,13 @@ func TestInternals(t *testing.T) { byte(vm.CALL), }, tracer: mkTracer("callTracer", nil), - want: fmt.Sprintf(`{"beforeEVMTransfers":[{"purpose":"feePayment","from":"%s","to":null,"value":"0x13880"}],"afterEVMTransfers":[{"purpose":"gasRefund","from":null,"to":"%s","value":"0xe3a8"},{"purpose":"tip","from":null,"to":"0x0000000000000000000000000000000000000000","value":"0x54d8"}],"balanceChanges":[{"addr":"%s","prev":"0x1c6bf52634000","new":"0x1c6bf52620780","reason":"unspecified"},{"addr":"%s","prev":"0x1c6bf52620780","new":"0x1c6bf5262eb28","reason":"unspecified"},{"addr":"0x0000000000000000000000000000000000000000","prev":"0x0","new":"0x54d8","reason":"unspecified"}],"from":"%s","gas":"0x13880","gasUsed":"0x54d8","to":"0x00000000000000000000000000000000deadbeef","input":"0x","calls":[{"from":"0x00000000000000000000000000000000deadbeef","gas":"0xe01a","gasUsed":"0x0","to":"0x00000000000000000000000000000000000000ff","input":"0x","value":"0x0","type":"CALL"}],"value":"0x0","type":"CALL"}`, origin.Hex(), origin.Hex(), origin.Hex(), origin.Hex(), originHex), + want: fmt.Sprintf(`{"beforeEVMTransfers":[{"purpose":"purchase of gas for execution of a transaction","from":"%s","to":null,"value":"0x13880"}],"afterEVMTransfers":[{"purpose":"refund for unused gas at the end of execution","from":null,"to":"%s","value":"0xe3a8"},{"purpose":"payment of transaction tip","from":null,"to":"0x0000000000000000000000000000000000000000","value":"0x54d8"}],"balanceChanges":[{"addr":"%s","prev":"0x1c6bf52634000","new":"0x1c6bf52620780","reason":"balance decrease due to purchase of gas for execution of a transaction"},{"addr":"%s","prev":"0x1c6bf52620780","new":"0x1c6bf5262eb28","reason":"balance increase due to refund for unused gas at the end of execution"},{"addr":"0x0000000000000000000000000000000000000000","prev":"0x0","new":"0x54d8","reason":"balance increase due to payment of transaction tip"}],"from":"%s","gas":"0x13880","gasUsed":"0x54d8","to":"0x00000000000000000000000000000000deadbeef","input":"0x","calls":[{"from":"0x00000000000000000000000000000000deadbeef","gas":"0xe01a","gasUsed":"0x0","to":"0x00000000000000000000000000000000000000ff","input":"0x","value":"0x0","type":"CALL"}],"value":"0x0","type":"CALL"}`, origin.Hex(), origin.Hex(), origin.Hex(), origin.Hex(), originHex), }, { name: "Stack depletion in LOG0", code: []byte{byte(vm.LOG3)}, tracer: mkTracer("callTracer", json.RawMessage(`{ "withLog": true }`)), - want: fmt.Sprintf(`{"beforeEVMTransfers":[{"purpose":"feePayment","from":"%s","to":null,"value":"0x13880"}],"afterEVMTransfers":[{"purpose":"gasRefund","from":null,"to":"%s","value":"0x0"},{"purpose":"tip","from":null,"to":"0x0000000000000000000000000000000000000000","value":"0x13880"}],"balanceChanges":[{"addr":"%s","prev":"0x1c6bf52634000","new":"0x1c6bf52620780","reason":"unspecified"},{"addr":"0x0000000000000000000000000000000000000000","prev":"0x0","new":"0x13880","reason":"unspecified"}],"from":"%s","gas":"0x13880","gasUsed":"0x13880","to":"0x00000000000000000000000000000000deadbeef","input":"0x","error":"stack underflow (0 \u003c=\u003e 5)","value":"0x0","type":"CALL"}`, origin.Hex(), origin.Hex(), origin.Hex(), originHex), + want: fmt.Sprintf(`{"beforeEVMTransfers":[{"purpose":"purchase of gas for execution of a transaction","from":"%s","to":null,"value":"0x13880"}],"afterEVMTransfers":[{"purpose":"refund for unused gas at the end of execution","from":null,"to":"%s","value":"0x0"},{"purpose":"payment of transaction tip","from":null,"to":"0x0000000000000000000000000000000000000000","value":"0x13880"}],"balanceChanges":[{"addr":"%s","prev":"0x1c6bf52634000","new":"0x1c6bf52620780","reason":"balance decrease due to purchase of gas for execution of a transaction"},{"addr":"0x0000000000000000000000000000000000000000","prev":"0x0","new":"0x13880","reason":"balance increase due to payment of transaction tip"}],"from":"%s","gas":"0x13880","gasUsed":"0x13880","to":"0x00000000000000000000000000000000deadbeef","input":"0x","error":"stack underflow (0 \u003c=\u003e 5)","value":"0x0","type":"CALL"}`, origin.Hex(), origin.Hex(), origin.Hex(), originHex), }, { name: "Mem expansion in LOG0", @@ -328,7 +328,7 @@ func TestInternals(t *testing.T) { byte(vm.LOG0), }, tracer: mkTracer("callTracer", json.RawMessage(`{ "withLog": true }`)), - want: fmt.Sprintf(`{"beforeEVMTransfers":[{"purpose":"feePayment","from":"%s","to":null,"value":"0x13880"}],"afterEVMTransfers":[{"purpose":"gasRefund","from":null,"to":"%s","value":"0xdce2"},{"purpose":"tip","from":null,"to":"0x0000000000000000000000000000000000000000","value":"0x5b9e"}],"balanceChanges":[{"addr":"%s","prev":"0x1c6bf52634000","new":"0x1c6bf52620780","reason":"unspecified"},{"addr":"%s","prev":"0x1c6bf52620780","new":"0x1c6bf5262e462","reason":"unspecified"},{"addr":"0x0000000000000000000000000000000000000000","prev":"0x0","new":"0x5b9e","reason":"unspecified"}],"from":"%s","gas":"0x13880","gasUsed":"0x5b9e","to":"0x00000000000000000000000000000000deadbeef","input":"0x","logs":[{"address":"0x00000000000000000000000000000000deadbeef","topics":[],"data":"0x000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000","position":"0x0"}],"value":"0x0","type":"CALL"}`, origin.Hex(), origin.Hex(), origin.Hex(), origin.Hex(), originHex), + want: fmt.Sprintf(`{"beforeEVMTransfers":[{"purpose":"purchase of gas for execution of a transaction","from":"%s","to":null,"value":"0x13880"}],"afterEVMTransfers":[{"purpose":"refund for unused gas at the end of execution","from":null,"to":"%s","value":"0xdce2"},{"purpose":"payment of transaction tip","from":null,"to":"0x0000000000000000000000000000000000000000","value":"0x5b9e"}],"balanceChanges":[{"addr":"%s","prev":"0x1c6bf52634000","new":"0x1c6bf52620780","reason":"balance decrease due to purchase of gas for execution of a transaction"},{"addr":"%s","prev":"0x1c6bf52620780","new":"0x1c6bf5262e462","reason":"balance increase due to refund for unused gas at the end of execution"},{"addr":"0x0000000000000000000000000000000000000000","prev":"0x0","new":"0x5b9e","reason":"balance increase due to payment of transaction tip"}],"from":"%s","gas":"0x13880","gasUsed":"0x5b9e","to":"0x00000000000000000000000000000000deadbeef","input":"0x","logs":[{"address":"0x00000000000000000000000000000000deadbeef","topics":[],"data":"0x000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000","position":"0x0"}],"value":"0x0","type":"CALL"}`, origin.Hex(), origin.Hex(), origin.Hex(), origin.Hex(), originHex), }, { // Leads to OOM on the prestate tracer diff --git a/eth/tracers/internal/tracetest/testdata/call_tracer/blob_tx.json b/eth/tracers/internal/tracetest/testdata/call_tracer/blob_tx.json index 9ab4b97502..e8a4c9b53d 100644 --- a/eth/tracers/internal/tracetest/testdata/call_tracer/blob_tx.json +++ b/eth/tracers/internal/tracetest/testdata/call_tracer/blob_tx.json @@ -58,7 +58,7 @@ "result": { "beforeEVMTransfers": [ { - "purpose": "feePayment", + "purpose": "purchase of gas for execution of a transaction", "from": "0x0c2c51a0990AeE1d73C1228de158688341557508", "to": null, "value": "0x2de364958" @@ -66,13 +66,13 @@ ], "afterEVMTransfers": [ { - "purpose": "gasRefund", + "purpose": "refund for unused gas at the end of execution", "from": null, "to": "0x0c2c51a0990AeE1d73C1228de158688341557508", "value": "0x0" }, { - "purpose": "tip", + "purpose": "payment of transaction tip", "from": null, "to": "0x0000000000000000000000000000000000000000", "value": "0x200b20" @@ -83,13 +83,13 @@ "addr": "0x0c2c51a0990AeE1d73C1228de158688341557508", "prev": "0xde0b6b3a7640000", "new": "0xde0b6b0c92db6a8", - "reason": "unspecified" + "reason": "balance decrease due to purchase of gas for execution of a transaction" }, { "addr": "0x0000000000000000000000000000000000000000", "prev": "0x272e0528", "new": "0x274e1048", - "reason": "unspecified" + "reason": "balance increase due to payment of transaction tip" } ], "from": "0x0c2c51a0990aee1d73c1228de158688341557508", diff --git a/eth/tracers/internal/tracetest/testdata/call_tracer/create.json b/eth/tracers/internal/tracetest/testdata/call_tracer/create.json index 5582ff2088..1bb6eea20d 100644 --- a/eth/tracers/internal/tracetest/testdata/call_tracer/create.json +++ b/eth/tracers/internal/tracetest/testdata/call_tracer/create.json @@ -48,7 +48,7 @@ "result": { "beforeEVMTransfers": [ { - "purpose": "feePayment", + "purpose": "purchase of gas for execution of a transaction", "from": "0x13e4ACeFE6a6700604929946E70E6443E4E73447", "to": null, "value": "0x2a0383e2a65c00" @@ -56,13 +56,13 @@ ], "afterEVMTransfers": [ { - "purpose": "gasRefund", + "purpose": "refund for unused gas at the end of execution", "from": null, "to": "0x13e4ACeFE6a6700604929946E70E6443E4E73447", "value": "0x0" }, { - "purpose": "tip", + "purpose": "payment of transaction tip", "from": null, "to": "0xD049bfd667cB46Aa3Ef5Df0dA3e57DB3Be39E511", "value": "0x2a0383e2a65c00" @@ -73,13 +73,13 @@ "addr": "0x13e4ACeFE6a6700604929946E70E6443E4E73447", "prev": "0xcf3e0938579f000", "new": "0xcc9dd0fa2d39400", - "reason": "unspecified" + "reason": "balance decrease due to purchase of gas for execution of a transaction" }, { "addr": "0xD049bfd667cB46Aa3Ef5Df0dA3e57DB3Be39E511", "prev": "0x0", "new": "0x2a0383e2a65c00", - "reason": "unspecified" + "reason": "balance increase due to payment of transaction tip" } ], "from": "0x13e4acefe6a6700604929946e70e6443e4e73447", diff --git a/eth/tracers/internal/tracetest/testdata/call_tracer/deep_calls.json b/eth/tracers/internal/tracetest/testdata/call_tracer/deep_calls.json index af173c0416..a99350937c 100644 --- a/eth/tracers/internal/tracetest/testdata/call_tracer/deep_calls.json +++ b/eth/tracers/internal/tracetest/testdata/call_tracer/deep_calls.json @@ -111,7 +111,7 @@ "result": { "beforeEVMTransfers": [ { - "purpose": "feePayment", + "purpose": "purchase of gas for execution of a transaction", "from": "0x70C9217D814985faEF62B124420F8dFbdDD96433", "to": null, "value": "0x11c37937e08000" @@ -119,13 +119,13 @@ ], "afterEVMTransfers": [ { - "purpose": "gasRefund", + "purpose": "refund for unused gas at the end of execution", "from": null, "to": "0x70C9217D814985faEF62B124420F8dFbdDD96433", "value": "0xac27a3b12e800" }, { - "purpose": "tip", + "purpose": "payment of transaction tip", "from": null, "to": "0x1977C248e1014Cc103929Dd7f154199C916E39Ec", "value": "0x700fefccd9800" @@ -136,19 +136,19 @@ "addr": "0x70C9217D814985faEF62B124420F8dFbdDD96433", "prev": "0x4ef436dcbda6cd4a", "new": "0x4ee2736385c64d4a", - "reason": "unspecified" + "reason": "balance decrease due to purchase of gas for execution of a transaction" }, { "addr": "0x70C9217D814985faEF62B124420F8dFbdDD96433", "prev": "0x4ee2736385c64d4a", "new": "0x4eed35ddc0d9354a", - "reason": "unspecified" + "reason": "balance increase due to refund for unused gas at the end of execution" }, { "addr": "0x1977C248e1014Cc103929Dd7f154199C916E39Ec", "prev": "0x0", "new": "0x700fefccd9800", - "reason": "unspecified" + "reason": "balance increase due to payment of transaction tip" } ], "calls": [ diff --git a/eth/tracers/internal/tracetest/testdata/call_tracer/delegatecall.json b/eth/tracers/internal/tracetest/testdata/call_tracer/delegatecall.json index ba30db78e1..093765e032 100644 --- a/eth/tracers/internal/tracetest/testdata/call_tracer/delegatecall.json +++ b/eth/tracers/internal/tracetest/testdata/call_tracer/delegatecall.json @@ -64,7 +64,7 @@ "result": { "beforeEVMTransfers": [ { - "purpose": "feePayment", + "purpose": "purchase of gas for execution of a transaction", "from": "0xA529806c67cc6486d4D62024471772F47F6FD672", "to": null, "value": "0xd529ae9e860000" @@ -72,13 +72,13 @@ ], "afterEVMTransfers": [ { - "purpose": "gasRefund", + "purpose": "refund for unused gas at the end of execution", "from": null, "to": "0xA529806c67cc6486d4D62024471772F47F6FD672", "value": "0xd1b8093ff89800" }, { - "purpose": "tip", + "purpose": "payment of transaction tip", "from": null, "to": "0x5659922cE141EedBC2733678f9806c77b4eEBEE8", "value": "0x371a55e8d6800" @@ -89,19 +89,19 @@ "addr": "0xA529806c67cc6486d4D62024471772F47F6FD672", "prev": "0x67820e39ac8fe9800", "new": "0x6774bb9ec2a789800", - "reason": "unspecified" + "reason": "balance decrease due to purchase of gas for execution of a transaction" }, { "addr": "0xA529806c67cc6486d4D62024471772F47F6FD672", "prev": "0x6774bb9ec2a789800", "new": "0x6781d71f56a713000", - "reason": "unspecified" + "reason": "balance increase due to refund for unused gas at the end of execution" }, { "addr": "0x5659922cE141EedBC2733678f9806c77b4eEBEE8", "prev": "0x0", "new": "0x371a55e8d6800", - "reason": "unspecified" + "reason": "balance increase due to payment of transaction tip" } ], "calls": [ diff --git a/eth/tracers/internal/tracetest/testdata/call_tracer/inner_create_oog_outer_throw.json b/eth/tracers/internal/tracetest/testdata/call_tracer/inner_create_oog_outer_throw.json index e6cd118fe1..8aa0104d0f 100644 --- a/eth/tracers/internal/tracetest/testdata/call_tracer/inner_create_oog_outer_throw.json +++ b/eth/tracers/internal/tracetest/testdata/call_tracer/inner_create_oog_outer_throw.json @@ -56,7 +56,7 @@ "result": { "beforeEVMTransfers": [ { - "purpose": "feePayment", + "purpose": "purchase of gas for execution of a transaction", "from": "0xE4A13Bc304682a903e9472F469C33801dd18d9E8", "to": null, "value": "0x2aa1efb94e0000" @@ -64,13 +64,13 @@ ], "afterEVMTransfers": [ { - "purpose": "gasRefund", + "purpose": "refund for unused gas at the end of execution", "from": null, "to": "0xE4A13Bc304682a903e9472F469C33801dd18d9E8", "value": "0x0" }, { - "purpose": "tip", + "purpose": "payment of transaction tip", "from": null, "to": "0x1585936b53834b021f68CC13eEeFdEc2EfC8e724", "value": "0x2aa1efb94e0000" @@ -81,13 +81,13 @@ "addr": "0xE4A13Bc304682a903e9472F469C33801dd18d9E8", "prev": "0x33c763c929f62c4f", "new": "0x339cc1d970a82c4f", - "reason": "unspecified" + "reason": "balance decrease due to purchase of gas for execution of a transaction" }, { "addr": "0x1585936b53834b021f68CC13eEeFdEc2EfC8e724", "prev": "0x0", "new": "0x2aa1efb94e0000", - "reason": "unspecified" + "reason": "balance increase due to payment of transaction tip" } ], "calls": [ diff --git a/eth/tracers/internal/tracetest/testdata/call_tracer/inner_instafail.json b/eth/tracers/internal/tracetest/testdata/call_tracer/inner_instafail.json index 5053749511..ba3dca39ee 100644 --- a/eth/tracers/internal/tracetest/testdata/call_tracer/inner_instafail.json +++ b/eth/tracers/internal/tracetest/testdata/call_tracer/inner_instafail.json @@ -52,7 +52,7 @@ "result": { "beforeEVMTransfers": [ { - "purpose": "feePayment", + "purpose": "purchase of gas for execution of a transaction", "from": "0x66fdfd05e46126A07465aD24e40cc0597BC1ef31", "to": null, "value": "0x931dcd31fd200" @@ -60,13 +60,13 @@ ], "afterEVMTransfers": [ { - "purpose": "gasRefund", + "purpose": "refund for unused gas at the end of execution", "from": null, "to": "0x66fdfd05e46126A07465aD24e40cc0597BC1ef31", "value": "0x71af98fe06000" }, { - "purpose": "tip", + "purpose": "payment of transaction tip", "from": null, "to": "0xc822ef32e6d26E170B70Cf761e204c1806265914", "value": "0x216e3433f7200" @@ -77,19 +77,19 @@ "addr": "0x66fdfd05e46126A07465aD24e40cc0597BC1ef31", "prev": "0x229ebbb36c3e0f20", "new": "0x229589d6991e3d20", - "reason": "unspecified" + "reason": "balance decrease due to purchase of gas for execution of a transaction" }, { "addr": "0x66fdfd05e46126A07465aD24e40cc0597BC1ef31", "prev": "0x229589d6991e3d20", "new": "0x229ca4d028fe9d20", - "reason": "unspecified" + "reason": "balance increase due to refund for unused gas at the end of execution" }, { "addr": "0xc822ef32e6d26E170B70Cf761e204c1806265914", "prev": "0x0", "new": "0x216e3433f7200", - "reason": "unspecified" + "reason": "balance increase due to payment of transaction tip" } ], "type": "CALL", diff --git a/eth/tracers/internal/tracetest/testdata/call_tracer/inner_revert_reason.json b/eth/tracers/internal/tracetest/testdata/call_tracer/inner_revert_reason.json index f52d7875fc..301271e78e 100644 --- a/eth/tracers/internal/tracetest/testdata/call_tracer/inner_revert_reason.json +++ b/eth/tracers/internal/tracetest/testdata/call_tracer/inner_revert_reason.json @@ -52,7 +52,7 @@ "result": { "beforeEVMTransfers": [ { - "purpose": "feePayment", + "purpose": "purchase of gas for execution of a transaction", "from": "0x3623191d4CCfBbdf09E8EBf6382A1F8257417bC1", "to": null, "value": "0x23f8a24459d000" @@ -60,13 +60,13 @@ ], "afterEVMTransfers": [ { - "purpose": "gasRefund", + "purpose": "refund for unused gas at the end of execution", "from": null, "to": "0x3623191d4CCfBbdf09E8EBf6382A1F8257417bC1", "value": "0x22231133e19400" }, { - "purpose": "tip", + "purpose": "payment of transaction tip", "from": null, "to": "0x0000000000000000000000000000000000000000", "value": "0x15bd3c0591000" @@ -77,19 +77,19 @@ "addr": "0x3623191d4CCfBbdf09E8EBf6382A1F8257417bC1", "prev": "0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7", "new": "0xffffffffffffffffffffffffffffffffffffffffffffffffffdc075dbba62ff7", - "reason": "unspecified" + "reason": "balance decrease due to purchase of gas for execution of a transaction" }, { "addr": "0x3623191d4CCfBbdf09E8EBf6382A1F8257417bC1", "prev": "0xffffffffffffffffffffffffffffffffffffffffffffffffffdc075dbba62ff7", "new": "0xfffffffffffffffffffffffffffffffffffffffffffffffffffe2a6eef87c3f7", - "reason": "unspecified" + "reason": "balance increase due to refund for unused gas at the end of execution" }, { "addr": "0x0000000000000000000000000000000000000000", "prev": "0x0", "new": "0x15bd3c0591000", - "reason": "unspecified" + "reason": "balance increase due to payment of transaction tip" } ], "from": "0x3623191d4ccfbbdf09e8ebf6382a1f8257417bc1", diff --git a/eth/tracers/internal/tracetest/testdata/call_tracer/inner_throw_outer_revert.json b/eth/tracers/internal/tracetest/testdata/call_tracer/inner_throw_outer_revert.json index 01b9f9e59f..c7be1a7008 100644 --- a/eth/tracers/internal/tracetest/testdata/call_tracer/inner_throw_outer_revert.json +++ b/eth/tracers/internal/tracetest/testdata/call_tracer/inner_throw_outer_revert.json @@ -59,7 +59,7 @@ "result": { "beforeEVMTransfers": [ { - "purpose": "feePayment", + "purpose": "purchase of gas for execution of a transaction", "from": "0xd4FCAb9f0a6DC0493Af47C864f6f17A8a5e2E826", "to": null, "value": "0x267f6630f8ac00" @@ -67,13 +67,13 @@ ], "afterEVMTransfers": [ { - "purpose": "gasRefund", + "purpose": "refund for unused gas at the end of execution", "from": null, "to": "0xd4FCAb9f0a6DC0493Af47C864f6f17A8a5e2E826", "value": "0x9208af649c00" }, { - "purpose": "tip", + "purpose": "payment of transaction tip", "from": null, "to": "0x00d8Ae40D9a06d0E7a2877B62E32eB959Afbe16D", "value": "0x25ed5d81941000" @@ -84,31 +84,31 @@ "addr": "0xd4FCAb9f0a6DC0493Af47C864f6f17A8a5e2E826", "prev": "0x2a2dd979a35cf000", "new": "0x2a075a1372644400", - "reason": "unspecified" + "reason": "balance decrease due to purchase of gas for execution of a transaction" }, { "addr": "0xd4FCAb9f0a6DC0493Af47C864f6f17A8a5e2E826", "prev": "0x2a075a1372644400", "new": "0x1b7500a39c3b4400", - "reason": "balance decrease due to a transfer via a call" + "reason": "balance decrease due to transfer via a call" }, { "addr": "0x33056b5DcaC09a9b4BeCad0E1dcf92c19Bd0AF76", "prev": "0x0", "new": "0xe92596fd6290000", - "reason": "balance increase due to a transfer via a call" + "reason": "balance increase due to transfer via a call" }, { "addr": "0xd4FCAb9f0a6DC0493Af47C864f6f17A8a5e2E826", "prev": "0x2a075a1372644400", "new": "0x2a07ec1c21c8e000", - "reason": "unspecified" + "reason": "balance increase due to refund for unused gas at the end of execution" }, { "addr": "0x00d8Ae40D9a06d0E7a2877B62E32eB959Afbe16D", "prev": "0x0", "new": "0x25ed5d81941000", - "reason": "unspecified" + "reason": "balance increase due to payment of transaction tip" } ], "calls": [ diff --git a/eth/tracers/internal/tracetest/testdata/call_tracer/oog.json b/eth/tracers/internal/tracetest/testdata/call_tracer/oog.json index d3afcb2e32..838a96852d 100644 --- a/eth/tracers/internal/tracetest/testdata/call_tracer/oog.json +++ b/eth/tracers/internal/tracetest/testdata/call_tracer/oog.json @@ -50,7 +50,7 @@ "result": { "beforeEVMTransfers": [ { - "purpose": "feePayment", + "purpose": "purchase of gas for execution of a transaction", "from": "0x94194BC2aaF494501D7880B61274A169f6502A54", "to": null, "value": "0x49874422212000" @@ -58,13 +58,13 @@ ], "afterEVMTransfers": [ { - "purpose": "gasRefund", + "purpose": "refund for unused gas at the end of execution", "from": null, "to": "0x94194BC2aaF494501D7880B61274A169f6502A54", "value": "0x0" }, { - "purpose": "tip", + "purpose": "payment of transaction tip", "from": null, "to": "0xD049bfd667cB46Aa3Ef5Df0dA3e57DB3Be39E511", "value": "0x49874422212000" @@ -75,13 +75,13 @@ "addr": "0x94194BC2aaF494501D7880B61274A169f6502A54", "prev": "0xea8c39a876d19888d", "new": "0xea87a13434af8688d", - "reason": "unspecified" + "reason": "balance decrease due to purchase of gas for execution of a transaction" }, { "addr": "0xD049bfd667cB46Aa3Ef5Df0dA3e57DB3Be39E511", "prev": "0x0", "new": "0x49874422212000", - "reason": "unspecified" + "reason": "balance increase due to payment of transaction tip" } ], "error": "out of gas", diff --git a/eth/tracers/internal/tracetest/testdata/call_tracer/revert.json b/eth/tracers/internal/tracetest/testdata/call_tracer/revert.json index 9a2da5ba64..d48a412e7a 100644 --- a/eth/tracers/internal/tracetest/testdata/call_tracer/revert.json +++ b/eth/tracers/internal/tracetest/testdata/call_tracer/revert.json @@ -48,7 +48,7 @@ "result": { "beforeEVMTransfers": [ { - "purpose": "feePayment", + "purpose": "purchase of gas for execution of a transaction", "from": "0x0f6cEF2b7FbB504782e35AA82a2207e816a2B7a9", "to": null, "value": "0x10a741a46278000" @@ -56,13 +56,13 @@ ], "afterEVMTransfers": [ { - "purpose": "gasRefund", + "purpose": "refund for unused gas at the end of execution", "from": null, "to": "0x0f6cEF2b7FbB504782e35AA82a2207e816a2B7a9", "value": "0x107ded4ef0de200" }, { - "purpose": "tip", + "purpose": "payment of transaction tip", "from": null, "to": "0xF4D8e706CfB25c0DECBbDd4D2E2Cc10C66376a3F", "value": "0x2954557199e00" @@ -73,19 +73,19 @@ "addr": "0x0f6cEF2b7FbB504782e35AA82a2207e816a2B7a9", "prev": "0x2a3fc32bcc019283", "new": "0x29354f1185da1283", - "reason": "unspecified" + "reason": "balance decrease due to purchase of gas for execution of a transaction" }, { "addr": "0x0f6cEF2b7FbB504782e35AA82a2207e816a2B7a9", "prev": "0x29354f1185da1283", "new": "0x2a3d2de674e7f483", - "reason": "unspecified" + "reason": "balance increase due to refund for unused gas at the end of execution" }, { "addr": "0xF4D8e706CfB25c0DECBbDd4D2E2Cc10C66376a3F", "prev": "0x0", "new": "0x2954557199e00", - "reason": "unspecified" + "reason": "balance increase due to payment of transaction tip" } ], "error": "execution reverted", diff --git a/eth/tracers/internal/tracetest/testdata/call_tracer/revert_reason.json b/eth/tracers/internal/tracetest/testdata/call_tracer/revert_reason.json index 73c2d4dc2c..002b1b6b70 100644 --- a/eth/tracers/internal/tracetest/testdata/call_tracer/revert_reason.json +++ b/eth/tracers/internal/tracetest/testdata/call_tracer/revert_reason.json @@ -53,7 +53,7 @@ "result": { "beforeEVMTransfers": [ { - "purpose": "feePayment", + "purpose": "purchase of gas for execution of a transaction", "from": "0xf7579c3d8A669C89d5Ed246a22Eb6db8F6feDbf1", "to": null, "value": "0xd1c091338a000" @@ -61,13 +61,13 @@ ], "afterEVMTransfers": [ { - "purpose": "gasRefund", + "purpose": "refund for unused gas at the end of execution", "from": null, "to": "0xf7579c3d8A669C89d5Ed246a22Eb6db8F6feDbf1", "value": "0xd0279d3814000" }, { - "purpose": "tip", + "purpose": "payment of transaction tip", "from": null, "to": "0x0000000000000000000000000000000000000000", "value": "0x198f3fb76000" @@ -78,19 +78,19 @@ "addr": "0xf7579c3d8A669C89d5Ed246a22Eb6db8F6feDbf1", "prev": "0x57af9d6b3df812900", "new": "0x57aecbaaacc488900", - "reason": "unspecified" + "reason": "balance decrease due to purchase of gas for execution of a transaction" }, { "addr": "0xf7579c3d8A669C89d5Ed246a22Eb6db8F6feDbf1", "prev": "0x57aecbaaacc488900", "new": "0x57af9bd249fc9c900", - "reason": "unspecified" + "reason": "balance increase due to refund for unused gas at the end of execution" }, { "addr": "0x0000000000000000000000000000000000000000", "prev": "0x0", "new": "0x198f3fb76000", - "reason": "unspecified" + "reason": "balance increase due to payment of transaction tip" } ], "error": "execution reverted", diff --git a/eth/tracers/internal/tracetest/testdata/call_tracer/selfdestruct.json b/eth/tracers/internal/tracetest/testdata/call_tracer/selfdestruct.json index 03eca774de..492f078f09 100644 --- a/eth/tracers/internal/tracetest/testdata/call_tracer/selfdestruct.json +++ b/eth/tracers/internal/tracetest/testdata/call_tracer/selfdestruct.json @@ -54,7 +54,7 @@ "result": { "beforeEVMTransfers": [ { - "purpose": "feePayment", + "purpose": "purchase of gas for execution of a transaction", "from": "0xb436ba50D378D4BBC8660d312A13dF6af6E89dFB", "to": null, "value": "0x997a2bce4c000" @@ -62,13 +62,13 @@ ], "afterEVMTransfers": [ { - "purpose": "gasRefund", + "purpose": "refund for unused gas at the end of execution", "from": null, "to": "0xb436ba50D378D4BBC8660d312A13dF6af6E89dFB", "value": "0x68ac555075c00" }, { - "purpose": "tip", + "purpose": "payment of transaction tip", "from": null, "to": "0x1585936b53834b021f68CC13eEeFdEc2EfC8e724", "value": "0x30cdd67dd6400" @@ -85,7 +85,7 @@ "addr": "0xb436ba50D378D4BBC8660d312A13dF6af6E89dFB", "prev": "0x1780d77678137ac1b775", "new": "0x1780d76ce070bddcf775", - "reason": "unspecified" + "reason": "balance decrease due to purchase of gas for execution of a transaction" }, { "addr": "0x000000000000000000000000000000000000dEaD", @@ -97,19 +97,19 @@ "addr": "0x3b873A919aA0512D5A0F09E6dCCEaA4a6727faFE", "prev": "0x4d87094125a369d9bd5", "new": "0x0", - "reason": "unspecified" + "reason": "balance decrease due to selfDestruct" }, { "addr": "0xb436ba50D378D4BBC8660d312A13dF6af6E89dFB", "prev": "0x1780d76ce070bddcf775", "new": "0x1780d7736b3612e45375", - "reason": "unspecified" + "reason": "balance increase due to refund for unused gas at the end of execution" }, { "addr": "0x1585936b53834b021f68CC13eEeFdEc2EfC8e724", "prev": "0x0", "new": "0x30cdd67dd6400", - "reason": "unspecified" + "reason": "balance increase due to payment of transaction tip" } ], "calls": [ diff --git a/eth/tracers/internal/tracetest/testdata/call_tracer/simple.json b/eth/tracers/internal/tracetest/testdata/call_tracer/simple.json index f834c10b0a..f80846d48b 100644 --- a/eth/tracers/internal/tracetest/testdata/call_tracer/simple.json +++ b/eth/tracers/internal/tracetest/testdata/call_tracer/simple.json @@ -59,7 +59,7 @@ "result": { "beforeEVMTransfers": [ { - "purpose": "feePayment", + "purpose": "purchase of gas for execution of a transaction", "from": "0xb436ba50D378D4BBC8660d312A13dF6af6E89dFB", "to": null, "value": "0x997a2bce4c000" @@ -67,13 +67,13 @@ ], "afterEVMTransfers": [ { - "purpose": "gasRefund", + "purpose": "refund for unused gas at the end of execution", "from": null, "to": "0xb436ba50D378D4BBC8660d312A13dF6af6E89dFB", "value": "0x576b3eb275400" }, { - "purpose": "tip", + "purpose": "payment of transaction tip", "from": null, "to": "0x1585936b53834b021f68CC13eEeFdEc2EfC8e724", "value": "0x420eed1bd6c00" @@ -84,31 +84,31 @@ "addr": "0xb436ba50D378D4BBC8660d312A13dF6af6E89dFB", "prev": "0x1780d77678137ac1b775", "new": "0x1780d76ce070bddcf775", - "reason": "unspecified" + "reason": "balance decrease due to purchase of gas for execution of a transaction" }, { "addr": "0x3b873A919aA0512D5A0F09E6dCCEaA4a6727faFE", "prev": "0x4d87094125a369d9bd5", "new": "0x4d869a3b70062eb9bd5", - "reason": "balance decrease due to a transfer via a call" + "reason": "balance decrease due to transfer via a call" }, { "addr": "0x0024F658a46FBB89d8Ac105e98D7ac7cbBaF27C5", "prev": "0x0", "new": "0x6f05b59d3b20000", - "reason": "balance increase due to a transfer via a call" + "reason": "balance increase due to transfer via a call" }, { "addr": "0xb436ba50D378D4BBC8660d312A13dF6af6E89dFB", "prev": "0x1780d76ce070bddcf775", "new": "0x1780d7725724a9044b75", - "reason": "unspecified" + "reason": "balance increase due to refund for unused gas at the end of execution" }, { "addr": "0x1585936b53834b021f68CC13eEeFdEc2EfC8e724", "prev": "0x0", "new": "0x420eed1bd6c00", - "reason": "unspecified" + "reason": "balance increase due to payment of transaction tip" } ], "calls": [ diff --git a/eth/tracers/internal/tracetest/testdata/call_tracer/simple_onlytop.json b/eth/tracers/internal/tracetest/testdata/call_tracer/simple_onlytop.json index 1ed4a6839c..fac9ad11bb 100644 --- a/eth/tracers/internal/tracetest/testdata/call_tracer/simple_onlytop.json +++ b/eth/tracers/internal/tracetest/testdata/call_tracer/simple_onlytop.json @@ -62,7 +62,7 @@ "result": { "beforeEVMTransfers": [ { - "purpose": "feePayment", + "purpose": "purchase of gas for execution of a transaction", "from": "0xb436ba50D378D4BBC8660d312A13dF6af6E89dFB", "to": null, "value": "0x997a2bce4c000" @@ -70,13 +70,13 @@ ], "afterEVMTransfers": [ { - "purpose": "gasRefund", + "purpose": "refund for unused gas at the end of execution", "from": null, "to": "0xb436ba50D378D4BBC8660d312A13dF6af6E89dFB", "value": "0x576b3eb275400" }, { - "purpose": "tip", + "purpose": "payment of transaction tip", "from": null, "to": "0x1585936b53834b021f68CC13eEeFdEc2EfC8e724", "value": "0x420eed1bd6c00" @@ -87,31 +87,31 @@ "addr": "0xb436ba50D378D4BBC8660d312A13dF6af6E89dFB", "prev": "0x1780d77678137ac1b775", "new": "0x1780d76ce070bddcf775", - "reason": "unspecified" + "reason": "balance decrease due to purchase of gas for execution of a transaction" }, { "addr": "0x3b873A919aA0512D5A0F09E6dCCEaA4a6727faFE", "prev": "0x4d87094125a369d9bd5", "new": "0x4d869a3b70062eb9bd5", - "reason": "balance decrease due to a transfer via a call" + "reason": "balance decrease due to transfer via a call" }, { "addr": "0x0024F658a46FBB89d8Ac105e98D7ac7cbBaF27C5", "prev": "0x0", "new": "0x6f05b59d3b20000", - "reason": "balance increase due to a transfer via a call" + "reason": "balance increase due to transfer via a call" }, { "addr": "0xb436ba50D378D4BBC8660d312A13dF6af6E89dFB", "prev": "0x1780d76ce070bddcf775", "new": "0x1780d7725724a9044b75", - "reason": "unspecified" + "reason": "balance increase due to refund for unused gas at the end of execution" }, { "addr": "0x1585936b53834b021f68CC13eEeFdEc2EfC8e724", "prev": "0x0", "new": "0x420eed1bd6c00", - "reason": "unspecified" + "reason": "balance increase due to payment of transaction tip" } ], "from": "0xb436ba50d378d4bbc8660d312a13df6af6e89dfb", diff --git a/eth/tracers/internal/tracetest/testdata/call_tracer/throw.json b/eth/tracers/internal/tracetest/testdata/call_tracer/throw.json index f111654b91..72e0e194f5 100644 --- a/eth/tracers/internal/tracetest/testdata/call_tracer/throw.json +++ b/eth/tracers/internal/tracetest/testdata/call_tracer/throw.json @@ -52,7 +52,7 @@ "result": { "beforeEVMTransfers": [ { - "purpose": "feePayment", + "purpose": "purchase of gas for execution of a transaction", "from": "0x70C9217D814985faEF62B124420F8dFbdDD96433", "to": null, "value": "0x11c37937e08000" @@ -60,13 +60,13 @@ ], "afterEVMTransfers": [ { - "purpose": "gasRefund", + "purpose": "refund for unused gas at the end of execution", "from": null, "to": "0x70C9217D814985faEF62B124420F8dFbdDD96433", "value": "0x0" }, { - "purpose": "tip", + "purpose": "payment of transaction tip", "from": null, "to": "0x294e5d6c39A36Ce38aF1DCA70c1060f78Dee8070", "value": "0x11c37937e08000" @@ -77,13 +77,13 @@ "addr": "0x70C9217D814985faEF62B124420F8dFbdDD96433", "prev": "0x4ecd70668f5d854a", "new": "0x4ebbaced577d054a", - "reason": "unspecified" + "reason": "balance decrease due to purchase of gas for execution of a transaction" }, { "addr": "0x294e5d6c39A36Ce38aF1DCA70c1060f78Dee8070", "prev": "0x0", "new": "0x11c37937e08000", - "reason": "unspecified" + "reason": "balance increase due to payment of transaction tip" } ], "error": "invalid jump destination", diff --git a/eth/tracers/internal/tracetest/testdata/call_tracer_withLog/calldata.json b/eth/tracers/internal/tracetest/testdata/call_tracer_withLog/calldata.json index bddcb379d7..6dbf02e26c 100644 --- a/eth/tracers/internal/tracetest/testdata/call_tracer_withLog/calldata.json +++ b/eth/tracers/internal/tracetest/testdata/call_tracer_withLog/calldata.json @@ -78,7 +78,7 @@ "result": { "beforeEVMTransfers": [ { - "purpose": "feePayment", + "purpose": "purchase of gas for execution of a transaction", "from": "0x4F5777744b500616697CB655DCb02ee6CD51DeB5", "to": null, "value": "0x21c166071e51e6" @@ -86,13 +86,13 @@ ], "afterEVMTransfers": [ { - "purpose": "gasRefund", + "purpose": "refund for unused gas at the end of execution", "from": null, "to": "0x4F5777744b500616697CB655DCb02ee6CD51DeB5", "value": "0x1026111b8570c0" }, { - "purpose": "tip", + "purpose": "payment of transaction tip", "from": null, "to": "0xf8b483DbA2c3B7176a3Da549ad41A48BB3121069", "value": "0x119b54eb98e126" @@ -103,31 +103,31 @@ "addr": "0x4F5777744b500616697CB655DCb02ee6CD51DeB5", "prev": "0xb0983f1b83eec290", "new": "0xb0767db57cd070aa", - "reason": "unspecified" + "reason": "balance decrease due to purchase of gas for execution of a transaction" }, { "addr": "0x4F5777744b500616697CB655DCb02ee6CD51DeB5", "prev": "0xb0767db57cd070aa", "new": "0x25af5ab0f2e870aa", - "reason": "balance decrease due to a transfer via a call" + "reason": "balance decrease due to transfer via a call" }, { "addr": "0x200Edd17F30485A8735878661960Cd7a9A95733F", "prev": "0x0", "new": "0x8ac7230489e80000", - "reason": "balance increase due to a transfer via a call" + "reason": "balance increase due to transfer via a call" }, { "addr": "0x4F5777744b500616697CB655DCb02ee6CD51DeB5", "prev": "0x25af5ab0f2e870aa", "new": "0x25bf80c20e6de16a", - "reason": "unspecified" + "reason": "balance increase due to refund for unused gas at the end of execution" }, { "addr": "0xf8b483DbA2c3B7176a3Da549ad41A48BB3121069", "prev": "0x16969a0ba2c2d384d07", "new": "0x16969b2558118d12e2d", - "reason": "unspecified" + "reason": "balance increase due to payment of transaction tip" } ], "from": "0x4f5777744b500616697cb655dcb02ee6cd51deb5", diff --git a/eth/tracers/internal/tracetest/testdata/call_tracer_withLog/delegatecall.json b/eth/tracers/internal/tracetest/testdata/call_tracer_withLog/delegatecall.json index 6cc597a4bc..abf3e30915 100644 --- a/eth/tracers/internal/tracetest/testdata/call_tracer_withLog/delegatecall.json +++ b/eth/tracers/internal/tracetest/testdata/call_tracer_withLog/delegatecall.json @@ -135,7 +135,7 @@ "result": { "beforeEVMTransfers": [ { - "purpose": "feePayment", + "purpose": "purchase of gas for execution of a transaction", "from": "0x3dE712784baf97260455aE25fb74f574EC9c1add", "to": null, "value": "0x267b804776c000" @@ -143,13 +143,13 @@ ], "afterEVMTransfers": [ { - "purpose": "gasRefund", + "purpose": "refund for unused gas at the end of execution", "from": null, "to": "0x3dE712784baf97260455aE25fb74f574EC9c1add", "value": "0x1add08f8e96800" }, { - "purpose": "tip", + "purpose": "payment of transaction tip", "from": null, "to": "0x61C808D82A3Ac53231750daDc13c777b59310bD9", "value": "0xb9e774e8d5800" @@ -160,19 +160,19 @@ "addr": "0x3dE712784baf97260455aE25fb74f574EC9c1add", "prev": "0x23c8352f33854625", "new": "0x23a1b9aeec0e8625", - "reason": "unspecified" + "reason": "balance decrease due to purchase of gas for execution of a transaction" }, { "addr": "0x3dE712784baf97260455aE25fb74f574EC9c1add", "prev": "0x23a1b9aeec0e8625", "new": "0x23bc96b7e4f7ee25", - "reason": "unspecified" + "reason": "balance increase due to refund for unused gas at the end of execution" }, { "addr": "0x61C808D82A3Ac53231750daDc13c777b59310bD9", "prev": "0x90a7af5d4755984561", "new": "0x90a7bafbbea4259d61", - "reason": "unspecified" + "reason": "balance increase due to payment of transaction tip" } ], "from": "0x3de712784baf97260455ae25fb74f574ec9c1add", diff --git a/eth/tracers/internal/tracetest/testdata/call_tracer_withLog/frontier_create_outofstorage.json b/eth/tracers/internal/tracetest/testdata/call_tracer_withLog/frontier_create_outofstorage.json index b97ea4acb6..bd7e0b04c2 100644 --- a/eth/tracers/internal/tracetest/testdata/call_tracer_withLog/frontier_create_outofstorage.json +++ b/eth/tracers/internal/tracetest/testdata/call_tracer_withLog/frontier_create_outofstorage.json @@ -79,7 +79,7 @@ "result": { "beforeEVMTransfers": [ { - "purpose": "feePayment", + "purpose": "purchase of gas for execution of a transaction", "from": "0x0047A8033CC6d6Ca2ED5044674Fd421F44884dE8", "to": null, "value": "0x13fbe85edc90000" @@ -87,13 +87,13 @@ ], "afterEVMTransfers": [ { - "purpose": "gasRefund", + "purpose": "refund for unused gas at the end of execution", "from": null, "to": "0x0047A8033CC6d6Ca2ED5044674Fd421F44884dE8", "value": "0xd52ed21cc43400" }, { - "purpose": "tip", + "purpose": "payment of transaction tip", "from": null, "to": "0xe48430c4E88A929bBa0eE3DCe284866a9937b609", "value": "0x6a8fb3d104cc00" @@ -104,19 +104,19 @@ "addr": "0x0047A8033CC6d6Ca2ED5044674Fd421F44884dE8", "prev": "0x44f5ced08fe37cf7", "new": "0x43b6104aa21a7cf7", - "reason": "unspecified" + "reason": "balance decrease due to purchase of gas for execution of a transaction" }, { "addr": "0x0047A8033CC6d6Ca2ED5044674Fd421F44884dE8", "prev": "0x43b6104aa21a7cf7", "new": "0x448b3f1cbedeb0f7", - "reason": "unspecified" + "reason": "balance increase due to refund for unused gas at the end of execution" }, { "addr": "0xe48430c4E88A929bBa0eE3DCe284866a9937b609", "prev": "0x26758774d51d8677a", "new": "0x267c3070122dd337a", - "reason": "unspecified" + "reason": "balance increase due to payment of transaction tip" } ], "from": "0x0047a8033cc6d6ca2ed5044674fd421f44884de8", diff --git a/eth/tracers/internal/tracetest/testdata/call_tracer_withLog/multi_contracts.json b/eth/tracers/internal/tracetest/testdata/call_tracer_withLog/multi_contracts.json index a5a42a26e7..f4cfc0cb03 100644 --- a/eth/tracers/internal/tracetest/testdata/call_tracer_withLog/multi_contracts.json +++ b/eth/tracers/internal/tracetest/testdata/call_tracer_withLog/multi_contracts.json @@ -300,7 +300,7 @@ "result": { "beforeEVMTransfers": [ { - "purpose": "feePayment", + "purpose": "purchase of gas for execution of a transaction", "from": "0xBe3aE5Cb97c253DdA67181C6E34E43F5C275E08b", "to": null, "value": "0x136dcc951d8c000" @@ -308,13 +308,13 @@ ], "afterEVMTransfers": [ { - "purpose": "gasRefund", + "purpose": "refund for unused gas at the end of execution", "from": null, "to": "0xBe3aE5Cb97c253DdA67181C6E34E43F5C275E08b", "value": "0x5489446b9e1a00" }, { - "purpose": "tip", + "purpose": "payment of transaction tip", "from": null, "to": "0xEA674fdDe714fd979de3EdF0F56AA9716B898ec8", "value": "0xe25384e63aa600" @@ -325,55 +325,55 @@ "addr": "0xBe3aE5Cb97c253DdA67181C6E34E43F5C275E08b", "prev": "0x167d285b38143c04f", "new": "0x1669ba8ea2f6b004f", - "reason": "unspecified" + "reason": "balance decrease due to purchase of gas for execution of a transaction" }, { "addr": "0x6e715Ab4F598eACF0016b9b35Ef33e4141844CcC", "prev": "0x4563918244f400000", "new": "0x0", - "reason": "balance decrease due to a transfer via a call" + "reason": "balance decrease due to transfer via a call" }, { "addr": "0xAD3Ecf23c0c8983B07163708be6d763b5F056193", "prev": "0x0", "new": "0x4563918244f400000", - "reason": "balance increase due to a transfer via a call" + "reason": "balance increase due to transfer via a call" }, { "addr": "0xAD3Ecf23c0c8983B07163708be6d763b5F056193", "prev": "0x4563918244f400000", "new": "0x22b1c8c1227a00001", - "reason": "balance decrease due to a transfer via a call" + "reason": "balance decrease due to transfer via a call" }, { "addr": "0x6e715Ab4F598eACF0016b9b35Ef33e4141844CcC", "prev": "0x0", "new": "0x22b1c8c12279fffff", - "reason": "balance increase due to a transfer via a call" + "reason": "balance increase due to transfer via a call" }, { "addr": "0xAD3Ecf23c0c8983B07163708be6d763b5F056193", "prev": "0x22b1c8c1227a00001", "new": "0x2", - "reason": "balance decrease due to a transfer via a call" + "reason": "balance decrease due to transfer via a call" }, { "addr": "0x6e715Ab4F598eACF0016b9b35Ef33e4141844CcC", "prev": "0x22b1c8c12279fffff", "new": "0x4563918244f3ffffe", - "reason": "balance increase due to a transfer via a call" + "reason": "balance increase due to transfer via a call" }, { "addr": "0xBe3aE5Cb97c253DdA67181C6E34E43F5C275E08b", "prev": "0x1669ba8ea2f6b004f", "new": "0x166f0322e9b091a4f", - "reason": "unspecified" + "reason": "balance increase due to refund for unused gas at the end of execution" }, { "addr": "0xEA674fdDe714fd979de3EdF0F56AA9716B898ec8", "prev": "0x4ab3566739e7b24371", "new": "0x4ab438babecdece971", - "reason": "unspecified" + "reason": "balance increase due to payment of transaction tip" } ], "from": "0xbe3ae5cb97c253dda67181c6e34e43f5c275e08b", diff --git a/eth/tracers/internal/tracetest/testdata/call_tracer_withLog/multilogs.json b/eth/tracers/internal/tracetest/testdata/call_tracer_withLog/multilogs.json index 44a502617a..6d12f47fcb 100644 --- a/eth/tracers/internal/tracetest/testdata/call_tracer_withLog/multilogs.json +++ b/eth/tracers/internal/tracetest/testdata/call_tracer_withLog/multilogs.json @@ -168,7 +168,7 @@ "result": { "beforeEVMTransfers": [ { - "purpose": "feePayment", + "purpose": "purchase of gas for execution of a transaction", "from": "0x3FcB0342353c541E210013AadDc2E740b9A33D08", "to": null, "value": "0x214e8348c4f0000" @@ -176,13 +176,13 @@ ], "afterEVMTransfers": [ { - "purpose": "gasRefund", + "purpose": "refund for unused gas at the end of execution", "from": null, "to": "0x3FcB0342353c541E210013AadDc2E740b9A33D08", "value": "0x610b133d337400" }, { - "purpose": "tip", + "purpose": "payment of transaction tip", "from": null, "to": "0x2a65Aca4D5fC5B5C859090a6c34d164135398226", "value": "0x1b3dd214f1b8c00" @@ -193,31 +193,31 @@ "addr": "0x3FcB0342353c541E210013AadDc2E740b9A33D08", "prev": "0x6a0e4be198f18400", "new": "0x67f963ad0ca28400", - "reason": "unspecified" + "reason": "balance decrease due to purchase of gas for execution of a transaction" }, { "addr": "0x3FcB0342353c541E210013AadDc2E740b9A33D08", "prev": "0x67f963ad0ca28400", "new": "0x6481360022c98400", - "reason": "balance decrease due to a transfer via a call" + "reason": "balance decrease due to transfer via a call" }, { "addr": "0x350e0fFC780a6a75B44Cc52E1fF9092870668945", "prev": "0xe37111b7c79406c0", "new": "0xe6e93f64b16d06c0", - "reason": "balance increase due to a transfer via a call" + "reason": "balance increase due to transfer via a call" }, { "addr": "0x3FcB0342353c541E210013AadDc2E740b9A33D08", "prev": "0x6481360022c98400", "new": "0x64e241135ffcf800", - "reason": "unspecified" + "reason": "balance increase due to refund for unused gas at the end of execution" }, { "addr": "0x2a65Aca4D5fC5B5C859090a6c34d164135398226", "prev": "0x44dc051cccdfd2e132", "new": "0x44ddb8f9ee2eee6d32", - "reason": "unspecified" + "reason": "balance increase due to payment of transaction tip" } ], "from": "0x3fcb0342353c541e210013aaddc2e740b9a33d08", diff --git a/eth/tracers/internal/tracetest/testdata/call_tracer_withLog/notopic.json b/eth/tracers/internal/tracetest/testdata/call_tracer_withLog/notopic.json index 94e1148a8c..ae4d73ba00 100644 --- a/eth/tracers/internal/tracetest/testdata/call_tracer_withLog/notopic.json +++ b/eth/tracers/internal/tracetest/testdata/call_tracer_withLog/notopic.json @@ -103,7 +103,7 @@ "result": { "beforeEVMTransfers": [ { - "purpose": "feePayment", + "purpose": "purchase of gas for execution of a transaction", "from": "0x6412Becf35cc7e2A9E7e47966E443F295e1E4F4a", "to": null, "value": "0xeebe0b40e8000" @@ -111,13 +111,13 @@ ], "afterEVMTransfers": [ { - "purpose": "gasRefund", + "purpose": "refund for unused gas at the end of execution", "from": null, "to": "0x6412Becf35cc7e2A9E7e47966E443F295e1E4F4a", "value": "0x3bb109f807a00" }, { - "purpose": "tip", + "purpose": "payment of transaction tip", "from": null, "to": "0x61C808D82A3Ac53231750daDc13c777b59310bD9", "value": "0xb30d0148e0600" @@ -128,43 +128,43 @@ "addr": "0x6412Becf35cc7e2A9E7e47966E443F295e1E4F4a", "prev": "0xfb5dbfc0d448e70", "new": "0xfa6f01b59360e70", - "reason": "unspecified" + "reason": "balance decrease due to purchase of gas for execution of a transaction" }, { "addr": "0x6412Becf35cc7e2A9E7e47966E443F295e1E4F4a", "prev": "0xfa6f01b59360e70", "new": "0xb7d1fb240980e70", - "reason": "balance decrease due to a transfer via a call" + "reason": "balance decrease due to transfer via a call" }, { "addr": "0x50739060a2C32dc076E507aE1A893aAB28eCFe68", "prev": "0x6a8ecefb09f7c4141", "new": "0x6ad16c019b81a4141", - "reason": "balance increase due to a transfer via a call" + "reason": "balance increase due to transfer via a call" }, { "addr": "0x50739060a2C32dc076E507aE1A893aAB28eCFe68", "prev": "0x6ad16c019b81a4141", "new": "0x6acff22b6b6ddeaed", - "reason": "balance decrease due to a transfer via a call" + "reason": "balance decrease due to transfer via a call" }, { "addr": "0x88e1315687AeC48a72786c6B3b3F075208B62713", "prev": "0x24b9f2c5dc266dc6", "new": "0x24d19028dd62c41a", - "reason": "balance increase due to a transfer via a call" + "reason": "balance increase due to transfer via a call" }, { "addr": "0x6412Becf35cc7e2A9E7e47966E443F295e1E4F4a", "prev": "0xb7d1fb240980e70", "new": "0xb80dac2e0188870", - "reason": "unspecified" + "reason": "balance increase due to refund for unused gas at the end of execution" }, { "addr": "0x61C808D82A3Ac53231750daDc13c777b59310bD9", "prev": "0x12f621ea72fef44f848", "new": "0x12f6229d80003d2fe48", - "reason": "unspecified" + "reason": "balance increase due to payment of transaction tip" } ], "from": "0x6412becf35cc7e2a9e7e47966e443f295e1e4f4a", diff --git a/eth/tracers/internal/tracetest/testdata/call_tracer_withLog/simple.json b/eth/tracers/internal/tracetest/testdata/call_tracer_withLog/simple.json index 4dc0c107cc..32bc2c0659 100644 --- a/eth/tracers/internal/tracetest/testdata/call_tracer_withLog/simple.json +++ b/eth/tracers/internal/tracetest/testdata/call_tracer_withLog/simple.json @@ -64,7 +64,7 @@ "result": { "beforeEVMTransfers": [ { - "purpose": "feePayment", + "purpose": "purchase of gas for execution of a transaction", "from": "0xD1220A0cf47c7B9Be7A2E6BA89F429762e7b9aDb", "to": null, "value": "0x1acc000dea4400" @@ -72,13 +72,13 @@ ], "afterEVMTransfers": [ { - "purpose": "gasRefund", + "purpose": "refund for unused gas at the end of execution", "from": null, "to": "0xD1220A0cf47c7B9Be7A2E6BA89F429762e7b9aDb", "value": "0x11c37937e08000" }, { - "purpose": "tip", + "purpose": "payment of transaction tip", "from": null, "to": "0xe2fE6B13287f28E193333fDfe7Fedf2f6Df6124A", "value": "0x90886d609c400" @@ -89,19 +89,19 @@ "addr": "0xD1220A0cf47c7B9Be7A2E6BA89F429762e7b9aDb", "prev": "0x14203bee2ea6fbe8c", "new": "0x141e8f2e2dc857a8c", - "reason": "unspecified" + "reason": "balance decrease due to purchase of gas for execution of a transaction" }, { "addr": "0xD1220A0cf47c7B9Be7A2E6BA89F429762e7b9aDb", "prev": "0x141e8f2e2dc857a8c", "new": "0x141fab65c1465fa8c", - "reason": "unspecified" + "reason": "balance increase due to refund for unused gas at the end of execution" }, { "addr": "0xe2fE6B13287f28E193333fDfe7Fedf2f6Df6124A", "prev": "0x2717a9c870a286f4350", "new": "0x2717aa58f90fe790750", - "reason": "unspecified" + "reason": "balance increase due to payment of transaction tip" } ], "from": "0xd1220a0cf47c7b9be7a2e6ba89f429762e7b9adb", diff --git a/eth/tracers/internal/tracetest/testdata/call_tracer_withLog/tx_failed.json b/eth/tracers/internal/tracetest/testdata/call_tracer_withLog/tx_failed.json index fd60e54554..603289ac50 100644 --- a/eth/tracers/internal/tracetest/testdata/call_tracer_withLog/tx_failed.json +++ b/eth/tracers/internal/tracetest/testdata/call_tracer_withLog/tx_failed.json @@ -138,7 +138,7 @@ "result": { "beforeEVMTransfers": [ { - "purpose": "feePayment", + "purpose": "purchase of gas for execution of a transaction", "from": "0xe6002189a74B43e6868b20C1311Bc108E38AaC57", "to": null, "value": "0x81fc72632f7340" @@ -146,13 +146,13 @@ ], "afterEVMTransfers": [ { - "purpose": "gasRefund", + "purpose": "refund for unused gas at the end of execution", "from": null, "to": "0xe6002189a74B43e6868b20C1311Bc108E38AaC57", "value": "0x0" }, { - "purpose": "tip", + "purpose": "payment of transaction tip", "from": null, "to": "0xEA674fdDe714fd979de3EdF0F56AA9716B898ec8", "value": "0x81fc72632f7340" @@ -163,25 +163,25 @@ "addr": "0xe6002189a74B43e6868b20C1311Bc108E38AaC57", "prev": "0x29129264d1ae4848b", "new": "0x290a729dab7b5114b", - "reason": "unspecified" + "reason": "balance decrease due to purchase of gas for execution of a transaction" }, { "addr": "0xBB9bc244D798123fDe783fCc1C72d3Bb8C189413", "prev": "0x53d2c8df046dd3db5", "new": "0x51cfa87ca63cad105", - "reason": "balance decrease due to a transfer via a call" + "reason": "balance decrease due to transfer via a call" }, { "addr": "0x10abb5EfEcdC09581f8b7cb95791FE2936790b4E", "prev": "0x81f158e2814b4ab624c", "new": "0x81f35c02e3a97bdcefc", - "reason": "balance increase due to a transfer via a call" + "reason": "balance increase due to transfer via a call" }, { "addr": "0xEA674fdDe714fd979de3EdF0F56AA9716B898ec8", "prev": "0x1601bbe4c58ec73210", "new": "0x16023de137f1f6a550", - "reason": "unspecified" + "reason": "balance increase due to payment of transaction tip" } ], "from": "0xe6002189a74b43e6868b20c1311bc108e38aac57", diff --git a/eth/tracers/internal/tracetest/testdata/call_tracer_withLog/tx_partial_failed.json b/eth/tracers/internal/tracetest/testdata/call_tracer_withLog/tx_partial_failed.json index 208c21de94..96da1ed473 100644 --- a/eth/tracers/internal/tracetest/testdata/call_tracer_withLog/tx_partial_failed.json +++ b/eth/tracers/internal/tracetest/testdata/call_tracer_withLog/tx_partial_failed.json @@ -76,7 +76,7 @@ "result": { "beforeEVMTransfers": [ { - "purpose": "feePayment", + "purpose": "purchase of gas for execution of a transaction", "from": "0x01115b41bD2731353dd3e6Abf44818FDc035aAf1", "to": null, "value": "0xe35fa931a0000" @@ -84,13 +84,13 @@ ], "afterEVMTransfers": [ { - "purpose": "gasRefund", + "purpose": "refund for unused gas at the end of execution", "from": null, "to": "0x01115b41bD2731353dd3e6Abf44818FDc035aAf1", "value": "0x268d6662df800" }, { - "purpose": "tip", + "purpose": "payment of transaction tip", "from": null, "to": "0x61C808D82A3Ac53231750daDc13c777b59310bD9", "value": "0xbcd242cec0800" @@ -101,19 +101,19 @@ "addr": "0x01115b41bD2731353dd3e6Abf44818FDc035aAf1", "prev": "0x16d99e16e809000", "new": "0x15f63e6db669000", - "reason": "unspecified" + "reason": "balance decrease due to purchase of gas for execution of a transaction" }, { "addr": "0x01115b41bD2731353dd3e6Abf44818FDc035aAf1", "prev": "0x15f63e6db669000", "new": "0x161ccbd41948800", - "reason": "unspecified" + "reason": "balance increase due to refund for unused gas at the end of execution" }, { "addr": "0x61C808D82A3Ac53231750daDc13c777b59310bD9", "prev": "0x6a636960e34bd696f4", "new": "0x6a63752e0778c29ef4", - "reason": "unspecified" + "reason": "balance increase due to payment of transaction tip" } ], "from": "0x01115b41bd2731353dd3e6abf44818fdc035aaf1", diff --git a/eth/tracers/internal/tracetest/testdata/call_tracer_withLog/with_onlyTopCall.json b/eth/tracers/internal/tracetest/testdata/call_tracer_withLog/with_onlyTopCall.json index 97b9db76ea..4d1e17d27b 100644 --- a/eth/tracers/internal/tracetest/testdata/call_tracer_withLog/with_onlyTopCall.json +++ b/eth/tracers/internal/tracetest/testdata/call_tracer_withLog/with_onlyTopCall.json @@ -79,7 +79,7 @@ "result": { "beforeEVMTransfers": [ { - "purpose": "feePayment", + "purpose": "purchase of gas for execution of a transaction", "from": "0x4F5777744b500616697CB655DCb02ee6CD51DeB5", "to": null, "value": "0x21c166071e51e6" @@ -87,13 +87,13 @@ ], "afterEVMTransfers": [ { - "purpose": "gasRefund", + "purpose": "refund for unused gas at the end of execution", "from": null, "to": "0x4F5777744b500616697CB655DCb02ee6CD51DeB5", "value": "0x1026111b8570c0" }, { - "purpose": "tip", + "purpose": "payment of transaction tip", "from": null, "to": "0xf8b483DbA2c3B7176a3Da549ad41A48BB3121069", "value": "0x119b54eb98e126" @@ -104,31 +104,31 @@ "addr": "0x4F5777744b500616697CB655DCb02ee6CD51DeB5", "prev": "0xb0983f1b83eec290", "new": "0xb0767db57cd070aa", - "reason": "unspecified" + "reason": "balance decrease due to purchase of gas for execution of a transaction" }, { "addr": "0x4F5777744b500616697CB655DCb02ee6CD51DeB5", "prev": "0xb0767db57cd070aa", "new": "0x25af5ab0f2e870aa", - "reason": "balance decrease due to a transfer via a call" + "reason": "balance decrease due to transfer via a call" }, { "addr": "0x200Edd17F30485A8735878661960Cd7a9A95733F", "prev": "0x0", "new": "0x8ac7230489e80000", - "reason": "balance increase due to a transfer via a call" + "reason": "balance increase due to transfer via a call" }, { "addr": "0x4F5777744b500616697CB655DCb02ee6CD51DeB5", "prev": "0x25af5ab0f2e870aa", "new": "0x25bf80c20e6de16a", - "reason": "unspecified" + "reason": "balance increase due to refund for unused gas at the end of execution" }, { "addr": "0xf8b483DbA2c3B7176a3Da549ad41A48BB3121069", "prev": "0x16969a0ba2c2d384d07", "new": "0x16969b2558118d12e2d", - "reason": "unspecified" + "reason": "balance increase due to payment of transaction tip" } ], "from": "0x4f5777744b500616697cb655dcb02ee6cd51deb5", diff --git a/eth/tracers/js/tracer_arbitrum.go b/eth/tracers/js/tracer_arbitrum.go index 49fcaeeb40..5bf0fd4bb6 100644 --- a/eth/tracers/js/tracer_arbitrum.go +++ b/eth/tracers/js/tracer_arbitrum.go @@ -25,7 +25,7 @@ import ( ) func (jst *jsTracer) CaptureArbitrumTransfer( - from, to *common.Address, value *big.Int, before bool, purpose string, + from, to *common.Address, value *big.Int, before bool, reason tracing.BalanceChangeReason, ) { traceTransfer, ok := goja.AssertFunction(jst.obj.Get("captureArbitrumTransfer")) if !ok { @@ -46,7 +46,7 @@ func (jst *jsTracer) CaptureArbitrumTransfer( transfer.Set("value", value) transfer.Set("before", before) - transfer.Set("purpose", purpose) + transfer.Set("purpose", reason.String(nil, nil)) if _, err := traceTransfer(transfer); err != nil { jst.err = wrapError("captureArbitrumTransfer", err) diff --git a/eth/tracers/native/mux.go b/eth/tracers/native/mux.go index 2a3a7dcdd0..4a66d05be7 100644 --- a/eth/tracers/native/mux.go +++ b/eth/tracers/native/mux.go @@ -193,10 +193,10 @@ func (t *muxTracer) CaptureArbitrumStorageSet(key, value common.Hash, depth int, } } -func (t *muxTracer) CaptureArbitrumTransfer(from, to *common.Address, value *big.Int, before bool, purpose string) { +func (t *muxTracer) CaptureArbitrumTransfer(from, to *common.Address, value *big.Int, before bool, reason tracing.BalanceChangeReason) { for _, t := range t.tracers { if t.CaptureArbitrumTransfer != nil { - t.CaptureArbitrumTransfer(from, to, value, before, purpose) + t.CaptureArbitrumTransfer(from, to, value, before, reason) } } } diff --git a/eth/tracers/native/tracer_arbitrum.go b/eth/tracers/native/tracer_arbitrum.go index ee5c23fae7..3a44d51830 100644 --- a/eth/tracers/native/tracer_arbitrum.go +++ b/eth/tracers/native/tracer_arbitrum.go @@ -30,11 +30,9 @@ type arbitrumTransfer struct { Value string `json:"value"` } -func (t *callTracer) CaptureArbitrumTransfer( - from, to *common.Address, value *big.Int, before bool, purpose string, -) { +func (t *callTracer) CaptureArbitrumTransfer(from, to *common.Address, value *big.Int, before bool, reason tracing.BalanceChangeReason) { transfer := arbitrumTransfer{ - Purpose: purpose, + Purpose: reason.String(nil, nil), Value: bigToHex(value), } if from != nil { @@ -52,12 +50,12 @@ func (t *callTracer) CaptureArbitrumTransfer( } } -func (t *flatCallTracer) CaptureArbitrumTransfer(from, to *common.Address, value *big.Int, before bool, purpose string) { +func (t *flatCallTracer) CaptureArbitrumTransfer(from, to *common.Address, value *big.Int, before bool, reason tracing.BalanceChangeReason) { if t.interrupt.Load() { return } transfer := arbitrumTransfer{ - Purpose: purpose, + Purpose: reason.String(nil, nil), Value: bigToHex(value), } if from != nil { From 622b43bec4befb786a25a8ad8b5934a4e7b89eac Mon Sep 17 00:00:00 2001 From: Ganesh Vanahalli Date: Wed, 20 Nov 2024 16:34:11 +0530 Subject: [PATCH 3/4] address PR comments --- core/tracing/hooks.go | 47 ++++++++++++++++++++----------------------- 1 file changed, 22 insertions(+), 25 deletions(-) diff --git a/core/tracing/hooks.go b/core/tracing/hooks.go index fd39bfa723..763746f749 100644 --- a/core/tracing/hooks.go +++ b/core/tracing/hooks.go @@ -232,33 +232,30 @@ const ( // account within the same tx (captured at end of tx). // Note it doesn't account for a self-destruct which appoints itself as recipient. BalanceDecreaseSelfdestructBurn BalanceChangeReason = 14 +) - // Arbitrum specific - BalanceIncreaseDeposit BalanceChangeReason = 15 - BalanceDecreaseWithdrawToL1 BalanceChangeReason = 16 - BalanceIncreaseL1PosterFee BalanceChangeReason = 17 - BalanceIncreaseInfraFee BalanceChangeReason = 18 - BalanceIncreaseNetworkFee BalanceChangeReason = 19 - BalanceIncreaseRetryTxPrepaid BalanceChangeReason = 20 - BalanceDecreaseRetryTxUndoRefund BalanceChangeReason = 21 - - BalanceChangeTransferRetryTxToEscrow BalanceChangeReason = 22 - BalanceChangeTransferRetryTxFromEscrow BalanceChangeReason = 23 - - BalanceChangeTransferRetryableToFeeRefundAddr BalanceChangeReason = 24 - BalanceChangeTransferRetryableToEscrow BalanceChangeReason = 25 - - BalanceChangeTransferRetryableToInfra BalanceChangeReason = 26 - BalanceChangeTransferRetryableFromInfra BalanceChangeReason = 27 - BalanceChangeTransferRetryableToNetwork BalanceChangeReason = 28 - BalanceChangeTransferRetryableFromNetwork BalanceChangeReason = 29 - - BalanceChangeTransferBatchposterReward BalanceChangeReason = 30 - BalanceChangeTransferBatchposterRefund BalanceChangeReason = 31 - +// Arbitrum specific +const ( + BalanceIncreaseDeposit BalanceChangeReason = 128 + iota + BalanceDecreaseWithdrawToL1 + BalanceIncreaseL1PosterFee + BalanceIncreaseInfraFee + BalanceIncreaseNetworkFee + BalanceIncreaseRetryTxPrepaid + BalanceDecreaseRetryTxUndoRefund + BalanceChangeTransferRetryTxToEscrow + BalanceChangeTransferRetryTxFromEscrow + BalanceChangeTransferRetryableToFeeRefundAddr + BalanceChangeTransferRetryableToEscrow + BalanceChangeTransferRetryableToInfra + BalanceChangeTransferRetryableFromInfra + BalanceChangeTransferRetryableToNetwork + BalanceChangeTransferRetryableFromNetwork + BalanceChangeTransferBatchposterReward + BalanceChangeTransferBatchposterRefund // Stylus - BalanceChangeTransferActivationFee BalanceChangeReason = 32 - BalanceChangeTransferActivationReimburse BalanceChangeReason = 33 + BalanceChangeTransferActivationFee + BalanceChangeTransferActivationReimburse ) func (b BalanceChangeReason) String(prev, new *big.Int) string { From fb4097a4e8ab025fbd63a911923ebf49c0538643 Mon Sep 17 00:00:00 2001 From: Ganesh Vanahalli Date: Thu, 21 Nov 2024 12:41:02 +0530 Subject: [PATCH 4/4] address PR comments --- core/tracing/hooks.go | 101 ++++++------------ .../internal/tracetest/calltrace_test.go | 14 +-- .../testdata/call_tracer/blob_tx.json | 28 ++--- .../testdata/call_tracer/create.json | 22 +--- .../testdata/call_tracer/deep_calls.json | 30 +----- .../testdata/call_tracer/delegatecall.json | 28 +---- .../inner_create_oog_outer_throw.json | 24 +---- .../testdata/call_tracer/inner_instafail.json | 52 +++------ .../call_tracer/inner_revert_reason.json | 26 +---- .../call_tracer/inner_throw_outer_revert.json | 42 +------- .../tracetest/testdata/call_tracer/oog.json | 22 +--- .../testdata/call_tracer/revert.json | 30 +----- .../testdata/call_tracer/revert_reason.json | 30 +----- .../testdata/call_tracer/selfdestruct.json | 42 +------- .../testdata/call_tracer/simple.json | 40 +------ .../testdata/call_tracer/simple_onlytop.json | 42 +------- .../tracetest/testdata/call_tracer/throw.json | 24 +---- .../call_tracer_withLog/calldata.json | 40 +------ .../call_tracer_withLog/delegatecall.json | 28 +---- .../frontier_create_outofstorage.json | 42 ++------ .../call_tracer_withLog/multi_contracts.json | 64 +---------- .../call_tracer_withLog/multilogs.json | 96 ++++++----------- .../testdata/call_tracer_withLog/notopic.json | 52 +-------- .../testdata/call_tracer_withLog/simple.json | 28 +---- .../call_tracer_withLog/tx_failed.json | 34 +----- .../tx_partial_failed.json | 28 +---- .../call_tracer_withLog/with_onlyTopCall.json | 40 +------ eth/tracers/js/tracer_arbitrum.go | 4 +- eth/tracers/native/call.go | 7 -- eth/tracers/native/call_flat.go | 7 -- eth/tracers/native/gen_callframe_json.go | 6 -- eth/tracers/native/tracer_arbitrum.go | 32 +----- 32 files changed, 195 insertions(+), 910 deletions(-) diff --git a/core/tracing/hooks.go b/core/tracing/hooks.go index 763746f749..378eedbdce 100644 --- a/core/tracing/hooks.go +++ b/core/tracing/hooks.go @@ -236,21 +236,17 @@ const ( // Arbitrum specific const ( - BalanceIncreaseDeposit BalanceChangeReason = 128 + iota + BalanceChangeDuringEVMExecution BalanceChangeReason = 128 + iota + BalanceIncreaseDeposit BalanceDecreaseWithdrawToL1 BalanceIncreaseL1PosterFee BalanceIncreaseInfraFee BalanceIncreaseNetworkFee - BalanceIncreaseRetryTxPrepaid - BalanceDecreaseRetryTxUndoRefund - BalanceChangeTransferRetryTxToEscrow - BalanceChangeTransferRetryTxFromEscrow - BalanceChangeTransferRetryableToFeeRefundAddr - BalanceChangeTransferRetryableToEscrow - BalanceChangeTransferRetryableToInfra - BalanceChangeTransferRetryableFromInfra - BalanceChangeTransferRetryableToNetwork - BalanceChangeTransferRetryableFromNetwork + BalanceChangeTransferInfraRefund + BalanceChangeTransferNetworkRefund + BalanceIncreasePrepaid + BalanceDecreaseUndoRefund + BalanceChangeEscrowTransfer BalanceChangeTransferBatchposterReward BalanceChangeTransferBatchposterRefund // Stylus @@ -258,82 +254,47 @@ const ( BalanceChangeTransferActivationReimburse ) -func (b BalanceChangeReason) String(prev, new *big.Int) string { - // When both prev and new are nil, we only return the main reason without specifying if the balance incrased or decreased - // useful for CaptureArbitrumTransfer - var reason string - - if prev != nil && new != nil { - if new.Cmp(prev) == 1 { - reason = "balance increase due to " - } else if new.Cmp(prev) == -1 { - reason = "balance decrease due to " - } - } else if new != nil { - reason = "balance increase due to " - } else if prev != nil { - reason = "balance decrease due to " - } - - // Append main reason for the balance change +func (b BalanceChangeReason) String() string { switch b { case BalanceIncreaseRewardTransactionFee: - reason += "payment of transaction tip" + return "tip" case BalanceDecreaseGasBuy: - reason += "purchase of gas for execution of a transaction" + return "feePayment" case BalanceIncreaseGasReturn: - reason += "refund for unused gas at the end of execution" + return "gasRefund" case BalanceChangeTransfer: - reason += "transfer via a call" + return "transfer via a call" case BalanceDecreaseSelfdestruct: - reason += "selfDestruct" + return "selfDestruct" + case BalanceChangeDuringEVMExecution: + return "during evm execution" case BalanceIncreaseDeposit: - reason += "deposit" + return "deposit" case BalanceDecreaseWithdrawToL1: - reason += "withdrawal to L1" - case BalanceIncreaseL1PosterFee: - reason += "fee collection for L1 posting" - case BalanceIncreaseInfraFee: - reason += "fee collection by infrastructure fee account" - case BalanceIncreaseNetworkFee: - reason += "fee collection by network fee account" - // ArbitrumRetryTx - case BalanceIncreaseRetryTxPrepaid: - reason += "deposit of prepaid value in a tx of ArbitrumRetryTx type" - case BalanceDecreaseRetryTxUndoRefund: - reason += "undoing of Geth's refund for a tx of ArbitrumRetryTx type" - case BalanceChangeTransferRetryTxToEscrow: - reason += "transfer to escrow in a tx of ArbitrumRetryTx type" - case BalanceChangeTransferRetryTxFromEscrow: - reason += "transfer from escrow in a tx of ArbitrumRetryTx type" - // ArbitrumSubmitRetryableTx - case BalanceChangeTransferRetryableToFeeRefundAddr: - reason += "transfer to FeeRefundAddr in a tx of ArbitrumSubmitRetryableTx type" - case BalanceChangeTransferRetryableToEscrow: - reason += "transfer to escrow in a tx of ArbitrumSubmitRetryableTx type" - case BalanceChangeTransferRetryableToInfra: - reason += "transfer to infrastructure fee account in a tx of ArbitrumSubmitRetryableTx type" - case BalanceChangeTransferRetryableFromInfra: - reason += "transfer from infrastructure fee account in a tx of ArbitrumSubmitRetryableTx type" - case BalanceChangeTransferRetryableToNetwork: - reason += "transfer to network fee account in a tx of ArbitrumSubmitRetryableTx type" - case BalanceChangeTransferRetryableFromNetwork: - reason += "transfer from network fee account in a tx of ArbitrumSubmitRetryableTx type" + return "withdraw" + case BalanceIncreaseL1PosterFee, BalanceIncreaseInfraFee, BalanceIncreaseNetworkFee: + return "feeCollection" + case BalanceIncreasePrepaid: + return "prepaid" + case BalanceDecreaseUndoRefund: + return "undoRefund" + case BalanceChangeEscrowTransfer: + return "escrow" + case BalanceChangeTransferInfraRefund, BalanceChangeTransferNetworkRefund: + return "refund" // Batchposter case BalanceChangeTransferBatchposterReward: - reason += "transfer from L1PricerFundsPoolAddress as batchPosterReward" + return "batchPosterReward" case BalanceChangeTransferBatchposterRefund: - reason += "transfer from L1PricerFundsPoolAddress as batchPosterRefund" + return "batchPosterRefund" // Stylus case BalanceChangeTransferActivationFee: - reason += "transfer of activation fee to network fee account" + return "activate" case BalanceChangeTransferActivationReimburse: - reason += "transfer of reimburse amount after charging the activation fee" + return "reimburse" default: return "unspecified" } - - return reason } // GasChangeReason is used to indicate the reason for a gas change, useful diff --git a/eth/tracers/internal/tracetest/calltrace_test.go b/eth/tracers/internal/tracetest/calltrace_test.go index af40b347f3..a682cf06af 100644 --- a/eth/tracers/internal/tracetest/calltrace_test.go +++ b/eth/tracers/internal/tracetest/calltrace_test.go @@ -53,19 +53,11 @@ type arbitrumTransfer struct { Value string `json:"value"` } -type balanceChange struct { - Addr string `json:"addr"` - Prev string `json:"prev"` - New string `json:"new"` - Reason string `json:"reason"` -} - // callTrace is the result of a callTracer run. type callTrace struct { // Arbitrum: we add these here due to the tracer returning the top frame BeforeEVMTransfers *[]arbitrumTransfer `json:"beforeEVMTransfers,omitempty"` AfterEVMTransfers *[]arbitrumTransfer `json:"afterEVMTransfers,omitempty"` - BalanceChanges *[]balanceChange `json:"balanceChanges,omitempty"` From common.Address `json:"from"` Gas *hexutil.Uint64 `json:"gas"` @@ -309,13 +301,13 @@ func TestInternals(t *testing.T) { byte(vm.CALL), }, tracer: mkTracer("callTracer", nil), - want: fmt.Sprintf(`{"beforeEVMTransfers":[{"purpose":"purchase of gas for execution of a transaction","from":"%s","to":null,"value":"0x13880"}],"afterEVMTransfers":[{"purpose":"refund for unused gas at the end of execution","from":null,"to":"%s","value":"0xe3a8"},{"purpose":"payment of transaction tip","from":null,"to":"0x0000000000000000000000000000000000000000","value":"0x54d8"}],"balanceChanges":[{"addr":"%s","prev":"0x1c6bf52634000","new":"0x1c6bf52620780","reason":"balance decrease due to purchase of gas for execution of a transaction"},{"addr":"%s","prev":"0x1c6bf52620780","new":"0x1c6bf5262eb28","reason":"balance increase due to refund for unused gas at the end of execution"},{"addr":"0x0000000000000000000000000000000000000000","prev":"0x0","new":"0x54d8","reason":"balance increase due to payment of transaction tip"}],"from":"%s","gas":"0x13880","gasUsed":"0x54d8","to":"0x00000000000000000000000000000000deadbeef","input":"0x","calls":[{"from":"0x00000000000000000000000000000000deadbeef","gas":"0xe01a","gasUsed":"0x0","to":"0x00000000000000000000000000000000000000ff","input":"0x","value":"0x0","type":"CALL"}],"value":"0x0","type":"CALL"}`, origin.Hex(), origin.Hex(), origin.Hex(), origin.Hex(), originHex), + want: fmt.Sprintf(`{"beforeEVMTransfers":[{"purpose":"feePayment","from":"%s","to":null,"value":"0x13880"}],"afterEVMTransfers":[{"purpose":"gasRefund","from":null,"to":"%s","value":"0xe3a8"},{"purpose":"tip","from":null,"to":"0x0000000000000000000000000000000000000000","value":"0x54d8"}],"from":"%s","gas":"0x13880","gasUsed":"0x54d8","to":"0x00000000000000000000000000000000deadbeef","input":"0x","calls":[{"from":"0x00000000000000000000000000000000deadbeef","gas":"0xe01a","gasUsed":"0x0","to":"0x00000000000000000000000000000000000000ff","input":"0x","value":"0x0","type":"CALL"}],"value":"0x0","type":"CALL"}`, origin.Hex(), origin.Hex(), originHex), }, { name: "Stack depletion in LOG0", code: []byte{byte(vm.LOG3)}, tracer: mkTracer("callTracer", json.RawMessage(`{ "withLog": true }`)), - want: fmt.Sprintf(`{"beforeEVMTransfers":[{"purpose":"purchase of gas for execution of a transaction","from":"%s","to":null,"value":"0x13880"}],"afterEVMTransfers":[{"purpose":"refund for unused gas at the end of execution","from":null,"to":"%s","value":"0x0"},{"purpose":"payment of transaction tip","from":null,"to":"0x0000000000000000000000000000000000000000","value":"0x13880"}],"balanceChanges":[{"addr":"%s","prev":"0x1c6bf52634000","new":"0x1c6bf52620780","reason":"balance decrease due to purchase of gas for execution of a transaction"},{"addr":"0x0000000000000000000000000000000000000000","prev":"0x0","new":"0x13880","reason":"balance increase due to payment of transaction tip"}],"from":"%s","gas":"0x13880","gasUsed":"0x13880","to":"0x00000000000000000000000000000000deadbeef","input":"0x","error":"stack underflow (0 \u003c=\u003e 5)","value":"0x0","type":"CALL"}`, origin.Hex(), origin.Hex(), origin.Hex(), originHex), + want: fmt.Sprintf(`{"beforeEVMTransfers":[{"purpose":"feePayment","from":"%s","to":null,"value":"0x13880"}],"afterEVMTransfers":[{"purpose":"gasRefund","from":null,"to":"%s","value":"0x0"},{"purpose":"tip","from":null,"to":"0x0000000000000000000000000000000000000000","value":"0x13880"}],"from":"%s","gas":"0x13880","gasUsed":"0x13880","to":"0x00000000000000000000000000000000deadbeef","input":"0x","error":"stack underflow (0 \u003c=\u003e 5)","value":"0x0","type":"CALL"}`, origin.Hex(), origin.Hex(), originHex), }, { name: "Mem expansion in LOG0", @@ -328,7 +320,7 @@ func TestInternals(t *testing.T) { byte(vm.LOG0), }, tracer: mkTracer("callTracer", json.RawMessage(`{ "withLog": true }`)), - want: fmt.Sprintf(`{"beforeEVMTransfers":[{"purpose":"purchase of gas for execution of a transaction","from":"%s","to":null,"value":"0x13880"}],"afterEVMTransfers":[{"purpose":"refund for unused gas at the end of execution","from":null,"to":"%s","value":"0xdce2"},{"purpose":"payment of transaction tip","from":null,"to":"0x0000000000000000000000000000000000000000","value":"0x5b9e"}],"balanceChanges":[{"addr":"%s","prev":"0x1c6bf52634000","new":"0x1c6bf52620780","reason":"balance decrease due to purchase of gas for execution of a transaction"},{"addr":"%s","prev":"0x1c6bf52620780","new":"0x1c6bf5262e462","reason":"balance increase due to refund for unused gas at the end of execution"},{"addr":"0x0000000000000000000000000000000000000000","prev":"0x0","new":"0x5b9e","reason":"balance increase due to payment of transaction tip"}],"from":"%s","gas":"0x13880","gasUsed":"0x5b9e","to":"0x00000000000000000000000000000000deadbeef","input":"0x","logs":[{"address":"0x00000000000000000000000000000000deadbeef","topics":[],"data":"0x000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000","position":"0x0"}],"value":"0x0","type":"CALL"}`, origin.Hex(), origin.Hex(), origin.Hex(), origin.Hex(), originHex), + want: fmt.Sprintf(`{"beforeEVMTransfers":[{"purpose":"feePayment","from":"%s","to":null,"value":"0x13880"}],"afterEVMTransfers":[{"purpose":"gasRefund","from":null,"to":"%s","value":"0xdce2"},{"purpose":"tip","from":null,"to":"0x0000000000000000000000000000000000000000","value":"0x5b9e"}],"from":"%s","gas":"0x13880","gasUsed":"0x5b9e","to":"0x00000000000000000000000000000000deadbeef","input":"0x","logs":[{"address":"0x00000000000000000000000000000000deadbeef","topics":[],"data":"0x000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000","position":"0x0"}],"value":"0x0","type":"CALL"}`, origin.Hex(), origin.Hex(), originHex), }, { // Leads to OOM on the prestate tracer diff --git a/eth/tracers/internal/tracetest/testdata/call_tracer/blob_tx.json b/eth/tracers/internal/tracetest/testdata/call_tracer/blob_tx.json index e8a4c9b53d..9b48434e11 100644 --- a/eth/tracers/internal/tracetest/testdata/call_tracer/blob_tx.json +++ b/eth/tracers/internal/tracetest/testdata/call_tracer/blob_tx.json @@ -56,42 +56,30 @@ }, "input": "0x03f8b1820539806485174876e800825208940c2c51a0990aee1d73c1228de1586883415575088080c083020000f842a00100c9fbdf97f747e85847b4f3fff408f89c26842f77c882858bf2c89923849aa00138e3896f3c27f2389147507f8bcec52028b0efca6ee842ed83c9158873943880a0dbac3f97a532c9b00e6239b29036245a5bfbb96940b9d848634661abee98b945a03eec8525f261c2e79798f7b45a5d6ccaefa24576d53ba5023e919b86841c0675", "result": { - "beforeEVMTransfers": [ + "beforeEVMTransfers": + [ { - "purpose": "purchase of gas for execution of a transaction", + "purpose": "feePayment", "from": "0x0c2c51a0990AeE1d73C1228de158688341557508", "to": null, "value": "0x2de364958" } ], - "afterEVMTransfers": [ + "afterEVMTransfers": + [ { - "purpose": "refund for unused gas at the end of execution", + "purpose": "gasRefund", "from": null, "to": "0x0c2c51a0990AeE1d73C1228de158688341557508", "value": "0x0" }, { - "purpose": "payment of transaction tip", + "purpose": "tip", "from": null, "to": "0x0000000000000000000000000000000000000000", "value": "0x200b20" } ], - "balanceChanges": [ - { - "addr": "0x0c2c51a0990AeE1d73C1228de158688341557508", - "prev": "0xde0b6b3a7640000", - "new": "0xde0b6b0c92db6a8", - "reason": "balance decrease due to purchase of gas for execution of a transaction" - }, - { - "addr": "0x0000000000000000000000000000000000000000", - "prev": "0x272e0528", - "new": "0x274e1048", - "reason": "balance increase due to payment of transaction tip" - } - ], "from": "0x0c2c51a0990aee1d73c1228de158688341557508", "gas": "0x5208", "gasUsed": "0x5208", @@ -100,4 +88,4 @@ "value": "0x0", "type": "CALL" } -} \ No newline at end of file +} diff --git a/eth/tracers/internal/tracetest/testdata/call_tracer/create.json b/eth/tracers/internal/tracetest/testdata/call_tracer/create.json index 1bb6eea20d..903ff57c57 100644 --- a/eth/tracers/internal/tracetest/testdata/call_tracer/create.json +++ b/eth/tracers/internal/tracetest/testdata/call_tracer/create.json @@ -48,7 +48,7 @@ "result": { "beforeEVMTransfers": [ { - "purpose": "purchase of gas for execution of a transaction", + "purpose": "feePayment", "from": "0x13e4ACeFE6a6700604929946E70E6443E4E73447", "to": null, "value": "0x2a0383e2a65c00" @@ -56,32 +56,18 @@ ], "afterEVMTransfers": [ { - "purpose": "refund for unused gas at the end of execution", + "purpose": "gasRefund", "from": null, "to": "0x13e4ACeFE6a6700604929946E70E6443E4E73447", "value": "0x0" }, { - "purpose": "payment of transaction tip", + "purpose": "tip", "from": null, "to": "0xD049bfd667cB46Aa3Ef5Df0dA3e57DB3Be39E511", "value": "0x2a0383e2a65c00" } ], - "balanceChanges": [ - { - "addr": "0x13e4ACeFE6a6700604929946E70E6443E4E73447", - "prev": "0xcf3e0938579f000", - "new": "0xcc9dd0fa2d39400", - "reason": "balance decrease due to purchase of gas for execution of a transaction" - }, - { - "addr": "0xD049bfd667cB46Aa3Ef5Df0dA3e57DB3Be39E511", - "prev": "0x0", - "new": "0x2a0383e2a65c00", - "reason": "balance increase due to payment of transaction tip" - } - ], "from": "0x13e4acefe6a6700604929946e70e6443e4e73447", "gas": "0x897be", "gasUsed": "0x897be", @@ -91,4 +77,4 @@ "type": "CREATE", "value": "0x0" } -} \ No newline at end of file +} diff --git a/eth/tracers/internal/tracetest/testdata/call_tracer/deep_calls.json b/eth/tracers/internal/tracetest/testdata/call_tracer/deep_calls.json index a99350937c..a5cca5d434 100644 --- a/eth/tracers/internal/tracetest/testdata/call_tracer/deep_calls.json +++ b/eth/tracers/internal/tracetest/testdata/call_tracer/deep_calls.json @@ -111,7 +111,7 @@ "result": { "beforeEVMTransfers": [ { - "purpose": "purchase of gas for execution of a transaction", + "purpose": "feePayment", "from": "0x70C9217D814985faEF62B124420F8dFbdDD96433", "to": null, "value": "0x11c37937e08000" @@ -119,39 +119,19 @@ ], "afterEVMTransfers": [ { - "purpose": "refund for unused gas at the end of execution", + "purpose": "gasRefund", "from": null, "to": "0x70C9217D814985faEF62B124420F8dFbdDD96433", "value": "0xac27a3b12e800" }, { - "purpose": "payment of transaction tip", + "purpose": "tip", "from": null, "to": "0x1977C248e1014Cc103929Dd7f154199C916E39Ec", "value": "0x700fefccd9800" } ], - "balanceChanges": [ - { - "addr": "0x70C9217D814985faEF62B124420F8dFbdDD96433", - "prev": "0x4ef436dcbda6cd4a", - "new": "0x4ee2736385c64d4a", - "reason": "balance decrease due to purchase of gas for execution of a transaction" - }, - { - "addr": "0x70C9217D814985faEF62B124420F8dFbdDD96433", - "prev": "0x4ee2736385c64d4a", - "new": "0x4eed35ddc0d9354a", - "reason": "balance increase due to refund for unused gas at the end of execution" - }, - { - "addr": "0x1977C248e1014Cc103929Dd7f154199C916E39Ec", - "prev": "0x0", - "new": "0x700fefccd9800", - "reason": "balance increase due to payment of transaction tip" - } - ], - "calls": [ + "calls": [ { "from": "0xc212e03b9e060e36facad5fd8f4435412ca22e6b", "gas": "0x31217", @@ -448,4 +428,4 @@ "type": "CALL", "value": "0x0" } -} \ No newline at end of file +} diff --git a/eth/tracers/internal/tracetest/testdata/call_tracer/delegatecall.json b/eth/tracers/internal/tracetest/testdata/call_tracer/delegatecall.json index 093765e032..26788a6ce4 100644 --- a/eth/tracers/internal/tracetest/testdata/call_tracer/delegatecall.json +++ b/eth/tracers/internal/tracetest/testdata/call_tracer/delegatecall.json @@ -64,7 +64,7 @@ "result": { "beforeEVMTransfers": [ { - "purpose": "purchase of gas for execution of a transaction", + "purpose": "feePayment", "from": "0xA529806c67cc6486d4D62024471772F47F6FD672", "to": null, "value": "0xd529ae9e860000" @@ -72,38 +72,18 @@ ], "afterEVMTransfers": [ { - "purpose": "refund for unused gas at the end of execution", + "purpose": "gasRefund", "from": null, "to": "0xA529806c67cc6486d4D62024471772F47F6FD672", "value": "0xd1b8093ff89800" }, { - "purpose": "payment of transaction tip", + "purpose": "tip", "from": null, "to": "0x5659922cE141EedBC2733678f9806c77b4eEBEE8", "value": "0x371a55e8d6800" } ], - "balanceChanges": [ - { - "addr": "0xA529806c67cc6486d4D62024471772F47F6FD672", - "prev": "0x67820e39ac8fe9800", - "new": "0x6774bb9ec2a789800", - "reason": "balance decrease due to purchase of gas for execution of a transaction" - }, - { - "addr": "0xA529806c67cc6486d4D62024471772F47F6FD672", - "prev": "0x6774bb9ec2a789800", - "new": "0x6781d71f56a713000", - "reason": "balance increase due to refund for unused gas at the end of execution" - }, - { - "addr": "0x5659922cE141EedBC2733678f9806c77b4eEBEE8", - "prev": "0x0", - "new": "0x371a55e8d6800", - "reason": "balance increase due to payment of transaction tip" - } - ], "calls": [ { "calls": [ @@ -136,4 +116,4 @@ "type": "CALL", "value": "0x0" } -} \ No newline at end of file +} diff --git a/eth/tracers/internal/tracetest/testdata/call_tracer/inner_create_oog_outer_throw.json b/eth/tracers/internal/tracetest/testdata/call_tracer/inner_create_oog_outer_throw.json index 8aa0104d0f..41d541761f 100644 --- a/eth/tracers/internal/tracetest/testdata/call_tracer/inner_create_oog_outer_throw.json +++ b/eth/tracers/internal/tracetest/testdata/call_tracer/inner_create_oog_outer_throw.json @@ -56,7 +56,7 @@ "result": { "beforeEVMTransfers": [ { - "purpose": "purchase of gas for execution of a transaction", + "purpose": "feePayment", "from": "0xE4A13Bc304682a903e9472F469C33801dd18d9E8", "to": null, "value": "0x2aa1efb94e0000" @@ -64,33 +64,19 @@ ], "afterEVMTransfers": [ { - "purpose": "refund for unused gas at the end of execution", + "purpose": "gasRefund", "from": null, "to": "0xE4A13Bc304682a903e9472F469C33801dd18d9E8", "value": "0x0" }, { - "purpose": "payment of transaction tip", + "purpose": "tip", "from": null, "to": "0x1585936b53834b021f68CC13eEeFdEc2EfC8e724", "value": "0x2aa1efb94e0000" } ], - "balanceChanges": [ - { - "addr": "0xE4A13Bc304682a903e9472F469C33801dd18d9E8", - "prev": "0x33c763c929f62c4f", - "new": "0x339cc1d970a82c4f", - "reason": "balance decrease due to purchase of gas for execution of a transaction" - }, - { - "addr": "0x1585936b53834b021f68CC13eEeFdEc2EfC8e724", - "prev": "0x0", - "new": "0x2aa1efb94e0000", - "reason": "balance increase due to payment of transaction tip" - } - ], - "calls": [ + "calls": [ { "error": "contract creation code storage out of gas", "from": "0x1d3ddf7caf024f253487e18bc4a15b1a360c170a", @@ -110,4 +96,4 @@ "type": "CALL", "value": "0x0" } -} \ No newline at end of file +} diff --git a/eth/tracers/internal/tracetest/testdata/call_tracer/inner_instafail.json b/eth/tracers/internal/tracetest/testdata/call_tracer/inner_instafail.json index ba3dca39ee..460c3d91b8 100644 --- a/eth/tracers/internal/tracetest/testdata/call_tracer/inner_instafail.json +++ b/eth/tracers/internal/tracetest/testdata/call_tracer/inner_instafail.json @@ -52,7 +52,7 @@ "result": { "beforeEVMTransfers": [ { - "purpose": "purchase of gas for execution of a transaction", + "purpose": "feePayment", "from": "0x66fdfd05e46126A07465aD24e40cc0597BC1ef31", "to": null, "value": "0x931dcd31fd200" @@ -60,56 +60,34 @@ ], "afterEVMTransfers": [ { - "purpose": "refund for unused gas at the end of execution", + "purpose": "gasRefund", "from": null, "to": "0x66fdfd05e46126A07465aD24e40cc0597BC1ef31", "value": "0x71af98fe06000" }, { - "purpose": "payment of transaction tip", + "purpose": "tip", "from": null, "to": "0xc822ef32e6d26E170B70Cf761e204c1806265914", "value": "0x216e3433f7200" } ], - "balanceChanges": [ - { - "addr": "0x66fdfd05e46126A07465aD24e40cc0597BC1ef31", - "prev": "0x229ebbb36c3e0f20", - "new": "0x229589d6991e3d20", - "reason": "balance decrease due to purchase of gas for execution of a transaction" - }, - { - "addr": "0x66fdfd05e46126A07465aD24e40cc0597BC1ef31", - "prev": "0x229589d6991e3d20", - "new": "0x229ca4d028fe9d20", - "reason": "balance increase due to refund for unused gas at the end of execution" - }, - { - "addr": "0xc822ef32e6d26E170B70Cf761e204c1806265914", - "prev": "0x0", - "new": "0x216e3433f7200", - "reason": "balance increase due to payment of transaction tip" - } - ], - "type": "CALL", + "type": "CALL", "from": "0x66fdfd05e46126a07465ad24e40cc0597bc1ef31", "to": "0x6c06b16512b332e6cd8293a2974872674716ce18", "value": "0x0", "gas": "0x1f97e", "gasUsed": "0x72de", "input": "0x2e1a7d4d00000000000000000000000000000000000000000000000014d1120d7b160000", - "calls": [ - { - "from": "0x6c06b16512b332e6cd8293a2974872674716ce18", - "gas": "0x8fc", - "gasUsed": "0x0", - "to": "0x66fdfd05e46126a07465ad24e40cc0597bc1ef31", - "input": "0x", - "error": "insufficient balance for transfer", - "value": "0x14d1120d7b160000", - "type": "CALL" - } - ] + "calls": [{ + "from":"0x6c06b16512b332e6cd8293a2974872674716ce18", + "gas":"0x8fc", + "gasUsed":"0x0", + "to":"0x66fdfd05e46126a07465ad24e40cc0597bc1ef31", + "input":"0x", + "error":"insufficient balance for transfer", + "value":"0x14d1120d7b160000", + "type":"CALL" + }] } -} \ No newline at end of file +} diff --git a/eth/tracers/internal/tracetest/testdata/call_tracer/inner_revert_reason.json b/eth/tracers/internal/tracetest/testdata/call_tracer/inner_revert_reason.json index 301271e78e..2e06a33f5f 100644 --- a/eth/tracers/internal/tracetest/testdata/call_tracer/inner_revert_reason.json +++ b/eth/tracers/internal/tracetest/testdata/call_tracer/inner_revert_reason.json @@ -52,7 +52,7 @@ "result": { "beforeEVMTransfers": [ { - "purpose": "purchase of gas for execution of a transaction", + "purpose": "feePayment", "from": "0x3623191d4CCfBbdf09E8EBf6382A1F8257417bC1", "to": null, "value": "0x23f8a24459d000" @@ -60,38 +60,18 @@ ], "afterEVMTransfers": [ { - "purpose": "refund for unused gas at the end of execution", + "purpose": "gasRefund", "from": null, "to": "0x3623191d4CCfBbdf09E8EBf6382A1F8257417bC1", "value": "0x22231133e19400" }, { - "purpose": "payment of transaction tip", + "purpose": "tip", "from": null, "to": "0x0000000000000000000000000000000000000000", "value": "0x15bd3c0591000" } ], - "balanceChanges": [ - { - "addr": "0x3623191d4CCfBbdf09E8EBf6382A1F8257417bC1", - "prev": "0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7", - "new": "0xffffffffffffffffffffffffffffffffffffffffffffffffffdc075dbba62ff7", - "reason": "balance decrease due to purchase of gas for execution of a transaction" - }, - { - "addr": "0x3623191d4CCfBbdf09E8EBf6382A1F8257417bC1", - "prev": "0xffffffffffffffffffffffffffffffffffffffffffffffffffdc075dbba62ff7", - "new": "0xfffffffffffffffffffffffffffffffffffffffffffffffffffe2a6eef87c3f7", - "reason": "balance increase due to refund for unused gas at the end of execution" - }, - { - "addr": "0x0000000000000000000000000000000000000000", - "prev": "0x0", - "new": "0x15bd3c0591000", - "reason": "balance increase due to payment of transaction tip" - } - ], "from": "0x3623191d4ccfbbdf09e8ebf6382a1f8257417bc1", "gas": "0x2dc6c0", "gasUsed": "0x25590", diff --git a/eth/tracers/internal/tracetest/testdata/call_tracer/inner_throw_outer_revert.json b/eth/tracers/internal/tracetest/testdata/call_tracer/inner_throw_outer_revert.json index c7be1a7008..9ebd222e29 100644 --- a/eth/tracers/internal/tracetest/testdata/call_tracer/inner_throw_outer_revert.json +++ b/eth/tracers/internal/tracetest/testdata/call_tracer/inner_throw_outer_revert.json @@ -59,7 +59,7 @@ "result": { "beforeEVMTransfers": [ { - "purpose": "purchase of gas for execution of a transaction", + "purpose": "feePayment", "from": "0xd4FCAb9f0a6DC0493Af47C864f6f17A8a5e2E826", "to": null, "value": "0x267f6630f8ac00" @@ -67,51 +67,19 @@ ], "afterEVMTransfers": [ { - "purpose": "refund for unused gas at the end of execution", + "purpose": "gasRefund", "from": null, "to": "0xd4FCAb9f0a6DC0493Af47C864f6f17A8a5e2E826", "value": "0x9208af649c00" }, { - "purpose": "payment of transaction tip", + "purpose": "tip", "from": null, "to": "0x00d8Ae40D9a06d0E7a2877B62E32eB959Afbe16D", "value": "0x25ed5d81941000" } ], - "balanceChanges": [ - { - "addr": "0xd4FCAb9f0a6DC0493Af47C864f6f17A8a5e2E826", - "prev": "0x2a2dd979a35cf000", - "new": "0x2a075a1372644400", - "reason": "balance decrease due to purchase of gas for execution of a transaction" - }, - { - "addr": "0xd4FCAb9f0a6DC0493Af47C864f6f17A8a5e2E826", - "prev": "0x2a075a1372644400", - "new": "0x1b7500a39c3b4400", - "reason": "balance decrease due to transfer via a call" - }, - { - "addr": "0x33056b5DcaC09a9b4BeCad0E1dcf92c19Bd0AF76", - "prev": "0x0", - "new": "0xe92596fd6290000", - "reason": "balance increase due to transfer via a call" - }, - { - "addr": "0xd4FCAb9f0a6DC0493Af47C864f6f17A8a5e2E826", - "prev": "0x2a075a1372644400", - "new": "0x2a07ec1c21c8e000", - "reason": "balance increase due to refund for unused gas at the end of execution" - }, - { - "addr": "0x00d8Ae40D9a06d0E7a2877B62E32eB959Afbe16D", - "prev": "0x0", - "new": "0x25ed5d81941000", - "reason": "balance increase due to payment of transaction tip" - } - ], - "calls": [ + "calls": [ { "error": "invalid opcode: INVALID", "from": "0x33056b5dcac09a9b4becad0e1dcf92c19bd0af76", @@ -132,4 +100,4 @@ "type": "CALL", "value": "0xe92596fd6290000" } -} \ No newline at end of file +} diff --git a/eth/tracers/internal/tracetest/testdata/call_tracer/oog.json b/eth/tracers/internal/tracetest/testdata/call_tracer/oog.json index 838a96852d..8f11c63911 100644 --- a/eth/tracers/internal/tracetest/testdata/call_tracer/oog.json +++ b/eth/tracers/internal/tracetest/testdata/call_tracer/oog.json @@ -50,7 +50,7 @@ "result": { "beforeEVMTransfers": [ { - "purpose": "purchase of gas for execution of a transaction", + "purpose": "feePayment", "from": "0x94194BC2aaF494501D7880B61274A169f6502A54", "to": null, "value": "0x49874422212000" @@ -58,32 +58,18 @@ ], "afterEVMTransfers": [ { - "purpose": "refund for unused gas at the end of execution", + "purpose": "gasRefund", "from": null, "to": "0x94194BC2aaF494501D7880B61274A169f6502A54", "value": "0x0" }, { - "purpose": "payment of transaction tip", + "purpose": "tip", "from": null, "to": "0xD049bfd667cB46Aa3Ef5Df0dA3e57DB3Be39E511", "value": "0x49874422212000" } ], - "balanceChanges": [ - { - "addr": "0x94194BC2aaF494501D7880B61274A169f6502A54", - "prev": "0xea8c39a876d19888d", - "new": "0xea87a13434af8688d", - "reason": "balance decrease due to purchase of gas for execution of a transaction" - }, - { - "addr": "0xD049bfd667cB46Aa3Ef5Df0dA3e57DB3Be39E511", - "prev": "0x0", - "new": "0x49874422212000", - "reason": "balance increase due to payment of transaction tip" - } - ], "error": "out of gas", "from": "0x94194bc2aaf494501d7880b61274a169f6502a54", "gas": "0xca1d", @@ -93,4 +79,4 @@ "type": "CALL", "value": "0x0" } -} \ No newline at end of file +} diff --git a/eth/tracers/internal/tracetest/testdata/call_tracer/revert.json b/eth/tracers/internal/tracetest/testdata/call_tracer/revert.json index d48a412e7a..1ea1a8a55a 100644 --- a/eth/tracers/internal/tracetest/testdata/call_tracer/revert.json +++ b/eth/tracers/internal/tracetest/testdata/call_tracer/revert.json @@ -48,7 +48,7 @@ "result": { "beforeEVMTransfers": [ { - "purpose": "purchase of gas for execution of a transaction", + "purpose": "feePayment", "from": "0x0f6cEF2b7FbB504782e35AA82a2207e816a2B7a9", "to": null, "value": "0x10a741a46278000" @@ -56,39 +56,19 @@ ], "afterEVMTransfers": [ { - "purpose": "refund for unused gas at the end of execution", + "purpose": "gasRefund", "from": null, "to": "0x0f6cEF2b7FbB504782e35AA82a2207e816a2B7a9", "value": "0x107ded4ef0de200" }, { - "purpose": "payment of transaction tip", + "purpose": "tip", "from": null, "to": "0xF4D8e706CfB25c0DECBbDd4D2E2Cc10C66376a3F", "value": "0x2954557199e00" } ], - "balanceChanges": [ - { - "addr": "0x0f6cEF2b7FbB504782e35AA82a2207e816a2B7a9", - "prev": "0x2a3fc32bcc019283", - "new": "0x29354f1185da1283", - "reason": "balance decrease due to purchase of gas for execution of a transaction" - }, - { - "addr": "0x0f6cEF2b7FbB504782e35AA82a2207e816a2B7a9", - "prev": "0x29354f1185da1283", - "new": "0x2a3d2de674e7f483", - "reason": "balance increase due to refund for unused gas at the end of execution" - }, - { - "addr": "0xF4D8e706CfB25c0DECBbDd4D2E2Cc10C66376a3F", - "prev": "0x0", - "new": "0x2954557199e00", - "reason": "balance increase due to payment of transaction tip" - } - ], - "error": "execution reverted", + "error": "execution reverted", "from": "0x0f6cef2b7fbb504782e35aa82a2207e816a2b7a9", "gas": "0x2dc6c0", "gasUsed": "0x719b", @@ -97,4 +77,4 @@ "type": "CALL", "value": "0x0" } -} \ No newline at end of file +} diff --git a/eth/tracers/internal/tracetest/testdata/call_tracer/revert_reason.json b/eth/tracers/internal/tracetest/testdata/call_tracer/revert_reason.json index 002b1b6b70..610ecc9b4a 100644 --- a/eth/tracers/internal/tracetest/testdata/call_tracer/revert_reason.json +++ b/eth/tracers/internal/tracetest/testdata/call_tracer/revert_reason.json @@ -27,7 +27,7 @@ "byzantiumBlock": 0, "constantinopleBlock": 0, "petersburgBlock": 0, - "IstanbulBlock": 1561651, + "IstanbulBlock": 1561651, "chainId": 5, "daoForkSupport": true, "eip150Block": 0, @@ -53,7 +53,7 @@ "result": { "beforeEVMTransfers": [ { - "purpose": "purchase of gas for execution of a transaction", + "purpose": "feePayment", "from": "0xf7579c3d8A669C89d5Ed246a22Eb6db8F6feDbf1", "to": null, "value": "0xd1c091338a000" @@ -61,38 +61,18 @@ ], "afterEVMTransfers": [ { - "purpose": "refund for unused gas at the end of execution", + "purpose": "gasRefund", "from": null, "to": "0xf7579c3d8A669C89d5Ed246a22Eb6db8F6feDbf1", "value": "0xd0279d3814000" }, { - "purpose": "payment of transaction tip", + "purpose": "tip", "from": null, "to": "0x0000000000000000000000000000000000000000", "value": "0x198f3fb76000" } ], - "balanceChanges": [ - { - "addr": "0xf7579c3d8A669C89d5Ed246a22Eb6db8F6feDbf1", - "prev": "0x57af9d6b3df812900", - "new": "0x57aecbaaacc488900", - "reason": "balance decrease due to purchase of gas for execution of a transaction" - }, - { - "addr": "0xf7579c3d8A669C89d5Ed246a22Eb6db8F6feDbf1", - "prev": "0x57aecbaaacc488900", - "new": "0x57af9bd249fc9c900", - "reason": "balance increase due to refund for unused gas at the end of execution" - }, - { - "addr": "0x0000000000000000000000000000000000000000", - "prev": "0x0", - "new": "0x198f3fb76000", - "reason": "balance increase due to payment of transaction tip" - } - ], "error": "execution reverted", "from": "0xf7579c3d8a669c89d5ed246a22eb6db8f6fedbf1", "gas": "0x2dc6c0", @@ -104,4 +84,4 @@ "output": "0x08c379a00000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000001e53656c662d64656c65676174696f6e20697320646973616c6c6f7765642e0000", "revertReason": "Self-delegation is disallowed." } -} \ No newline at end of file +} diff --git a/eth/tracers/internal/tracetest/testdata/call_tracer/selfdestruct.json b/eth/tracers/internal/tracetest/testdata/call_tracer/selfdestruct.json index 492f078f09..eb16322eae 100644 --- a/eth/tracers/internal/tracetest/testdata/call_tracer/selfdestruct.json +++ b/eth/tracers/internal/tracetest/testdata/call_tracer/selfdestruct.json @@ -54,7 +54,7 @@ "result": { "beforeEVMTransfers": [ { - "purpose": "purchase of gas for execution of a transaction", + "purpose": "feePayment", "from": "0xb436ba50D378D4BBC8660d312A13dF6af6E89dFB", "to": null, "value": "0x997a2bce4c000" @@ -62,13 +62,13 @@ ], "afterEVMTransfers": [ { - "purpose": "refund for unused gas at the end of execution", + "purpose": "gasRefund", "from": null, "to": "0xb436ba50D378D4BBC8660d312A13dF6af6E89dFB", "value": "0x68ac555075c00" }, { - "purpose": "payment of transaction tip", + "purpose": "tip", "from": null, "to": "0x1585936b53834b021f68CC13eEeFdEc2EfC8e724", "value": "0x30cdd67dd6400" @@ -80,39 +80,7 @@ "value": "0x0" } ], - "balanceChanges": [ - { - "addr": "0xb436ba50D378D4BBC8660d312A13dF6af6E89dFB", - "prev": "0x1780d77678137ac1b775", - "new": "0x1780d76ce070bddcf775", - "reason": "balance decrease due to purchase of gas for execution of a transaction" - }, - { - "addr": "0x000000000000000000000000000000000000dEaD", - "prev": "0x0", - "new": "0x4d87094125a369d9bd5", - "reason": "unspecified" - }, - { - "addr": "0x3b873A919aA0512D5A0F09E6dCCEaA4a6727faFE", - "prev": "0x4d87094125a369d9bd5", - "new": "0x0", - "reason": "balance decrease due to selfDestruct" - }, - { - "addr": "0xb436ba50D378D4BBC8660d312A13dF6af6E89dFB", - "prev": "0x1780d76ce070bddcf775", - "new": "0x1780d7736b3612e45375", - "reason": "balance increase due to refund for unused gas at the end of execution" - }, - { - "addr": "0x1585936b53834b021f68CC13eEeFdEc2EfC8e724", - "prev": "0x0", - "new": "0x30cdd67dd6400", - "reason": "balance increase due to payment of transaction tip" - } - ], - "calls": [ + "calls": [ { "from": "0x3b873a919aa0512d5a0f09e6dcceaa4a6727fafe", "gas": "0x0", @@ -131,4 +99,4 @@ "type": "CALL", "value": "0x0" } -} \ No newline at end of file +} diff --git a/eth/tracers/internal/tracetest/testdata/call_tracer/simple.json b/eth/tracers/internal/tracetest/testdata/call_tracer/simple.json index f80846d48b..92f7a68a18 100644 --- a/eth/tracers/internal/tracetest/testdata/call_tracer/simple.json +++ b/eth/tracers/internal/tracetest/testdata/call_tracer/simple.json @@ -59,7 +59,7 @@ "result": { "beforeEVMTransfers": [ { - "purpose": "purchase of gas for execution of a transaction", + "purpose": "feePayment", "from": "0xb436ba50D378D4BBC8660d312A13dF6af6E89dFB", "to": null, "value": "0x997a2bce4c000" @@ -67,50 +67,18 @@ ], "afterEVMTransfers": [ { - "purpose": "refund for unused gas at the end of execution", + "purpose": "gasRefund", "from": null, "to": "0xb436ba50D378D4BBC8660d312A13dF6af6E89dFB", "value": "0x576b3eb275400" }, { - "purpose": "payment of transaction tip", + "purpose": "tip", "from": null, "to": "0x1585936b53834b021f68CC13eEeFdEc2EfC8e724", "value": "0x420eed1bd6c00" } ], - "balanceChanges": [ - { - "addr": "0xb436ba50D378D4BBC8660d312A13dF6af6E89dFB", - "prev": "0x1780d77678137ac1b775", - "new": "0x1780d76ce070bddcf775", - "reason": "balance decrease due to purchase of gas for execution of a transaction" - }, - { - "addr": "0x3b873A919aA0512D5A0F09E6dCCEaA4a6727faFE", - "prev": "0x4d87094125a369d9bd5", - "new": "0x4d869a3b70062eb9bd5", - "reason": "balance decrease due to transfer via a call" - }, - { - "addr": "0x0024F658a46FBB89d8Ac105e98D7ac7cbBaF27C5", - "prev": "0x0", - "new": "0x6f05b59d3b20000", - "reason": "balance increase due to transfer via a call" - }, - { - "addr": "0xb436ba50D378D4BBC8660d312A13dF6af6E89dFB", - "prev": "0x1780d76ce070bddcf775", - "new": "0x1780d7725724a9044b75", - "reason": "balance increase due to refund for unused gas at the end of execution" - }, - { - "addr": "0x1585936b53834b021f68CC13eEeFdEc2EfC8e724", - "prev": "0x0", - "new": "0x420eed1bd6c00", - "reason": "balance increase due to payment of transaction tip" - } - ], "calls": [ { "from": "0x3b873a919aa0512d5a0f09e6dcceaa4a6727fafe", @@ -131,4 +99,4 @@ "type": "CALL", "value": "0x0" } -} \ No newline at end of file +} diff --git a/eth/tracers/internal/tracetest/testdata/call_tracer/simple_onlytop.json b/eth/tracers/internal/tracetest/testdata/call_tracer/simple_onlytop.json index fac9ad11bb..deb7d5cddf 100644 --- a/eth/tracers/internal/tracetest/testdata/call_tracer/simple_onlytop.json +++ b/eth/tracers/internal/tracetest/testdata/call_tracer/simple_onlytop.json @@ -57,12 +57,12 @@ }, "input": "0xf88b8271908506fc23ac0083015f90943b873a919aa0512d5a0f09e6dcceaa4a6727fafe80a463e4bff40000000000000000000000000024f658a46fbb89d8ac105e98d7ac7cbbaf27c52aa0bdce0b59e8761854e857fe64015f06dd08a4fbb7624f6094893a79a72e6ad6bea01d9dde033cff7bb235a3163f348a6d7ab8d6b52bc0963a95b91612e40ca766a4", "tracerConfig": { - "onlyTopCall": true + "onlyTopCall": true }, "result": { "beforeEVMTransfers": [ { - "purpose": "purchase of gas for execution of a transaction", + "purpose": "feePayment", "from": "0xb436ba50D378D4BBC8660d312A13dF6af6E89dFB", "to": null, "value": "0x997a2bce4c000" @@ -70,50 +70,18 @@ ], "afterEVMTransfers": [ { - "purpose": "refund for unused gas at the end of execution", + "purpose": "gasRefund", "from": null, "to": "0xb436ba50D378D4BBC8660d312A13dF6af6E89dFB", "value": "0x576b3eb275400" }, { - "purpose": "payment of transaction tip", + "purpose": "tip", "from": null, "to": "0x1585936b53834b021f68CC13eEeFdEc2EfC8e724", "value": "0x420eed1bd6c00" } ], - "balanceChanges": [ - { - "addr": "0xb436ba50D378D4BBC8660d312A13dF6af6E89dFB", - "prev": "0x1780d77678137ac1b775", - "new": "0x1780d76ce070bddcf775", - "reason": "balance decrease due to purchase of gas for execution of a transaction" - }, - { - "addr": "0x3b873A919aA0512D5A0F09E6dCCEaA4a6727faFE", - "prev": "0x4d87094125a369d9bd5", - "new": "0x4d869a3b70062eb9bd5", - "reason": "balance decrease due to transfer via a call" - }, - { - "addr": "0x0024F658a46FBB89d8Ac105e98D7ac7cbBaF27C5", - "prev": "0x0", - "new": "0x6f05b59d3b20000", - "reason": "balance increase due to transfer via a call" - }, - { - "addr": "0xb436ba50D378D4BBC8660d312A13dF6af6E89dFB", - "prev": "0x1780d76ce070bddcf775", - "new": "0x1780d7725724a9044b75", - "reason": "balance increase due to refund for unused gas at the end of execution" - }, - { - "addr": "0x1585936b53834b021f68CC13eEeFdEc2EfC8e724", - "prev": "0x0", - "new": "0x420eed1bd6c00", - "reason": "balance increase due to payment of transaction tip" - } - ], "from": "0xb436ba50d378d4bbc8660d312a13df6af6e89dfb", "gas": "0x15f90", "gasUsed": "0x9751", @@ -123,4 +91,4 @@ "type": "CALL", "value": "0x0" } -} \ No newline at end of file +} diff --git a/eth/tracers/internal/tracetest/testdata/call_tracer/throw.json b/eth/tracers/internal/tracetest/testdata/call_tracer/throw.json index 72e0e194f5..4bdfbd349b 100644 --- a/eth/tracers/internal/tracetest/testdata/call_tracer/throw.json +++ b/eth/tracers/internal/tracetest/testdata/call_tracer/throw.json @@ -52,7 +52,7 @@ "result": { "beforeEVMTransfers": [ { - "purpose": "purchase of gas for execution of a transaction", + "purpose": "feePayment", "from": "0x70C9217D814985faEF62B124420F8dFbdDD96433", "to": null, "value": "0x11c37937e08000" @@ -60,32 +60,18 @@ ], "afterEVMTransfers": [ { - "purpose": "refund for unused gas at the end of execution", + "purpose": "gasRefund", "from": null, "to": "0x70C9217D814985faEF62B124420F8dFbdDD96433", "value": "0x0" }, { - "purpose": "payment of transaction tip", + "purpose": "tip", "from": null, "to": "0x294e5d6c39A36Ce38aF1DCA70c1060f78Dee8070", "value": "0x11c37937e08000" } - ], - "balanceChanges": [ - { - "addr": "0x70C9217D814985faEF62B124420F8dFbdDD96433", - "prev": "0x4ecd70668f5d854a", - "new": "0x4ebbaced577d054a", - "reason": "balance decrease due to purchase of gas for execution of a transaction" - }, - { - "addr": "0x294e5d6c39A36Ce38aF1DCA70c1060f78Dee8070", - "prev": "0x0", - "new": "0x11c37937e08000", - "reason": "balance increase due to payment of transaction tip" - } - ], + ], "error": "invalid jump destination", "from": "0x70c9217d814985faef62b124420f8dfbddd96433", "gas": "0x3d090", @@ -95,4 +81,4 @@ "type": "CALL", "value": "0x0" } -} \ No newline at end of file +} diff --git a/eth/tracers/internal/tracetest/testdata/call_tracer_withLog/calldata.json b/eth/tracers/internal/tracetest/testdata/call_tracer_withLog/calldata.json index 6dbf02e26c..53d561f395 100644 --- a/eth/tracers/internal/tracetest/testdata/call_tracer_withLog/calldata.json +++ b/eth/tracers/internal/tracetest/testdata/call_tracer_withLog/calldata.json @@ -78,7 +78,7 @@ "result": { "beforeEVMTransfers": [ { - "purpose": "purchase of gas for execution of a transaction", + "purpose": "feePayment", "from": "0x4F5777744b500616697CB655DCb02ee6CD51DeB5", "to": null, "value": "0x21c166071e51e6" @@ -86,50 +86,18 @@ ], "afterEVMTransfers": [ { - "purpose": "refund for unused gas at the end of execution", + "purpose": "gasRefund", "from": null, "to": "0x4F5777744b500616697CB655DCb02ee6CD51DeB5", "value": "0x1026111b8570c0" }, { - "purpose": "payment of transaction tip", + "purpose": "tip", "from": null, "to": "0xf8b483DbA2c3B7176a3Da549ad41A48BB3121069", "value": "0x119b54eb98e126" } ], - "balanceChanges": [ - { - "addr": "0x4F5777744b500616697CB655DCb02ee6CD51DeB5", - "prev": "0xb0983f1b83eec290", - "new": "0xb0767db57cd070aa", - "reason": "balance decrease due to purchase of gas for execution of a transaction" - }, - { - "addr": "0x4F5777744b500616697CB655DCb02ee6CD51DeB5", - "prev": "0xb0767db57cd070aa", - "new": "0x25af5ab0f2e870aa", - "reason": "balance decrease due to transfer via a call" - }, - { - "addr": "0x200Edd17F30485A8735878661960Cd7a9A95733F", - "prev": "0x0", - "new": "0x8ac7230489e80000", - "reason": "balance increase due to transfer via a call" - }, - { - "addr": "0x4F5777744b500616697CB655DCb02ee6CD51DeB5", - "prev": "0x25af5ab0f2e870aa", - "new": "0x25bf80c20e6de16a", - "reason": "balance increase due to refund for unused gas at the end of execution" - }, - { - "addr": "0xf8b483DbA2c3B7176a3Da549ad41A48BB3121069", - "prev": "0x16969a0ba2c2d384d07", - "new": "0x16969b2558118d12e2d", - "reason": "balance increase due to payment of transaction tip" - } - ], "from": "0x4f5777744b500616697cb655dcb02ee6cd51deb5", "gas": "0x33085", "gasUsed": "0x1a9e5", @@ -168,4 +136,4 @@ "value": "0x8ac7230489e80000", "type": "CALL" } -} \ No newline at end of file +} diff --git a/eth/tracers/internal/tracetest/testdata/call_tracer_withLog/delegatecall.json b/eth/tracers/internal/tracetest/testdata/call_tracer_withLog/delegatecall.json index abf3e30915..288043d3da 100644 --- a/eth/tracers/internal/tracetest/testdata/call_tracer_withLog/delegatecall.json +++ b/eth/tracers/internal/tracetest/testdata/call_tracer_withLog/delegatecall.json @@ -135,7 +135,7 @@ "result": { "beforeEVMTransfers": [ { - "purpose": "purchase of gas for execution of a transaction", + "purpose": "feePayment", "from": "0x3dE712784baf97260455aE25fb74f574EC9c1add", "to": null, "value": "0x267b804776c000" @@ -143,38 +143,18 @@ ], "afterEVMTransfers": [ { - "purpose": "refund for unused gas at the end of execution", + "purpose": "gasRefund", "from": null, "to": "0x3dE712784baf97260455aE25fb74f574EC9c1add", "value": "0x1add08f8e96800" }, { - "purpose": "payment of transaction tip", + "purpose": "tip", "from": null, "to": "0x61C808D82A3Ac53231750daDc13c777b59310bD9", "value": "0xb9e774e8d5800" } ], - "balanceChanges": [ - { - "addr": "0x3dE712784baf97260455aE25fb74f574EC9c1add", - "prev": "0x23c8352f33854625", - "new": "0x23a1b9aeec0e8625", - "reason": "balance decrease due to purchase of gas for execution of a transaction" - }, - { - "addr": "0x3dE712784baf97260455aE25fb74f574EC9c1add", - "prev": "0x23a1b9aeec0e8625", - "new": "0x23bc96b7e4f7ee25", - "reason": "balance increase due to refund for unused gas at the end of execution" - }, - { - "addr": "0x61C808D82A3Ac53231750daDc13c777b59310bD9", - "prev": "0x90a7af5d4755984561", - "new": "0x90a7bafbbea4259d61", - "reason": "balance increase due to payment of transaction tip" - } - ], "from": "0x3de712784baf97260455ae25fb74f574ec9c1add", "gas": "0x84398", "gasUsed": "0x27ec3", @@ -452,4 +432,4 @@ "value": "0x0", "type": "CALL" } -} \ No newline at end of file +} diff --git a/eth/tracers/internal/tracetest/testdata/call_tracer_withLog/frontier_create_outofstorage.json b/eth/tracers/internal/tracetest/testdata/call_tracer_withLog/frontier_create_outofstorage.json index bd7e0b04c2..b2e1ea79cd 100644 --- a/eth/tracers/internal/tracetest/testdata/call_tracer_withLog/frontier_create_outofstorage.json +++ b/eth/tracers/internal/tracetest/testdata/call_tracer_withLog/frontier_create_outofstorage.json @@ -77,48 +77,30 @@ "withLog": true }, "result": { - "beforeEVMTransfers": [ + "beforeEVMTransfers": + [ { - "purpose": "purchase of gas for execution of a transaction", + "purpose": "feePayment", "from": "0x0047A8033CC6d6Ca2ED5044674Fd421F44884dE8", "to": null, "value": "0x13fbe85edc90000" } ], - "afterEVMTransfers": [ + "afterEVMTransfers": + [ { - "purpose": "refund for unused gas at the end of execution", + "purpose": "gasRefund", "from": null, "to": "0x0047A8033CC6d6Ca2ED5044674Fd421F44884dE8", "value": "0xd52ed21cc43400" }, { - "purpose": "payment of transaction tip", + "purpose": "tip", "from": null, "to": "0xe48430c4E88A929bBa0eE3DCe284866a9937b609", "value": "0x6a8fb3d104cc00" } ], - "balanceChanges": [ - { - "addr": "0x0047A8033CC6d6Ca2ED5044674Fd421F44884dE8", - "prev": "0x44f5ced08fe37cf7", - "new": "0x43b6104aa21a7cf7", - "reason": "balance decrease due to purchase of gas for execution of a transaction" - }, - { - "addr": "0x0047A8033CC6d6Ca2ED5044674Fd421F44884dE8", - "prev": "0x43b6104aa21a7cf7", - "new": "0x448b3f1cbedeb0f7", - "reason": "balance increase due to refund for unused gas at the end of execution" - }, - { - "addr": "0xe48430c4E88A929bBa0eE3DCe284866a9937b609", - "prev": "0x26758774d51d8677a", - "new": "0x267c3070122dd337a", - "reason": "balance increase due to payment of transaction tip" - } - ], "from": "0x0047a8033cc6d6ca2ed5044674fd421f44884de8", "gas": "0x1b7740", "gasUsed": "0x9274f", @@ -213,14 +195,12 @@ "type": "CALL" } ], - "logs": [ + "logs":[ { "address": "0xf631e3b3aafa084bc51c714825aacf505d2059be", - "topics": [ - "0x1f28d876aff267c3302a63cd25ebcca53e6f60691049df42275b6d06ab455c67" - ], - "data": "0x55bc8431ce52389ac668a9b14a0943290cb7263732251186e960bc8b249b5f32000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000e00000000000000000000000000000000000000000000000000000000000030d41000000000000000000000000000000000000000000000000000000000000000355524c0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004c6a736f6e2868747470733a2f2f6170692e6b72616b656e2e636f6d2f302f7075626c69632f5469636b65723f706169723d455448584254292e726573756c742e58455448585842542e632e300000000000000000000000000000000000000000", - "position": "0x3" + "topics": ["0x1f28d876aff267c3302a63cd25ebcca53e6f60691049df42275b6d06ab455c67"], + "data":"0x55bc8431ce52389ac668a9b14a0943290cb7263732251186e960bc8b249b5f32000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000e00000000000000000000000000000000000000000000000000000000000030d41000000000000000000000000000000000000000000000000000000000000000355524c0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004c6a736f6e2868747470733a2f2f6170692e6b72616b656e2e636f6d2f302f7075626c69632f5469636b65723f706169723d455448584254292e726573756c742e58455448585842542e632e300000000000000000000000000000000000000000", + "position":"0x3" } ], "value": "0x0", diff --git a/eth/tracers/internal/tracetest/testdata/call_tracer_withLog/multi_contracts.json b/eth/tracers/internal/tracetest/testdata/call_tracer_withLog/multi_contracts.json index f4cfc0cb03..df7f7a8318 100644 --- a/eth/tracers/internal/tracetest/testdata/call_tracer_withLog/multi_contracts.json +++ b/eth/tracers/internal/tracetest/testdata/call_tracer_withLog/multi_contracts.json @@ -300,7 +300,7 @@ "result": { "beforeEVMTransfers": [ { - "purpose": "purchase of gas for execution of a transaction", + "purpose": "feePayment", "from": "0xBe3aE5Cb97c253DdA67181C6E34E43F5C275E08b", "to": null, "value": "0x136dcc951d8c000" @@ -308,74 +308,18 @@ ], "afterEVMTransfers": [ { - "purpose": "refund for unused gas at the end of execution", + "purpose": "gasRefund", "from": null, "to": "0xBe3aE5Cb97c253DdA67181C6E34E43F5C275E08b", "value": "0x5489446b9e1a00" }, { - "purpose": "payment of transaction tip", + "purpose": "tip", "from": null, "to": "0xEA674fdDe714fd979de3EdF0F56AA9716B898ec8", "value": "0xe25384e63aa600" } ], - "balanceChanges": [ - { - "addr": "0xBe3aE5Cb97c253DdA67181C6E34E43F5C275E08b", - "prev": "0x167d285b38143c04f", - "new": "0x1669ba8ea2f6b004f", - "reason": "balance decrease due to purchase of gas for execution of a transaction" - }, - { - "addr": "0x6e715Ab4F598eACF0016b9b35Ef33e4141844CcC", - "prev": "0x4563918244f400000", - "new": "0x0", - "reason": "balance decrease due to transfer via a call" - }, - { - "addr": "0xAD3Ecf23c0c8983B07163708be6d763b5F056193", - "prev": "0x0", - "new": "0x4563918244f400000", - "reason": "balance increase due to transfer via a call" - }, - { - "addr": "0xAD3Ecf23c0c8983B07163708be6d763b5F056193", - "prev": "0x4563918244f400000", - "new": "0x22b1c8c1227a00001", - "reason": "balance decrease due to transfer via a call" - }, - { - "addr": "0x6e715Ab4F598eACF0016b9b35Ef33e4141844CcC", - "prev": "0x0", - "new": "0x22b1c8c12279fffff", - "reason": "balance increase due to transfer via a call" - }, - { - "addr": "0xAD3Ecf23c0c8983B07163708be6d763b5F056193", - "prev": "0x22b1c8c1227a00001", - "new": "0x2", - "reason": "balance decrease due to transfer via a call" - }, - { - "addr": "0x6e715Ab4F598eACF0016b9b35Ef33e4141844CcC", - "prev": "0x22b1c8c12279fffff", - "new": "0x4563918244f3ffffe", - "reason": "balance increase due to transfer via a call" - }, - { - "addr": "0xBe3aE5Cb97c253DdA67181C6E34E43F5C275E08b", - "prev": "0x1669ba8ea2f6b004f", - "new": "0x166f0322e9b091a4f", - "reason": "balance increase due to refund for unused gas at the end of execution" - }, - { - "addr": "0xEA674fdDe714fd979de3EdF0F56AA9716B898ec8", - "prev": "0x4ab3566739e7b24371", - "new": "0x4ab438babecdece971", - "reason": "balance increase due to payment of transaction tip" - } - ], "from": "0xbe3ae5cb97c253dda67181c6e34e43f5c275e08b", "gas": "0x3567e0", "gasUsed": "0x26e1ef", @@ -2402,4 +2346,4 @@ "value": "0x0", "type": "CALL" } -} \ No newline at end of file +} diff --git a/eth/tracers/internal/tracetest/testdata/call_tracer_withLog/multilogs.json b/eth/tracers/internal/tracetest/testdata/call_tracer_withLog/multilogs.json index 6d12f47fcb..55848ae7ab 100644 --- a/eth/tracers/internal/tracetest/testdata/call_tracer_withLog/multilogs.json +++ b/eth/tracers/internal/tracetest/testdata/call_tracer_withLog/multilogs.json @@ -168,7 +168,7 @@ "result": { "beforeEVMTransfers": [ { - "purpose": "purchase of gas for execution of a transaction", + "purpose": "feePayment", "from": "0x3FcB0342353c541E210013AadDc2E740b9A33D08", "to": null, "value": "0x214e8348c4f0000" @@ -176,50 +176,18 @@ ], "afterEVMTransfers": [ { - "purpose": "refund for unused gas at the end of execution", + "purpose": "gasRefund", "from": null, "to": "0x3FcB0342353c541E210013AadDc2E740b9A33D08", "value": "0x610b133d337400" }, { - "purpose": "payment of transaction tip", + "purpose": "tip", "from": null, "to": "0x2a65Aca4D5fC5B5C859090a6c34d164135398226", "value": "0x1b3dd214f1b8c00" } ], - "balanceChanges": [ - { - "addr": "0x3FcB0342353c541E210013AadDc2E740b9A33D08", - "prev": "0x6a0e4be198f18400", - "new": "0x67f963ad0ca28400", - "reason": "balance decrease due to purchase of gas for execution of a transaction" - }, - { - "addr": "0x3FcB0342353c541E210013AadDc2E740b9A33D08", - "prev": "0x67f963ad0ca28400", - "new": "0x6481360022c98400", - "reason": "balance decrease due to transfer via a call" - }, - { - "addr": "0x350e0fFC780a6a75B44Cc52E1fF9092870668945", - "prev": "0xe37111b7c79406c0", - "new": "0xe6e93f64b16d06c0", - "reason": "balance increase due to transfer via a call" - }, - { - "addr": "0x3FcB0342353c541E210013AadDc2E740b9A33D08", - "prev": "0x6481360022c98400", - "new": "0x64e241135ffcf800", - "reason": "balance increase due to refund for unused gas at the end of execution" - }, - { - "addr": "0x2a65Aca4D5fC5B5C859090a6c34d164135398226", - "prev": "0x44dc051cccdfd2e132", - "new": "0x44ddb8f9ee2eee6d32", - "reason": "balance increase due to payment of transaction tip" - } - ], "from": "0x3fcb0342353c541e210013aaddc2e740b9a33d08", "gas": "0x2dc6c0", "gasUsed": "0x2570bf", @@ -409,7 +377,7 @@ "0xcacb62d8acea4678658eb5dc4aaa889b34d893b967c96a5f8c066e6549fa3f42" ], "data": "0x000000000000000000000000000000000000000000000000000000000000034200000000000000000000000000000000000000000000000000000000000000380000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003fcb0342353c541e210013aaddc2e740b9a33d08fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffefefe0000000000000000000000000000000000000000000000000011c37937e08000", - "position": "0x0" + "position": "0x0" }, { "address": "0x350e0ffc780a6a75b44cc52e1ff9092870668945", @@ -417,7 +385,7 @@ "0xcacb62d8acea4678658eb5dc4aaa889b34d893b967c96a5f8c066e6549fa3f42" ], "data": "0x00000000000000000000000000000000000000000000000000000000000002fe00000000000000000000000000000000000000000000000000000000000000370000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003fcb0342353c541e210013aaddc2e740b9a33d08ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa0a0a00000000000000000000000000000000000000000000000000011c37937e08000", - "position": "0x0" + "position": "0x0" }, { "address": "0x350e0ffc780a6a75b44cc52e1ff9092870668945", @@ -425,7 +393,7 @@ "0xcacb62d8acea4678658eb5dc4aaa889b34d893b967c96a5f8c066e6549fa3f42" ], "data": "0x000000000000000000000000000000000000000000000000000000000000034200000000000000000000000000000000000000000000000000000000000000370000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003fcb0342353c541e210013aaddc2e740b9a33d08ffffffffffffffffffffffffffffffffffffffffffffffffffffffffff5b5b5b0000000000000000000000000000000000000000000000000011c37937e08000", - "position": "0x0" + "position": "0x0" }, { "address": "0x350e0ffc780a6a75b44cc52e1ff9092870668945", @@ -433,7 +401,7 @@ "0xcacb62d8acea4678658eb5dc4aaa889b34d893b967c96a5f8c066e6549fa3f42" ], "data": "0x00000000000000000000000000000000000000000000000000000000000002fe00000000000000000000000000000000000000000000000000000000000000390000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003fcb0342353c541e210013aaddc2e740b9a33d08ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffbababa0000000000000000000000000000000000000000000000000011c37937e08000", - "position": "0x0" + "position": "0x0" }, { "address": "0x350e0ffc780a6a75b44cc52e1ff9092870668945", @@ -441,7 +409,7 @@ "0xcacb62d8acea4678658eb5dc4aaa889b34d893b967c96a5f8c066e6549fa3f42" ], "data": "0x000000000000000000000000000000000000000000000000000000000000034200000000000000000000000000000000000000000000000000000000000000390000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003fcb0342353c541e210013aaddc2e740b9a33d08ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000000000000000000000000000000000000000000000000011c37937e08000", - "position": "0x0" + "position": "0x0" }, { "address": "0x350e0ffc780a6a75b44cc52e1ff9092870668945", @@ -449,7 +417,7 @@ "0xcacb62d8acea4678658eb5dc4aaa889b34d893b967c96a5f8c066e6549fa3f42" ], "data": "0x00000000000000000000000000000000000000000000000000000000000002fe00000000000000000000000000000000000000000000000000000000000000360000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003fcb0342353c541e210013aaddc2e740b9a33d08ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffeaeaea0000000000000000000000000000000000000000000000000011c37937e08000", - "position": "0x0" + "position": "0x0" }, { "address": "0x350e0ffc780a6a75b44cc52e1ff9092870668945", @@ -457,7 +425,7 @@ "0xcacb62d8acea4678658eb5dc4aaa889b34d893b967c96a5f8c066e6549fa3f42" ], "data": "0x000000000000000000000000000000000000000000000000000000000000034200000000000000000000000000000000000000000000000000000000000000360000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003fcb0342353c541e210013aaddc2e740b9a33d08ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa9a9a90000000000000000000000000000000000000000000000000011c37937e08000", - "position": "0x0" + "position": "0x0" }, { "address": "0x350e0ffc780a6a75b44cc52e1ff9092870668945", @@ -465,7 +433,7 @@ "0xcacb62d8acea4678658eb5dc4aaa889b34d893b967c96a5f8c066e6549fa3f42" ], "data": "0x00000000000000000000000000000000000000000000000000000000000002fe000000000000000000000000000000000000000000000000000000000000003a0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003fcb0342353c541e210013aaddc2e740b9a33d08ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffb9b9b90000000000000000000000000000000000000000000000000011c37937e08000", - "position": "0x0" + "position": "0x0" }, { "address": "0x350e0ffc780a6a75b44cc52e1ff9092870668945", @@ -473,7 +441,7 @@ "0xcacb62d8acea4678658eb5dc4aaa889b34d893b967c96a5f8c066e6549fa3f42" ], "data": "0x0000000000000000000000000000000000000000000000000000000000000342000000000000000000000000000000000000000000000000000000000000003a0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003fcb0342353c541e210013aaddc2e740b9a33d08fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffbfbfb0000000000000000000000000000000000000000000000000011c37937e08000", - "position": "0x0" + "position": "0x0" }, { "address": "0x350e0ffc780a6a75b44cc52e1ff9092870668945", @@ -481,7 +449,7 @@ "0xcacb62d8acea4678658eb5dc4aaa889b34d893b967c96a5f8c066e6549fa3f42" ], "data": "0x00000000000000000000000000000000000000000000000000000000000002fe00000000000000000000000000000000000000000000000000000000000000350000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003fcb0342353c541e210013aaddc2e740b9a33d08fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffefefe0000000000000000000000000000000000000000000000000011c37937e08000", - "position": "0x0" + "position": "0x0" }, { "address": "0x350e0ffc780a6a75b44cc52e1ff9092870668945", @@ -489,7 +457,7 @@ "0xcacb62d8acea4678658eb5dc4aaa889b34d893b967c96a5f8c066e6549fa3f42" ], "data": "0x000000000000000000000000000000000000000000000000000000000000034200000000000000000000000000000000000000000000000000000000000000350000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003fcb0342353c541e210013aaddc2e740b9a33d08fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffefefe0000000000000000000000000000000000000000000000000011c37937e08000", - "position": "0x0" + "position": "0x0" }, { "address": "0x350e0ffc780a6a75b44cc52e1ff9092870668945", @@ -497,7 +465,7 @@ "0xcacb62d8acea4678658eb5dc4aaa889b34d893b967c96a5f8c066e6549fa3f42" ], "data": "0x00000000000000000000000000000000000000000000000000000000000002fe000000000000000000000000000000000000000000000000000000000000003b0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003fcb0342353c541e210013aaddc2e740b9a33d08ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffbababa0000000000000000000000000000000000000000000000000011c37937e08000", - "position": "0x0" + "position": "0x0" }, { "address": "0x350e0ffc780a6a75b44cc52e1ff9092870668945", @@ -505,7 +473,7 @@ "0xcacb62d8acea4678658eb5dc4aaa889b34d893b967c96a5f8c066e6549fa3f42" ], "data": "0x0000000000000000000000000000000000000000000000000000000000000342000000000000000000000000000000000000000000000000000000000000003b0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003fcb0342353c541e210013aaddc2e740b9a33d08ffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6363630000000000000000000000000000000000000000000000000011c37937e08000", - "position": "0x0" + "position": "0x0" }, { "address": "0x350e0ffc780a6a75b44cc52e1ff9092870668945", @@ -513,7 +481,7 @@ "0xcacb62d8acea4678658eb5dc4aaa889b34d893b967c96a5f8c066e6549fa3f42" ], "data": "0x00000000000000000000000000000000000000000000000000000000000002fe00000000000000000000000000000000000000000000000000000000000000340000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003fcb0342353c541e210013aaddc2e740b9a33d08ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000000000000000000000000000000000000000000000000011c37937e08000", - "position": "0x0" + "position": "0x0" }, { "address": "0x350e0ffc780a6a75b44cc52e1ff9092870668945", @@ -521,7 +489,7 @@ "0xcacb62d8acea4678658eb5dc4aaa889b34d893b967c96a5f8c066e6549fa3f42" ], "data": "0x000000000000000000000000000000000000000000000000000000000000034200000000000000000000000000000000000000000000000000000000000000340000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003fcb0342353c541e210013aaddc2e740b9a33d08fffffffffffffffffffffffffffffffffffffffffffffffffffffffffff9f9f90000000000000000000000000000000000000000000000000011c37937e08000", - "position": "0x0" + "position": "0x0" }, { "address": "0x350e0ffc780a6a75b44cc52e1ff9092870668945", @@ -529,7 +497,7 @@ "0xcacb62d8acea4678658eb5dc4aaa889b34d893b967c96a5f8c066e6549fa3f42" ], "data": "0x00000000000000000000000000000000000000000000000000000000000002fe000000000000000000000000000000000000000000000000000000000000003c0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003fcb0342353c541e210013aaddc2e740b9a33d08ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffeaeaea0000000000000000000000000000000000000000000000000011c37937e08000", - "position": "0x0" + "position": "0x0" }, { "address": "0x350e0ffc780a6a75b44cc52e1ff9092870668945", @@ -537,7 +505,7 @@ "0xcacb62d8acea4678658eb5dc4aaa889b34d893b967c96a5f8c066e6549fa3f42" ], "data": "0x0000000000000000000000000000000000000000000000000000000000000342000000000000000000000000000000000000000000000000000000000000003c0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003fcb0342353c541e210013aaddc2e740b9a33d08ffffffffffffffffffffffffffffffffffffffffffffffffffffffffff9c9c9c0000000000000000000000000000000000000000000000000011c37937e08000", - "position": "0x0" + "position": "0x0" }, { "address": "0x350e0ffc780a6a75b44cc52e1ff9092870668945", @@ -545,7 +513,7 @@ "0xcacb62d8acea4678658eb5dc4aaa889b34d893b967c96a5f8c066e6549fa3f42" ], "data": "0x00000000000000000000000000000000000000000000000000000000000002fe00000000000000000000000000000000000000000000000000000000000000330000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003fcb0342353c541e210013aaddc2e740b9a33d08fffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8f8f80000000000000000000000000000000000000000000000000011c37937e08000", - "position": "0x0" + "position": "0x0" }, { "address": "0x350e0ffc780a6a75b44cc52e1ff9092870668945", @@ -553,7 +521,7 @@ "0xcacb62d8acea4678658eb5dc4aaa889b34d893b967c96a5f8c066e6549fa3f42" ], "data": "0x000000000000000000000000000000000000000000000000000000000000034200000000000000000000000000000000000000000000000000000000000000330000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003fcb0342353c541e210013aaddc2e740b9a33d08ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000000000000000000000000000000000000000000000000011c37937e08000", - "position": "0x0" + "position": "0x0" }, { "address": "0x350e0ffc780a6a75b44cc52e1ff9092870668945", @@ -561,7 +529,7 @@ "0xcacb62d8acea4678658eb5dc4aaa889b34d893b967c96a5f8c066e6549fa3f42" ], "data": "0x00000000000000000000000000000000000000000000000000000000000002fe000000000000000000000000000000000000000000000000000000000000003d0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003fcb0342353c541e210013aaddc2e740b9a33d08fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffdfdfd0000000000000000000000000000000000000000000000000011c37937e08000", - "position": "0x0" + "position": "0x0" }, { "address": "0x350e0ffc780a6a75b44cc52e1ff9092870668945", @@ -569,7 +537,7 @@ "0xcacb62d8acea4678658eb5dc4aaa889b34d893b967c96a5f8c066e6549fa3f42" ], "data": "0x0000000000000000000000000000000000000000000000000000000000000342000000000000000000000000000000000000000000000000000000000000003d0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003fcb0342353c541e210013aaddc2e740b9a33d08ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000000000000000000000000000000000000000000000000011c37937e08000", - "position": "0x0" + "position": "0x0" }, { "address": "0x350e0ffc780a6a75b44cc52e1ff9092870668945", @@ -577,7 +545,7 @@ "0xcacb62d8acea4678658eb5dc4aaa889b34d893b967c96a5f8c066e6549fa3f42" ], "data": "0x00000000000000000000000000000000000000000000000000000000000002fe00000000000000000000000000000000000000000000000000000000000000320000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003fcb0342353c541e210013aaddc2e740b9a33d08ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000000000000000000000000000000000000000000000000011c37937e08000", - "position": "0x0" + "position": "0x0" }, { "address": "0x350e0ffc780a6a75b44cc52e1ff9092870668945", @@ -585,7 +553,7 @@ "0xcacb62d8acea4678658eb5dc4aaa889b34d893b967c96a5f8c066e6549fa3f42" ], "data": "0x000000000000000000000000000000000000000000000000000000000000034200000000000000000000000000000000000000000000000000000000000000320000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003fcb0342353c541e210013aaddc2e740b9a33d08fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffcfcfc0000000000000000000000000000000000000000000000000011c37937e08000", - "position": "0x0" + "position": "0x0" }, { "address": "0x350e0ffc780a6a75b44cc52e1ff9092870668945", @@ -593,7 +561,7 @@ "0xcacb62d8acea4678658eb5dc4aaa889b34d893b967c96a5f8c066e6549fa3f42" ], "data": "0x00000000000000000000000000000000000000000000000000000000000002fe000000000000000000000000000000000000000000000000000000000000003e0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003fcb0342353c541e210013aaddc2e740b9a33d08fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffdfdfd0000000000000000000000000000000000000000000000000011c37937e08000", - "position": "0x0" + "position": "0x0" }, { "address": "0x350e0ffc780a6a75b44cc52e1ff9092870668945", @@ -601,7 +569,7 @@ "0xcacb62d8acea4678658eb5dc4aaa889b34d893b967c96a5f8c066e6549fa3f42" ], "data": "0x0000000000000000000000000000000000000000000000000000000000000342000000000000000000000000000000000000000000000000000000000000003e0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003fcb0342353c541e210013aaddc2e740b9a33d08ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000000000000000000000000000000000000000000000000011c37937e08000", - "position": "0x0" + "position": "0x0" }, { "address": "0x350e0ffc780a6a75b44cc52e1ff9092870668945", @@ -609,7 +577,7 @@ "0xcacb62d8acea4678658eb5dc4aaa889b34d893b967c96a5f8c066e6549fa3f42" ], "data": "0x00000000000000000000000000000000000000000000000000000000000002fd00000000000000000000000000000000000000000000000000000000000000380000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003fcb0342353c541e210013aaddc2e740b9a33d08ffffffffffffffffffffffffffffffffffffffffffffffffffffffffff4d4e530000000000000000000000000000000000000000000000000011c37937e08000", - "position": "0x0" + "position": "0x0" }, { "address": "0x350e0ffc780a6a75b44cc52e1ff9092870668945", @@ -617,7 +585,7 @@ "0xcacb62d8acea4678658eb5dc4aaa889b34d893b967c96a5f8c066e6549fa3f42" ], "data": "0x000000000000000000000000000000000000000000000000000000000000034300000000000000000000000000000000000000000000000000000000000000380000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003fcb0342353c541e210013aaddc2e740b9a33d08ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000000000000000000000000000000000000000000000000011c37937e08000", - "position": "0x0" + "position": "0x0" }, { "address": "0x350e0ffc780a6a75b44cc52e1ff9092870668945", @@ -625,10 +593,10 @@ "0xcacb62d8acea4678658eb5dc4aaa889b34d893b967c96a5f8c066e6549fa3f42" ], "data": "0x00000000000000000000000000000000000000000000000000000000000002fd00000000000000000000000000000000000000000000000000000000000000370000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003fcb0342353c541e210013aaddc2e740b9a33d08ffffffffffffffffffffffffffffffffffffffffffffffffffffffffff4f494b0000000000000000000000000000000000000000000000000011c37937e08000", - "position": "0x0" + "position": "0x0" } ], "value": "0x3782dace9d90000", "type": "CALL" } -} \ No newline at end of file +} diff --git a/eth/tracers/internal/tracetest/testdata/call_tracer_withLog/notopic.json b/eth/tracers/internal/tracetest/testdata/call_tracer_withLog/notopic.json index ae4d73ba00..f2316eb1b9 100644 --- a/eth/tracers/internal/tracetest/testdata/call_tracer_withLog/notopic.json +++ b/eth/tracers/internal/tracetest/testdata/call_tracer_withLog/notopic.json @@ -103,7 +103,7 @@ "result": { "beforeEVMTransfers": [ { - "purpose": "purchase of gas for execution of a transaction", + "purpose": "feePayment", "from": "0x6412Becf35cc7e2A9E7e47966E443F295e1E4F4a", "to": null, "value": "0xeebe0b40e8000" @@ -111,62 +111,18 @@ ], "afterEVMTransfers": [ { - "purpose": "refund for unused gas at the end of execution", + "purpose": "gasRefund", "from": null, "to": "0x6412Becf35cc7e2A9E7e47966E443F295e1E4F4a", "value": "0x3bb109f807a00" }, { - "purpose": "payment of transaction tip", + "purpose": "tip", "from": null, "to": "0x61C808D82A3Ac53231750daDc13c777b59310bD9", "value": "0xb30d0148e0600" } ], - "balanceChanges": [ - { - "addr": "0x6412Becf35cc7e2A9E7e47966E443F295e1E4F4a", - "prev": "0xfb5dbfc0d448e70", - "new": "0xfa6f01b59360e70", - "reason": "balance decrease due to purchase of gas for execution of a transaction" - }, - { - "addr": "0x6412Becf35cc7e2A9E7e47966E443F295e1E4F4a", - "prev": "0xfa6f01b59360e70", - "new": "0xb7d1fb240980e70", - "reason": "balance decrease due to transfer via a call" - }, - { - "addr": "0x50739060a2C32dc076E507aE1A893aAB28eCFe68", - "prev": "0x6a8ecefb09f7c4141", - "new": "0x6ad16c019b81a4141", - "reason": "balance increase due to transfer via a call" - }, - { - "addr": "0x50739060a2C32dc076E507aE1A893aAB28eCFe68", - "prev": "0x6ad16c019b81a4141", - "new": "0x6acff22b6b6ddeaed", - "reason": "balance decrease due to transfer via a call" - }, - { - "addr": "0x88e1315687AeC48a72786c6B3b3F075208B62713", - "prev": "0x24b9f2c5dc266dc6", - "new": "0x24d19028dd62c41a", - "reason": "balance increase due to transfer via a call" - }, - { - "addr": "0x6412Becf35cc7e2A9E7e47966E443F295e1E4F4a", - "prev": "0xb7d1fb240980e70", - "new": "0xb80dac2e0188870", - "reason": "balance increase due to refund for unused gas at the end of execution" - }, - { - "addr": "0x61C808D82A3Ac53231750daDc13c777b59310bD9", - "prev": "0x12f621ea72fef44f848", - "new": "0x12f6229d80003d2fe48", - "reason": "balance increase due to payment of transaction tip" - } - ], "from": "0x6412becf35cc7e2a9e7e47966e443f295e1e4f4a", "gas": "0x30d40", "gasUsed": "0x249eb", @@ -351,4 +307,4 @@ "value": "0x429d069189e0000", "type": "CALL" } -} \ No newline at end of file +} diff --git a/eth/tracers/internal/tracetest/testdata/call_tracer_withLog/simple.json b/eth/tracers/internal/tracetest/testdata/call_tracer_withLog/simple.json index 32bc2c0659..82d0596304 100644 --- a/eth/tracers/internal/tracetest/testdata/call_tracer_withLog/simple.json +++ b/eth/tracers/internal/tracetest/testdata/call_tracer_withLog/simple.json @@ -64,7 +64,7 @@ "result": { "beforeEVMTransfers": [ { - "purpose": "purchase of gas for execution of a transaction", + "purpose": "feePayment", "from": "0xD1220A0cf47c7B9Be7A2E6BA89F429762e7b9aDb", "to": null, "value": "0x1acc000dea4400" @@ -72,38 +72,18 @@ ], "afterEVMTransfers": [ { - "purpose": "refund for unused gas at the end of execution", + "purpose": "gasRefund", "from": null, "to": "0xD1220A0cf47c7B9Be7A2E6BA89F429762e7b9aDb", "value": "0x11c37937e08000" }, { - "purpose": "payment of transaction tip", + "purpose": "tip", "from": null, "to": "0xe2fE6B13287f28E193333fDfe7Fedf2f6Df6124A", "value": "0x90886d609c400" } ], - "balanceChanges": [ - { - "addr": "0xD1220A0cf47c7B9Be7A2E6BA89F429762e7b9aDb", - "prev": "0x14203bee2ea6fbe8c", - "new": "0x141e8f2e2dc857a8c", - "reason": "balance decrease due to purchase of gas for execution of a transaction" - }, - { - "addr": "0xD1220A0cf47c7B9Be7A2E6BA89F429762e7b9aDb", - "prev": "0x141e8f2e2dc857a8c", - "new": "0x141fab65c1465fa8c", - "reason": "balance increase due to refund for unused gas at the end of execution" - }, - { - "addr": "0xe2fE6B13287f28E193333fDfe7Fedf2f6Df6124A", - "prev": "0x2717a9c870a286f4350", - "new": "0x2717aa58f90fe790750", - "reason": "balance increase due to payment of transaction tip" - } - ], "from": "0xd1220a0cf47c7b9be7a2e6ba89f429762e7b9adb", "gas": "0x24d45", "gasUsed": "0xc6a5", @@ -124,4 +104,4 @@ "value": "0x0", "type": "CALL" } -} \ No newline at end of file +} diff --git a/eth/tracers/internal/tracetest/testdata/call_tracer_withLog/tx_failed.json b/eth/tracers/internal/tracetest/testdata/call_tracer_withLog/tx_failed.json index 603289ac50..730fea23e1 100644 --- a/eth/tracers/internal/tracetest/testdata/call_tracer_withLog/tx_failed.json +++ b/eth/tracers/internal/tracetest/testdata/call_tracer_withLog/tx_failed.json @@ -138,7 +138,7 @@ "result": { "beforeEVMTransfers": [ { - "purpose": "purchase of gas for execution of a transaction", + "purpose": "feePayment", "from": "0xe6002189a74B43e6868b20C1311Bc108E38AaC57", "to": null, "value": "0x81fc72632f7340" @@ -146,44 +146,18 @@ ], "afterEVMTransfers": [ { - "purpose": "refund for unused gas at the end of execution", + "purpose": "gasRefund", "from": null, "to": "0xe6002189a74B43e6868b20C1311Bc108E38AaC57", "value": "0x0" }, { - "purpose": "payment of transaction tip", + "purpose": "tip", "from": null, "to": "0xEA674fdDe714fd979de3EdF0F56AA9716B898ec8", "value": "0x81fc72632f7340" } ], - "balanceChanges": [ - { - "addr": "0xe6002189a74B43e6868b20C1311Bc108E38AaC57", - "prev": "0x29129264d1ae4848b", - "new": "0x290a729dab7b5114b", - "reason": "balance decrease due to purchase of gas for execution of a transaction" - }, - { - "addr": "0xBB9bc244D798123fDe783fCc1C72d3Bb8C189413", - "prev": "0x53d2c8df046dd3db5", - "new": "0x51cfa87ca63cad105", - "reason": "balance decrease due to transfer via a call" - }, - { - "addr": "0x10abb5EfEcdC09581f8b7cb95791FE2936790b4E", - "prev": "0x81f158e2814b4ab624c", - "new": "0x81f35c02e3a97bdcefc", - "reason": "balance increase due to transfer via a call" - }, - { - "addr": "0xEA674fdDe714fd979de3EdF0F56AA9716B898ec8", - "prev": "0x1601bbe4c58ec73210", - "new": "0x16023de137f1f6a550", - "reason": "balance increase due to payment of transaction tip" - } - ], "from": "0xe6002189a74b43e6868b20c1311bc108e38aac57", "gas": "0xaae60", "gasUsed": "0xaae60", @@ -289,4 +263,4 @@ "value": "0x0", "type": "CALL" } -} \ No newline at end of file +} diff --git a/eth/tracers/internal/tracetest/testdata/call_tracer_withLog/tx_partial_failed.json b/eth/tracers/internal/tracetest/testdata/call_tracer_withLog/tx_partial_failed.json index 96da1ed473..8a46028598 100644 --- a/eth/tracers/internal/tracetest/testdata/call_tracer_withLog/tx_partial_failed.json +++ b/eth/tracers/internal/tracetest/testdata/call_tracer_withLog/tx_partial_failed.json @@ -76,7 +76,7 @@ "result": { "beforeEVMTransfers": [ { - "purpose": "purchase of gas for execution of a transaction", + "purpose": "feePayment", "from": "0x01115b41bD2731353dd3e6Abf44818FDc035aAf1", "to": null, "value": "0xe35fa931a0000" @@ -84,38 +84,18 @@ ], "afterEVMTransfers": [ { - "purpose": "refund for unused gas at the end of execution", + "purpose": "gasRefund", "from": null, "to": "0x01115b41bD2731353dd3e6Abf44818FDc035aAf1", "value": "0x268d6662df800" }, { - "purpose": "payment of transaction tip", + "purpose": "tip", "from": null, "to": "0x61C808D82A3Ac53231750daDc13c777b59310bD9", "value": "0xbcd242cec0800" } ], - "balanceChanges": [ - { - "addr": "0x01115b41bD2731353dd3e6Abf44818FDc035aAf1", - "prev": "0x16d99e16e809000", - "new": "0x15f63e6db669000", - "reason": "balance decrease due to purchase of gas for execution of a transaction" - }, - { - "addr": "0x01115b41bD2731353dd3e6Abf44818FDc035aAf1", - "prev": "0x15f63e6db669000", - "new": "0x161ccbd41948800", - "reason": "balance increase due to refund for unused gas at the end of execution" - }, - { - "addr": "0x61C808D82A3Ac53231750daDc13c777b59310bD9", - "prev": "0x6a636960e34bd696f4", - "new": "0x6a63752e0778c29ef4", - "reason": "balance increase due to payment of transaction tip" - } - ], "from": "0x01115b41bd2731353dd3e6abf44818fdc035aaf1", "gas": "0x30d40", "gasUsed": "0x288c9", @@ -147,4 +127,4 @@ "value": "0x0", "type": "CALL" } -} \ No newline at end of file +} diff --git a/eth/tracers/internal/tracetest/testdata/call_tracer_withLog/with_onlyTopCall.json b/eth/tracers/internal/tracetest/testdata/call_tracer_withLog/with_onlyTopCall.json index 4d1e17d27b..50b3b0b276 100644 --- a/eth/tracers/internal/tracetest/testdata/call_tracer_withLog/with_onlyTopCall.json +++ b/eth/tracers/internal/tracetest/testdata/call_tracer_withLog/with_onlyTopCall.json @@ -79,7 +79,7 @@ "result": { "beforeEVMTransfers": [ { - "purpose": "purchase of gas for execution of a transaction", + "purpose": "feePayment", "from": "0x4F5777744b500616697CB655DCb02ee6CD51DeB5", "to": null, "value": "0x21c166071e51e6" @@ -87,50 +87,18 @@ ], "afterEVMTransfers": [ { - "purpose": "refund for unused gas at the end of execution", + "purpose": "gasRefund", "from": null, "to": "0x4F5777744b500616697CB655DCb02ee6CD51DeB5", "value": "0x1026111b8570c0" }, { - "purpose": "payment of transaction tip", + "purpose": "tip", "from": null, "to": "0xf8b483DbA2c3B7176a3Da549ad41A48BB3121069", "value": "0x119b54eb98e126" } ], - "balanceChanges": [ - { - "addr": "0x4F5777744b500616697CB655DCb02ee6CD51DeB5", - "prev": "0xb0983f1b83eec290", - "new": "0xb0767db57cd070aa", - "reason": "balance decrease due to purchase of gas for execution of a transaction" - }, - { - "addr": "0x4F5777744b500616697CB655DCb02ee6CD51DeB5", - "prev": "0xb0767db57cd070aa", - "new": "0x25af5ab0f2e870aa", - "reason": "balance decrease due to transfer via a call" - }, - { - "addr": "0x200Edd17F30485A8735878661960Cd7a9A95733F", - "prev": "0x0", - "new": "0x8ac7230489e80000", - "reason": "balance increase due to transfer via a call" - }, - { - "addr": "0x4F5777744b500616697CB655DCb02ee6CD51DeB5", - "prev": "0x25af5ab0f2e870aa", - "new": "0x25bf80c20e6de16a", - "reason": "balance increase due to refund for unused gas at the end of execution" - }, - { - "addr": "0xf8b483DbA2c3B7176a3Da549ad41A48BB3121069", - "prev": "0x16969a0ba2c2d384d07", - "new": "0x16969b2558118d12e2d", - "reason": "balance increase due to payment of transaction tip" - } - ], "from": "0x4f5777744b500616697cb655dcb02ee6cd51deb5", "gas": "0x33085", "gasUsed": "0x1a9e5", @@ -140,4 +108,4 @@ "value": "0x8ac7230489e80000", "type": "CALL" } -} \ No newline at end of file +} diff --git a/eth/tracers/js/tracer_arbitrum.go b/eth/tracers/js/tracer_arbitrum.go index 5bf0fd4bb6..8d0a70e848 100644 --- a/eth/tracers/js/tracer_arbitrum.go +++ b/eth/tracers/js/tracer_arbitrum.go @@ -46,7 +46,7 @@ func (jst *jsTracer) CaptureArbitrumTransfer( transfer.Set("value", value) transfer.Set("before", before) - transfer.Set("purpose", reason.String(nil, nil)) + transfer.Set("purpose", reason.String()) if _, err := traceTransfer(transfer); err != nil { jst.err = wrapError("captureArbitrumTransfer", err) @@ -81,7 +81,7 @@ func (jst *jsTracer) OnBalanceChange(addr common.Address, prev, new *big.Int, re balanceChange.Set("addr", addr.String()) balanceChange.Set("prev", prev) balanceChange.Set("new", new) - balanceChange.Set("reason", reason.String(prev, new)) + balanceChange.Set("reason", reason.String()) if _, err := traceBalanceChange(jst.obj, balanceChange); err != nil { jst.err = wrapError("onBalanceChange", err) diff --git a/eth/tracers/native/call.go b/eth/tracers/native/call.go index 0bb08049e5..05690c3aa4 100644 --- a/eth/tracers/native/call.go +++ b/eth/tracers/native/call.go @@ -50,7 +50,6 @@ type callFrame struct { // Arbitrum: we add these here due to the tracer returning the top frame BeforeEVMTransfers *[]arbitrumTransfer `json:"beforeEVMTransfers,omitempty"` AfterEVMTransfers *[]arbitrumTransfer `json:"afterEVMTransfers,omitempty"` - BalanceChanges *[]balanceChange `json:"balanceChanges,omitempty"` Type vm.OpCode `json:"-"` From common.Address `json:"from"` @@ -115,9 +114,6 @@ type callTracer struct { beforeEVMTransfers []arbitrumTransfer afterEVMTransfers []arbitrumTransfer - // Arbitrum: capture balance changes - balanceChanges []balanceChange - callstack []callFrame config callTracerConfig gasLimit uint64 @@ -145,7 +141,6 @@ func newCallTracer(ctx *tracers.Context, cfg json.RawMessage) (*tracers.Tracer, OnEnter: t.OnEnter, OnExit: t.OnExit, OnLog: t.OnLog, - OnBalanceChange: t.OnBalanceChange, CaptureArbitrumTransfer: t.CaptureArbitrumTransfer, }, GetResult: t.GetResult, @@ -165,7 +160,6 @@ func newCallTracerObject(ctx *tracers.Context, cfg json.RawMessage) (*callTracer return &callTracer{ beforeEVMTransfers: []arbitrumTransfer{}, afterEVMTransfers: []arbitrumTransfer{}, - balanceChanges: []balanceChange{}, callstack: make([]callFrame, 0, 1), config: config, }, nil @@ -281,7 +275,6 @@ func (t *callTracer) GetResult() (json.RawMessage, error) { call := t.callstack[0] call.BeforeEVMTransfers = &t.beforeEVMTransfers call.AfterEVMTransfers = &t.afterEVMTransfers - call.BalanceChanges = &t.balanceChanges res, err := json.Marshal(call) if err != nil { diff --git a/eth/tracers/native/call_flat.go b/eth/tracers/native/call_flat.go index 6eeaedbec0..45f81cf1c1 100644 --- a/eth/tracers/native/call_flat.go +++ b/eth/tracers/native/call_flat.go @@ -63,7 +63,6 @@ type flatCallFrame struct { // Arbitrum: we add these here due to the tracer returning the top frame BeforeEVMTransfers *[]arbitrumTransfer `json:"beforeEVMTransfers,omitempty"` AfterEVMTransfers *[]arbitrumTransfer `json:"afterEVMTransfers,omitempty"` - BalanceChanges *[]balanceChange `json:"balanceChanges,omitempty"` Action flatCallAction `json:"action"` BlockHash *common.Hash `json:"blockHash"` @@ -121,9 +120,6 @@ type flatCallTracer struct { beforeEVMTransfers []arbitrumTransfer afterEVMTransfers []arbitrumTransfer - // Arbitrum: capture balance changes - balanceChanges []balanceChange - tracer *callTracer config flatCallTracerConfig ctx *tracers.Context // Holds tracer context data @@ -159,7 +155,6 @@ func newFlatCallTracer(ctx *tracers.Context, cfg json.RawMessage) (*tracers.Trac OnTxEnd: ft.OnTxEnd, OnEnter: ft.OnEnter, OnExit: ft.OnExit, - OnBalanceChange: ft.OnBalanceChange, CaptureArbitrumTransfer: ft.CaptureArbitrumTransfer, }, Stop: ft.Stop, @@ -229,7 +224,6 @@ func (t *flatCallTracer) GetResult() (json.RawMessage, error) { call := t.tracer.callstack[0] call.BeforeEVMTransfers = &t.beforeEVMTransfers call.AfterEVMTransfers = &t.afterEVMTransfers - call.BalanceChanges = &t.balanceChanges flat, err := flatFromNested(&call, []int{}, t.config.ConvertParityErrors, t.ctx) if err != nil { @@ -269,7 +263,6 @@ func flatFromNested(input *callFrame, traceAddress []int, convertErrs bool, ctx frame.BeforeEVMTransfers = input.BeforeEVMTransfers frame.AfterEVMTransfers = input.AfterEVMTransfers - frame.BalanceChanges = input.BalanceChanges frame.TraceAddress = traceAddress frame.Error = input.Error frame.Subtraces = len(input.Calls) diff --git a/eth/tracers/native/gen_callframe_json.go b/eth/tracers/native/gen_callframe_json.go index 2df0d730ff..ceb652b32e 100644 --- a/eth/tracers/native/gen_callframe_json.go +++ b/eth/tracers/native/gen_callframe_json.go @@ -18,7 +18,6 @@ func (c callFrame) MarshalJSON() ([]byte, error) { type callFrame0 struct { BeforeEVMTransfers *[]arbitrumTransfer `json:"beforeEVMTransfers,omitempty"` AfterEVMTransfers *[]arbitrumTransfer `json:"afterEVMTransfers,omitempty"` - BalanceChanges *[]balanceChange `json:"balanceChanges,omitempty"` Type vm.OpCode `json:"-"` From common.Address `json:"from"` Gas hexutil.Uint64 `json:"gas"` @@ -36,7 +35,6 @@ func (c callFrame) MarshalJSON() ([]byte, error) { var enc callFrame0 enc.BeforeEVMTransfers = c.BeforeEVMTransfers enc.AfterEVMTransfers = c.AfterEVMTransfers - enc.BalanceChanges = c.BalanceChanges enc.Type = c.Type enc.From = c.From enc.Gas = hexutil.Uint64(c.Gas) @@ -58,7 +56,6 @@ func (c *callFrame) UnmarshalJSON(input []byte) error { type callFrame0 struct { BeforeEVMTransfers *[]arbitrumTransfer `json:"beforeEVMTransfers,omitempty"` AfterEVMTransfers *[]arbitrumTransfer `json:"afterEVMTransfers,omitempty"` - BalanceChanges *[]balanceChange `json:"balanceChanges,omitempty"` Type *vm.OpCode `json:"-"` From *common.Address `json:"from"` Gas *hexutil.Uint64 `json:"gas"` @@ -82,9 +79,6 @@ func (c *callFrame) UnmarshalJSON(input []byte) error { if dec.AfterEVMTransfers != nil { c.AfterEVMTransfers = dec.AfterEVMTransfers } - if dec.BalanceChanges != nil { - c.BalanceChanges = dec.BalanceChanges - } if dec.Type != nil { c.Type = *dec.Type } diff --git a/eth/tracers/native/tracer_arbitrum.go b/eth/tracers/native/tracer_arbitrum.go index 3a44d51830..a858dfe732 100644 --- a/eth/tracers/native/tracer_arbitrum.go +++ b/eth/tracers/native/tracer_arbitrum.go @@ -32,7 +32,7 @@ type arbitrumTransfer struct { func (t *callTracer) CaptureArbitrumTransfer(from, to *common.Address, value *big.Int, before bool, reason tracing.BalanceChangeReason) { transfer := arbitrumTransfer{ - Purpose: reason.String(nil, nil), + Purpose: reason.String(), Value: bigToHex(value), } if from != nil { @@ -55,7 +55,7 @@ func (t *flatCallTracer) CaptureArbitrumTransfer(from, to *common.Address, value return } transfer := arbitrumTransfer{ - Purpose: reason.String(nil, nil), + Purpose: reason.String(), Value: bigToHex(value), } if from != nil { @@ -73,34 +73,6 @@ func (t *flatCallTracer) CaptureArbitrumTransfer(from, to *common.Address, value } } -type balanceChange struct { - Addr string `json:"addr"` - Prev string `json:"prev"` - New string `json:"new"` - Reason string `json:"reason"` -} - -func (t *callTracer) OnBalanceChange(addr common.Address, prev, new *big.Int, reason tracing.BalanceChangeReason) { - t.balanceChanges = append(t.balanceChanges, balanceChange{ - Addr: addr.String(), - Prev: bigToHex(prev), - New: bigToHex(new), - Reason: reason.String(prev, new), - }) -} - -func (t *flatCallTracer) OnBalanceChange(addr common.Address, prev, new *big.Int, reason tracing.BalanceChangeReason) { - if t.interrupt.Load() { - return - } - t.balanceChanges = append(t.balanceChanges, balanceChange{ - Addr: addr.String(), - Prev: bigToHex(prev), - New: bigToHex(new), - Reason: reason.String(prev, new), - }) -} - func bigToHex(n *big.Int) string { if n == nil { return ""