0
0
Fork 0
mirror of https://github.com/bitcoin/bitcoin.git synced 2025-02-14 11:26:09 -05:00
bitcoin-bitcoin-core/src/common
Ava Chow da083d4bbd
Merge bitcoin/bitcoin#29775: Testnet4 including PoW difficulty adjustment fix
6bfa26048d testnet: Add timewarp attack prevention for Testnet4 (Fabian Jahr)
0100907ca1 testnet: Add Testnet4 difficulty adjustment rules fix (Fabian Jahr)
74a04f9e7a testnet: Introduce Testnet4 (Fabian Jahr)

Pull request description:

  To supplement the [ongoing conceptual discussion about a testnet reset](https://groups.google.com/g/bitcoindev/c/9bL00vRj7OU/m/9yCPo3uUBwAJ) I have drafted a move to v4 including a fix to the difficulty adjustment mechanism, which was part of the motivation that started the discussion.

  Conceptual considerations:
  - The conceptual discussion about doing a testnet4 or softforking the fix into testnet3 is outside of the scope of this PR and I would ask reviewers to contribute their opinions on this on the ML instead. However, I am happy to adapt this PR to a softfork change on testnet3 if there is consensus for that instead.
  - The difficulty adjustment fix suggested here touches the `CalculateNextWorkRequired` function and uses the same logic used in `GetNextWorkRequired` to find the last previous block that was not mined with difficulty 1 under the exceptionf. An alternative fix briefly mentioned on the mailing list by Jameson Lopp would be to "restrict the special testnet minimum difficulty rule so that it can't be triggered on the block right before a difficulty retarget". That would also fix the issue but I find my suggestion here a bit more elegant.

ACKs for top commit:
  jsarenik:
    tACK 6bfa26048d
  achow101:
    ACK 6bfa26048d
  murchandamus:
    tACK 6bfa26048d

Tree-SHA512: 0b8b69a621406a944da5be551b863d065358ba94d85dd3b80d83c412660e230ee93b27316081fbee9b4851cc4ff8585db64c7dfa26cb5148ac835663f2712c3d
2024-08-07 13:05:04 -04:00
..
args.cpp testnet: Introduce Testnet4 2024-08-06 01:38:10 +02:00
args.h testnet: Introduce Testnet4 2024-08-06 01:38:10 +02:00
bloom.cpp random: get rid of GetRand by inlining 2024-07-01 12:39:53 -04:00
bloom.h
config.cpp util: Move util/string.h functions to util namespace 2024-05-16 10:16:08 -05:00
init.cpp
init.h
interfaces.cpp
messages.cpp Merge bitcoin/bitcoin#30525: doc, rpc : #30275 followups 2024-08-07 01:27:42 -04:00
messages.h [rpc, fees]: add more detail on the fee estimation modes 2024-08-02 15:40:43 +01:00
run_command.cpp scripted-diff: Add IWYU pragma keep to bitcoin-config.h includes 2024-05-01 08:33:04 +02:00
run_command.h
settings.cpp scripted-diff: Add IWYU pragma keep to bitcoin-config.h includes 2024-05-01 08:33:04 +02:00
settings.h
signmessage.cpp util: move util/message to common/signmessage 2024-05-16 11:16:08 -04:00
signmessage.h util: move util/message to common/signmessage 2024-05-16 11:16:08 -04:00
system.cpp util: Move util/string.h functions to util namespace 2024-05-16 10:16:08 -05:00
system.h scripted-diff: Add IWYU pragma keep to bitcoin-config.h includes 2024-05-01 08:33:04 +02:00
types.h common: Add PSBTError enum 2024-05-16 10:16:08 -05:00
url.cpp common: Don't terminate on null character in UrlDecode 2024-04-24 23:27:50 +02:00
url.h scripted-diff: Modernize name of urlDecode function and param 2024-04-24 23:26:24 +02:00