59 votes
Accepted

Why is the average block time 17 seconds?

Due to advances in blockchain research, it was shown that significantly lower block times were possible and perhaps beneficial given the current connectivity of the internet. One of the potential ...
Taylor Gerring's user avatar
16 votes
Accepted

Is Solidity block.number more secure than timestamp?

The block number will always be correct by definition: It's number x in the chain, because it's chained on top of x-1. However, as you say block.timestamp can be gamed a little bit - or with the ...
Edmund Edgar's user avatar
  • 16.7k
15 votes
Accepted

What is the safest minimum block time to use without having any problem on Proof-of-Authority consensus?

PoA in Aura consensus engine of parity defaults to 5s, which has been tested to run with good stability. PoA network runs one such infrastructure. I have tested for a 1 sec PoA using aura running ...
Ayushya's user avatar
  • 1,698
13 votes
Accepted

How would a miner cope with a huge block time?

Summary A block mined by a miner that sets their computer time ahead of the current "real" time will have their winning block rejected by other Ethereum nodes. Other miners on the Ethereum network ...
BokkyPooBah's user avatar
12 votes
Accepted

What is the target block time for Casper?

Somewhere between 2s and 7.5s, depending on what tradeoffs we choose between maximizing speed and minimizing consensus overhead. One of the important philosophical points imo is that very high ...
Vitalik Buterin's user avatar
9 votes

How would a miner cope with a huge block time?

If a miner M sees a block B with a timestamp far in the future, here's what they would probably do: instead of building on B, they would publish their own block C with a more accurate timestamp. By ...
eth's user avatar
  • 84.2k
8 votes

How does Ethereum regulate the time between blocks?

If you are using geth here's a patch that I use to accelerate mining. You could probably modify it to decelerate mining if you wish. (I'm curious why you wish to go slower). In any event, I think ...
Paul S's user avatar
  • 4,261
7 votes
Accepted

What is the measured distribution of block times since Homestead?

First of all it seems that I am too ignorant to understand Poissons Lamda! At least I have some R skills left: Summary: Min. 1st Qu. Median Mean 3rd Qu. Max. 1.00 5.00 10.00 14.35 ...
Roland Kofler's user avatar
7 votes

How to get the block number which is the closest to a given timestamp?

DeFiLlama has a new API that does this. https://defillama.com/docs/api Just GET https://coins.llama.fi/block/ethereum/1658171864 You can also check different chains
cwatkins's user avatar
  • 171
6 votes

What is the target block time for Casper?

The proposed blocktime is 2-3 seconds. At least that's what Vlad Zamfir (Ethereum Researcher) is aiming for. There are more details on the subject in this epicenter bitcoin podcast #105 .
user2899971's user avatar
6 votes
Accepted

What happened to the average blocktime during this period?

This was the Difficulty Bomb, originally put in place in the lead up to Proof of Stake being implemented. The aim was to make mining gradually more difficult before the switchover. See: What is the &...
Richard Horrocks's user avatar
6 votes
Accepted

How to get the block number which is the closest to a given timestamp?

Ethfinex just published a function that does exactly that. It's to "pixel perfect" but it's working really well so far, you give it a timestamp and it will walk the blockchain backwards until it ...
kroe's user avatar
  • 216
6 votes

Increase block number on Ganache

In addition to goodvibration's answer, OpenZeppelin recently released their openzeppelin-test-helpers package. This library contains all kinds of helpers for testing smart contracts, including methods ...
Rosco Kalis's user avatar
  • 2,117
6 votes

Avoid using "now"

The use of block.timestamp (which is what now is an alias of) is often discouraged because it is somewhat manipulable by miners. This is only an issue if you need the time to be precise to within ~90 ...
Tjaden Hess's user avatar
  • 36.5k
5 votes

Why is avg. block time growing so much latley

This is due to the Ethereum 'Ice Age' - an incentive implemented in the code to switch from the current Proof of Work consensus mechanism to a Proof of Stake consensus mechanism or as Vitalik puts it ...
SteveJaxon's user avatar
  • 2,518
5 votes

Rinkeby not producing blocks

