Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 17 additions & 4 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"context"
"crypto/sha256"
"encoding/json"
"errors"
"fmt"
"io"
"math"
Expand Down Expand Up @@ -1319,8 +1320,14 @@ func (app *App) DeliverTxWithResult(ctx sdk.Context, tx []byte, typedTx sdk.Tx)
// Only do expensive validation for potentially gasless transactions
isGasless, err := antedecorators.IsTxGasless(typedTx, ctx, app.OracleKeeper, &app.EvmKeeper)
if err != nil {
ctx.Logger().Error("error checking if tx is gasless for metrics", "error", err)
// If we can't determine if it's gasless, record metrics to maintain existing behavior
if errors.Is(err, oracletypes.ErrAggregateVoteExist) {
// ErrAggregateVoteExist is expected when checking gasless status after tx processing
// since oracle votes will now exist in state. We know it was gasless, skip metrics.
skipMetrics = true
} else {
ctx.Logger().Error("error checking if tx is gasless for metrics", "error", err)
// If we can't determine if it's gasless, record metrics to maintain existing behavior
}
} else if isGasless {
skipMetrics = true // Skip metrics for confirmed gasless transactions
}
Expand Down Expand Up @@ -1487,8 +1494,14 @@ func (app *App) ProcessTXsWithOCCV2(ctx sdk.Context, txs [][]byte, typedTxs []sd
// Only do expensive validation for potentially gasless transactions
isGasless, err := antedecorators.IsTxGasless(typedTxs[i], ctx, app.OracleKeeper, &app.EvmKeeper)
if err != nil {
ctx.Logger().Error("error checking if tx is gasless for OCC metrics", "error", err, "txIndex", i)
// If we can't determine if it's gasless, record metrics to maintain existing behavior
if errors.Is(err, oracletypes.ErrAggregateVoteExist) {
// ErrAggregateVoteExist is expected when checking gasless status after tx processing
// since oracle votes will now exist in state. We know it was gasless, skip metrics.
recordGasMetrics = false
} else {
ctx.Logger().Error("error checking if tx is gasless for OCC metrics", "error", err, "txIndex", i)
// If we can't determine if it's gasless, record metrics to maintain existing behavior
}
} else if isGasless {
recordGasMetrics = false
}
Expand Down
Loading