ethereum / genesis_block_generator

32 stars 255 forks source link

TypeError: 'NoneType' object is not iterable on Windows #2

Closed nicksavers closed 8 years ago

nicksavers commented 9 years ago

The script works fine on Linux, but fails on Windows (I just used a random block hash)

http://pastebin.com/L6th3zNG

C:\ethereum\make-genesis>python mk_genesis_block.py --extradata 0x675f8203a6fc688c0f45ecd52a02ee9d84dfe1b039671dcdf389d4ccf7a5dbd0 > genesis_block.json
Fetching more transactions... 50
Fetching more transactions... 100
Fetching more transactions... 150
[......]
Fetching more transactions... 9400
Fetching more transactions... 9450
Fetching more transactions... 9500
Fetching more transactions... 9550
Gathered history: 9012
Processed transactions: 20
Processed transactions: 40
Processed transactions: 60
Processed transactions: 80
Processed transactions: 100
[......]
Processed transactions: 1140
Processed transactions: 1160
Processed transactions: 1180
Processed transactions: 1200
Bad tx found (genesis output index not zero): 79a554739734b70ed834281d72a00006e576c645b486855b601257abdf3bdb75
Processed transactions: 1219
Processed transactions: 1239
Processed transactions: 1259
Processed transactions: 1279
Processed transactions: 1299
[......]
Processed transactions: 2859
Processed transactions: 2879
Processed transactions: 2899
Processed transactions: 2919
Bad tx found (genesis output index not zero): 1720d776ff374d6be4ea726f0b67f5024bcb5ebfc0fe19af50a6bedcdb4f32d2
Processed transactions: 2938
Processed transactions: 2958
Processed transactions: 2978
Processed transactions: 2998
Processed transactions: 3018
[......]
Processed transactions: 4118
Processed transactions: 4138
Processed transactions: 4158
Processed transactions: 4178
Bad tx found (genesis output index not zero): 3545933ca0510a20dacf1d0bea3c7bc3e2489642177a53c52981414cc910144d
Processed transactions: 4197
Processed transactions: 4217
Processed transactions: 4237
Processed transactions: 4257
Processed transactions: 4277
[......]
Processed transactions: 7717
Processed transactions: 7737
Processed transactions: 7757
Processed transactions: 7777
Bad tx found (genesis output index not zero): 8663b52719fa852c16331accc622f01a160d11da69f5840f2327aaa49878b3ab
Processed transactions: 7796
Processed transactions: 7816
Processed transactions: 7836
[......]
Processed transactions: 8956
Processed transactions: 8976
Processed transactions: 8996
Processed transactions: 9008
Gathered txs and heights
Bad tx found (insufficient value): f22b3fe49d7a110c4fba4361a87fdd8f88b232ecb35a0745b722c7454c026c2a
Bad tx found (insufficient value): fac5d54ea05a6546aed6cd2d5109780d42f900c5dd13a25f37911cf348afeeaf
Bad tx found (insufficient value): a4f992e56d2ff229adec52462645ae0655d54e34fcfe82a045bf3203fc3cff3b
Bad tx found (insufficient value): 103fd529135a990c207c9c89eca1df10695fd676eb10012762f4b86cb618d983
Bad tx found (insufficient value): 78c9dbf496cfb8360b7d7383f473ea75d4f788122f00667f243cd41f392d2ddf
Bad tx found (insufficient value): e85316cdecbf85408b48ab4bc786e7c19af998dee3daf1b82c39377a8afa366e
Bad tx found (insufficient value): 2a1bd037a2f01306ff69257a0bb7222b72b67ca5c7eb7deea4b7df478987f6e8
Bad tx found (insufficient value): 87b098632982a5c4086bbf806ffabb38171212533547ec925b37d37e35cc2963
Bad tx found (single output): 68ffd92d90a79b13b30f2fa97ae5c4089aca5a4b62b5300b4d8100e544c6f0d5
Bad tx found (insufficient value): 303952c770a11d78d17c97d28e83fd7b566900b90bca7e1334babba467fb843a
Bad tx found (insufficient value): a0e33074b806ff10d8b63255ce43b451751742007298fb45deffb31ad4bcfebb
Bad tx found (insufficient value): 9e2e19f19e55d0e2b6681d73cd5b374fc96e358dda37e0e89c95259a439d343f
Bad tx found (insufficient value): 1afad5f2683bde98ab7587d05abc09e9f2f41e2de243eaa8af31f02113c90cee
Bad tx found (insufficient value): 4b868f945476470a575413ea3f0b549f88fa005fd348f3d55d83a4f2b76ec145
Bad tx found (insufficient value): 8b7f5e0cddbed9a2cf3c694242ba22ce0b86ac02de029f15b13e309673eba744
Bad tx found (insufficient value): aac6464a943b8a3e0c0a83b3d4fc89ccaf4d2834b0e625b9e63bebc168f72a5f
Bad tx found (insufficient value): 7faafb670c3d5093dd8fc33e6318fb43371f89784d3c89364e3aa9756bdbec0a
Bad tx found (insufficient value): 15d51dfcb5858059128bd5ab8ac1677a772962cdeee156e85d50beaa100ce773
Bad tx found (insufficient value): 910396b5871e8847ce3a970583c60266a38fcb72656382c541043c9816abb85b
Bad tx found (insufficient value): 5513be5a84ebbcd8faf434198fdb1e90bd406db9bebfd488de86060c2b89c86f
Bad tx found (insufficient value): 8d9ef866e0b2926cbb3cbf3cb16230096ab0f3e74ec2b4ee39839a21dd4d5a0a
Bad tx found (insufficient value): 38dd77196e8e1eb3202e38a357b1acd90a11231c75067c9f9f8257a170dbb269
Bad tx found (insufficient value): 8a42a9063572c70141035fe0859cadb69d8e89ffa7df2d211d710df20abedc33
Bad tx found (insufficient value): 858575f72c333218effd0174e7f4baebe1db513043d33bb5f00c25e5575bcc5d
Bad tx found (insufficient value): 02150a031e86bd42d3659c0a7a3e1187a6c592370c5a82f65dd68168ede0523e
Bad tx found (insufficient value): 7a42bdbbafdb08ec0d2e625eb6b797af5e256e8fa0a20d83b96f99025306e251
Bad tx found (insufficient value): a805ed31ebdcf6ac75e45fd599271449cda92fbae391ce27339b49ee3a898544
Bad tx found (insufficient value): 5dee64116f78e4516ac61c4094a5165f6c2b855a74fda4fc6f884c3fcba3aa8d
Bad tx found (insufficient value): 3a63c41fab284c6f58a79d7d5fd8949a903a47a5cdc6d0c8ace224b3028afa77
Bad tx found (insufficient value): 747cf7e5a326ac2b6d44cf4a88c305b6edc2ef6aab521d81bbecf702831cd343
Bad tx found (insufficient value): bd0fc0aa53d96a229327b2738f484eea22b412c37c6dcc15680497262771576c
Bad tx found (insufficient value): d0b4a1fc977118bcd89b40f5f9ea3fed9effa72d341e5be8045bdf06a09ff5c2
Bad tx found (insufficient value): 3948a58615534335306efcef5b7e0865969a658a0ec006cd3b28f8e2c88b3f77
Bad tx found (insufficient value): 3e1a7b424dabacd5b67bac7308f4f23f4c6a11c3681f20401a1a07a9556c09d2
Bad tx found (insufficient value): ce474a3f0fe93b10d8fe144b32835a1f584290c1fd0fe02b6eb949f36ffb9ffa
Bad tx found (insufficient value): abc8ad3c8f2dc817800f6bdfdd850fc1652c6e8839753b0fdd009f18f9ef17e8
Bad tx found (insufficient value): f3aa0680665fb14622abd37afcaf365af3964a49dec68b5366d5bcba460d8167
Bad tx found (insufficient value): 25e1e8ec1b28136bbe42c99ec8f5da4a454d17bf1698d860ed28bb7ec511705b
Bad tx found (insufficient value): 05311bc7a272d1d382c4af3432f991b5fefa5768f7ecc6cb3c2c796277a4f2fa
Bad tx found (insufficient value): fce0cf89fe07216b01fc3005844e04c191c740baf39cd6b9cb1f84c9f0bfeb91
Bad tx found (insufficient value): 393e3bdb4f91a21b3f53906485ad3e71f973a3e07f3e47dd256cb2beb5bb2e61
Bad tx found (insufficient value): 46a20da936d36f698664e85fffdee7fe60fc99e479d2572380cc9e09c52b29d7
Bad tx found (insufficient value): efc5a6afd26f42bd45672118d579f35a4e56015803a82a4518de01d6b5ceaf8b
Bad tx found (insufficient value): 61d6a414a5c683465785c77e306a9ae11a72334a97977784013c32ddc0207c04
Bad tx found (insufficient value): f1bae4c63788e3eb115323b698dd0106c02f28e91edbc8739fecd391516c3979
Bad tx found (insufficient value): c8f4faab93e8e8200832d98b7457e2d78b634c1b84e47c11d1adbecdbed0bc8f
Bad tx found (insufficient value): a9cd7a0535923fa2959244b62c0ec4987d8c44e2044565628d2b29a9301b27d6
Bad tx found (insufficient value): c8822e707cbda2dbc53f098c8f0d11940c6f392ab336711304a2eb78410eef13
Bad tx found (insufficient value): e8895ba6b76a27add85b68e447c191f3ec759b16e57248ecd61b0c5c741790f1
Bad tx found (insufficient value): 1b218afad88b14ab33ea63a4c3d05b70918258cdde9fbf2cbdef394730cb69f1
Bad tx found (insufficient value): add47b60d330f11015fbc099038b919e37a5d3629d77069378d237e091f16668
Bad tx found (insufficient value): 64f4904f654437b51e8a8a90fbaa660dcf5fbfc1fe3a4b95bc2576e350a726e4
Bad tx found (insufficient value): d19bdf3620e36e3de3d9b62341f296112199eeaee234df5aa9cf840e4d5c5890
Bad tx found (insufficient value): 4ae5d706abd27200d99cdeb313ca2a9e804568c1479e2a698c70bf5108ce8318
Bad tx found (insufficient value): c607161264b5d0bbe4b58f8dfadeb4f004a796f759468e25b00cf5dc7200c75f
Bad tx found (insufficient value): 77c5798f71b18117c643173dfa89fbc1f27e1f0679cde2dbaa178f6c3380d382
Bad tx found (insufficient value): b204f4bfd140bc4d73bca07715cca6b3cb0362664c4026e51e0607e7f90cb477
Bad tx found (insufficient value): 47b58a63be196dd3a88c1a8a5dc61826ec3878f308c753cf134090a2c59aa557
Bad tx found (insufficient value): 42f9228e2d8eabdcc1415f88e8a154a33eb3714348141c5cb2dcd08bf6172d05
Gathered outputs, collecting block timestamps
Collected timestamps: 20
Collected timestamps: 40
Collected timestamps: 60
Collected timestamps: 80
Collected timestamps: 100
[......]
Collected timestamps: 2380
Collected timestamps: 2400
Collected timestamps: 2420
Traceback (most recent call last):
  File "mk_genesis_block.py", line 279, in <module>
    print json.dumps(evaluate(), indent=4)
  File "mk_genesis_block.py", line 271, in evaluate
    p = list_purchases(th)
  File "mk_genesis_block.py", line 210, in list_purchases
    t = get_block_timestamp([x['height'] - 1 for x in subpq])
  File "mk_genesis_block.py", line 141, in new_method
    c[str(arg)] = method(arg)
  File "C:\Python27\lib\site-packages\bitcoin\bci.py", line 416, in get_block_timestamp
    "%Y-%m-%dT%H:%M:%SZ")) for x in k['data']}
