From d57ab7da95759e2a5f6d6824eeb4dd068db612e8 Mon Sep 17 00:00:00 2001 From: codchen Date: Wed, 31 Jul 2024 00:00:43 +0800 Subject: [PATCH] Do not charge gas for feecollector address query (#1795) Do not charge cache for feecollector address query --- x/evm/keeper/coinbase.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/x/evm/keeper/coinbase.go b/x/evm/keeper/coinbase.go index 378f4b9ca8..39115f3bd3 100644 --- a/x/evm/keeper/coinbase.go +++ b/x/evm/keeper/coinbase.go @@ -20,7 +20,8 @@ func (k *Keeper) GetFeeCollectorAddress(ctx sdk.Context) (common.Address, error) return *cache, nil } moduleAddr := k.accountKeeper.GetModuleAddress(authtypes.FeeCollectorName) - evmAddr, ok := k.GetEVMAddress(ctx, moduleAddr) + // we don't want to charge gas for this query, since it could cause non-determinism + evmAddr, ok := k.GetEVMAddress(ctx.WithGasMeter(sdk.NewInfiniteGasMeterWithMultiplier(ctx)), moduleAddr) if !ok { return common.Address{}, errors.New("fee collector's EVM address not found") }