Pages:
Author

Topic: Gocoin - totally different bitcoin client with deterministic cold wallet - page 4. (Read 38500 times)

sr. member
Activity: 467
Merit: 266
In that case, the node is supposed to return headers starting from the genesis block. The relevant code of bitcoin core is in main.cpp (line 4886-)

Code:
        if (locator.IsNull())
        {
            // If locator is null, return the hashStop block
            BlockMap::iterator mi = mapBlockIndex.find(hashStop);
            if (mi == mapBlockIndex.end())
                return true;
            pindex = (*mi).second;
        }
        else
        {
            // Find the last block the caller has in the main chain
            pindex = FindForkInGlobalIndex(chainActive, locator);
            if (pindex)
                pindex = chainActive.Next(pindex);
        }

...

CBlockIndex* FindForkInGlobalIndex(const CChain& chain, const CBlockLocator& locator)
{
    // Find the first block the caller has in the main chain
    BOOST_FOREACH(const uint256& hash, locator.vHave) {
        BlockMap::iterator mi = mapBlockIndex.find(hash);
        if (mi != mapBlockIndex.end())
        {
            CBlockIndex* pindex = (*mi).second;
            if (chain.Contains(pindex))
                return pindex;
        }
    }
    return chain.Genesis();
}


I have no clue why there is a different behavior if the locator is null.
legendary
Activity: 2053
Merit: 1354
aka tonikt
but there is only one locator in that getheaders request
it'd print them all, but there was only one.
sr. member
Activity: 467
Merit: 266
Code:
Commiting block 0b1c05438c178aa1976b713a0b794d705f955b99236a2bcc9cd8609b68db92bf -> 7cd3ee22eab70c6bc23fe7d43c19a797eb9529e9c9bc71aaca6c8b9f9c3496f4
Undo block 102 748223dc39df65a8c88ef9af80f98cbf130a2f8cfdf1900ff84f1bcf1fcc04b2 0 KB
 - New TOP 103
Current last 0b1c05438c178aa1976b713a0b794d705f955b99236a2bcc9cd8609b68db92bf

GetHeaders 1 up to 0000000000000000000000000000000000000000000000000000000000000000
 ? 748223dc39df65a8c88ef9af80f98cbf130a2f8cfdf1900ff84f1bcf1fcc04b2   found: true
sending back 0 headers

Isn't it supposed to return the new fork?
I don't think so, because 748223dc39df65a8c88ef9af80f98cbf130a2f8cfdf1900ff84f1bcf1fcc04b2 has no children.


748223dc39df65a8c88ef9af80f98cbf130a2f8cfdf1900ff84f1bcf1fcc04b2 is no longer on the main chain, so you're supposed to ignore it and try the next locator. getheaders/getblocks are used by your peers to get the main chain, they don't care about forks.
legendary
Activity: 2053
Merit: 1354
aka tonikt
Code:
Commiting block 0b1c05438c178aa1976b713a0b794d705f955b99236a2bcc9cd8609b68db92bf -> 7cd3ee22eab70c6bc23fe7d43c19a797eb9529e9c9bc71aaca6c8b9f9c3496f4
Undo block 102 748223dc39df65a8c88ef9af80f98cbf130a2f8cfdf1900ff84f1bcf1fcc04b2 0 KB
 - New TOP 103
Current last 0b1c05438c178aa1976b713a0b794d705f955b99236a2bcc9cd8609b68db92bf

GetHeaders 1 up to 0000000000000000000000000000000000000000000000000000000000000000
 ? 748223dc39df65a8c88ef9af80f98cbf130a2f8cfdf1900ff84f1bcf1fcc04b2   found: true
sending back 0 headers

Isn't it supposed to return the new fork?
I don't think so, because 748223dc39df65a8c88ef9af80f98cbf130a2f8cfdf1900ff84f1bcf1fcc04b2 has no children.
sr. member
Activity: 467
Merit: 266
Oops, you are right. I thought that was b2.

How about:

Code:
Commiting block 0b1c05438c178aa1976b713a0b794d705f955b99236a2bcc9cd8609b68db92bf -> 7cd3ee22eab70c6bc23fe7d43c19a797eb9529e9c9bc71aaca6c8b9f9c3496f4
Undo block 102 748223dc39df65a8c88ef9af80f98cbf130a2f8cfdf1900ff84f1bcf1fcc04b2 0 KB
 - New TOP 103
Current last 0b1c05438c178aa1976b713a0b794d705f955b99236a2bcc9cd8609b68db92bf

GetHeaders 1 up to 0000000000000000000000000000000000000000000000000000000000000000
 ? 748223dc39df65a8c88ef9af80f98cbf130a2f8cfdf1900ff84f1bcf1fcc04b2   found: true
sending back 0 headers

Isn't it supposed to return the new fork?
legendary
Activity: 2053
Merit: 1354
aka tonikt
But is says "We saw b2 first so it takes priority."
So b3 should be orphaned...
Or not?

