Track nonce locally so it is possible to make multiple transactions in a single block
See original GitHub issueCurrently unless I track the nonce locally in my code and pass it to signAndSend
, the second one is likely going to fail because the nonce value it used will be same as the first one.
polkadot.js should provide a way to track nonce for each account so we can make multiple transactions in a block.
Background: We are implement a very simple faucet service, with a naive implementation it cannot handle two users requesting fund at same time due to nonce issue. And now the implementation is getting bit more complicated than I initially expected. I hope polkadot.js can shield us from those details.
Related but not dependent on: https://github.com/paritytech/substrate/issues/2263
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:5 (4 by maintainers)
Top Results From Across the Web
Sending multiple transactions in the same block with ...
You can write a solidity contract with one method that receives the addresses and the amounts to transfer, and performs the corresponding ...
Read more >Sending Web3 Transactions In Node.js — Nonce Hell.
Let's say you want to send two transactions at the same time and you don't specify their nonce, the library automatically detects the...
Read more >Transaction Queue · OpenEthereum Documentation
Local transactions are transactions that have been created or submitted to the local node. Such transactions have a priority boost in the queue...
Read more >Managing nonces - Nethereum Documentation
Nonces act as counters that keeps track of the number of transactions sent by an account. Nonces have two functions: 1- Allowing to...
Read more >Conquering the Nonce - Devcon Archive
The nonce - just a single, incrementing integer that lets you send your transactions to the Eth network. Simple, right? Our experience working...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Make sense. Let’s see what will come out of https://github.com/paritytech/substrate/issues/2263
At minimum I think it make sense to have a receipt to show how to catch nonce issue when submitting transaction and retry with an updated new nonce. It won’t be optimal but good enough for most of the cases.
So this become a document issue that we should teach user how to handle nonce error.
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue if you think you have a related problem or query.