mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-25 22:26:42 +00:00
More suicide withdraw logging to understand the problem
This commit is contained in:
parent
713f67421e
commit
32f4d962ee
2 changed files with 5 additions and 2 deletions
|
|
@ -896,13 +896,15 @@ func (s *StateDB) SelfDestruct(addr common.Address) uint256.Int {
|
||||||
|
|
||||||
prevBalance = *(stateObject.Balance())
|
prevBalance = *(stateObject.Balance())
|
||||||
|
|
||||||
|
fmt.Fprintf(os.Stderr, "[Firehose] SelfDestruct (statedb): Firehose 2.3 would have called RecordSuicide here (addr=%s, prevBalance=%s, sign=%d)\n", addr, &prevBalance, prevBalance.ToBig().Sign())
|
||||||
|
|
||||||
// Regardless of whether it is already destructed or not, we do have to
|
// Regardless of whether it is already destructed or not, we do have to
|
||||||
// journal the balance-change, if we set it to zero here.
|
// journal the balance-change, if we set it to zero here.
|
||||||
if !stateObject.Balance().IsZero() {
|
if !stateObject.Balance().IsZero() {
|
||||||
fmt.Fprintf(os.Stderr, "[Firehose] SelfDestruct: previous balance is non-zero (addr=%s)\n", addr)
|
fmt.Fprintf(os.Stderr, "[Firehose] SelfDestruct (statedb): previous balance is non-zero (addr=%s)\n", addr)
|
||||||
stateObject.SetBalance(new(uint256.Int))
|
stateObject.SetBalance(new(uint256.Int))
|
||||||
} else {
|
} else {
|
||||||
fmt.Fprintf(os.Stderr, "[Firehose] SelfDestruct: previous balance is zero! (addr=%s)\n", addr)
|
fmt.Fprintf(os.Stderr, "[Firehose] SelfDestruct (statedb): previous balance is zero! (addr=%s)\n", addr)
|
||||||
}
|
}
|
||||||
// If it is already marked as self-destructed, we do not need to add it
|
// If it is already marked as self-destructed, we do not need to add it
|
||||||
// for journalling a second time.
|
// for journalling a second time.
|
||||||
|
|
|
||||||
|
|
@ -1013,6 +1013,7 @@ func opSelfdestruct6780(pc *uint64, interpreter *EVMInterpreter, scope *ScopeCon
|
||||||
balance := interpreter.evm.StateDB.GetBalance(scope.Contract.Address())
|
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)
|
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.SubBalance(scope.Contract.Address(), balance, tracing.BalanceDecreaseSelfdestruct)
|
||||||
|
fmt.Fprintf(os.Stderr, "[Firehose] SelfDestruct6780 (instructions): previous balance refund (addr=%s, refund=%s)\n", common.Address(beneficiary.Bytes20()), balance)
|
||||||
interpreter.evm.StateDB.AddBalance(beneficiary.Bytes20(), balance, tracing.BalanceIncreaseSelfdestruct)
|
interpreter.evm.StateDB.AddBalance(beneficiary.Bytes20(), balance, tracing.BalanceIncreaseSelfdestruct)
|
||||||
interpreter.evm.StateDB.SelfDestruct6780(scope.Contract.Address())
|
interpreter.evm.StateDB.SelfDestruct6780(scope.Contract.Address())
|
||||||
if tracer := interpreter.evm.Config.Tracer; tracer != nil {
|
if tracer := interpreter.evm.Config.Tracer; tracer != nil {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue