Skip to content

Commit

Permalink
remove precompile check for newAccount
Browse files Browse the repository at this point in the history
  • Loading branch information
dhyaniarun1993 committed Feb 13, 2024
1 parent e3855f6 commit 45af942
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 20 deletions.
3 changes: 0 additions & 3 deletions core/blockchain.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,6 @@ func ExecuteBlockEphemerally(
ibs.SetLogger(bcLogger)
header := block.Header()

rules := chainConfig.Rules(block.NumberU64(), block.Time())
ibs.PrepareBlock(vm.ActivePrecompiles(rules))

usedGas := new(uint64)
usedBlobGas := new(uint64)
gp := new(GasPool)
Expand Down
18 changes: 1 addition & 17 deletions core/state/intra_block_state.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,6 @@ type IntraBlockState struct {
// Transient storage
transientStorage transientStorage

// Enabled precompile contracts
precompiles map[libcommon.Address]struct{}

// Journal of state modifications. This is the backbone of
// Snapshot and RevertToSnapshot.
journal *journal
Expand All @@ -119,7 +116,6 @@ func New(stateReader StateReader) *IntraBlockState {
stateObjectsDirty: map[libcommon.Address]struct{}{},
nilAccounts: map[libcommon.Address]struct{}{},
logs: map[libcommon.Hash][]*types.Log{},
precompiles: make(map[libcommon.Address]struct{}),
journal: newJournal(),
accessList: newAccessList(),
transientStorage: newTransientStorage(),
Expand Down Expand Up @@ -557,11 +553,7 @@ func (sdb *IntraBlockState) createObject(addr libcommon.Address, previous *state
var original *accounts.Account

if sdb.logger != nil {
// Precompiled contracts are touched during a call.
// Make sure we avoid emitting a new account event for them.
if _, ok := sdb.precompiles[addr]; !ok {
sdb.logger.OnNewAccount(addr, previous != nil)
}
sdb.logger.OnNewAccount(addr, previous != nil)
}

if previous == nil {
Expand Down Expand Up @@ -845,14 +837,6 @@ func (sdb *IntraBlockState) Prepare(rules *chain.Rules, sender, coinbase libcomm
sdb.transientStorage = newTransientStorage()
}

// PrepareBlock prepares the statedb for execution of a block. It tracks
// the addresses of enabled precompiles for debugging purposes.
func (sdb *IntraBlockState) PrepareBlock(precompiles []libcommon.Address) {
for _, addr := range precompiles {
sdb.precompiles[addr] = struct{}{}
}
}

// AddAddressToAccessList adds the given address to the access list
func (sdb *IntraBlockState) AddAddressToAccessList(addr libcommon.Address) (addrMod bool) {
addrMod = sdb.accessList.AddAddress(addr)
Expand Down

0 comments on commit 45af942

Please sign in to comment.