sr. member
Activity: 467
Merit: 266
Actually, I think the problem comes from B3 (7cd3ee22eab70c6bc23fe7d43c19a797eb9529e9c9bc71aaca6c8b9f9c3496f4).

Code:
Commiting block 7cd3ee22eab70c6bc23fe7d43c19a797eb9529e9c9bc71aaca6c8b9f9c3496f4 -> 104cbafb5906c7b9fe28eba9b288eea1acec306320c53cd49ac1a5dd0e673ce1
 - Orphaned 102
Orphaned block: 102 7cd3ee22eab70c6bc23fe7d43c19a797eb9529e9c9bc71aaca6c8b9f9c3496f4 0 KB

That one shouldn't be orphaned because

Code:
        // We now have the following chain (which output is spent is in parentheses):
        //     genesis -> b1 (0) -> b2 (1)
        //
        // so fork like this:
        //
        //     genesis -> b1 (0) -> b2 (1)
        //                      \-> b3 (1)
        //
        // Nothing should happen at this point. We saw b2 first so it takes priority.
legendary
Activity: 2053
Merit: 1354
aka tonikt
Search for  Error because the tool continues for a while after a failure. You got a problem at block b4. This tool is truly a pain to use though. B4 should have caused a reorganization but your node stayed on the same fork.

OK... that's helpful - thank you.
sr. member
Activity: 467
Merit: 266
Search for  Error because the tool continues for a while after a failure. You got a problem at block b4. This tool is truly a pain to use though. B4 should have caused a reorganization but your node stayed on the same fork.
legendary
Activity: 2053
Merit: 1354
aka tonikt
It's also not very stable.

Sometimes it gets stuck in some infinite loops like:
Code:
06:17:52 17 BitcoindComparisonTool$1.onPreMessageReceived: Found header 6b81558bbf532017db214d7996339c7d798a2644265e962196eaf681c2dad149
06:17:52 17 BitcoindComparisonTool$1.onPreMessageReceived: Found header 6b81558bbf532017db214d7996339c7d798a2644265e962196eaf681c2dad149
06:17:52 17 BitcoindComparisonTool$1.onPreMessageReceived: Found header 6b81558bbf532017db214d7996339c7d798a2644265e962196eaf681c2dad149
[...]
06:17:52 17 BitcoindComparisonTool$1.onPreMessageReceived: Found header 6b81558bbf532017db214d7996339c7d798a2644265e962196eaf681c2dad149
06:17:52 17 BitcoindComparisonTool$1.onPreMessageReceived: Found header 6b81558bbf532017db214d7996339c7d798a2644265e962196eaf681c2dad149

I wish it was working, because it could indeed be very helpful, but there are just so many issues with this tool that it seems more like a waste of time, rather than a help.

But I will try to work some more on it - fix it or something... will keep you updated.
legendary
Activity: 2053
Merit: 1354
aka tonikt
Sorry, maybe I'm crazy or stupid, but I think this tool is somehow broken.

I spent a couple of hours on it already; I don't see what Gocoin would be doing wrong at this specific moment...
I have no idea why the tool says BitcoindComparisonTool.main: Block "b8" completed processing - and then ends without a word.

