question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Track nonce locally so it is possible to make multiple transactions in a single block

See original GitHub issue

Currently 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:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
xlccommented, Apr 12, 2019

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.

0reactions
polkadot-js-botcommented, Jun 5, 2021

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found