TypeError: 'NoneType' object is not iterable

Second time around and any attempt after that it fails at

[......]
Collected timestamps: 8380
Collected timestamps: 8400
Collected timestamps: 8420
Traceback (most recent call last):
  File "mk_genesis_block.py", line 279, in <module>
    print json.dumps(evaluate(), indent=4)
  File "mk_genesis_block.py", line 271, in evaluate
    p = list_purchases(th)
  File "mk_genesis_block.py", line 210, in list_purchases
    t = get_block_timestamp([x['height'] - 1 for x in subpq])
  File "mk_genesis_block.py", line 141, in new_method
    c[str(arg)] = method(arg)
  File "C:\Python27\lib\site-packages\bitcoin\bci.py", line 416, in get_block_timestamp
    "%Y-%m-%dT%H:%M:%SZ")) for x in k['data']}
TypeError: 'NoneType' object is not iterable

Finally after switching from the 32-bit installer to the 64-bit installer, the process finally continued

Finished, total purchased: 60108506260000000000000000
Foundation wallet creator address: 5abfec25f74cd88437631a7731906932776356f9
Foundation balance: 11901484239480000000000000

However throwing away the cache and restarting the process with Python 2.7 64-bit, a similar error occurs while processing transactions. Retried it a couple of times and got the same result. Then after waiting 5 minutes and trying again, it finally worked with the result as mentioned above.