Log from the tool:
Code:
05:47:31 1 BitcoindComparisonTool.main: Testing block b1 104cbafb5906c7b9fe28eba9b288eea1acec306320c53cd49ac1a5dd0e673ce1
05:47:31 17 BitcoindComparisonTool$1.onPreMessageReceived: Found header 635e870a77419af8cd8fc1a56b45d7e54846707559c61dd454c088dbf09be771
05:47:31 17 BitcoindComparisonTool$1.onPreMessageReceived: Sending header (635e870a77419af8cd8fc1a56b45d7e54846707559c61dd454c088dbf09be771) -> 104cbafb5906c7b9fe28eba9b288eea1acec306320c53cd49ac1a5dd0e673ce1
05:47:31 1 BitcoindComparisonTool.main: Sent inv with block 104cbafb5906c7b9fe28eba9b288eea1acec306320c53cd49ac1a5dd0e673ce1
05:47:31 17 BitcoindComparisonTool$1.onPreMessageReceived: Requested 104cbafb5906c7b9fe28eba9b288eea1acec306320c53cd49ac1a5dd0e673ce1
05:47:31 17 BitcoindComparisonTool$1.onPreMessageReceived: Got header from bitcoind 104cbafb5906c7b9fe28eba9b288eea1acec306320c53cd49ac1a5dd0e673ce1
05:47:31 1 BitcoindComparisonTool.main: Block "b1" completed processing
05:47:31 1 BitcoindComparisonTool.main: Testing block b2 748223dc39df65a8c88ef9af80f98cbf130a2f8cfdf1900ff84f1bcf1fcc04b2
05:47:31 17 BitcoindComparisonTool$1.onPreMessageReceived: Found header 104cbafb5906c7b9fe28eba9b288eea1acec306320c53cd49ac1a5dd0e673ce1
05:47:31 17 BitcoindComparisonTool$1.onPreMessageReceived: Sending header (104cbafb5906c7b9fe28eba9b288eea1acec306320c53cd49ac1a5dd0e673ce1) -> 748223dc39df65a8c88ef9af80f98cbf130a2f8cfdf1900ff84f1bcf1fcc04b2
05:47:31 1 BitcoindComparisonTool.main: Sent inv with block 748223dc39df65a8c88ef9af80f98cbf130a2f8cfdf1900ff84f1bcf1fcc04b2
05:47:31 17 BitcoindComparisonTool$1.onPreMessageReceived: Requested 748223dc39df65a8c88ef9af80f98cbf130a2f8cfdf1900ff84f1bcf1fcc04b2
05:47:31 17 BitcoindComparisonTool$1.onPreMessageReceived: Got header from bitcoind 748223dc39df65a8c88ef9af80f98cbf130a2f8cfdf1900ff84f1bcf1fcc04b2
05:47:31 1 BitcoindComparisonTool.main: Block "b2" completed processing
05:47:31 17 BitcoindComparisonTool$1.onPreMessageReceived: Found header 748223dc39df65a8c88ef9af80f98cbf130a2f8cfdf1900ff84f1bcf1fcc04b2
05:47:31 1 BitcoindComparisonTool.main: Testing block b2 748223dc39df65a8c88ef9af80f98cbf130a2f8cfdf1900ff84f1bcf1fcc04b2
05:47:31 1 BitcoindComparisonTool.main: Sent inv with block 748223dc39df65a8c88ef9af80f98cbf130a2f8cfdf1900ff84f1bcf1fcc04b2
05:47:31 17 BitcoindComparisonTool$1.onPreMessageReceived: Found header 748223dc39df65a8c88ef9af80f98cbf130a2f8cfdf1900ff84f1bcf1fcc04b2
05:47:31 17 BitcoindComparisonTool$1.onPreMessageReceived: Found header 748223dc39df65a8c88ef9af80f98cbf130a2f8cfdf1900ff84f1bcf1fcc04b2
05:47:31 17 BitcoindComparisonTool$1.onPreMessageReceived: Found header 748223dc39df65a8c88ef9af80f98cbf130a2f8cfdf1900ff84f1bcf1fcc04b2
05:47:31 17 BitcoindComparisonTool$1.onPreMessageReceived: Found header 748223dc39df65a8c88ef9af80f98cbf130a2f8cfdf1900ff84f1bcf1fcc04b2
05:47:31 17 BitcoindComparisonTool$1.onPreMessageReceived: Got empty header message from bitcoind
05:47:31 1 BitcoindComparisonTool.main: Block "b2" completed processing
05:47:31 17 BitcoindComparisonTool$1.onPreMessageReceived: Found header 748223dc39df65a8c88ef9af80f98cbf130a2f8cfdf1900ff84f1bcf1fcc04b2
05:47:31 1 BitcoindComparisonTool.main: Testing block b3 7cd3ee22eab70c6bc23fe7d43c19a797eb9529e9c9bc71aaca6c8b9f9c3496f4
05:47:31 1 AbstractBlockChain.connectBlock: Block forks the chain at height 101/block 104cbafb5906c7b9fe28eba9b288eea1acec306320c53cd49ac1a5dd0e673ce1, but it did not cause a reorganize:
7cd3ee22eab70c6bc23fe7d43c19a797eb9529e9c9bc71aaca6c8b9f9c3496f4
05:47:31 1 BitcoindComparisonTool.main: Sent inv with block 7cd3ee22eab70c6bc23fe7d43c19a797eb9529e9c9bc71aaca6c8b9f9c3496f4
05:47:31 17 BitcoindComparisonTool$1.onPreMessageReceived: Found header 104cbafb5906c7b9fe28eba9b288eea1acec306320c53cd49ac1a5dd0e673ce1
05:47:31 17 BitcoindComparisonTool$1.onPreMessageReceived: Sending header (104cbafb5906c7b9fe28eba9b288eea1acec306320c53cd49ac1a5dd0e673ce1) -> 7cd3ee22eab70c6bc23fe7d43c19a797eb9529e9c9bc71aaca6c8b9f9c3496f4
05:47:31 17 BitcoindComparisonTool$1.onPreMessageReceived: Requested 7cd3ee22eab70c6bc23fe7d43c19a797eb9529e9c9bc71aaca6c8b9f9c3496f4
05:47:31 17 BitcoindComparisonTool$1.onPreMessageReceived: Got empty header message from bitcoind
05:47:31 1 BitcoindComparisonTool.main: Block "b3" completed processing
05:47:31 1 BitcoindComparisonTool.main: Testing block b3 7cd3ee22eab70c6bc23fe7d43c19a797eb9529e9c9bc71aaca6c8b9f9c3496f4
05:47:31 17 BitcoindComparisonTool$1.onPreMessageReceived: Found header 7cd3ee22eab70c6bc23fe7d43c19a797eb9529e9c9bc71aaca6c8b9f9c3496f4
05:47:31 17 BitcoindComparisonTool$1.onPreMessageReceived: Found header 7cd3ee22eab70c6bc23fe7d43c19a797eb9529e9c9bc71aaca6c8b9f9c3496f4
05:47:31 1 BitcoindComparisonTool.main: Sent inv with block 7cd3ee22eab70c6bc23fe7d43c19a797eb9529e9c9bc71aaca6c8b9f9c3496f4
05:47:31 17 BitcoindComparisonTool$1.onPreMessageReceived: Found header 7cd3ee22eab70c6bc23fe7d43c19a797eb9529e9c9bc71aaca6c8b9f9c3496f4
05:47:31 17 BitcoindComparisonTool$1.onPreMessageReceived: Got empty header message from bitcoind
05:47:31 1 BitcoindComparisonTool.main: Block "b3" completed processing
05:47:31 1 BitcoindComparisonTool.main: Testing block b4 0b1c05438c178aa1976b713a0b794d705f955b99236a2bcc9cd8609b68db92bf
05:47:31 17 BitcoindComparisonTool$1.onPreMessageReceived: Found header 7cd3ee22eab70c6bc23fe7d43c19a797eb9529e9c9bc71aaca6c8b9f9c3496f4
05:47:31 1 AbstractBlockChain.connectBlock: Block is causing a re-organize
05:47:31 17 BitcoindComparisonTool$1.onPreMessageReceived: Sending header (7cd3ee22eab70c6bc23fe7d43c19a797eb9529e9c9bc71aaca6c8b9f9c3496f4) -> 0b1c05438c178aa1976b713a0b794d705f955b99236a2bcc9cd8609b68db92bf
05:47:31 1 AbstractBlockChain.handleNewBestChain: Re-organize after split at height 101
05:47:31 1 AbstractBlockChain.handleNewBestChain: Old chain head: 748223dc39df65a8c88ef9af80f98cbf130a2f8cfdf1900ff84f1bcf1fcc04b2
05:47:31 1 AbstractBlockChain.handleNewBestChain: New chain head: 0b1c05438c178aa1976b713a0b794d705f955b99236a2bcc9cd8609b68db92bf
05:47:31 1 AbstractBlockChain.handleNewBestChain: Split at block: 104cbafb5906c7b9fe28eba9b288eea1acec306320c53cd49ac1a5dd0e673ce1
05:47:31 1 BitcoindComparisonTool.main: Sent inv with block 0b1c05438c178aa1976b713a0b794d705f955b99236a2bcc9cd8609b68db92bf
05:47:31 17 BitcoindComparisonTool$1.onPreMessageReceived: Requested 0b1c05438c178aa1976b713a0b794d705f955b99236a2bcc9cd8609b68db92bf
05:47:32 17 BitcoindComparisonTool$1.onPreMessageReceived: Got empty header message from bitcoind
05:47:32 1 BitcoindComparisonTool.main: ERROR: bitcoind and bitcoinj acceptance differs on block "b4"
05:47:32 1 BitcoindComparisonTool.main: Block "b4" completed processing
05:47:32 1 BitcoindComparisonTool.main: Testing block b5 3e58cc4ad076bb0e3fb823c7e802a58119c938cd3f306a34a893a4ae01b4c1a8
05:47:32 1 AbstractBlockChain.add: 6 blocks per second
05:47:32 17 BitcoindComparisonTool$1.onPreMessageReceived: Found header 104cbafb5906c7b9fe28eba9b288eea1acec306320c53cd49ac1a5dd0e673ce1
05:47:32 17 BitcoindComparisonTool$1.onPreMessageReceived: Sending header (104cbafb5906c7b9fe28eba9b288eea1acec306320c53cd49ac1a5dd0e673ce1) -> 748223dc39df65a8c88ef9af80f98cbf130a2f8cfdf1900ff84f1bcf1fcc04b2
05:47:32 17 BitcoindComparisonTool$1.onPreMessageReceived: Sending header (748223dc39df65a8c88ef9af80f98cbf130a2f8cfdf1900ff84f1bcf1fcc04b2) -> 3e58cc4ad076bb0e3fb823c7e802a58119c938cd3f306a34a893a4ae01b4c1a8
05:47:32 1 AbstractBlockChain.connectBlock: Block forks the chain at height 101/block 104cbafb5906c7b9fe28eba9b288eea1acec306320c53cd49ac1a5dd0e673ce1, but it did not cause a reorganize:
3e58cc4ad076bb0e3fb823c7e802a58119c938cd3f306a34a893a4ae01b4c1a8
05:47:32 1 BitcoindComparisonTool.main: Sent inv with block 3e58cc4ad076bb0e3fb823c7e802a58119c938cd3f306a34a893a4ae01b4c1a8
05:47:32 17 BitcoindComparisonTool$1.onPreMessageReceived: Requested 3e58cc4ad076bb0e3fb823c7e802a58119c938cd3f306a34a893a4ae01b4c1a8
05:47:32 17 BitcoindComparisonTool$1.onPreMessageReceived: Got header from bitcoind 3e58cc4ad076bb0e3fb823c7e802a58119c938cd3f306a34a893a4ae01b4c1a8
05:47:32 1 BitcoindComparisonTool.main: ERROR: bitcoind and bitcoinj acceptance differs on block "b5"
05:47:32 1 BitcoindComparisonTool.main: Block "b5" completed processing
05:47:32 17 BitcoindComparisonTool$1.onPreMessageReceived: Found header 3e58cc4ad076bb0e3fb823c7e802a58119c938cd3f306a34a893a4ae01b4c1a8
05:47:32 1 BitcoindComparisonTool.main: Testing block b6 7dbea1c7540a80c216a6b9612ce84a65302bbce95236a8ab47ac1f7bd7c580fb
05:47:32 1 AbstractBlockChain.connectBlock: Block is causing a re-organize
05:47:32 1 AbstractBlockChain.handleNewBestChain: Re-organize after split at height 101
05:47:32 1 AbstractBlockChain.handleNewBestChain: Old chain head: 0b1c05438c178aa1976b713a0b794d705f955b99236a2bcc9cd8609b68db92bf
05:47:32 1 AbstractBlockChain.handleNewBestChain: New chain head: 7dbea1c7540a80c216a6b9612ce84a65302bbce95236a8ab47ac1f7bd7c580fb
05:47:32 1 AbstractBlockChain.handleNewBestChain: Split at block: 104cbafb5906c7b9fe28eba9b288eea1acec306320c53cd49ac1a5dd0e673ce1
05:47:32 17 BitcoindComparisonTool$1.onPreMessageReceived: Found header 3e58cc4ad076bb0e3fb823c7e802a58119c938cd3f306a34a893a4ae01b4c1a8
05:47:32 17 BitcoindComparisonTool$1.onPreMessageReceived: Sending header (3e58cc4ad076bb0e3fb823c7e802a58119c938cd3f306a34a893a4ae01b4c1a8) -> 7dbea1c7540a80c216a6b9612ce84a65302bbce95236a8ab47ac1f7bd7c580fb
05:47:32 1 BitcoindComparisonTool.main: Sent inv with block 7dbea1c7540a80c216a6b9612ce84a65302bbce95236a8ab47ac1f7bd7c580fb
05:47:32 17 BitcoindComparisonTool$1.onPreMessageReceived: Requested 7dbea1c7540a80c216a6b9612ce84a65302bbce95236a8ab47ac1f7bd7c580fb
05:47:32 17 BitcoindComparisonTool$1.onPreMessageReceived: Got header from bitcoind 7dbea1c7540a80c216a6b9612ce84a65302bbce95236a8ab47ac1f7bd7c580fb
05:47:32 1 BitcoindComparisonTool.main: Block "b6" completed processing
05:47:32 17 BitcoindComparisonTool$1.onPreMessageReceived: Found header 7dbea1c7540a80c216a6b9612ce84a65302bbce95236a8ab47ac1f7bd7c580fb
05:47:32 1 BitcoindComparisonTool.main: Testing block b7 4797c6105b7fa7474db3998df6e61a4dc5b164d51509cc38824f8eccd8253fa0
05:47:32 1 AbstractBlockChain.connectBlock: Block forks the chain at height 103/block 3e58cc4ad076bb0e3fb823c7e802a58119c938cd3f306a34a893a4ae01b4c1a8, but it did not cause a reorganize:
4797c6105b7fa7474db3998df6e61a4dc5b164d51509cc38824f8eccd8253fa0
05:47:32 1 BitcoindComparisonTool.main: Sent inv with block 4797c6105b7fa7474db3998df6e61a4dc5b164d51509cc38824f8eccd8253fa0
05:47:32 17 BitcoindComparisonTool$1.onPreMessageReceived: Found header 3e58cc4ad076bb0e3fb823c7e802a58119c938cd3f306a34a893a4ae01b4c1a8
05:47:32 17 BitcoindComparisonTool$1.onPreMessageReceived: Sending header (3e58cc4ad076bb0e3fb823c7e802a58119c938cd3f306a34a893a4ae01b4c1a8) -> 4797c6105b7fa7474db3998df6e61a4dc5b164d51509cc38824f8eccd8253fa0
05:47:32 17 BitcoindComparisonTool$1.onPreMessageReceived: Requested 4797c6105b7fa7474db3998df6e61a4dc5b164d51509cc38824f8eccd8253fa0
05:47:32 17 BitcoindComparisonTool$1.onPreMessageReceived: Got empty header message from bitcoind
05:47:32 1 BitcoindComparisonTool.main: Block "b7" completed processing
05:47:32 1 BitcoindComparisonTool.main: Testing block b8 6919e48b3b892549ff1229491a82b4942ca4f6380a9bd9fbe3c953011a2bcca1
05:47:32 1 AbstractBlockChain.connectBlock: Block is causing a re-organize
05:47:32 1 AbstractBlockChain.handleNewBestChain: Re-organize after split at height 103
05:47:32 1 AbstractBlockChain.handleNewBestChain: Old chain head: 7dbea1c7540a80c216a6b9612ce84a65302bbce95236a8ab47ac1f7bd7c580fb
05:47:32 1 AbstractBlockChain.handleNewBestChain: New chain head: 6919e48b3b892549ff1229491a82b4942ca4f6380a9bd9fbe3c953011a2bcca1
05:47:32 1 AbstractBlockChain.handleNewBestChain: Split at block: 3e58cc4ad076bb0e3fb823c7e802a58119c938cd3f306a34a893a4ae01b4c1a8
05:47:32 17 BitcoindComparisonTool$1.onPreMessageReceived: Found header 4797c6105b7fa7474db3998df6e61a4dc5b164d51509cc38824f8eccd8253fa0
05:47:32 17 BitcoindComparisonTool$1.onPreMessageReceived: Sending header (4797c6105b7fa7474db3998df6e61a4dc5b164d51509cc38824f8eccd8253fa0) -> 6919e48b3b892549ff1229491a82b4942ca4f6380a9bd9fbe3c953011a2bcca1
05:47:32 1 DatabaseFullPrunedBlockStore.abortDatabaseBatchWrite: Warning: Rollback attempt without transaction
05:47:32 1 BitcoindComparisonTool.main: Sent inv with block 6919e48b3b892549ff1229491a82b4942ca4f6380a9bd9fbe3c953011a2bcca1
05:47:32 17 BitcoindComparisonTool$1.onPreMessageReceived: Requested 6919e48b3b892549ff1229491a82b4942ca4f6380a9bd9fbe3c953011a2bcca1
05:47:32 17 BitcoindComparisonTool$1.onPreMessageReceived: Got empty header message from bitcoind
05:47:32 1 BitcoindComparisonTool.main: Block "b8" completed processing


Log from Gocoin :
Code:
Commiting block 104cbafb5906c7b9fe28eba9b288eea1acec306320c53cd49ac1a5dd0e673ce1 -> 635e870a77419af8cd8fc1a56b45d7e54846707559c61dd454c088dbf09be771
 - New TOP 101
Current last 104cbafb5906c7b9fe28eba9b288eea1acec306320c53cd49ac1a5dd0e673ce1

GetHeaders 1 up to 0000000000000000000000000000000000000000000000000000000000000000
 ? 635e870a77419af8cd8fc1a56b45d7e54846707559c61dd454c088dbf09be771   found: true
 returning header of block 101 104cbafb5906c7b9fe28eba9b288eea1acec306320c53cd49ac1a5dd0e673ce1
sending back 1 headers


Commiting block 748223dc39df65a8c88ef9af80f98cbf130a2f8cfdf1900ff84f1bcf1fcc04b2 -> 104cbafb5906c7b9fe28eba9b288eea1acec306320c53cd49ac1a5dd0e673ce1
 - New TOP 102
Current last 748223dc39df65a8c88ef9af80f98cbf130a2f8cfdf1900ff84f1bcf1fcc04b2

GetHeaders 1 up to 0000000000000000000000000000000000000000000000000000000000000000
 ? 104cbafb5906c7b9fe28eba9b288eea1acec306320c53cd49ac1a5dd0e673ce1   found: true
 returning header of block 102 748223dc39df65a8c88ef9af80f98cbf130a2f8cfdf1900ff84f1bcf1fcc04b2
