shohu / c0ban

c0ban source tree
MIT License
0 stars 0 forks source link

Pass for p2p-segwit.py #36

Closed shohu closed 6 years ago

shohu commented 6 years ago
# test/functional/p2p-segwit.py
2018-05-31 06:22:06.466000 TestFramework (INFO): Initializing test directory /tmp/testz0ei5fnw
2018-05-31 06:22:06.995000 TestFramework.mininode (INFO): Connecting to Bitcoin Node: 127.0.0.1:15048
2018-05-31 06:22:06.996000 TestFramework.mininode (INFO): Connecting to Bitcoin Node: 127.0.0.1:15048
2018-05-31 06:22:06.996000 TestFramework.mininode (INFO): Connecting to Bitcoin Node: 127.0.0.1:15049
2018-05-31 06:22:07.049000 TestFramework (INFO): Starting tests before segwit lock in:
2018-05-31 06:22:07.050000 TestFramework (INFO): Verifying NODE_WITNESS service bit
2018-05-31 06:22:07.050000 TestFramework (INFO): Testing non-witness transaction
2018-05-31 06:22:07.350000 TestFramework (INFO): Testing behavior of unnecessary witnesses
2018-05-31 06:22:08.142000 TestFramework (INFO): Testing block relay
2018-05-31 06:22:10.998000 TestFramework (INFO): Testing getblocktemplate setting of segwit versionbit (before lockin)
2018-05-31 06:22:14.054000 TestFramework (INFO): Testing behavior post lockin, pre-activation
2018-05-31 06:22:14.359000 TestFramework (INFO): Testing behavior of unnecessary witnesses
2018-05-31 06:22:15.170000 TestFramework (INFO): Testing relay of witness transactions
2018-05-31 06:22:17.553000 TestFramework (INFO): Testing block relay
2018-05-31 06:23:17.702000 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/p2p-segwit.py", line 1915, in run_test
    self.test_block_relay(segwit_activated=False)
  File "test/functional/p2p-segwit.py", line 956, in test_block_relay
    self.test_node.announce_block_and_wait_for_getdata(block1, use_header=False)
  File "test/functional/p2p-segwit.py", line 62, in announce_block_and_wait_for_getdata
    self.wait_for_getdata()
  File "/c0ban/test/functional/test_framework/mininode.py", line 1588, in wait_for_getdata
    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: 1527747797.6593795 <= 1527747797.7025087
2018-05-31 06:23:17.718000 TestFramework (INFO): Stopping nodes
2018-05-31 06:23:19.961000 TestFramework (WARNING): Not cleaning up dir /tmp/testz0ei5fnw
2018-05-31 06:23:19.962000 TestFramework (ERROR): Test failed. Test logging available at /tmp/testz0ei5fnw/test_framework.log
shohu commented 6 years ago

debug.log node0

2018-06-01 04:42:26.024002 TESTTTTTT222 CheckBlockHeader GetPoWHash height = 288, b4c86b46ccc0c5c1bbd57f3027b6bab8a52ce8526af581c94190240078668ea6
2018-06-01 04:42:26.024222 Misbehaving: 127.0.0.1:56564 peer=2 (150 -> 200)
2018-06-01 04:42:26.024247 ERROR: ProcessNewBlock: AcceptBlock FAILED

c++

