aboutsummaryrefslogtreecommitdiffstats
path: root/eth
diff options
context:
space:
mode:
authorJeffrey Wilcke <geffobscura@gmail.com>2016-06-13 17:56:42 +0800
committerPéter Szilágyi <peterke@gmail.com>2016-06-14 22:12:05 +0800
commitf7fdfa4eace4f0ab1dd820398efa0f2f44bd1eca (patch)
tree724bbf0bbf7164e6279f9a8fdc4b8b6f5270ffdd /eth
parent0405f728c632b99ad6b755ff68019c6ae7ab0cec (diff)
downloadgo-tangerine-f7fdfa4eace4f0ab1dd820398efa0f2f44bd1eca.tar
go-tangerine-f7fdfa4eace4f0ab1dd820398efa0f2f44bd1eca.tar.gz
go-tangerine-f7fdfa4eace4f0ab1dd820398efa0f2f44bd1eca.tar.bz2
go-tangerine-f7fdfa4eace4f0ab1dd820398efa0f2f44bd1eca.tar.lz
go-tangerine-f7fdfa4eace4f0ab1dd820398efa0f2f44bd1eca.tar.xz
go-tangerine-f7fdfa4eace4f0ab1dd820398efa0f2f44bd1eca.tar.zst
go-tangerine-f7fdfa4eace4f0ab1dd820398efa0f2f44bd1eca.zip
[release/1.4.7] core/state, eth: Updated suicides objects when tracing transactions
Consensus rules dictate that objects can only be removed during the finalisation of the transaction (i.e. after all calls have finished). Thus calling a suicided contract twice from the same transaction: A->B(S)->ret(A)->B(S) results in 2 suicides. Calling the suicided object twice from two transactions: A->B(S), A->B, results in only one suicide and a call to an empty object. Our current debug tracing functionality replays all transaction that were executed prior to the targetted transaction in order to provide the user with an accurate trace. As a side effect to calling StateDB.IntermediateRoot it also deletes any suicides objects. Our tracing code never calls this function because it isn't interested in the intermediate root. Becasue of this it caused a bug in the tracing code where transactions that were send to priviously deleted objects resulted in two suicides rather than one suicide and a call to an empty object. Fixes #2542 (cherry picked from commit bb3651abc865c6f6babec0d357afa85f5a539d83)
Diffstat (limited to 'eth')
-rw-r--r--eth/api.go1
1 files changed, 1 insertions, 0 deletions
diff --git a/eth/api.go b/eth/api.go
index f5f942c27..a2be81428 100644
--- a/eth/api.go
+++ b/eth/api.go
@@ -1876,6 +1876,7 @@ func (api *PrivateDebugAPI) TraceTransaction(txHash common.Hash, logger *vm.LogC
if err != nil {
return nil, fmt.Errorf("mutation failed: %v", err)
}
+ stateDb.DeleteSuicides()
continue
}
// Otherwise trace the transaction and return