sending back 1 headers
GetHeaders 1 up to 0000000000000000000000000000000000000000000000000000000000000000
 ? 748223dc39df65a8c88ef9af80f98cbf130a2f8cfdf1900ff84f1bcf1fcc04b2   found: true
sending back 0 headers


Commiting block 7cd3ee22eab70c6bc23fe7d43c19a797eb9529e9c9bc71aaca6c8b9f9c3496f4 -> 104cbafb5906c7b9fe28eba9b288eea1acec306320c53cd49ac1a5dd0e673ce1
 - Orphaned 102
Orphaned block: 102 7cd3ee22eab70c6bc23fe7d43c19a797eb9529e9c9bc71aaca6c8b9f9c3496f4 0 KB
Current last 748223dc39df65a8c88ef9af80f98cbf130a2f8cfdf1900ff84f1bcf1fcc04b2

GetHeaders 1 up to 0000000000000000000000000000000000000000000000000000000000000000
 ? 748223dc39df65a8c88ef9af80f98cbf130a2f8cfdf1900ff84f1bcf1fcc04b2   found: true
sending back 0 headers

GetHeaders 1 up to 0000000000000000000000000000000000000000000000000000000000000000
 ? 748223dc39df65a8c88ef9af80f98cbf130a2f8cfdf1900ff84f1bcf1fcc04b2   found: true
sending back 0 headers


Commiting block 0b1c05438c178aa1976b713a0b794d705f955b99236a2bcc9cd8609b68db92bf -> 7cd3ee22eab70c6bc23fe7d43c19a797eb9529e9c9bc71aaca6c8b9f9c3496f4
Undo block 102 748223dc39df65a8c88ef9af80f98cbf130a2f8cfdf1900ff84f1bcf1fcc04b2 0 KB
 - New TOP 103
Current last 0b1c05438c178aa1976b713a0b794d705f955b99236a2bcc9cd8609b68db92bf

GetHeaders 1 up to 0000000000000000000000000000000000000000000000000000000000000000
 ? 748223dc39df65a8c88ef9af80f98cbf130a2f8cfdf1900ff84f1bcf1fcc04b2   found: true
sending back 0 headers

Commiting block 3e58cc4ad076bb0e3fb823c7e802a58119c938cd3f306a34a893a4ae01b4c1a8 -> 748223dc39df65a8c88ef9af80f98cbf130a2f8cfdf1900ff84f1bcf1fcc04b2
 - Orphaned 103
Orphaned block: 103 3e58cc4ad076bb0e3fb823c7e802a58119c938cd3f306a34a893a4ae01b4c1a8 0 KB
WARNING: the fork is 2 blocks deep
Current last 0b1c05438c178aa1976b713a0b794d705f955b99236a2bcc9cd8609b68db92bf

