0

So, the other day I tried batching a lot of transactions ~100 from the same account and sent them out to ethereum. I was programmatically creating a lot of txs, incremented the nonce accordingly, signed them and sent them put (all via web3js 1.0).

All of them got processed eventually but I could rarely see 2 or more txs go in the same block. they mostly got mined every other block one at a time. even when I increased the gasPrice a lot I couldn`t see an improvement in how quickly the batch got mined.

Does somebody have an idea why this happens?

Before moving to mainnet i tested on ropsten and an entire batch of 30txs got mined in the same block. Is this related to how miner pick which tx to put into blocks? I understand why a miner does not include in a block a tx that has its nonce in the future but i dont get why it would not include more txs from the same account if they have consecutive nonces, they're valid and the gasPrice is high. Funny thing is that every once in a while a block came out with 2 or more consecutive txs but this was rare.

  • Could you check, whether blocks your transactions were mined in were full or had some spare space? You said that you rarely saw two or more of your transactions in one block, but how often did you saw several of your transactions included into consecutive blocks? Probably, there were just too many pending transactions in memory pool at that time. – Mikhail Vladimirov Mar 23 at 10:19
0

My guess is that miners generally don't keep transactions they can't execute in their tx pool. So the miner might receive them out of order and just delete them, only keeping the one it can execute, and then later one of their peers sends them the next transactions. Since there are so many nodes on the network, your transactions will generally stay on a node for a long time, so it's not an issue if some nodes delete them.

  • I haven't considered that a miner might receive them out of order. And i guess that this depends on the miner's policy to drop certain txs or even not propagate certain txs. I read somewhere that certain node implementation drop unmined txs after a period and I think keeping on to some txs for too long is not a great strategy since one could spam a node with a lot unminable (nonce far in the future) to make it run out of memory or storage. But I think keeping the ones with nonces near the current one would not be that bad. – rosul May 4 '18 at 14:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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