From 26c91e6dc5d3d1dc76939aee369ac2e33bcf54c2 Mon Sep 17 00:00:00 2001 From: codchen Date: Tue, 11 Jun 2024 05:21:24 +0800 Subject: [PATCH] rebase --- x/evm/keeper/msg_server.go | 4 ++-- x/evm/state/accesslist.go | 6 ------ 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/x/evm/keeper/msg_server.go b/x/evm/keeper/msg_server.go index f5f28ed30..e860a63d6 100644 --- a/x/evm/keeper/msg_server.go +++ b/x/evm/keeper/msg_server.go @@ -61,9 +61,9 @@ func (server msgServer) EVMTransaction(goCtx context.Context, msg *types.MsgEVMT gp := server.GetGasPool() defer func() { + defer stateDB.Cleanup() if pe := recover(); pe != nil { - stateDB.Cleanup() - // there is not supposed to be any panic (except from OCC) + // there is not supposed to be any panic debug.PrintStack() ctx.Logger().Error(fmt.Sprintf("EVM PANIC: %s", pe)) telemetry.IncrCounter(1, types.ModuleName, "panics") diff --git a/x/evm/state/accesslist.go b/x/evm/state/accesslist.go index c09399d16..f3c558e01 100644 --- a/x/evm/state/accesslist.go +++ b/x/evm/state/accesslist.go @@ -56,7 +56,6 @@ func (s *DBImpl) SlotInAccessList(addr common.Address, slot common.Hash) (addres func (s *DBImpl) AddAddressToAccessList(addr common.Address) { s.k.PrepareReplayedAddr(s.ctx, addr) al := s.getCurrentAccessList() - defer s.saveAccessList(al) if _, present := al.Addresses[addr]; present { return } @@ -66,7 +65,6 @@ func (s *DBImpl) AddAddressToAccessList(addr common.Address) { func (s *DBImpl) AddSlotToAccessList(addr common.Address, slot common.Hash) { s.k.PrepareReplayedAddr(s.ctx, addr) al := s.getCurrentAccessList() - defer s.saveAccessList(al) idx, addrPresent := al.Addresses[addr] if !addrPresent || idx == -1 { // Address not present, or addr present but no slots there @@ -113,7 +111,3 @@ func (s *DBImpl) Prepare(_ params.Rules, sender, coinbase common.Address, dest * func (s *DBImpl) getCurrentAccessList() *accessList { return s.tempStateCurrent.transientAccessLists } - -func (s *DBImpl) saveAccessList(al *accessList) { - // s.tempStateCurrent.transientAccessLists = al -}