GetHeaders 1 up to 0000000000000000000000000000000000000000000000000000000000000000
 ? 748223dc39df65a8c88ef9af80f98cbf130a2f8cfdf1900ff84f1bcf1fcc04b2   found: true
 returning header of block 103 3e58cc4ad076bb0e3fb823c7e802a58119c938cd3f306a34a893a4ae01b4c1a8
sending back 1 headers


Commiting block 7dbea1c7540a80c216a6b9612ce84a65302bbce95236a8ab47ac1f7bd7c580fb -> 3e58cc4ad076bb0e3fb823c7e802a58119c938cd3f306a34a893a4ae01b4c1a8
Undo block 103 0b1c05438c178aa1976b713a0b794d705f955b99236a2bcc9cd8609b68db92bf 0 KB
Undo block 102 7cd3ee22eab70c6bc23fe7d43c19a797eb9529e9c9bc71aaca6c8b9f9c3496f4 0 KB
 - New TOP 104
Current last 7dbea1c7540a80c216a6b9612ce84a65302bbce95236a8ab47ac1f7bd7c580fb

GetHeaders 1 up to 0000000000000000000000000000000000000000000000000000000000000000
 ? 3e58cc4ad076bb0e3fb823c7e802a58119c938cd3f306a34a893a4ae01b4c1a8   found: true
 returning header of block 104 7dbea1c7540a80c216a6b9612ce84a65302bbce95236a8ab47ac1f7bd7c580fb
sending back 1 headers


Commiting block 4797c6105b7fa7474db3998df6e61a4dc5b164d51509cc38824f8eccd8253fa0 -> 3e58cc4ad076bb0e3fb823c7e802a58119c938cd3f306a34a893a4ae01b4c1a8
 - Orphaned 104
Orphaned block: 104 4797c6105b7fa7474db3998df6e61a4dc5b164d51509cc38824f8eccd8253fa0 0 KB
Current last 7dbea1c7540a80c216a6b9612ce84a65302bbce95236a8ab47ac1f7bd7c580fb

GetHeaders 1 up to 0000000000000000000000000000000000000000000000000000000000000000
 ? 7dbea1c7540a80c216a6b9612ce84a65302bbce95236a8ab47ac1f7bd7c580fb   found: true
sending back 0 headers


Commiting block 6919e48b3b892549ff1229491a82b4942ca4f6380a9bd9fbe3c953011a2bcca1 -> 4797c6105b7fa7474db3998df6e61a4dc5b164d51509cc38824f8eccd8253fa0
Undo block 104 7dbea1c7540a80c216a6b9612ce84a65302bbce95236a8ab47ac1f7bd7c580fb 0 KB
ProcessBlockTransactionsB 4797c6105b7fa7474db3998df6e61a4dc5b164d51509cc38824f8eccd8253fa0 104 Unknown input TxID: 7bb7718103fe4dc0287b50f1aa390f9542dc3441d40c826bbc98a23bb16f2679
ParseTillBlock failed - go back to 104
Current last 7dbea1c7540a80c216a6b9612ce84a65302bbce95236a8ab47ac1f7bd7c580fb

GetHeaders 1 up to 0000000000000000000000000000000000000000000000000000000000000000
 ? 7dbea1c7540a80c216a6b9612ce84a65302bbce95236a8ab47ac1f7bd7c580fb   found: true
sending back 0 headers


