Cosmos SDK account sequence mismatch

6.1k views Asked by At

I am using the Cosmos SDK and run into an issue creating new transactions.

I get the following error when I try to create a transaction with the CLI:

account sequence mismatch, expected 3787, got 3786: incorrect account sequence

This is on the cosmoshub-testnet, using the Cosmos SDK version from https://github.com/b-harvest/gravity-dex which mentions

github.com/tendermint/tendermint v0.34.10

github.com/cosmos/cosmos-sdk v0.42.5

module github.com/cosmos/gaia/v4

go 1.16


I do not know why this happened or how to resolve. Any help is appreciated.

2

There are 2 answers

0
Black Bob On

I think it is that you are siging with lower sequense number in a transaction. You could assign a specified sequense number in CLI with --sequence flag.

More details cac be seen here

0
Ankit kumar On

This generally happens when any of your past trxs get stuck and that is not being processed because of any reason. The common one is related to gas. As Black Bob correctly pointed out you can pass --sequence flag with the latest account sequence + 1. To avoid this issue i usually try to simulate before submitting it to chain.