target-block-time parameter not working as intended

+1 vote

If I set the target-block-time to say 10 seconds, and publish just one key ("key123", "AB); from my understanding this transaction should be confirmed when the block is formed after 10 seconds. But in my case, its confirmed much earlier (varies between 3-8 seconds). If I keep publishing 3-4 keys at a time, it decreases even further :- 1-3 seconds. 

Or is there any other parameter which affects this? Cant be maximum-block-size because my publish pair is very small. Or does this parameter work differently? 

asked Mar 7, 2018 by amolpednekar

1 Answer

+1 vote
I think if your network also does mine empty blocks the average of a confirmed transaction should be about 5 seconds. For example if an empty block was mined 8 seconds ago, your newly created transaction will be mined after 2 seconds.

And also the blocktime is not absolutely exact at 10 seconds.

 

That's what I experienced.
answered Mar 7, 2018 by Alexoid
That's interesting.
So now I setup with setup-initial-blocks=3 and mine-empty-rounds=0 & target-block-time=10
I have 'blocknotify' enabled so I can confirm that no empty blocks are generated when I dont do any transactions.

Even with these settings, some transactions are confirmed well before 10 seconds (same as earlier)

"And also the blocktime is not absolutely exact at 10 seconds." - What exactly does this mean? And I'm guessing it should be slightly more/less in any case, and not such a big difference.

Note: I dont send the next transaction (publish) unless I get a block containing txid of the transaction I sent; so its not the case that one affects other, there is only on tx per block.
@multichain Your take on this?
If mining has stopped because there are no new transactions, then when mining restarts new blocks are generated more quickly. This is because the target-block-time is the desired average aimed for, and blocks weren't generated for a long time, so they're now generated quickly to try to reach that average again. If transactions start to be generated continuously, the average block time will stabilize at the desired rate.
...