mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-27 23:26:44 +00:00
Fixed some small stuff while merging extended-tracer in
This commit is contained in:
parent
35c5b287f0
commit
8545daf9f9
2 changed files with 10 additions and 6 deletions
|
|
@ -485,7 +485,7 @@ func (s *StateDB) SelfDestruct(addr common.Address) {
|
||||||
prev: stateObject.selfDestructed,
|
prev: stateObject.selfDestructed,
|
||||||
prevbalance: prev,
|
prevbalance: prev,
|
||||||
})
|
})
|
||||||
if s.logger != nil {
|
if s.logger != nil && prev.Sign() > 0 {
|
||||||
s.logger.OnBalanceChange(addr, prev, n, BalanceDecreaseSelfdestruct)
|
s.logger.OnBalanceChange(addr, prev, n, BalanceDecreaseSelfdestruct)
|
||||||
}
|
}
|
||||||
stateObject.markSelfdestructed()
|
stateObject.markSelfdestructed()
|
||||||
|
|
|
||||||
|
|
@ -423,10 +423,6 @@ func (f *Firehose) CaptureEnter(typ vm.OpCode, from common.Address, to common.Ad
|
||||||
f.ensureInCall()
|
f.ensureInCall()
|
||||||
f.callStack.Peek().Suicide = true
|
f.callStack.Peek().Suicide = true
|
||||||
|
|
||||||
if value.Sign() != 0 {
|
|
||||||
f.OnBalanceChange(from, value, common.Big0, state.BalanceDecreaseSelfdestruct)
|
|
||||||
}
|
|
||||||
|
|
||||||
// The next CaptureExit must be ignored, this variable will make the next CaptureExit to be ignored
|
// The next CaptureExit must be ignored, this variable will make the next CaptureExit to be ignored
|
||||||
f.latestCallStartSuicided = true
|
f.latestCallStartSuicided = true
|
||||||
return
|
return
|
||||||
|
|
@ -670,6 +666,15 @@ func (f *Firehose) OnBalanceChange(a common.Address, prev, new *big.Int, reason
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Known Firehose issue: It's possible to burn Ether by sending some ether to a suicided account. In those case,
|
||||||
|
// at theend of block producing, StateDB finalize the block by burning ether from the account. This is something
|
||||||
|
// we were not tracking in the old Firehose instrumentation.
|
||||||
|
//
|
||||||
|
// New chain integration should remove this `if` statement all along.
|
||||||
|
if reason == state.BalanceDecreaseSelfdestructBurn {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
f.ensureInBlockOrTrx()
|
f.ensureInBlockOrTrx()
|
||||||
|
|
||||||
change := f.newBalanceChange("tracer", a, prev, new, balanceChangeReasonFromChain(reason))
|
change := f.newBalanceChange("tracer", a, prev, new, balanceChangeReasonFromChain(reason))
|
||||||
|
|
@ -1067,7 +1072,6 @@ func transactionTypeFromChainTxType(txType uint8) pbeth.TransactionTrace_Type {
|
||||||
return pbeth.TransactionTrace_TRX_TYPE_DYNAMIC_FEE
|
return pbeth.TransactionTrace_TRX_TYPE_DYNAMIC_FEE
|
||||||
case types.LegacyTxType:
|
case types.LegacyTxType:
|
||||||
return pbeth.TransactionTrace_TRX_TYPE_LEGACY
|
return pbeth.TransactionTrace_TRX_TYPE_LEGACY
|
||||||
// Add when enabled in a fork
|
|
||||||
// case types.BlobTxType:
|
// case types.BlobTxType:
|
||||||
// return pbeth.TransactionTrace_TRX_TYPE_BLOB
|
// return pbeth.TransactionTrace_TRX_TYPE_BLOB
|
||||||
default:
|
default:
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue