-
Notifications
You must be signed in to change notification settings - Fork 276
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge bitcoin/bitcoin#31600: rpc: have getblocktemplate mintime accou…
…nt for timewarp e1676b0 doc: release notes (Sjors Provoost) 0082f6a rpc: have mintime account for timewarp rule (Sjors Provoost) 79d45b1 rpc: clarify BIP94 behavior for curtime (Sjors Provoost) 0713548 refactor: add GetMinimumTime() helper (Sjors Provoost) Pull request description: #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. #31376 changed the `curtime` field to always account for the timewarp rule. This PR maintains that behavior. Note that `mintime` now always applies BIP94, including on mainnet. This makes future softfork activation safer. It could be backported to v28. ACKs for top commit: fjahr: tACK e1676b0 achow101: ACK e1676b0 darosior: utACK e1676b0 on the code changes tdb3: brief code review re ACK e1676b0 TheCharlatan: ACK e1676b0 Tree-SHA512: 0e322d8cc3b8ff770849bce211edcb5b6f55d04e5e0dee0657805049663d758f27423b047ee6363bd8f6c6fead13f974760f48b3321ea86f514f446e1b23231c
- Loading branch information
Showing
5 changed files
with
39 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
Updated RPCs | ||
--- | ||
- the `getblocktemplate` RPC `curtime` (BIP22) and `mintime` (BIP23) fields now | ||
account for the timewarp fix proposed in BIP94 on all networks. This ensures | ||
that, in the event a timewarp fix softfork activates on mainnet, un-upgraded | ||
miners will not accidentally violate the timewarp rule. (#31376, #31600) | ||
|
||
As a reminder, it's important that any software which uses the `getblocktemplate` | ||
RPC takes these values into account (either `curtime` or `mintime` is fine). | ||
Relying only on a clock can lead to invalid blocks under some circumstances, | ||
especially once a timewarp fix is deployed. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters