Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow multiple transactions from the same account on the same block #5905

Closed
wants to merge 4 commits into from
Closed
Changes from 1 commit
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
9 changes: 3 additions & 6 deletions x/auth/ante/sigverify.go
Original file line number Diff line number Diff line change
Expand Up @@ -219,10 +219,7 @@ func (svd SigVerificationDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simul
// IncrementSequenceDecorator handles incrementing sequences of all signers.
// Use the IncrementSequenceDecorator decorator to prevent replay attacks. Note,
// there is no need to execute IncrementSequenceDecorator on CheckTx or RecheckTX
// since it is merely updating the nonce. As a result, this has the side effect
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would undo this comment removal. The idea is still the same. BaseApp maintains two different states -- check and deliver state. Sending sequential txs for the same block can still be unreliable.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bump @mjackson001

// that subsequent and sequential txs orginating from the same account cannot be
// handled correctly in a reliable way. To send sequential txs orginating from the
// same account, it is recommended to instead use multiple messages in a tx.
// since it is merely updating the nonce.
//
// CONTRACT: The tx must implement the SigVerifiableTx interface.
type IncrementSequenceDecorator struct {
Expand All @@ -236,8 +233,8 @@ func NewIncrementSequenceDecorator(ak keeper.AccountKeeper) IncrementSequenceDec
}

func (isd IncrementSequenceDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool, next sdk.AnteHandler) (sdk.Context, error) {
// no need to increment sequence on CheckTx or RecheckTx
alexanderbez marked this conversation as resolved.
Show resolved Hide resolved
if ctx.IsCheckTx() && !simulate {
// no need to increment sequence on RecheckTx
if ctx.IsReCheckTx() && !simulate {
alexanderbez marked this conversation as resolved.
Show resolved Hide resolved
return next(ctx, tx, simulate)
}

Expand Down