-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Changes from all commits
68c1b94
be6c0c4
b10ec69
97554f1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 { | ||
|
@@ -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) | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.