osagga / bitcore-node-cash

Extensible full node using Bitcore
https://bitcore.io/
Other
9 stars 2 forks source link

Stopped syncing at block #545957 #11

Closed MartinSolie closed 5 years ago

MartinSolie commented 5 years ago

Bitcore was working OK till the 1st of September. It synced block 545957, but cannot sync block 545958. It downloads headers, so it knows the latest block, but cannot download the block. Bitcore-node-cash is running version from 28348ea commit. Bitcore node is connected to the local official bitcoin-abc node (Bitcoin ABC:0.17.2(EB32.0)). I've tried to connect to other open bitcoin-abc nodes, but results are all the same.

Bitcore logs:

[2018-09-18T12:00:33.186Z] info: Checked the current working directory for service: address
[2018-09-18T12:00:33.189Z] info: Checked the current working directory for service: block
[2018-09-18T12:00:33.225Z] info: Checked the current working directory for service: db
[2018-09-18T12:00:33.235Z] info: Checked the current working directory for service: fee
[2018-09-18T12:00:33.237Z] info: Checked the current working directory for service: header
[2018-09-18T12:00:33.238Z] info: Checked the current working directory for service: mempool
[2018-09-18T12:00:33.239Z] info: Checked the current working directory for service: p2p
[2018-09-18T12:00:33.247Z] info: Checked the current working directory for service: timestamp
[2018-09-18T12:00:33.247Z] info: Checked the current working directory for service: transaction
[2018-09-18T12:00:33.248Z] info: Checked the current working directory for service: web
[2018-09-18T12:00:33.314Z] info: Using config: /root/.bitcore/bitcore-node.json
[2018-09-18T12:00:33.314Z] info: Using network: livenet
[2018-09-18T12:00:33.315Z] info: Starting db
[2018-09-18T12:00:33.319Z] info: Starting timestamp
[2018-09-18T12:00:33.956Z] info: Db Service: service prefix for: timestamp is: 0001
[2018-09-18T12:00:33.957Z] info: Starting p2p
[2018-09-18T12:00:33.962Z] info: Starting header
[2018-09-18T12:00:33.962Z] info: Db Service: service prefix for: header is: 0002
[2018-09-18T12:00:33.963Z] info: Getting last header synced at height: 546282
[2018-09-18T12:00:34.015Z] info: Starting mempool
[2018-09-18T12:00:34.015Z] info: Db Service: service prefix for: mempool is: 0003
[2018-09-18T12:00:34.015Z] info: Mempool Service: mempool disabled until full sync.
[2018-09-18T12:00:34.015Z] info: Starting block
[2018-09-18T12:00:34.016Z] info: Db Service: service prefix for: block is: 0004
[2018-09-18T12:00:39.005Z] info: Block Service: loaded: 144 hashes from the index.
[2018-09-18T12:00:39.005Z] info: Starting transaction
[2018-09-18T12:00:39.005Z] info: Db Service: service prefix for: transaction is: 0005
[2018-09-18T12:00:39.005Z] info: Starting address
[2018-09-18T12:00:39.005Z] info: Db Service: service prefix for: address is: 0006
[2018-09-18T12:00:39.006Z] info: Starting fee
[2018-09-18T12:00:39.006Z] info: Starting web
[2018-09-18T12:00:39.017Z] info: Starting insight-api
[2018-09-18T12:00:39.017Z] info: localhost-insight-api subscribe: mempool/transaction total: 1
[2018-09-18T12:00:39.017Z] info: localhost-insight-api subscribe: block/block total: 1
[2018-09-18T12:00:39.017Z] info: Bitcore Node ready
[2018-09-18T12:00:39.017Z] info: Connecting to p2p network.
[2018-09-18T12:00:39.028Z] info: Connected to peer: 127.0.0.1, network: livenet, version: 70015, subversion: /Bitcoin ABC:0.17.2(EB32.0)/, status: ready, port: 8333, best height: 548399
[2018-09-18T12:00:39.028Z] info: Header Service: Best Height is: 548399
[2018-09-18T12:00:39.028Z] info: localhost-header unsubscribe: p2p/headers total: 0
[2018-09-18T12:00:39.028Z] info: localhost-header unsubscribe: p2p/block total: 0
[2018-09-18T12:00:39.029Z] info: Header Service: Gathering: 2117 header(s) from the peer-to-peer network.
[2018-09-18T12:00:39.029Z] info: Header Service: subscribed to p2p headers.
[2018-09-18T12:00:39.029Z] info: localhost-header subscribe: p2p/headers total: 1
[2018-09-18T12:00:39.162Z] info: Header Service: download progress: 548282/548399  (99.98%)
[2018-09-18T12:00:39.169Z] info: Header Service: download progress: 548399/548399  (100.00%)
[2018-09-18T12:00:39.169Z] info: Header Service: p2p header subscription no longer needed, unsubscribing.
[2018-09-18T12:00:39.169Z] info: localhost-header unsubscribe: p2p/headers total: 0
[2018-09-18T12:00:39.169Z] info: Header Service: starting p2p block subscription.
[2018-09-18T12:00:39.169Z] info: localhost-header subscribe: p2p/block total: 1
[2018-09-18T12:00:39.169Z] info: Header Service: sync complete.
[2018-09-18T12:00:39.169Z] info: localhost-block unsubscribe: p2p/block total: 1
[2018-09-18T12:00:39.169Z] info: Block Service: checking the saved tip...
[2018-09-18T12:00:39.170Z] info: Block Service: saved tip is good to go.
[2018-09-18T12:00:39.170Z] info: Block Service: Gathering: 2442 block(s) from the peer-to-peer network.
[2018-09-18T12:00:39.329Z] info: Disconnected from peer: 127.0.0.1
[2018-09-18T12:00:44.175Z] info: Block Service: download progress: 545957/548399  (99.5547%)
[2018-09-18T12:00:44.330Z] info: Retrying connection to p2p network.
[2018-09-18T12:00:44.335Z] info: Connected to peer: 127.0.0.1, network: livenet, version: 70015, subversion: /Bitcoin ABC:0.17.2(EB32.0)/, status: ready, port: 8333, best height: 548399
[2018-09-18T12:00:44.335Z] info: Header Service: Best Height is: 548399
[2018-09-18T12:00:44.336Z] info: localhost-header unsubscribe: p2p/headers total: 0
[2018-09-18T12:00:44.336Z] info: localhost-header unsubscribe: p2p/block total: 0
[2018-09-18T12:00:44.336Z] info: Header Service: we seem to be already synced with the peer.
[2018-09-18T12:00:44.336Z] info: Header Service: starting p2p block subscription.
[2018-09-18T12:00:44.336Z] info: localhost-header subscribe: p2p/block total: 1
[2018-09-18T12:00:44.336Z] info: Header Service: sync complete.
[2018-09-18T12:00:49.176Z] info: Block Service: download progress: 545957/548399  (99.5547%)
[2018-09-18T12:00:49.343Z] info: Disconnected from peer: 127.0.0.1

