# Timewarp attack 600 second grace period

**URL:** <https://delvingbitcoin.org/t/timewarp-attack-600-second-grace-period/1326>\
**Category:** Protocol Design\
**Tags:** softfork\
**Created:** [December 17, 2024, 6:31am UTC](https://delvingbitcoin.org/t/timewarp-attack-600-second-grace-period/1326 "2024-12-17T06:31:46Z")\
**Posts on this page:** 1\
**Showing post:** 19

<div class="post-metadata">

**Author:** ![sjors](https://delvingbitcoin.org/user_avatar/delvingbitcoin.org/sjors/32/59_2.png) [@sjors](https://delvingbitcoin.org/u/sjors)\
**Post date:** [January 3, 2025, 1:11pm UTC](https://delvingbitcoin.org/t/timewarp-attack-600-second-grace-period/1326/19 "2025-01-03T13:11:52Z")

</div>

While trying to illustrate the griefing attack with a functional test, I found another bug 🙂 Will link to a fix PR here.

Update:

> <https://github.com/bitcoin/bitcoin/pull/31600>
>
> \#30681 fixed the \`curtime\` field of \`getblocktemplate\` to take the timewarp rule… into account. However I forgot to do the same for the \`mintime\` field, which was hardcoded to use \`pindexPrev-\>GetMedianTimePast()+1\`.
> 
> This PR adds a helper \`GetMinimumTime()\` and uses it for the \`mintime\` field.
> 
> It could be backported to v28. However I don't expect (testnet4) pools to use \`mintime\` in practice, since under normal mainnet circumstances this would produce blocks an hour in the past.
> 
> 
> Additionally this PR adjusts the timewarp test to better illustrate the griefing attack discussed here: https://delvingbitcoin.org/t/timewarp-attack-600-second-grace-period/1326/19 
> 
> Changing \`MAX\_TIMEWARP\` to something \`\> MAX\_FUTURE\_BLOCK\_TIME\` in \`consensus.h\` and \`mining\_basic.py\` will cause the updated test to fail. I'm not proposing such a change here of course. The new test should be useful guidance for pool software developers, for why they really should use \`curtime\`, or least not ignore \`mintime\`.

Aside from the fix it illustrates the griefing attack above.

---

_[View the full topic](https://delvingbitcoin.org/t/timewarp-attack-600-second-grace-period/1326)._
