Skip to content
Open
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
18 changes: 18 additions & 0 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -1746,6 +1746,24 @@ func (app *App) executeEVMTxWithGigaExecutor(ctx sdk.Context, msg *evmtypes.MsgE

_, isAssociated := app.GigaEvmKeeper.GetEVMAddress(ctx, seiAddr)

// ============================================================================
// Nonce validation (mirrors V2's ante handler check in x/evm/ante/sig.go)
// V2 rejects with ErrWrongSequence if txNonce != expectedNonce, with NO state changes.
// ============================================================================
expectedNonce := app.GigaEvmKeeper.GetNonce(ctx, sender)
txNonce := ethTx.Nonce()
if txNonce != expectedNonce {
nonceDirection := "too high"
if txNonce < expectedNonce {
nonceDirection = "too low"
}
return &abci.ExecTxResult{
Code: sdkerrors.ErrWrongSequence.ABCICode(),
GasWanted: int64(ethTx.Gas()), //nolint:gosec
Log: fmt.Sprintf("nonce %s: address %s, tx: %d state: %d: %s", nonceDirection, sender.Hex(), txNonce, expectedNonce, sdkerrors.ErrWrongSequence.Error()),
}, nil
}

// ============================================================================
// Fee validation (mirrors V2's ante handler checks in evm_checktx.go)
// NOTE: In V2, failed transactions still increment nonce and charge gas.
Expand Down
Loading