ain icon indicating copy to clipboard operation
ain copied to clipboard

Update consensus that blocks must be in chronological order

Open Bushstar opened this issue 1 year ago • 0 comments

Summary

  • This PR makes it that all blocks must be ahead of the previous block time wise. This is consistent with the behaviour of Ethereum and will solve some issues faced with Smart Contracts that have made this assumption on DeFiChain's EVM.
  • Based on previous experience, reducing the seconds available in the staking range range lowers difficulty and reduces the number of empty blocks generated. Each new block opens up the entire range of time from the median of the last few blocks to 30 seconds ahead. To limit to future only blocks would reduce this range to the previous block time to 30 seconds ahead of the current time. For active miners when a new block is minted this would be somewhere between 0 to 30 seconds.
  • Fixes https://github.com/DeFiCh/ain/issues/2929

Implications

  • Storage

    • [x] Database reindex required
    • [ ] Database reindex optional
    • [ ] Database reindex not required
    • [ ] None
  • Consensus

    • [x] Network upgrade required
    • [ ] Includes backward compatible changes
    • [ ] Includes consensus workarounds
    • [ ] Includes consensus refactors
    • [ ] None

Bushstar avatar Jun 10 '24 06:06 Bushstar