forked from cerc-io/laconicd-deprecated
evm: prepare access list in eth_call
(#348)
Closes: #335 Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com>
This commit is contained in:
parent
df13b398ec
commit
353455def9
@ -74,7 +74,6 @@ func NewAnteHandler(
|
|||||||
NewEthNonceVerificationDecorator(ak),
|
NewEthNonceVerificationDecorator(ak),
|
||||||
NewEthGasConsumeDecorator(ak, bankKeeper, evmKeeper),
|
NewEthGasConsumeDecorator(ak, bankKeeper, evmKeeper),
|
||||||
NewCanTransferDecorator(evmKeeper),
|
NewCanTransferDecorator(evmKeeper),
|
||||||
NewAccessListDecorator(evmKeeper),
|
|
||||||
NewEthIncrementSenderSequenceDecorator(ak), // innermost AnteDecorator.
|
NewEthIncrementSenderSequenceDecorator(ak), // innermost AnteDecorator.
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -242,6 +242,12 @@ func (k *Keeper) ApplyMessage(evm *vm.EVM, msg core.Message, cfg *params.ChainCo
|
|||||||
}
|
}
|
||||||
leftoverGas := msg.Gas() - intrinsicGas
|
leftoverGas := msg.Gas() - intrinsicGas
|
||||||
|
|
||||||
|
// access list preparaion is moved from ante handler to here, because it's needed when `ApplyMessage` is called
|
||||||
|
// under contexts where ante handlers are not run, for example `eth_call` and `eth_estimateGas`.
|
||||||
|
if rules := cfg.Rules(big.NewInt(k.Ctx().BlockHeight())); rules.IsBerlin {
|
||||||
|
k.PrepareAccessList(msg.From(), msg.To(), vm.ActivePrecompiles(rules), msg.AccessList())
|
||||||
|
}
|
||||||
|
|
||||||
if contractCreation {
|
if contractCreation {
|
||||||
ret, _, leftoverGas, vmErr = evm.Create(sender, msg.Data(), leftoverGas, msg.Value())
|
ret, _, leftoverGas, vmErr = evm.Create(sender, msg.Data(), leftoverGas, msg.Value())
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user