Skip to content
This repository has been archived by the owner on Feb 23, 2024. It is now read-only.

Fix account sequence mismatch errors #206

Closed
wants to merge 4 commits into from

Conversation

agouin
Copy link
Member

@agouin agouin commented Sep 28, 2022

While using lens for tx broadcasting in the relayer, we frequently see account mismatch errors, often repetitive with the same sequence mismatch multiple times:

2022-09-28T19:11:43.957745Z     info    Error building or broadcasting transaction      {"provider_type": "cosmos", "chain_id": "axelar-dojo-1", "attempt": 2, "max_attempts": 5, "error": "rpc error: code = InvalidArgument desc = account sequence mismatch, expected 10, got 9: incorrect account sequence: invalid request"}
2022-09-28T19:11:51.252966Z     info    Error building or broadcasting transaction      {"provider_type": "cosmos", "chain_id": "axelar-dojo-1", "attempt": 3, "max_attempts": 5, "error": "rpc error: code = InvalidArgument desc = account sequence mismatch, expected 10, got 9: incorrect account sequence: invalid request"}
2022-09-28T19:11:59.269768Z     info    Error building or broadcasting transaction      {"provider_type": "cosmos", "chain_id": "axelar-dojo-1", "attempt": 4, "max_attempts": 5, "error": "rpc error: code = InvalidArgument desc = account sequence mismatch, expected 10, got 9: incorrect account sequence: invalid request"}
2022-09-28T19:12:06.017468Z     info    Error building or broadcasting transaction      {"provider_type": "cosmos", "chain_id": "axelar-dojo-1", "attempt": 1, "max_attempts": 5, "error": "rpc error: code = InvalidArgument desc = account sequence mismatch, expected 10, got 9: incorrect account sequence: invalid request"}

After one of these account sequence errors, lens should not try to send another transaction with sequence 9, since it has already been given an error from the node that 10 is expected.

The account sequence number should be queried every time in case there are tx broadcasters for the same wallet outside of lens.

Additionally, lens can guard its own use of the wallet by using a mutex surrounding the process of:

  • Query for account sequence and add to tx
  • Sign tx
  • Broadcast tx

@agouin
Copy link
Member Author

agouin commented Sep 28, 2022

Closing since this can be handled in the relayer without lens changes. cosmos/relayer#1007

@agouin agouin closed this Sep 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant