diff --git a/x/evm/ante/fee.go b/x/evm/ante/fee.go index d127a61bdd..7c293ea2c3 100644 --- a/x/evm/ante/fee.go +++ b/x/evm/ante/fee.go @@ -1,6 +1,7 @@ package ante import ( + "math" "math/big" "github.com/ethereum/go-ethereum/consensus/misc/eip4844" @@ -12,7 +13,7 @@ import ( sdkerrors "github.com/sei-protocol/sei-chain/sei-cosmos/types/errors" upgradekeeper "github.com/sei-protocol/sei-chain/sei-cosmos/x/upgrade/keeper" "github.com/sei-protocol/sei-chain/utils" - "github.com/sei-protocol/sei-chain/utils/metrics" + utilmetrics "github.com/sei-protocol/sei-chain/utils/metrics" "github.com/sei-protocol/sei-chain/x/evm/derived" evmkeeper "github.com/sei-protocol/sei-chain/x/evm/keeper" "github.com/sei-protocol/sei-chain/x/evm/state" @@ -127,7 +128,8 @@ func (fc EVMFeeCheckDecorator) getMinimumFee(ctx sdk.Context) *big.Int { func (fc EVMFeeCheckDecorator) CalculatePriority(ctx sdk.Context, txData ethtx.TxData) *big.Int { gp := txData.EffectiveGasPrice(utils.Big0) if !ctx.IsCheckTx() && !ctx.IsReCheckTx() { - metrics.HistogramEvmEffectiveGasPrice(gp) + utilmetrics.HistogramEvmEffectiveGasPrice(gp) // TODO(PLT-330): remove once evm_effective_gas_price verified + evmAnteMetrics.effectiveGasPrice.Record(ctx.Context(), effectiveGasPriceHistogramSample(gp)) } priority := sdk.NewDecFromBigInt(gp).Quo(fc.evmKeeper.GetPriorityNormalizer(ctx)).TruncateInt().BigInt() if priority.Cmp(big.NewInt(antedecorators.MaxPriority)) > 0 { @@ -135,3 +137,20 @@ func (fc EVMFeeCheckDecorator) CalculatePriority(ctx sdk.Context, txData ethtx.T } return priority } + +// effectiveGasPriceHistogramSample converts wei-per-gas to float64 for OTel without calling +// Uint64() on values larger than uint64 (undefined in math/big). Clamps +Inf so histograms +// stay finite. +func effectiveGasPriceHistogramSample(gp *big.Int) float64 { + if gp == nil || gp.Sign() < 0 { + return 0 + } + if gp.IsUint64() { + return float64(gp.Uint64()) + } + f, _ := new(big.Float).SetInt(gp).Float64() + if math.IsInf(f, 1) { + return math.MaxFloat64 + } + return f +} diff --git a/x/evm/ante/metrics.go b/x/evm/ante/metrics.go new file mode 100644 index 0000000000..8c08336236 --- /dev/null +++ b/x/evm/ante/metrics.go @@ -0,0 +1,61 @@ +package ante + +import ( + "go.opentelemetry.io/otel" + "go.opentelemetry.io/otel/metric" +) + +var ( + meter = otel.Meter("evm_ante") + + // evmEffectiveGasPriceBucketBoundaries are explicit histogram upper bounds in wei per gas + // (EIP-1559 effective gas price). Spaced from 1 wei through 100k gwei for useful quantiles. + evmEffectiveGasPriceBucketBoundaries = []float64{ + 1, 10, 100, 1e3, 1e4, 1e5, 1e6, 1e7, 1e8, + 5e8, 1e9, 2e9, 5e9, 1e10, 2e10, 5e10, + 1e11, 2e11, 5e11, 1e12, 5e12, 1e13, 5e13, 1e14, + } + + evmAnteMetrics = struct { + pendingNonce metric.Int64Counter + nonceMismatch metric.Int64Counter + + // Gas price histogram + effectiveGasPrice metric.Float64Histogram + + // Association errors + associationError metric.Int64Counter + }{ + pendingNonce: must(meter.Int64Counter( + "evm_pending_nonce", + metric.WithDescription("EVM pending nonce events by type (added, expired, rejected, accepted)"), + metric.WithUnit("{count}"), + )), + + nonceMismatch: must(meter.Int64Counter( + "evm_nonce_mismatch", + metric.WithDescription("EVM nonce mismatches by cause (too_high, too_low)"), + metric.WithUnit("{count}"), + )), + + effectiveGasPrice: must(meter.Float64Histogram( + "evm_effective_gas_price", + metric.WithDescription("Effective gas price (wei per gas) for EVM transactions"), + metric.WithUnit("{wei}/{gas}"), + metric.WithExplicitBucketBoundaries(evmEffectiveGasPriceBucketBoundaries...), + )), + + associationError: must(meter.Int64Counter( + "evm_ante_association_error", + metric.WithDescription("EVM address association errors by scenario and address type"), + metric.WithUnit("{count}"), + )), + } +) + +func must[V any](v V, err error) V { + if err != nil { + panic(err) + } + return v +} diff --git a/x/evm/ante/preprocess.go b/x/evm/ante/preprocess.go index 4ca9e8a3e6..eb8f13a3c2 100644 --- a/x/evm/ante/preprocess.go +++ b/x/evm/ante/preprocess.go @@ -18,8 +18,11 @@ import ( sdkerrors "github.com/sei-protocol/sei-chain/sei-cosmos/types/errors" accountkeeper "github.com/sei-protocol/sei-chain/sei-cosmos/x/auth/keeper" authsigning "github.com/sei-protocol/sei-chain/sei-cosmos/x/auth/signing" + "go.opentelemetry.io/otel/attribute" + otelmetric "go.opentelemetry.io/otel/metric" + "github.com/sei-protocol/sei-chain/utils" - "github.com/sei-protocol/sei-chain/utils/metrics" + utilmetrics "github.com/sei-protocol/sei-chain/utils/metrics" "github.com/sei-protocol/sei-chain/x/evm/derived" evmkeeper "github.com/sei-protocol/sei-chain/x/evm/keeper" evmtypes "github.com/sei-protocol/sei-chain/x/evm/types" @@ -77,7 +80,9 @@ func (p *EVMPreprocessDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate } else if isAssociateTx { // check if the account has enough balance (without charging) if !p.IsAccountBalancePositive(ctx, seiAddr, evmAddr) { - metrics.IncrementAssociationError("associate_tx_insufficient_funds", evmtypes.NewAssociationMissingErr(seiAddr.String())) + assocErr := evmtypes.NewAssociationMissingErr(seiAddr.String()) + utilmetrics.IncrementAssociationError("associate_tx_insufficient_funds", assocErr) // TODO(PLT-330): remove once evm_association_error_total verified + evmAnteMetrics.associationError.Add(ctx.Context(), 1, otelmetric.WithAttributes(attribute.String("scenario", "associate_tx_insufficient_funds"), attribute.String("type", assocErr.AddressType()))) return ctx, sdkerrors.Wrap(sdkerrors.ErrInsufficientFunds, "account needs to have at least 1 wei to force association") } if err := associateHelper.AssociateAddresses(ctx, seiAddr, evmAddr, pubkey, false); err != nil { diff --git a/x/evm/ante/sig.go b/x/evm/ante/sig.go index a6b3ca1ab9..c963be331c 100644 --- a/x/evm/ante/sig.go +++ b/x/evm/ante/sig.go @@ -8,7 +8,10 @@ import ( sdkerrors "github.com/sei-protocol/sei-chain/sei-cosmos/types/errors" "github.com/sei-protocol/seilog" - "github.com/sei-protocol/sei-chain/utils/metrics" + "go.opentelemetry.io/otel/attribute" + otelmetric "go.opentelemetry.io/otel/metric" + + utilmetrics "github.com/sei-protocol/sei-chain/utils/metrics" evmkeeper "github.com/sei-protocol/sei-chain/x/evm/keeper" "github.com/sei-protocol/sei-chain/x/evm/types" ) @@ -70,7 +73,9 @@ func (svd *EVMSigVerifyDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulat } ctx = ctx.WithEVMRequiredBalance(fee) } else if txNonce != nextNonce { - metrics.IncrementNonceMismatch(txNonce > nextNonce) + tooHigh := txNonce > nextNonce + utilmetrics.IncrementNonceMismatch(tooHigh) // TODO(PLT-330): remove once evm_nonce_mismatch_total verified + evmAnteMetrics.nonceMismatch.Add(ctx.Context(), 1, otelmetric.WithAttributes(attribute.Bool("too_high", tooHigh))) return ctx, sdkerrors.ErrWrongSequence } diff --git a/x/evm/keeper/abci.go b/x/evm/keeper/abci.go index 60e950f83b..c52215aae7 100644 --- a/x/evm/keeper/abci.go +++ b/x/evm/keeper/abci.go @@ -14,13 +14,17 @@ import ( authtypes "github.com/sei-protocol/sei-chain/sei-cosmos/x/auth/types" abci "github.com/sei-protocol/sei-chain/sei-tendermint/abci/types" "github.com/sei-protocol/sei-chain/utils" - "github.com/sei-protocol/sei-chain/utils/metrics" + utilmetrics "github.com/sei-protocol/sei-chain/utils/metrics" "github.com/sei-protocol/sei-chain/x/evm/state" "github.com/sei-protocol/sei-chain/x/evm/types" ) func (k *Keeper) BeginBlock(ctx sdk.Context) { - defer telemetry.ModuleMeasureSince(types.ModuleName, time.Now(), telemetry.MetricKeyBeginBlocker) + beginBlockerStart := time.Now() + defer func() { + telemetry.ModuleMeasureSince(types.ModuleName, beginBlockerStart, telemetry.MetricKeyBeginBlocker) // TODO(PLT-330): remove once evm_abci_begin_blocker_duration_seconds verified + evmKeeperMetrics.beginBlockerDuration.Record(ctx.Context(), time.Since(beginBlockerStart).Seconds()) + }() // clear tx/tx responses from last block if !ctx.IsTracing() { k.SetMsgs([]*types.MsgEVMTransaction{}) @@ -59,7 +63,11 @@ func (k *Keeper) BeginBlock(ctx sdk.Context) { } func (k *Keeper) EndBlock(ctx sdk.Context, height int64, blockGasUsed int64) { - defer telemetry.ModuleMeasureSince(types.ModuleName, time.Now(), telemetry.MetricKeyEndBlocker) + endBlockerStart := time.Now() + defer func() { + telemetry.ModuleMeasureSince(types.ModuleName, endBlockerStart, telemetry.MetricKeyEndBlocker) // TODO(PLT-330): remove once evm_abci_end_blocker_duration_seconds verified + evmKeeperMetrics.endBlockerDuration.Record(ctx.Context(), time.Since(endBlockerStart).Seconds()) + }() // Bake height-1: at EndBlock(N) the indexer's safe latest is N-1. When // the snapshot store is wired, also Put a memiavl snapshot keyed by // its committed version (= N-1, since Commit fires after EndBlock); @@ -90,7 +98,9 @@ func (k *Keeper) EndBlock(ctx sdk.Context, height int64, blockGasUsed int64) { newBaseFee := k.AdjustDynamicBaseFeePerGas(ctx, uint64(blockGasUsed)) // nolint:gosec if newBaseFee != nil { - metrics.GaugeEvmBlockBaseFee(newBaseFee.TruncateInt().BigInt(), height) + baseFeeBI := newBaseFee.TruncateInt().BigInt() + utilmetrics.GaugeEvmBlockBaseFee(baseFeeBI, height) // TODO(PLT-330): remove once evm_block_base_fee verified + evmKeeperMetrics.blockBaseFee.Record(ctx.Context(), bigIntToFloat64(baseFeeBI)) } var coinbase sdk.AccAddress if k.EthBlockTestConfig.Enabled { diff --git a/x/evm/keeper/evm.go b/x/evm/keeper/evm.go index eacfd85f02..3614b7878d 100644 --- a/x/evm/keeper/evm.go +++ b/x/evm/keeper/evm.go @@ -14,9 +14,12 @@ import ( sdk "github.com/sei-protocol/sei-chain/sei-cosmos/types" sdkerrors "github.com/sei-protocol/sei-chain/sei-cosmos/types/errors" + "go.opentelemetry.io/otel/attribute" + otelmetric "go.opentelemetry.io/otel/metric" + "github.com/sei-protocol/sei-chain/precompiles/solo" "github.com/sei-protocol/sei-chain/utils" - "github.com/sei-protocol/sei-chain/utils/metrics" + utilmetrics "github.com/sei-protocol/sei-chain/utils/metrics" "github.com/sei-protocol/sei-chain/x/evm/state" "github.com/sei-protocol/sei-chain/x/evm/types" ) @@ -64,7 +67,8 @@ func (k *Keeper) HandleInternalEVMDelegateCall(ctx sdk.Context, req *types.MsgIn senderEvmAddr, found := k.GetEVMAddress(ctx, senderAddr) if !found { err := types.NewAssociationMissingErr(req.Sender) - metrics.IncrementAssociationError("evm_handle_internal_evm_delegate_call", err) + utilmetrics.IncrementAssociationError("evm_handle_internal_evm_delegate_call", err) // TODO(PLT-330): remove once evm_association_error_total verified + evmKeeperMetrics.associationError.Add(ctx.Context(), 1, otelmetric.WithAttributes(attribute.String("scenario", "evm_handle_internal_evm_delegate_call"), attribute.String("type", err.AddressType()))) return nil, err } ret, err := k.CallEVM(ctx, senderEvmAddr, to, &zeroInt, req.Data) diff --git a/x/evm/keeper/metrics.go b/x/evm/keeper/metrics.go new file mode 100644 index 0000000000..3ad922d36e --- /dev/null +++ b/x/evm/keeper/metrics.go @@ -0,0 +1,123 @@ +package keeper + +import ( + "math" + "math/big" + + "go.opentelemetry.io/otel" + "go.opentelemetry.io/otel/metric" +) + +var ( + //numbers are in seconds + finerGrainedBuckets = metric.WithExplicitBucketBoundaries( + 0.000025, 0.000050, 0.0001, 0.0005, 0.001, 0.0025, 0.005, 0.010, 0.020, 0.050, 0.075, 0.1, 0.25, 0.5, 1, 10, + ) + meter = otel.Meter("evm_keeper") + + evmKeeperMetrics = struct { + // ABCI phase durations + beginBlockerDuration metric.Float64Histogram + endBlockerDuration metric.Float64Histogram + + // Block base fee (set each EndBlock) + blockBaseFee metric.Float64Gauge + + // EVMTransaction error counters + panics metric.Int64Counter + errors metric.Int64Counter + receiptStatus metric.Int64Counter + + // Association errors + associationError metric.Int64Counter + + // Zero-storage cleanup counters + zeroStorageProcessedKeys metric.Int64Counter + zeroStoragePrunedKeys metric.Int64Counter + zeroStoragePrunedBytes metric.Int64Counter + }{ + beginBlockerDuration: must(meter.Float64Histogram( + "evm_abci_begin_blocker_duration", + metric.WithDescription("Duration of EVM module BeginBlock"), + metric.WithUnit("s"), + finerGrainedBuckets, + )), + + endBlockerDuration: must(meter.Float64Histogram( + "evm_abci_end_blocker_duration", + metric.WithDescription("Duration of EVM module EndBlock"), + metric.WithUnit("s"), + finerGrainedBuckets, + )), + + blockBaseFee: must(meter.Float64Gauge( + "evm_block_base_fee", + metric.WithDescription("Current EVM block base fee per gas"), + )), + + panics: must(meter.Int64Counter( + "evm_panics", + metric.WithDescription("Number of panics recovered during EVM transaction processing"), + metric.WithUnit("{count}"), + )), + + errors: must(meter.Int64Counter( + "evm_errors", + metric.WithDescription("EVM processing errors by type (state_transition, stateDB_finalize, write_receipt, apply_message, vm_execution)"), + metric.WithUnit("{count}"), + )), + + receiptStatus: must(meter.Int64Counter( + "evm_receipt_status", + metric.WithDescription("EVM transaction receipt outcomes by status (success, failed)"), + metric.WithUnit("{count}"), + )), + + associationError: must(meter.Int64Counter( + "evm_keeper_association_error", + metric.WithDescription("EVM address association errors by scenario and address type"), + metric.WithUnit("{count}"), + )), + + zeroStorageProcessedKeys: must(meter.Int64Counter( + "evm_zero_storage_processed_keys", + metric.WithDescription("Storage slots scanned during zero-value cleanup"), + metric.WithUnit("{count}"), + )), + + zeroStoragePrunedKeys: must(meter.Int64Counter( + "evm_zero_storage_pruned_keys", + metric.WithDescription("Zero-value storage slots deleted during cleanup"), + metric.WithUnit("{count}"), + )), + + zeroStoragePrunedBytes: must(meter.Int64Counter( + "evm_zero_storage_pruned_bytes", + metric.WithDescription("Bytes reclaimed by zero-value storage slot cleanup"), + metric.WithUnit("By"), + )), + } +) + +func must[V any](v V, err error) V { + if err != nil { + panic(err) + } + return v +} + +// bigIntToFloat64 converts a *big.Int to float64 without calling Uint64(), which +// has undefined behavior for values > math.MaxUint64 per the math/big docs. +func bigIntToFloat64(v *big.Int) float64 { + if v == nil || v.Sign() < 0 { + return 0 + } + if v.IsUint64() { + return float64(v.Uint64()) + } + f, _ := new(big.Float).SetInt(v).Float64() + if math.IsInf(f, 1) { + return math.MaxFloat64 + } + return f +} diff --git a/x/evm/keeper/msg_server.go b/x/evm/keeper/msg_server.go index d7f55a62d0..374d45f377 100644 --- a/x/evm/keeper/msg_server.go +++ b/x/evm/keeper/msg_server.go @@ -10,17 +10,18 @@ import ( "runtime/debug" "strings" - "github.com/armon/go-metrics" + armonmetrics "github.com/armon/go-metrics" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core" ethtypes "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/core/vm" - "github.com/sei-protocol/sei-chain/sei-cosmos/telemetry" sdk "github.com/sei-protocol/sei-chain/sei-cosmos/types" occtypes "github.com/sei-protocol/sei-chain/sei-cosmos/types/occ" bankkeeper "github.com/sei-protocol/sei-chain/sei-cosmos/x/bank/keeper" banktypes "github.com/sei-protocol/sei-chain/sei-cosmos/x/bank/types" "github.com/sei-protocol/seilog" + "go.opentelemetry.io/otel/attribute" + otelmetric "go.opentelemetry.io/otel/metric" "github.com/sei-protocol/sei-chain/precompiles/wasmd" "github.com/sei-protocol/sei-chain/utils" @@ -82,20 +83,16 @@ func (server msgServer) EVMTransaction(goCtx context.Context, msg *types.MsgEVMT if !strings.Contains(fmt.Sprintf("%s", pe), occtypes.ErrReadEstimate.Error()) { debug.PrintStack() logger.Error("EVM PANIC", "err", pe) - seimetrics.SafeTelemetryIncrCounter(1, types.ModuleName, "panics") + seimetrics.SafeTelemetryIncrCounter(1, types.ModuleName, "panics") // TODO(PLT-330): remove once evm_panics_total verified + evmKeeperMetrics.panics.Add(goCtx, 1) } panic(pe) } if err != nil { logger.Error("Got EVM state transition error (not VM error)", "err", err) - seimetrics.SafeTelemetryIncrCounterWithLabels( - []string{types.ModuleName, "errors", "state_transition"}, - 1, - []metrics.Label{ - telemetry.NewLabel("type", err.Error()), - }, - ) + seimetrics.SafeTelemetryIncrCounterWithLabels([]string{types.ModuleName, "errors", "state_transition"}, 1, []armonmetrics.Label{{Name: "type", Value: err.Error()}}) // TODO(PLT-330): remove once evm_errors_total verified + evmKeeperMetrics.errors.Add(goCtx, 1, otelmetric.WithAttributes(attribute.String("type", "state_transition"))) return } extraSurplus := sdk.ZeroInt() @@ -104,13 +101,8 @@ func (server msgServer) EVMTransaction(goCtx context.Context, msg *types.MsgEVMT err = ferr logger.Error("failed to finalize EVM stateDB", "err", err) - seimetrics.SafeTelemetryIncrCounterWithLabels( - []string{types.ModuleName, "errors", "stateDB_finalize"}, - 1, - []metrics.Label{ - telemetry.NewLabel("type", err.Error()), - }, - ) + seimetrics.SafeTelemetryIncrCounterWithLabels([]string{types.ModuleName, "errors", "stateDB_finalize"}, 1, []armonmetrics.Label{{Name: "type", Value: err.Error()}}) // TODO(PLT-330): remove once evm_errors_total verified + evmKeeperMetrics.errors.Add(goCtx, 1, otelmetric.WithAttributes(attribute.String("type", "stateDB_finalize"))) return } if ctx.EVMEntryViaWasmdPrecompile() { @@ -138,21 +130,18 @@ func (server msgServer) EVMTransaction(goCtx context.Context, msg *types.MsgEVMT err = rerr logger.Error("failed to write EVM receipt", "err", err) - seimetrics.SafeTelemetryIncrCounterWithLabels( - []string{types.ModuleName, "errors", "write_receipt"}, - 1, - []metrics.Label{ - telemetry.NewLabel("type", err.Error()), - }, - ) + seimetrics.SafeTelemetryIncrCounterWithLabels([]string{types.ModuleName, "errors", "write_receipt"}, 1, []armonmetrics.Label{{Name: "type", Value: err.Error()}}) // TODO(PLT-330): remove once evm_errors_total verified + evmKeeperMetrics.errors.Add(goCtx, 1, otelmetric.WithAttributes(attribute.String("type", "write_receipt"))) return } // Add metrics for receipt status if receipt.Status == uint32(ethtypes.ReceiptStatusFailed) { - seimetrics.SafeTelemetryIncrCounter(1, "receipt", "status", "failed") + seimetrics.SafeTelemetryIncrCounter(1, "receipt", "status", "failed") // TODO(PLT-330): remove once evm_receipt_status_total verified + evmKeeperMetrics.receiptStatus.Add(goCtx, 1, otelmetric.WithAttributes(attribute.String("status", "failed"))) } else { - seimetrics.SafeTelemetryIncrCounter(1, "receipt", "status", "success") + seimetrics.SafeTelemetryIncrCounter(1, "receipt", "status", "success") // TODO(PLT-330): remove once evm_receipt_status_total verified + evmKeeperMetrics.receiptStatus.Add(goCtx, 1, otelmetric.WithAttributes(attribute.String("status", "success"))) } surplus = surplus.Add(extraSurplus) @@ -178,13 +167,8 @@ func (server msgServer) EVMTransaction(goCtx context.Context, msg *types.MsgEVMT // be checked in CheckTx first err = applyErr - seimetrics.SafeTelemetryIncrCounterWithLabels( - []string{types.ModuleName, "errors", "apply_message"}, - 1, - []metrics.Label{ - telemetry.NewLabel("type", err.Error()), - }, - ) + seimetrics.SafeTelemetryIncrCounterWithLabels([]string{types.ModuleName, "errors", "apply_message"}, 1, []armonmetrics.Label{{Name: "type", Value: err.Error()}}) // TODO(PLT-330): remove once evm_errors_total verified + evmKeeperMetrics.errors.Add(goCtx, 1, otelmetric.WithAttributes(attribute.String("type", "apply_message"))) return } @@ -193,13 +177,8 @@ func (server msgServer) EVMTransaction(goCtx context.Context, msg *types.MsgEVMT if res.Err != nil { serverRes.VmError = res.Err.Error() - seimetrics.SafeTelemetryIncrCounterWithLabels( - []string{types.ModuleName, "errors", "vm_execution"}, - 1, - []metrics.Label{ - telemetry.NewLabel("type", serverRes.VmError), - }, - ) + seimetrics.SafeTelemetryIncrCounterWithLabels([]string{types.ModuleName, "errors", "vm_execution"}, 1, []armonmetrics.Label{{Name: "type", Value: serverRes.VmError}}) // TODO(PLT-330): remove once evm_errors_total verified + evmKeeperMetrics.errors.Add(goCtx, 1, otelmetric.WithAttributes(attribute.String("type", "vm_execution"))) } serverRes.GasUsed = res.UsedGas diff --git a/x/evm/keeper/storage_cleanup.go b/x/evm/keeper/storage_cleanup.go index acd709d0a9..612cd1aa9f 100644 --- a/x/evm/keeper/storage_cleanup.go +++ b/x/evm/keeper/storage_cleanup.go @@ -85,11 +85,14 @@ func (k *Keeper) PruneZeroStorageSlots(ctx sdk.Context, limit int) (int, int) { k.setZeroStorageCleanupCheckpoint(ctx, nil) } - seimetrics.IncrEvmZeroStorageProcessedKeys(processedMetric) + seimetrics.IncrEvmZeroStorageProcessedKeys(processedMetric) // TODO(PLT-330): remove once evm_zero_storage_processed_keys_total verified + evmKeeperMetrics.zeroStorageProcessedKeys.Add(ctx.Context(), int64(processedMetric)) //nolint:gosec if deleted > 0 { - seimetrics.IncrEvmZeroStoragePrunedKeys(deletedMetric) - seimetrics.IncrEvmZeroStoragePrunedBytes(bytesPruned) + seimetrics.IncrEvmZeroStoragePrunedKeys(deletedMetric) // TODO(PLT-330): remove once evm_zero_storage_pruned_keys_total verified + seimetrics.IncrEvmZeroStoragePrunedBytes(bytesPruned) // TODO(PLT-330): remove once evm_zero_storage_pruned_bytes_total verified + evmKeeperMetrics.zeroStoragePrunedKeys.Add(ctx.Context(), int64(deletedMetric)) //nolint:gosec + evmKeeperMetrics.zeroStoragePrunedBytes.Add(ctx.Context(), int64(bytesPruned)) //nolint:gosec logger.Info("pruned zero storage slots", "processed", processed, "deleted", deleted, "bytes_saved", bytesPruned) } return processed, deleted