shohu / c0ban

c0ban source tree
MIT License
0 stars 0 forks source link

Pass for sendheaders.py #37

Closed shohu closed 6 years ago

shohu commented 6 years ago
# test/functional/sendheaders.py
2018-05-31 06:41:49.038000 TestFramework (INFO): Initializing test directory /tmp/testiapssv3c
2018-05-31 06:41:49.535000 TestFramework.mininode (INFO): Connecting to Bitcoin Node: 127.0.0.1:13841
2018-05-31 06:41:49.536000 TestFramework.mininode (INFO): Connecting to Bitcoin Node: 127.0.0.1:13841
2018-05-31 06:41:49.800000 TestFramework (INFO): Part 1: headers don't start before sendheaders message...
2018-05-31 06:41:50.256000 TestFramework (INFO): Part 1: success!
2018-05-31 06:41:50.256000 TestFramework (INFO): Part 2: announce blocks with headers after sendheaders message...
2018-05-31 06:41:59.633000 TestFramework (INFO): Part 2: success!
2018-05-31 06:41:59.633000 TestFramework (INFO): Part 3: headers announcements can stop after large reorg, and resume after headers/inv from peer...
2018-05-31 06:42:01.284000 TestFramework (INFO): Part 3: success!
2018-05-31 06:42:01.284000 TestFramework (INFO): Part 4: Testing direct fetch behavior...
2018-05-31 06:42:02.168000 TestFramework (INFO): Part 4: success!
2018-05-31 06:42:02.172000 TestFramework (INFO): Part 5: Testing handling of unconnecting headers
2018-05-31 06:43:02.194000 TestFramework (ERROR): Assertion failed
Traceback (most recent call last):
  File "/c0ban/test/functional/test_framework/test_framework.py", line 120, in main
    self.run_test()
  File "test/functional/sendheaders.py", line 498, in run_test
    test_node.wait_for_getheaders()
  File "/c0ban/test/functional/test_framework/mininode.py", line 1592, in wait_for_getheaders
    wait_until(test_function, timeout=timeout, lock=mininode_lock)
  File "/c0ban/test/functional/test_framework/util.py", line 222, in wait_until
    assert_greater_than(timeout, time.time())
  File "/c0ban/test/functional/test_framework/util.py", line 42, in assert_greater_than
    raise AssertionError("%s <= %s" % (str(thing1), str(thing2)))
AssertionError: 1527748982.1728113 <= 1527748982.194451
2018-05-31 06:43:02.206000 TestFramework (INFO): Stopping nodes
2018-05-31 06:43:04.371000 TestFramework (WARNING): Not cleaning up dir /tmp/testiapssv3c
2018-05-31 06:43:04.371000 TestFramework (ERROR): Test failed. Test logging available at /tmp/testiapssv3c/test_framework.log

debug.log

2018-05-31 06:42:02.252993 sending inv (37 bytes) peer=2
2018-05-31 06:42:02.253092 received: block (145 bytes) peer=3
2018-05-31 06:42:02.253170 received block 614a0f3641075dd31f8ffe2708f5e8c755ac9ef78da28308e30ecd79070578b3 peer=3
2018-05-31 06:42:02.253280 Misbehaving: 127.0.0.1:55548 peer=3 (50 -> 100) BAN THRESHOLD EXCEEDED
2018-05-31 06:42:02.253298 ERROR: ProcessNewBlock: AcceptBlock FAILED
2018-05-31 06:42:02.253330 sending reject (49 bytes) peer=3
2018-05-31 06:42:02.253424 Warning: not banning local peer 127.0.0.1:55548!
shohu commented 6 years ago

debug.log

2018-06-01 07:39:35.828442 TESTTTTTT222 CheckBlockHeader GetPoWHash height = 202, a3952f2f351d9a76fbbc6a4a4ad4c5c8c17d6cfa706e325a961fbadd3dae8799
2018-06-01 07:39:35.828580 Misbehaving: 127.0.0.1:51612 peer=3 (0 -> 50)
2018-06-01 07:39:35.828601 ERROR: ProcessNewBlock: AcceptBlock FAILED
2018-06-01 07:39:35.828624 sending reject (49 bytes) peer=3
shohu commented 6 years ago

I tested again when got following debug log.

2018-06-01 08:57:38.548503 ERROR: AcceptBlockHeader: Consensus::CheckBlockHeader: 3d6930bd449cf2a4bd76e47fa09ee47faac55c4b7f7e21eabf2dce5a96b76770, high-hash, proof of work failed (code 16)
shohu commented 6 years ago

I changed to #35 source. I got success.

# test/functional/sendheaders.py
2018-06-05 07:07:09.904000 TestFramework (INFO): Initializing test directory /tmp/testtuwyihtw
2018-06-05 07:07:10.396000 TestFramework.mininode (INFO): Connecting to Bitcoin Node: 127.0.0.1:13618
2018-06-05 07:07:10.397000 TestFramework.mininode (INFO): Connecting to Bitcoin Node: 127.0.0.1:13618
2018-06-05 07:07:10.659000 TestFramework (INFO): Part 1: headers don't start before sendheaders message...
2018-06-05 07:07:11.144000 TestFramework (INFO): Part 1: success!
2018-06-05 07:07:11.144000 TestFramework (INFO): Part 2: announce blocks with headers after sendheaders message...
2018-06-05 07:07:20.859000 TestFramework (INFO): Part 2: success!
2018-06-05 07:07:20.860000 TestFramework (INFO): Part 3: headers announcements can stop after large reorg, and resume after headers/inv from peer...
2018-06-05 07:07:22.559000 TestFramework (INFO): Part 3: success!
2018-06-05 07:07:22.559000 TestFramework (INFO): Part 4: Testing direct fetch behavior...
2018-06-05 07:07:23.454000 TestFramework (INFO): Part 4: success!
2018-06-05 07:07:23.458000 TestFramework (INFO): Part 5: Testing handling of unconnecting headers
2018-06-05 07:07:32.701000 TestFramework (INFO): Part 5: success!
2018-06-05 07:07:32.701000 TestFramework (INFO): Stopping nodes
2018-06-05 07:07:34.884000 TestFramework (INFO): Cleaning up
2018-06-05 07:07:34.889000 TestFramework (INFO): Tests successful