mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-06-19 13:21:37 +00:00
core: remove LogsForBurnAccounts and burn balance tracing per EIP-8246
This commit is contained in:
parent
82b85ad317
commit
16ee2ef1fc
3 changed files with 2 additions and 12 deletions
|
|
@ -230,10 +230,6 @@ func (s *hookedStateDB) AddLog(log *types.Log) {
|
|||
}
|
||||
}
|
||||
|
||||
func (s *hookedStateDB) LogsForBurnAccounts() []*types.Log {
|
||||
return s.inner.LogsForBurnAccounts()
|
||||
}
|
||||
|
||||
func (s *hookedStateDB) Finalise(deleteEmptyObjects bool) *bal.ConstructionBlockAccessList {
|
||||
if s.hooks.OnBalanceChange == nil && s.hooks.OnNonceChangeV2 == nil && s.hooks.OnNonceChange == nil && s.hooks.OnCodeChangeV2 == nil && s.hooks.OnCodeChange == nil {
|
||||
// Short circuit if no relevant hooks are set.
|
||||
|
|
@ -261,7 +257,8 @@ func (s *hookedStateDB) Finalise(deleteEmptyObjects bool) *bal.ConstructionBlock
|
|||
// Bingo: state object was self-destructed, call relevant hooks.
|
||||
|
||||
// If ether was sent to account post-selfdestruct, record as burnt.
|
||||
if s.hooks.OnBalanceChange != nil {
|
||||
// EIP-8246: balance is preserved, skip the burn trace.
|
||||
if s.hooks.OnBalanceChange != nil && s.inner.stateAccessList == nil {
|
||||
if bal := obj.Balance(); bal.Sign() != 0 {
|
||||
s.hooks.OnBalanceChange(addr, bal.ToBig(), new(big.Int), tracing.BalanceDecreaseSelfdestructBurn)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -744,12 +744,6 @@ func (st *stateTransition) execute() (*ExecutionResult, error) {
|
|||
}
|
||||
}
|
||||
|
||||
// EIP-7708: Emit the ETH-burn logs
|
||||
if rules.IsAmsterdam {
|
||||
for _, log := range st.evm.StateDB.LogsForBurnAccounts() {
|
||||
st.evm.StateDB.AddLog(log)
|
||||
}
|
||||
}
|
||||
return &ExecutionResult{
|
||||
UsedGas: gasUsed,
|
||||
MaxUsedGas: peakUsed,
|
||||
|
|
|
|||
|
|
@ -90,7 +90,6 @@ type StateDB interface {
|
|||
Snapshot() int
|
||||
|
||||
AddLog(*types.Log)
|
||||
LogsForBurnAccounts() []*types.Log
|
||||
AddPreimage(common.Hash, []byte)
|
||||
|
||||
Witness() *stateless.Witness
|
||||
|
|
|
|||
Loading…
Reference in a new issue