HandleError: read tcp4 127.0.0.1:18444->127.0.0.1:49999: wsarecv: An existing connection was forcibly closed by the remote host.
Disconnect from E:/DEV/GOPATH/src/github.com/piotrnar/gocoin/client/network/core.go 346
closing connection true false
sr. member
Activity: 467
Merit: 266
No problem. A few things not covered by the scripts that could be worth checking:
- the best chain is not necessarily the one with the highest height but the one with the most cumulative proof of work,
- difficulty readjustments are capped by +/- n % (I don't remember how much),
legendary
Activity: 2053
Merit: 1354
aka tonikt
I think I've got it - thank you!

Will let you know how the tests go.
sr. member
Activity: 467
Merit: 266
Install a jdk, compile and run.
legendary
Activity: 2053
Merit: 1354
aka tonikt
You don't have to be a Java expert because the tool acts as a peer to which your node connects.
So how do I run it?
sr. member
Activity: 467
Merit: 266
These test scripts would have exposed all the problems you mentioned. They focus on block validation and reorganization.  You don't have to be a Java expert because the tool acts as a peer to which your node connects.
I have briefly looked at your code and noticed a few odd things but I didn't do a throughout review.
legendary
Activity: 2053
Merit: 1354
aka tonikt
Hi, out of curiosity, did you check your node against the bitcoin regression tests?

https://github.com/TheBlueMatt/test-scripts

--h


I would not know how to use that tool as I'm not a very big fan of java, but I can say that Gocoin is being checked against the official core's test vectors for transaction and scripts - both valid and invalid:
https://github.com/bitcoin/bitcoin/tree/master/src/test/data
https://github.com/piotrnar/gocoin/tree/master/lib/test

And recently I added a functionality that is (optionally) using the consensus lib (which came with core 0.12.0) to cross-check every transaction.
I have been using it ever since and there have been no mismatches observed so far.

The biggest potential risk of an incompatibility is in verifying of entire blocks - checks that are only executed on a block level.
Like recently I found that I wasn't checking for the maximum number of sigops - which bitcoin core limits to 20000/block.
Some other time I found that I wasn't checking for the coinbase transactions to be "mature" while verifying blocks that spend them.
Then there was no check of the timestamp against the median time of the last 11 blocks.
Few other things, some of them I don't even remember...

The odds are that there are still some check on the new blocks that bitcoin core does, which gocoin doesn't (yet), but I am unaware of any specific cases.

If anyone finds such, please report.
sr. member
Activity: 467
Merit: 266
Hi, out of curiosity, did you check your node against the bitcoin regression tests?

https://github.com/TheBlueMatt/test-scripts

--h
legendary
Activity: 2053
Merit: 1354
aka tonikt
I'm about to release 1.6.0 that has got some cool new features, which you can briefly read about int the changelog.

Upgrade is highway recommended as all the versions up to (including) 1.5.0 have had a serious security issue, which I prefer to not talk about because it's just embarrassing. Smiley

As for the new features.

There is a basic RPC API, implementing functionality required for mining. It is compatible with bitcoind's API and so far has been tested successfully on testnet3 with ckpool mining software.

The Home, Network and Transaction pages of WebUI shows nice graphs: http://imgur.com/a/eq1AH

The node counts sigops inside transactions and blocks.

The new tool bdb allows to play (extract/add blocks, check integrity) with the block's database. Also allows to defragment the db without a need to have the double space on the disk.

UTXO database can now work in a "volatile mode" where it only writes changes to disk when exiting. Use -v switch for either client or downloader to trigger it. The qdb enginie has also changed a bit and now it writes any pending changes on disk much faster.

You can also start the client with "-undo " switch, which will cause the node to undo the last n blocks (on the UTXO db) and exit.

The most recently added is the feature that looks for "libbitcoinconsensus.so" or "libbitcoinconsensus-0.dll" (depending on host OS) and if found uses the function from it to cross-verify each transaction.
So far it hasn't found any mismatches. Use TextUI command cons to see the stats of the cross-checking.


I would also like to mention that the recent versions of Gocoin have no external dependencies and should build out-of-the-box.
Just make sure to have 64 bit OS and at least 6GB of RAM (it's swapping too much slow less memory). In peaks (especially when rebuilding the UTXO db) it may even need more memory. But normal node, working on a synchronized chain, should never use more than 4GB.

I also strongly advise to use downloader to sync up the block chain - it's really fast as it doesn't verify transactions.  
Theoretically it is less secure, but there is no way to exploit it, if you only check the hash of the last block it assumed trusted.
legendary
Activity: 2053
Merit: 1354
aka tonikt
Sorry, I forgot to add that I added the Browser Wallets feature.
It does not require a wallet file to be stored within the node's file system anymore.
I use it with nodes which I run remotely, on VPS.

It takes a few seconds to load a web wallet for the first time, so expect some lags launching WebUI having had a browser wallet selected.

It is actually a pretty cool thing.

The setup I use myself is the node running on some ~20EUR/month VPS.
I connect there via ssh, tunneling the WebUI's port number (8833) through it.
Then I just the webui via http://127.0.0.1:8833

So the node is running on some external server and the wallet is in my house.
Well, actually the wallet app is in my house and the actual wallet (the seed password) is only in my head Smiley
Pages:
Jump to: