0

I want to send multiple transactions from differents address at the same time with Infura and Web3.py

Currently my code look like this :

for i in range (n):
   tx= ... (build transaction for adresse i)
   signed_tx = w3.eth.account.sign_transaction(tx, key[i])
   w3.eth.sendRawTransaction(signed_tx.rawTransaction)

Is this the best way to do it ? Because it only send 3 tx each secondes.

Can it be caused by slow internet connexion or slow computer ? How to speed it ?

EDIT : I did some tests and build each transaction need 0.15s, send it 0.30s more, only 0.001s to sign

EDIT2 : I tried with faster internet and computer, it doesn't change anything

Thank you

2
  • How much gas does your tx uses? What is the gas: value that you provide?
    – Undead8
    Mar 30, 2021 at 0:20
  • Each tx uses 35.000 gas, the gas limit is 100.000
    – Kioup
    Mar 30, 2021 at 0:49

2 Answers 2

1

The miners needs to mine the transactions. Its need time.

In addiction, Ethereum is collapsed. You can see more than 100K pending transactions in Ether Scan

1
  • Yeah but I'm talking about sending multiple transaction in the mempool before any of them is mined. Currently my 10 transactions are sent in 3s and they all ended in the same block.
    – Kioup
    Mar 29, 2021 at 12:44
0

My guesses are that it's either:

  1. A limit of tx per address set by Infura, or
  2. A limit of tx per API user set by Infura, or
  3. A limit of tx per address set by miners (there is an option in Geth to set the max number of tx per address).
4
  • All the transactions are sent by differents address so it can't be a limit of transaction per address
    – Kioup
    Mar 30, 2021 at 1:13
  • I edited to add that it could be a limit set by Infura but at the user level.
    – Undead8
    Mar 30, 2021 at 1:14
  • With Infura I can have 100.000 tx/day but do you think there is a limit for tx/secondes ? And if it's the case do you know any alternatives ?
    – Kioup
    Mar 30, 2021 at 1:18
  • I don't know because I run my own node instead of using Infura. I never ran into a problem like this with my full node (that could be your alternative).
    – Undead8
    Mar 30, 2021 at 1:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.