bool ProcessNewBlock(const CChainParams& chainparams, const std::shared_ptr<const CBlock> pblock, bool fForceProcessing, bool *fNewBlock)
{
    {
        CBlockIndex *pindex = nullptr;
        if (fNewBlock) *fNewBlock = false;
        CValidationState state;
        // Ensure that CheckBlock() passes before calling AcceptBlock, as
        // belt-and-suspenders.
        bool ret = CheckBlock(*pblock, state, chainparams.GetConsensus());

        LOCK(cs_main);

        if (ret) {
            // Store to disk
            ret = AcceptBlock(pblock, state, chainparams, &pindex, fForceProcessing, nullptr, fNewBlock);
        }
        CheckBlockIndex(chainparams.GetConsensus());
        if (!ret) {
            GetMainSignals().BlockChecked(*pblock, state);
            return error("%s: AcceptBlock FAILED", __func__);
        }
    }
 :
shohu commented 6 years ago
2018-06-01 07:36:26.550384 ERROR: AcceptBlockHeader: Consensus::CheckBlockHeader: 2d5532f6c5fe7400ac9c49773e1210f909e9abec94c2d7a02d10a434e4ea7a91, high-hash, proof of work failed (code 16)
shohu commented 6 years ago

I changed to #35 source. I got success.

# test/functional/p2p-segwit.py
2018-06-05 06:58:08.654000 TestFramework (INFO): Initializing test directory /tmp/testdgs76djd
2018-06-05 06:58:09.159000 TestFramework.mininode (INFO): Connecting to Bitcoin Node: 127.0.0.1:12762
2018-06-05 06:58:09.160000 TestFramework.mininode (INFO): Connecting to Bitcoin Node: 127.0.0.1:12762
2018-06-05 06:58:09.160000 TestFramework.mininode (INFO): Connecting to Bitcoin Node: 127.0.0.1:12763
2018-06-05 06:58:09.211000 TestFramework (INFO): Starting tests before segwit lock in:
2018-06-05 06:58:09.212000 TestFramework (INFO): Verifying NODE_WITNESS service bit
2018-06-05 06:58:09.212000 TestFramework (INFO): Testing non-witness transaction
2018-06-05 06:58:09.600000 TestFramework (INFO): Testing behavior of unnecessary witnesses
2018-06-05 06:58:10.400000 TestFramework (INFO): Testing block relay
2018-06-05 06:58:13.285000 TestFramework (INFO): Testing getblocktemplate setting of segwit versionbit (before lockin)
2018-06-05 06:58:18.355000 TestFramework (INFO): Testing behavior post lockin, pre-activation
2018-06-05 06:58:18.698000 TestFramework (INFO): Testing behavior of unnecessary witnesses
2018-06-05 06:58:19.494000 TestFramework (INFO): Testing relay of witness transactions
2018-06-05 06:58:21.865000 TestFramework (INFO): Testing block relay
2018-06-05 06:58:24.692000 TestFramework (INFO): Testing P2SH witness transactions
2018-06-05 06:58:25.339000 TestFramework (INFO): Testing standardness of v0 outputs (before activation)
2018-06-05 06:58:25.762000 TestFramework (INFO): Testing behavior after segwit activation
2018-06-05 06:58:26.094000 TestFramework (INFO): Testing P2SH witness transactions
2018-06-05 06:58:26.634000 TestFramework (INFO): Testing witness commitments
2018-06-05 06:58:27.174000 TestFramework (INFO): Testing witness block malleability
2018-06-05 06:58:27.773000 TestFramework (INFO): Testing witness block size limit
2018-06-05 06:58:32.770000 TestFramework (INFO): Testing extra witness data in tx
2018-06-05 06:58:33.245000 TestFramework (INFO): Testing maximum witness push size
2018-06-05 06:58:33.509000 TestFramework (INFO): Testing maximum witness program length
2018-06-05 06:58:33.724000 TestFramework (INFO): Testing witness input length
2018-06-05 06:58:34.254000 TestFramework (INFO): Testing block relay
2018-06-05 06:58:35.365000 TestFramework (INFO): Testing relay of witness transactions
2018-06-05 06:58:36.565000 TestFramework (INFO): Testing standardness of v0 outputs (after activation)
2018-06-05 06:58:37.041000 TestFramework (INFO): Testing standardness/consensus for segwit versions (0-16)
2018-06-05 06:58:41.327000 TestFramework (INFO): Testing premature coinbase witness spend
2018-06-05 06:58:41.925000 TestFramework (INFO): Testing uncompressed pubkeys
2018-06-05 06:58:42.835000 TestFramework (INFO): Testing segwit signature hash version 1
2018-06-05 06:59:04.784000 TestFramework (INFO): Testing detection of non-standard P2WSH witness
2018-06-05 06:59:06.782000 TestFramework (INFO): Testing software upgrade after softfork activation
2018-06-05 06:59:12.324000 TestFramework (INFO): Testing sigops limit
2018-06-05 06:59:12.928000 TestFramework (INFO): Stopping nodes
2018-06-05 06:59:15.145000 TestFramework (INFO): Cleaning up
2018-06-05 06:59:15.166000 TestFramework (INFO): Tests successful