Bitcoin-abc debug.log:

2018-09-18 12:00:44 Added connection to 127.0.0.1:51272 peer=3681
2018-09-18 12:00:44 connection from 127.0.0.1:51272 accepted
2018-09-18 12:00:44 received: version (108 bytes) peer=3681
2018-09-18 12:00:44 sending version (114 bytes) peer=3681
2018-09-18 12:00:44 send version message: version 70015, blocks=548399, us=[::]:0, them=[::]:0, peer=3681
2018-09-18 12:00:44 sending verack (0 bytes) peer=3681
2018-09-18 12:00:44 receive version message: [127.0.0.1:51272] /bitcore:5.0.0-beta.2/: version
 70001, blocks=0, us=[::]:0, peer=3681, peeraddr=127.0.0.1:51272
2018-09-18 12:00:44 sending alert (168 bytes) peer=3681
2018-09-18 12:00:44 received: verack (0 bytes) peer=3681
2018-09-18 12:00:44 sending ping (8 bytes) peer=3681
2018-09-18 12:00:44 sending addr (31 bytes) peer=3681
2018-09-18 12:00:44 initial getheaders (548398) to peer=3681 (startheight:0)
2018-09-18 12:00:44 sending getheaders (1029 bytes) peer=3681
2018-09-18 12:00:44 received: pong (8 bytes) peer=3681
2018-09-18 12:00:48 sending inv (37 bytes) peer=3681
2018-09-18 12:00:48 received: getdata (37 bytes) peer=3681
2018-09-18 12:00:48 received getdata (1 invsz) peer=3681
2018-09-18 12:00:48 received getdata for: tx 54ca02e450f9a448f1d0c2763928a0c49a604c2083d1721e9
487c66e206716f0 peer=3681
2018-09-18 12:00:48 sending tx (814 bytes) peer=3681
2018-09-18 12:00:49 received: getblocks (69 bytes) peer=3681
2018-09-18 12:00:49 getblocks 545958 to 00000000000000000123b5eea3d141f79aebab2e99b68b4d62ea5082b54f5693 limit 500 from peer=3681
2018-09-18 12:00:49   getblocks stopping at 545960 00000000000000000123b5eea3d141f79aebab2e99b68b4d62ea5082b54f5693
2018-09-18 12:00:49 sending inv (73 bytes) peer=3681
2018-09-18 12:00:49 received: getdata (73 bytes) peer=3681
2018-09-18 12:00:49 received getdata (2 invsz) peer=3681
2018-09-18 12:00:49 received getdata for: block 0000000000000000017195513eeb78388f4d5dd30e886eb9282284127d74f08d peer=3681
2018-09-18 12:00:49 sending block (10281454 bytes) peer=3681
2018-09-18 12:00:49 socket recv error Connection reset by peer (104)
2018-09-18 12:00:49 disconnecting peer=3681

Looks, like bitcore drops connection itself, when bitcoin-abc node tries to send 10 Mb block (and actually 545958 block is the first ever to be larger than 8 Mb, as I understood).

May be something is incorrect with setup ?

osagga commented 5 years ago

hmm, I'm not really sure what could be the problem, maybe since the v5 version of bitcoin-lib doesn't support big blocks or something. I recommend moving to bitcore-v8. It natively supports BCH and is currently supported and maintained by Bitpay. Give it and see if it fixes the problem.

MartinSolie commented 5 years ago

Thanks. bitcore-v8 synced up to the end.

libinC-bit commented 5 years ago

谢谢。bitcore-v8同步到最后。

I also encountered the same problem, how to upgrade bch v5 to v8,

changliang0931 commented 5 years ago

You can change Peer.MAX_RECEIVE_BUFFER the value. https://github.com/osagga/bitcore-p2p/blob/a87c075ec2d19a7758acd3dec9e3b18b499f2f8f/lib/peer.js#L111 Peer.MAX_RECEIVE_BUFFER =1000000000000000000000