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.

Can't get multiple transactions in one block when using -b

See original GitHub issue

Running ganache-cli(6.1.8) with -b 5 and submitting 4 transactions in a row should result in the 4 transactions being mined in the same block. Instead I’m seeing each transaction being mined in a separate block.

hello everybody! I’m running ganache-cli (6.1.8) with -b 5 and doing a bunch of eth_sendTransaction together. I see in ganache console that the transactions are being sent one after the other very quickly but I’m also seeing ganache processing each of them when mining a different block, so all transactions end up in different blocks which is not what I’m trying to accomplish. Any ideas?

Expected Behavior

Each transaction should be mined in the same block when ganache-cli runs with -b t and the sum of all times between transaction submission is < t.

Current Behavior

Each transaction is mined in a separate block.

Possible Solution

Steps to Reproduce (for bugs)

  1. Run ganache-cli like :
ganache-cli -b 5 -v | grep et"eth_sendTransaction\|Transaction\|Block Number"

so you can see transaction submissions and transactions being mined with block number.

  1. Submit 4 transactions in a row using web3js
  2. Check in ganache log that all transactions were sent one after the other but it mines one block per transaction. It mines one block every 5 seconds (this is expected) but it includes 1 tx per block.

Context

Your Environment

  • Version used: 6.1.8
  • Version of Truffle/Remix/Other tools used:
  • NodeJS Version: v11.14.0
  • Operating System and version (include distro if Linux): Debian Linux

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
jpmonettascommented, Jan 14, 2020

@nicholasjpaterno great thanks!! Yeah I’m already unblocked, just giving it less gas to each tx so they don’t exceed the limit makes the trick.

0reactions
davidmurdochcommented, Aug 6, 2021

Confirmed that this will be fixed in ganache v7! You can try it now by installing our canary version: npm uninstall ganache-cli -g && npm install ganache@canary -g

Read more comments on GitHub >

github_iconTop Results From Across the Web

Can multiple transactions transferring the same bitcoin be ...
Yes, this is possible. This is seen happening today in MtGox's green address implementation. The two transactions are not guaranteed to be ...
Read more >
How to submit multiple transaction to a blockchain block?
Invalid blocks are rejected by the nodes in the network. Therefore, one chain branch can never confirm the same transaction more than once....
Read more >
What is Blockchain Technology? - IBM
As each transaction occurs, it is recorded as a “block” of data · Each block is connected to the ones before and after...
Read more >
Since each block in a blockchain has multiple transactions ...
In a blockchain, each block contains a list of transactions that have been ... be processed by an Ethereum-like public blockchain using current...
Read more >
5. Transactions - Mastering Bitcoin [Book] - O'Reilly
The transaction is then signed with one or more signatures indicating the ... A UTXO can have an arbitrary value denominated as a...
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