summaryrefslogtreecommitdiff
path: root/10/b55116000b9277ebba3bf48b153207bde14445
blob: 98885279a377237dc26491c8e7ecb962caaeee58 (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
Received: from sog-mx-1.v43.ch3.sourceforge.com ([172.29.43.191]
	helo=mx.sourceforge.net)
	by sfs-ml-2.v29.ch3.sourceforge.com with esmtp (Exim 4.76)
	(envelope-from <bob_bitcoin@mcelrath.org>) id 1XGTvX-0005lx-G8
	for Bitcoin-development@lists.sourceforge.net;
	Sun, 10 Aug 2014 14:16:51 +0000
Received-SPF: pass (sog-mx-1.v43.ch3.sourceforge.com: domain of mcelrath.org
	designates 50.31.3.130 as permitted sender)
	client-ip=50.31.3.130; envelope-from=bob_bitcoin@mcelrath.org;
	helo=mcelrath.org; 
Received: from moya.mcelrath.org ([50.31.3.130] helo=mcelrath.org)
	by sog-mx-1.v43.ch3.sourceforge.com with esmtps (TLSv1:AES256-SHA:256)
	(Exim 4.76) id 1XGTvW-0003lJ-ER
	for Bitcoin-development@lists.sourceforge.net;
	Sun, 10 Aug 2014 14:16:51 +0000
Received: from mcelrath.org (localhost [127.0.0.1])
	by mcelrath.org (8.14.3/8.14.3/Debian-9.4) with ESMTP id s7AE7K3I030618
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT);
	Sun, 10 Aug 2014 14:07:20 GMT
Received: (from mcelrath@localhost)
	by mcelrath.org (8.14.3/8.14.3/Submit) id s7AE7Kfx030617;
	Sun, 10 Aug 2014 14:07:20 GMT
X-Authentication-Warning: mcelrath.org: mcelrath set sender to
	bob_bitcoin@mcelrath.org using -f
Date: Sun, 10 Aug 2014 14:07:19 +0000
From: Bob McElrath <bob_bitcoin@mcelrath.org>
To: "mbde@bitwatch.co" <mbde@bitwatch.co>
Message-ID: <20140810140719.GA20493@mcelrath.org>
References: <53E776D1.1010503@bitwatch.co>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha1;
	protocol="application/pgp-signature"; boundary="1UWUbFP1cBYEclgG"
Content-Disposition: inline
In-Reply-To: <53E776D1.1010503@bitwatch.co>
User-Agent: Mutt/1.5.20 (2009-06-14)
X-Spam-Score: -2.2 (--)
X-Spam-Report: Spam Filtering performed by mx.sourceforge.net.
	See http://spamassassin.org/tag/ for more details.
	-1.5 SPF_CHECK_PASS SPF reports sender host as permitted sender for
	sender-domain
	-0.0 SPF_HELO_PASS          SPF: HELO matches SPF record
	-0.0 SPF_PASS               SPF: sender matches SPF record
	-0.7 RP_MATCHES_RCVD Envelope sender domain matches handover relay
	domain
X-Headers-End: 1XGTvW-0003lJ-ER
Cc: Bitcoin-development@lists.sourceforge.net
Subject: Re: [Bitcoin-development] Synchronization: 19.5 % orphaned blocks
 at height 197'324
X-BeenThere: bitcoin-development@lists.sourceforge.net
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: <bitcoin-development.lists.sourceforge.net>
List-Unsubscribe: <https://lists.sourceforge.net/lists/listinfo/bitcoin-development>,
	<mailto:bitcoin-development-request@lists.sourceforge.net?subject=unsubscribe>
List-Archive: <http://sourceforge.net/mailarchive/forum.php?forum_name=bitcoin-development>
List-Post: <mailto:bitcoin-development@lists.sourceforge.net>
List-Help: <mailto:bitcoin-development-request@lists.sourceforge.net?subject=help>
List-Subscribe: <https://lists.sourceforge.net/lists/listinfo/bitcoin-development>,
	<mailto:bitcoin-development-request@lists.sourceforge.net?subject=subscribe>
X-List-Received-Date: Sun, 10 Aug 2014 14:16:51 -0000


--1UWUbFP1cBYEclgG
Content-Type: multipart/mixed; boundary="/04w6evG8XlLl3ft"
Content-Disposition: inline


--/04w6evG8XlLl3ft
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

I had the same problem (repeatedly) which came down a hardware problem.  Bitcoin
more than other applications is very sensitive to single bit flips in memory or
during computation.  (In the end I under-clocked my CPU and RAM to fix the
problem)

Attached is a small python script which will run sha256 on random data
repeatedly and will print a message if a mismatch is found.  For me it took many
hours of running before a sha256 mismatch, but one is enough to fork the
blockchain.

mbde@bitwatch.co [mbde@bitwatch.co] wrote:
> Hello all,
> 
> I'm currently synchronizing a new node and right now, at a progress of a
> height of 197'324 blocks, I count in my debug.log an aweful amount of
> 38'447 orphaned blocks which is about 19.5 %.
> 
> It has been I while since I watched the synchronization process closely,
> but this number seems pretty high to me.
> 
> I'm wondering about the following: would it be possible for a malicious
> party to generate chains of blocks with low difficulity which are not
> part of the main chain to slow down the sync process?
> 
> 
> Build and version information:
> https://github.com/jmcorgan/bitcoin/tree/026686c7de76dfde6fcacfc3d667fb3418a946a7
> (sipa/jmcorgan address index)
> Rebased with:
> https://github.com/bitcoin/bitcoin/tree/94e1b9e05b96e4fe639e5b07b7a53ea216170962
> (almost up-to-date mainline)
> 
> Compressed debug.log attached:
> https://www.dropbox.com/s/uvtd91xiwmdmun7/debug.7z?m=
> (filesize: 7.67 MB, uncompressed: 41.3 MB)
> 
> ------------------------------------------------------------------------------
> _______________________________________________
> Bitcoin-development mailing list
> Bitcoin-development@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/bitcoin-development
--
Cheers, Bob McElrath

"The individual has always had to struggle to keep from being overwhelmed by
the tribe.  If you try it, you will be lonely often, and sometimes frightened.
But no price is too high to pay for the privilege of owning yourself." 
    -- Friedrich Nietzsche

--/04w6evG8XlLl3ft
Content-Type: text/x-python; charset=us-ascii
Content-Disposition: attachment; filename="sha256check.py"
Content-Transfer-Encoding: quoted-printable

#!/usr/bin/python

# Repeatedly run a sha256 on random data.  Keeps a rolling buffer of the la=
st
# <buflen> hashes and re-checks them.  Prints an error ONLY if a mismatch is
# found.  If a mismatch is found, you have a hardware problem.

=66rom hashlib import sha256
=66rom collections import deque
import random

buflen =3D 100000
hashbuf =3D deque(maxlen=3Dbuflen)

for i in range(buflen):
    hashbuf.append([str(i), sha256(str(i)).hexdigest()])

while True:
    k, khash =3D hashbuf.popleft()
    pophash =3D sha256(k).hexdigest()
    if pophash !=3D khash:
        print "ERROR: sha256(%s) =3D %s does not match:"%(k, khash)
        print "       sha256(%s) =3D %s"%(k, pophash)
    k =3D str(random.getrandbits(1000))
    khash =3D sha256(k).hexdigest()
    hashbuf.append([k, khash])

--/04w6evG8XlLl3ft--

--1UWUbFP1cBYEclgG
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: Digital signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)

iEYEARECAAYFAlPnfJcACgkQjwioWRGe9K3dTACeJOxJ4iScKcqE51LH6QynE06+
dVAAnR4ebLRpvFyZW9q03ESqyA/1AE69
=s2y4
-----END PGP SIGNATURE-----

--1UWUbFP1cBYEclgG--