RareSkills Solidity Interview Question #37 Answered: What changed with block.timestamp before and after proof of stake?
This series will provide answers to the list of Solidity interview questions that were published by RareSkills..
Question #37 (Medium): What changed with block.timestamp before and after proof of stake?
Answer: Before proof of stake, blocks came in on average about every 13
seconds with a fair amount of variance in actual block times. After proof of stake, blocks come in exactly every 12
seconds (except when a slot is missed). Thus, the intervals between block.timestamp
values decreased by approximately 1 second after transitioning from proof of work to to proof of stake.
Demonstration:
Examine this screenshot from Etherscan which shows the latest blocks (at the time it was taken). Note that the block times are exactly 12
seconds apart:
Further Discussion:
In a proof of stake system, slots can be missed because a validator is offline or because they do not submit a block in time. In practice, this occurs in less than 1% of slots.
Connect with me:
- LinkedIn: https://www.linkedin.com/in/faybianbyrd/
- Twitter: https://twitter.com/FaybianByrd
- Github: https://github.com/FaybianB
Latest articles:
- Question #27 (Easy): How can an ERC1155 token be made into a non-fungible token?
- Question #28 (Easy): What is access control and why is it important?
- Question #29 (Easy): What does a modifier do?
- Question #30 (Easy): What is the largest value a uint256 can store?
- Question #31 (Easy): What is variable and fixed interest rate?
- Question #32 (Medium): What is the difference between transfer and send? Why should they not be used?
- Question #33 (Medium): How do you write a gas-efficient for loop in Solidity?
- Question #34 (Medium): What is a storage collision in a proxy contract?
- Question #35 (Medium): What is the difference between abi.encode and abi.encodePacked?
- Question #36 (Medium): uint8, uint32, uint64, uint128, uint256 are all valid uint sizes. Are there others?