diff --git a/core/state/statedb.go b/core/state/statedb.go index c5e3a4b91f..2633ef4ee4 100644 --- a/core/state/statedb.go +++ b/core/state/statedb.go @@ -887,8 +887,6 @@ func (s *StateDB) SetStorage(addr common.Address, storage map[common.Hash]common // The account's state object is still available until the state is committed, // getStateObject will return a non-nil account after SelfDestruct. func (s *StateDB) SelfDestruct(addr common.Address) uint256.Int { - fmt.Fprintf(os.Stderr, "[Firehose] SelfDestruct called (addr=%s)\n", addr) - stateObject := s.getStateObject(addr) var prevBalance uint256.Int if stateObject == nil { @@ -918,8 +916,6 @@ func (s *StateDB) SelfDestruct(addr common.Address) uint256.Int { } func (s *StateDB) SelfDestruct6780(addr common.Address) (uint256.Int, bool) { - fmt.Fprintf(os.Stderr, "[Firehose] SelfDestruct6780 called (addr=%s)\n", addr) - stateObject := s.getStateObject(addr) if stateObject == nil { fmt.Fprintf(os.Stderr, "[Firehose] SelfDestruct6780: stateObject is nil (addr=%s)\n", addr) diff --git a/core/state/statedb_hooked.go b/core/state/statedb_hooked.go index d69e65d8f2..647ca6ffe3 100644 --- a/core/state/statedb_hooked.go +++ b/core/state/statedb_hooked.go @@ -17,7 +17,9 @@ package state import ( + "fmt" "math/big" + "os" "time" "github.com/ethereum/go-ethereum/common" @@ -257,6 +259,7 @@ func (s *hookedStateDB) SelfDestruct6780(address common.Address) (uint256.Int, b prev, changed := s.inner.SelfDestruct6780(address) if s.hooks.OnBalanceChange != nil && changed && !prev.IsZero() { + fmt.Fprintf(os.Stderr, "[Firehose] SelfDestruct6780 (hooked): previous balance withdraw (addr=%s, prev_balance=%s)\n", address, &prev) s.hooks.OnBalanceChange(address, prev.ToBig(), new(big.Int), tracing.BalanceDecreaseSelfdestruct) } diff --git a/core/vm/instructions.go b/core/vm/instructions.go index bbb5cedc34..3e996bd32d 100644 --- a/core/vm/instructions.go +++ b/core/vm/instructions.go @@ -17,7 +17,9 @@ package vm import ( + "fmt" "math" + "os" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/tracing" @@ -1009,6 +1011,7 @@ func opSelfdestruct6780(pc *uint64, interpreter *EVMInterpreter, scope *ScopeCon } beneficiary := scope.Stack.pop() balance := interpreter.evm.StateDB.GetBalance(scope.Contract.Address()) + fmt.Fprintf(os.Stderr, "[Firehose] SelfDestruct6780 (instructions): previous balance withdraw (addr=%s, prev_balance=%s)\n", scope.Contract.Address(), balance) interpreter.evm.StateDB.SubBalance(scope.Contract.Address(), balance, tracing.BalanceDecreaseSelfdestruct) interpreter.evm.StateDB.AddBalance(beneficiary.Bytes20(), balance, tracing.BalanceIncreaseSelfdestruct) interpreter.evm.StateDB.SelfDestruct6780(scope.Contract.Address())