Can't get multiple transactions in one block when using -b
See original GitHub issueRunning 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.
- I asked about this on gitter: [X]
- Link to my question on gitter: January 7, 2020 1:37 PM
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)
- 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.
- Submit 4 transactions in a row using web3js
- 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:
- Created 4 years ago
- Comments:10 (5 by maintainers)
Top GitHub Comments
@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.
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