A small side-note: The final result is 1,037,541 bytes (MD5: 29B20905BD3796E95A1FEB3F83FADEA6) Whereas the result on Linux is 1,010,850 bytes (MD5: 9E1DA9D4BCA3773B1501C871D36731F4)

caretcaret commented 9 years ago

Filesize difference is due to Windows using CRLF as newline, while Linux uses LF. There are 26691 lines in the genesis block, and the two filesizes differ by 26691.

nicksavers commented 9 years ago

You are correct that they have the same number of lines, but the files are notably different. See this screenshot of a diff: http://i.imgur.com/b0lpuHw.png

tgerring commented 9 years ago

I don't think output order is guaranteed. Sort then compare less new line differences

nicksavers commented 9 years ago

Ok apart from order they are the same. I suppose, its good as long as they generate the same genesis block hash after importing them into Geth

chriseth commented 8 years ago

Note that this does not only happen on Windows! I experienced this twice on Linux, but it went through on the third try.

frozeman commented 8 years ago

Should be fixed in the latest changes by vitalik

jeroenn13 commented 8 years ago

Its not fixed. I still have this issue. used the new version os: ubuntu server 15.04 64bit.

http://pastebin.com/jpr0En0g

frozeman commented 8 years ago

Retry multiple times, its when the API doesn't send the right stuff. Also try deleting the "cache" folder first.

jeroenn13 commented 8 years ago

That worked. I created another issue to raise awareness. Will close it. Thank you