Skip to content

Commit

Permalink
Problem: no way to disable nonce checking in benchmark
Browse files Browse the repository at this point in the history
Solution:
- add unsafe option to turn off nonce checking
  • Loading branch information
yihuang committed Jun 27, 2024
1 parent 773438f commit b98aaf7
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

Check warning on line 136 in app/ante/handler_options.go

View check run for this annotation

Codecov / codecov/patch

app/ante/handler_options.go#L136

Added line #L136 was not covered by tests
}
}

extraDecorators := options.ExtraDecorators
Expand Down

0 comments on commit b98aaf7

Please sign in to comment.