I checked https://www.rinkeby.io/#stats a few minutes ago. There was a problem with validators. To few were online. Now it runs again.
cqx's user avatar
  • 3,452
5 votes

Miner-modifiability of block timestamp after the Merge

Does that mean block timestamps can no longer be tweaked or fudged by miners, after the Merge? That's correct, (post-Merge) consensus on valid blocks is pre-determined timestamps that are not ...
eth's user avatar
  • 84.2k
4 votes
Accepted

Ensuring a transaction is included in a specific block

It's basically impossible to guarantee a transaction occurs in a given block. There's too many factors--network latency, the block gas limit, uncles, miners who mine empty blocks, other transactions, ...
Matthew Schmidt's user avatar
4 votes

How to speed up transaction confirmation time?

Miners pick up transactions by their gas cost. You can set gas price (not maximum gas limit) for your transaction. Take the default gas price value and multiple it with 2x - 3x for urgent transactions....
Mikko Ohtamaa's user avatar
4 votes

What is the safest minimum block time to use without having any problem on Proof-of-Authority consensus?

be it a PoA, PoW or PoS chain you want to build, the main point about the timing is for your nodes to be able to synchronize. If your network is private and you can ensure your network to have nodes ...
Asone's user avatar
  • 839
4 votes
Accepted

Ethereum's block times are under 10 seconds compared to most other coins which are in minutes. Why and How?

Average Ethereum blocktime is closer to 15 seconds. The reason blockchains generaly have larger block times is due to uncle rates. When 2 miners mine separate blocks at the same height, the network ...
natewelch_'s user avatar
  • 11.8k
4 votes
Accepted

Increase block number on Ganache

You can increase block.timestamp (aka now): web3.currentProvider.send({method: "evm_increaseTime", params: [numOfSeconds]}); Note that this method is a Ganache-extension of the standard. So do not ...
goodvibration's user avatar
4 votes

Increase block number on Ganache

I needed a promise-based solution that didn't require installing a third-party library. Copy-pasting from Ethan Wessel's amazing article on truffle time testing: advanceTime = (time) => { return ...
Paul Razvan Berg's user avatar
3 votes
Accepted

Could I give higher priority to transactions to mined right away?

All smart contract functions calls as well as smart contract deployments are inherently transactions. Each transaction gets incorporated into a block whenever a miner chooses to do so. Currently in ...
SCBuergel's user avatar
  • 8,604
3 votes
Accepted

Once PoS and Casper is reached, what stops block times from dropping into the millisecond range?

I think the answer is basically latency, plus giving enough of the nodes enough of a reasonable amount of time to validate. Millisecond blocks would only really get responses from a minority of nodes, ...
Samuel Hawksby-Robinson's user avatar
3 votes

How time difference can be calculated by block.number and how it is different from block.timestamp?

The timestamp can be easily gamed over short intervals. For instance, if block n is mined at 13:30:00, the miner of block n+1 can timestamp the next block at 13:30:01, even if they didn't really mine ...
Edmund Edgar's user avatar
  • 16.7k
3 votes
Accepted

How time difference can be calculated by block.number and how it is different from block.timestamp?

I believe the block.timestamp is the wall-clock date/time at which the block was mined. A block number set in the future based on some other block is based on an estimate of the rate of block mining. ...
lungj's user avatar
  • 6,630
3 votes
Accepted

Is code execution time limited by the block time?

Theoretically, yes, code execution time is limited by the block time. But on a practical level, gas costs and the block gas limit are what limit code execution time. Try writing a contract that ...
eth's user avatar
  • 84.2k
3 votes

How can we reduce the transaction time in ethereum?

Currently the average blocktime is ~ 14 s where a significant portion is just ~ 1 s. See my empirical asssesment here: https://github.com/rolandkofler/blocktime If you run your private net you can ...
Roland Kofler's user avatar
3 votes
Accepted

What happens if the block time changes to 5 seconds?

One thing to consider would be the orphan rate, which is alluded to in the comments for the thread you linked to. The lower you set the difficulty, the shorter the block time, which is what you're ...
Richard Horrocks's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible