summaryrefslogtreecommitdiff
path: root/e4/ce3e0d415eff6a6a6219fec8f19d25d4b4797b
blob: dde6aebb1542845a518864881ce940106263fdb3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
Delivery-date: Wed, 19 Mar 2025 00:59:32 -0700
Received: from mail-oa1-f57.google.com ([209.85.160.57])
	by mail.fairlystable.org with esmtps  (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
	(Exim 4.94.2)
	(envelope-from <bitcoindev+bncBAABBW7S5G7AMGQED57GYFY@googlegroups.com>)
	id 1tuoKq-0006Tf-1R
	for bitcoindev@gnusha.org; Wed, 19 Mar 2025 00:59:32 -0700
Received: by mail-oa1-f57.google.com with SMTP id 586e51a60fabf-2c2b7d57df9sf5847337fac.1
        for <bitcoindev@gnusha.org>; Wed, 19 Mar 2025 00:59:31 -0700 (PDT)
ARC-Seal: i=2; a=rsa-sha256; t=1742371166; cv=pass;
        d=google.com; s=arc-20240605;
        b=MOf2cQ1ExeN5li+LfCSO/R/WT9vTKWWD2I53W9lp0wayNi09s524RIQMecmOte4V8D
         kF4n2QzssrIN/sBQw6bBEQHJ1CjWygVGs1qGki7GMQ91KjhErScDnASyIkoM7xL3bP3M
         3hifY2NmZBFqpsl4OGd1Ko7Dguoe6Lq+lpNZ48GVl1P1DPFsY6QhCfML8C1jVM+r/+F/
         v/GWG8ot9E23SC8V+zRLqiUq/Ytc5isIxEBd1oRP32TQsxgqEGwG44T6d3GjwfJlEEKv
         kP9ghdZ7ODzZZriNM76yaKYrNrdavzwmrh7FdPOB20HCwlUXecSJ9kxxtC7JV0kmncKS
         T1Rw==
ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605;
        h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post
         :list-id:mailing-list:precedence:to:references:message-id:cc:date
         :in-reply-to:from:subject:mime-version:feedback-id:sender
         :dkim-signature;
        bh=lTbZW+Em0tZKRhHYRHp57gGJRACjmas0UhDDL5raJDs=;
        fh=dy3JMPGsd2gXGrx+66nGutfwYWDZoHqaFp6qpyJXpQc=;
        b=f8yOB7zKTH3eCIYeiz1NWPnYJxrt6qpgqbL7wNs3rgpJGexr2luYpLj2fdknsUQOiV
         l70HiEiteNgQdRGOkGmCMAFqF/uS5pCEKi5LN3QAZykJvEsHHH0TW+KpN5HaW6PxYYZz
         xQigcAC3VJOymfxFw1k6PC16KbafY/pSmBIbGmCAI94D7+6AETZTZsscKyxdrtfOEEtb
         lUQWUiW8ymkYV0LRR4GBeIUSVRXbtArEiiXW63H6cjTevZHGRkdDTEbQLztCXVHaP/Hy
         /dZJg4hdpAvxHxXgq1QnxjrFm4zCaZ/8fmlBV36QKucFPRU916BeYSwt/nWv9o2nzQe6
         nNhQ==;
        darn=gnusha.org
ARC-Authentication-Results: i=2; gmr-mx.google.com;
       dkim=pass header.i=@sprovoost.nl header.s=fm2 header.b=pulenQR6;
       dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=V3mV5sSS;
       spf=pass (google.com: domain of sjors@sprovoost.nl designates 202.12.124.156 as permitted sender) smtp.mailfrom=sjors@sprovoost.nl;
       dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=sprovoost.nl
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=googlegroups.com; s=20230601; t=1742371166; x=1742975966; darn=gnusha.org;
        h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post
         :list-id:mailing-list:precedence:x-original-authentication-results
         :x-original-sender:to:references:message-id:cc:date:in-reply-to:from
         :subject:mime-version:feedback-id:sender:from:to:cc:subject:date
         :message-id:reply-to;
        bh=lTbZW+Em0tZKRhHYRHp57gGJRACjmas0UhDDL5raJDs=;
        b=ae/jNU0cxVjc2EdrORKSQP3VtOiFJ8Yr+whLMllJBNxwAINkjxyh9muqpm4QvUYajN
         dvHxv8CY6d2Q3tb0kfh7eBav/rDGawuegwhqTtsTvgbY0YGRE+d3I96AplnjPe6JPbS5
         lvM6i0C0N/Sz6FOylmpgzmZJwj9BxTMUb3e6tnrZhRRL5YClAOUpmOvGhwgEBJsZvHTh
         dXu9gLTDhDZgfxLSLOjhu6O10faT+VwTy17pcxlsy+RrmvLS7DnOoW9ZZwvT9zT4SwZ1
         kUMrEnT7kw9rZCzpSwW0dG42Q3v1zx9IXE72ReIohAztSN7pIgTmIriIsaaBtBhfZjgl
         SnrA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1742371166; x=1742975966;
        h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post
         :list-id:mailing-list:precedence:x-original-authentication-results
         :x-original-sender:to:references:message-id:cc:date:in-reply-to:from
         :subject:mime-version:feedback-id:x-beenthere:x-gm-message-state
         :sender:from:to:cc:subject:date:message-id:reply-to;
        bh=lTbZW+Em0tZKRhHYRHp57gGJRACjmas0UhDDL5raJDs=;
        b=aSDrk8reU5i9dGHwWxAoQI7Uk2xOGtrMUPOyLtO2UXBXsxTw0alvW7iF9bgqw4Bg8J
         PW/Vm4kBC0rzfNOdM9nxyCYJq9z/b+LXNzmMmeocyJI+z0jAZjOVd8uex88uRwjawlOh
         1Ks30HdbVoXVW9ITXkbqvYBjaZYjRxi1RpftbQkxCyEHBlZUHvZraktG4l9HVkqsK3rz
         5KO4ZCjpL/xM6K/jGq9HbLuoMWaqYzeoZRfqvjOemXIr7XW63RxAEWdr9psSmdsLOeYh
         XhZJz4Uy8tBbFAT41A5XLvQqnMIGblnA1ljDxM9J5Fbi9VyS9oiQWPwJRb0ZUDlGdiO7
         21EA==
Sender: bitcoindev@googlegroups.com
X-Forwarded-Encrypted: i=2; AJvYcCVhQU7cob2rOMEIHGczSUZvL/tUkGiOEEIbRVFs3IXNvTrCRmqCtbDDafvhPnLCF4VQvnD6TS7aJmL4@gnusha.org
X-Gm-Message-State: AOJu0YyO4ZNp5Hb5f7USyAbFSHCpxhJBi5BWpOo5RMYubWCA+KER0x+R
	9nZoN6auC6QyRV67hyWAdp9joIA63o4avgP2bltfyULXs+T8p1UT
X-Google-Smtp-Source: AGHT+IGu++KT195AXbYk0ReXBRJVvpxeFVyJ84qgAcmNsUZEgtFQxVGyvhGQQWavUB/MiNhK9zC9HQ==
X-Received: by 2002:a05:6871:c3c6:b0:2c1:7289:d62a with SMTP id 586e51a60fabf-2c745a1f5acmr1301792fac.36.1742371165982;
        Wed, 19 Mar 2025 00:59:25 -0700 (PDT)
X-BeenThere: bitcoindev@googlegroups.com; h=ARLLPAKouN+k1qEPGurAmCcpVLcom64xoh+j2JEeXGowQhQPUg==
Received: by 2002:a05:6870:3314:b0:29f:aff3:65c8 with SMTP id
 586e51a60fabf-2c667a56711ls1051946fac.2.-pod-prod-08-us; Wed, 19 Mar 2025
 00:59:23 -0700 (PDT)
X-Received: by 2002:a05:6808:2203:b0:3fe:ab15:5e93 with SMTP id 5614622812f47-3fead580559mr1140855b6e.11.1742371163375;
        Wed, 19 Mar 2025 00:59:23 -0700 (PDT)
Received: by 2002:aca:120d:0:b0:3fa:6f09:b173 with SMTP id 5614622812f47-3feac931845msb6e;
        Wed, 19 Mar 2025 00:57:06 -0700 (PDT)
X-Received: by 2002:a05:6e02:32c2:b0:3d2:b509:af44 with SMTP id e9e14a558f8ab-3d586b3ac5emr20762985ab.8.1742371025813;
        Wed, 19 Mar 2025 00:57:05 -0700 (PDT)
ARC-Seal: i=1; a=rsa-sha256; t=1742371025; cv=none;
        d=google.com; s=arc-20240605;
        b=PlMGt12qup1d/k8rnX6HVIdrKrDOzQOzfqhxpgExgOjsfz4j78686XJUqA5Zn8CCVi
         cQ2HT9eFT7CzM01Q/DGxPTaJs4rrsn1H0SmrgTjbWTeVZlZwBwOqOvMwHvdebCA4ivUd
         6SsUK4ayrxyx9rzQA3IpE4RgviyrGcZzHEL3AqJEUT800o0nS03btvMYvQpPvtCqvPT1
         gau2pJKNbkInbx8gDofwSjBtotTLm1A8mJh5RATffIqGq4hhrYf5fWsfY88s+Ec2iKAj
         iYAOoN4yVoCPuBOhddvVUefW+XQ13aqt7ifPULZs9uwV5Uah8u0vXfgpUrnuO3gDoQkz
         PghA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605;
        h=to:references:message-id:content-transfer-encoding:cc:date
         :in-reply-to:from:subject:mime-version:feedback-id:dkim-signature
         :dkim-signature;
        bh=DXmfk9NskS72t6g0zVQDbFQQl58c+BTR5PntNjcutic=;
        fh=LaEIFPzsJwC7ws1VZG3A8mZJDF/4xC6unCuC5YjGPow=;
        b=j3foTVNOgWwPKM5R6YtnQYaVuXhgcHbv4OYS469LLSnaeuKDPjkJqu4lS/QeFzQI68
         dtt/5MIHr1ka1eI3BFFGUaM70ArCiF2kc5pUsuU6vjIvG1EJN9+Wkc7k28E4f6DpCHKn
         X60dC7XeAXZUjXs2i4ZP27Rwj9ufUduEmCEqqMuYg+JumOa7mP0AtfZR2y41G2iv+hZ3
         R/NdJUJNLc9k2p7s6641C5KIUKP2+Ae5mESO7R4xPBrDKC0QFY9LQ1mbisXdsJyit0pv
         +YoH1cok53fMBo+C+SbyFRn0Hae031fJU/hoqYW2Ei/ijaD8bjY72WYT1QcO7qHnnM2P
         MJpg==;
        dara=google.com
ARC-Authentication-Results: i=1; gmr-mx.google.com;
       dkim=pass header.i=@sprovoost.nl header.s=fm2 header.b=pulenQR6;
       dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=V3mV5sSS;
       spf=pass (google.com: domain of sjors@sprovoost.nl designates 202.12.124.156 as permitted sender) smtp.mailfrom=sjors@sprovoost.nl;
       dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=sprovoost.nl
Received: from fhigh-b5-smtp.messagingengine.com (fhigh-b5-smtp.messagingengine.com. [202.12.124.156])
        by gmr-mx.google.com with ESMTPS id e9e14a558f8ab-3d47a4491efsi5311955ab.0.2025.03.19.00.57.05
        for <bitcoindev@googlegroups.com>
        (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
        Wed, 19 Mar 2025 00:57:05 -0700 (PDT)
Received-SPF: pass (google.com: domain of sjors@sprovoost.nl designates 202.12.124.156 as permitted sender) client-ip=202.12.124.156;
Received: from phl-compute-10.internal (phl-compute-10.phl.internal [10.202.2.50])
	by mailfhigh.stl.internal (Postfix) with ESMTP id A389D2540198;
	Wed, 19 Mar 2025 03:57:04 -0400 (EDT)
Received: from phl-mailfrontend-02 ([10.202.2.163])
  by phl-compute-10.internal (MEProxy); Wed, 19 Mar 2025 03:57:04 -0400
X-ME-Sender: <xms:0HjaZ8U1J9Q-37yoFJq49UcRmz0FfkT6wg7V4XrYPO7-FoZHNoWaqQ>
    <xme:0HjaZwn_kj4Qyou_ukaql_rTo_ZiscnEzgs9cy5p6ZI-4opvTABf4GSMszJdNDJlC
    YlATp9g0NO8vHsQHQ>
X-ME-Received: <xmr:0HjaZwYFZZdavUK8tHswsJJrVa6QK5h1IPQi81jrec09_DpyRrZYJP_80N9KrNYOPWGM>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgddugeegjeelucetufdoteggodetrf
    dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggv
    pdfurfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpih
    gvnhhtshculddquddttddmnecujfgurheptggguffhjgffvefgkfhfvffosehtqhhmtdhh
    tddvnecuhfhrohhmpefujhhorhhsucfrrhhovhhoohhsthcuoehsjhhorhhssehsphhroh
    hvohhoshhtrdhnlheqnecuggftrfgrthhtvghrnhepveeklefgfffggfffleefhffgtddv
    udfftdduteeijedvjeevkeekgeffjeetfeejnecuvehluhhsthgvrhfuihiivgeptdenuc
    frrghrrghmpehmrghilhhfrhhomhepshhjohhrshesshhprhhovhhoohhsthdrnhhlpdhn
    sggprhgtphhtthhopedvpdhmohguvgepshhmthhpohhuthdprhgtphhtthhopegsihhttg
    hoihhnuggvvhesghhoohhglhgvghhrohhuphhsrdgtohhmpdhrtghpthhtohepghgrrhhl
    ohhnihgtohhnsehgmhgrihhlrdgtohhm
X-ME-Proxy: <xmx:0HjaZ7Xz8VJpS_bgPRUi3pSFHVUHIgIkRxV9EdOQIA3G0HVRYHzPWA>
    <xmx:0HjaZ2kmGY8YBDotQIX_Jz5dMvASJM7eMqUNgK3gifu7yBs9ywZhVw>
    <xmx:0HjaZwdN6n0PwrTdblCLkw6UrOF_m0q1vuJuJFnH3zqsQN5t9hlbcw>
    <xmx:0HjaZ4GnCKXhS7QJ1S6LyKTTpOGL9eLqQSpqRgDFssjhKnfOOPaolQ>
    <xmx:0HjaZ7w3EZKKBG5iHdMyOv9Ep6Cpsiz04_hAHWp12FjYV5vFZOX0upo8>
Feedback-ID: ie5e042df:Fastmail
Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed,
 19 Mar 2025 03:57:03 -0400 (EDT)
Content-Type: text/plain; charset="UTF-8"
Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3826.400.131.1.6\))
Subject: Re: [bitcoindev] Unbreaking testnet4
From: Sjors Provoost <sjors@sprovoost.nl>
In-Reply-To: <f0cace2b-d734-4b36-b8a1-d4364a573a19n@googlegroups.com>
Date: Wed, 19 Mar 2025 08:56:52 +0100
Cc: Garlo Nicon <garlonicon@gmail.com>
Message-Id: <688E575D-C370-4D7D-A6DB-11E0B56710B1@sprovoost.nl>
References: <hU75DurC5XToqizyA-vOKmVtmzd3uZGDKOyXuE_ogE6eQ8tPCrvX__S08fG_nrW5CjH6IUx7EPrq8KwM5KFy9ltbFBJZQCHR2ThoimRbMqU=@protonmail.com>
 <f0cace2b-d734-4b36-b8a1-d4364a573a19n@googlegroups.com>
To: Bitcoin Development Mailing List <bitcoindev@googlegroups.com>
X-Mailer: Apple Mail (2.3826.400.131.1.6)
X-Original-Sender: sjors@sprovoost.nl
X-Original-Authentication-Results: gmr-mx.google.com;       dkim=pass
 header.i=@sprovoost.nl header.s=fm2 header.b=pulenQR6;       dkim=pass
 header.i=@messagingengine.com header.s=fm1 header.b=V3mV5sSS;       spf=pass
 (google.com: domain of sjors@sprovoost.nl designates 202.12.124.156 as
 permitted sender) smtp.mailfrom=sjors@sprovoost.nl;       dmarc=pass (p=NONE
 sp=NONE dis=NONE) header.from=sprovoost.nl
Precedence: list
Mailing-list: list bitcoindev@googlegroups.com; contact bitcoindev+owners@googlegroups.com
List-ID: <bitcoindev.googlegroups.com>
X-Google-Group-Id: 786775582512
List-Post: <https://groups.google.com/group/bitcoindev/post>, <mailto:bitcoindev@googlegroups.com>
List-Help: <https://groups.google.com/support/>, <mailto:bitcoindev+help@googlegroups.com>
List-Archive: <https://groups.google.com/group/bitcoindev
List-Subscribe: <https://groups.google.com/group/bitcoindev/subscribe>, <mailto:bitcoindev+subscribe@googlegroups.com>
List-Unsubscribe: <mailto:googlegroups-manage+786775582512+unsubscribe@googlegroups.com>,
 <https://groups.google.com/group/bitcoindev/subscribe>
X-Spam-Score: -0.8 (/)



> Op 19 mrt 2025, om 08:01 heeft Garlo Nicon <garlonicon@gmail.com> het volgende geschreven:
> 
> > I propose to fix this by removing the difficulty reset rule from testnet4 through a flag day hard fork on 2026-01-01.
> 
> You can do that in a soft-fork way. Just rejecting blocks with difficulty=1, and requiring always a block with the true network difficulty, is a valid soft-fork.

Unfortunately it's a hard-fork.

> So, I assume if you change "fPowAllowMinDifficultyBlocks" from "true" to "false", when block time will be greater than unix time "1767225600", then you will get a valid soft-fork.


The fPowAllowMinDifficultyBlocks rule says that after 20 minutes the new block MUST have difficulty 1.  A block with the real difficulty will be rejected.

This is because in general the block nBits value, which announces how much work the block has, must have an exact value. It can't be higher.

In validation.cpp we have this:

if (block.nBits != GetNextWorkRequired(pindexPrev, &block, consensusParams))
    return state.Invalid(BlockValidationResult::BLOCK_INVALID_HEADER, "bad-diffbits", "incorrect proof of work");

Inside GetNextWorkRequired there is the testnet exception rule, which Antoine proposes to drop:

 if (params.fPowAllowMinDifficultyBlocks) {
    // Special difficulty rule for testnet:
    // If the new block's timestamp is more than 2* 10 minutes
    // then allow mining of a min-difficulty block.
    if (pblock->GetBlockTime() > pindexLast->GetBlockTime() + params.nPowTargetSpacing*2)
        return nProofOfWorkLimit;
    else
       ... (same difficulty as last block, unless it's a retarget)

The code comment is misleading, "allow" should be "require".

- Sjors

-- 
You received this message because you are subscribed to the Google Groups "Bitcoin Development Mailing List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bitcoindev+unsubscribe@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/bitcoindev/688E575D-C370-4D7D-A6DB-11E0B56710B1%40sprovoost.nl.