Skip to content

Commit

Permalink
prepare access list in eth_call
Browse files Browse the repository at this point in the history
Closes: #335
  • Loading branch information
yihuang committed Aug 16, 2021
1 parent df13b39 commit 877f217
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 0 additions & 1 deletion app/ante/ante.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ func NewAnteHandler(
NewEthNonceVerificationDecorator(ak),
NewEthGasConsumeDecorator(ak, bankKeeper, evmKeeper),
NewCanTransferDecorator(evmKeeper),
NewAccessListDecorator(evmKeeper),
NewEthIncrementSenderSequenceDecorator(ak), // innermost AnteDecorator.
)

Expand Down
4 changes: 4 additions & 0 deletions x/evm/keeper/state_transition.go
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,10 @@ func (k *Keeper) ApplyMessage(evm *vm.EVM, msg core.Message, cfg *params.ChainCo
}
leftoverGas := msg.Gas() - intrinsicGas

if rules := cfg.Rules(big.NewInt(k.ctx.BlockHeight())); rules.IsBerlin {
k.PrepareAccessList(msg.From(), msg.To(), vm.ActivePrecompiles(rules), msg.AccessList())
}

if contractCreation {
ret, _, leftoverGas, vmErr = evm.Create(sender, msg.Data(), leftoverGas, msg.Value())
} else {
Expand Down

0 comments on commit 877f217

Please sign in to comment.