Skip to content

Commit

Permalink
Problem: no way to disable nonce checking in benchmark (evmos#495)
Browse files Browse the repository at this point in the history
Solution:
- add unsafe option to turn off nonce checking
  • Loading branch information
yihuang authored Jun 28, 2024
1 parent 773438f commit f9cd15e
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions app/ante/handler_options.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ type HandlerOptions struct {
DisabledAuthzMsgs []string
ExtraDecorators []sdk.AnteDecorator
PendingTxListener PendingTxListener

// see #494, just for benchmark, don't turn on on production
UnsafeUnorderedTx bool
}

func (options HandlerOptions) validate() error {
Expand Down Expand Up @@ -128,8 +131,10 @@ func newEthAnteHandler(options HandlerOptions) sdk.AnteHandler {
return ctx, err
}

if err := CheckEthSenderNonce(ctx, tx, options.AccountKeeper); err != nil {
return ctx, err
if !options.UnsafeUnorderedTx {
if err := CheckEthSenderNonce(ctx, tx, options.AccountKeeper); err != nil {
return ctx, err
}
}

extraDecorators := options.ExtraDecorators
Expand Down

0 comments on commit f9cd15e

Please sign in to comment.