ethereum / aleth

Aleth – Ethereum C++ client, tools and libraries
GNU General Public License v3.0
3.96k stars 2.18k forks source link

Aleth ends up syncing on Ropsten fork #5587

Open halfalicious opened 5 years ago

halfalicious commented 5 years ago

(Originally found when investigating #5312 )

I hit a case when syncing Aleth where it ends up on a Ropsten fork and stops syncing because it's unable to sync with Ropsten boot nodes. Log: ropsten_fork_sync_stop.txt

Log snippet:

aleth, a C++ Ethereum client
INFO  04-26 09:43:31 main net    Id: ##0a980f60…
INFO  04-26 09:43:31 main net    ENR: [ 0x97d57bea532e913becb45ebe5e7c013c07d644a3f0219f7cea826d42919dcb1524b3c54e5857dad7f4ed5993e3082fc7061fef0454ee58eec6ca517dd5c6de23 seq=0 id=0x7634 ip=0x00000000 secp256k1=0x020a980f601094f21b4b23a19e4a1035ad708c1c3b157f432538905727b743fe50 tcp=0x765f udp=0x765f ]
DEBUG 04-26 09:43:31 eth  client startedWorking()
aleth 1.7.0-alpha.0-16+commit.bfb04343.dirty
DEBUG 04-26 09:43:33 p2p  net    devp2p started. Node id: ##0a980f60…
INFO  04-26 09:43:33 p2p  net    Active peer count: 0
INFO  04-26 09:43:33 p2p  net    Looking for peers...
Node ID: enode://0a980f601094f21b4b23a19e4a1035ad708c1c3b157f432538905727b743fe5094a91971133b41bfd5aae78adfaf3d74ad45742b7f1a92a9b657e059d8dfd6b8@0.0.0.0:0
JSONRPC Admin Session Key: 3/4YRZoKuRQ=
DEBUG 04-26 09:43:33 p2p  net    p2p.host.nodeTable.events.nodeEntryAdded ##aa36fdf3…
DEBUG 04-26 09:43:33 p2p  net    p2p.host.peers.events.peerAdded ##aa36fdf3… 13.93.211.84:30303
DEBUG 04-26 09:43:33 p2p  net    p2p.host.nodeTable.events.nodeEntryAdded ##15ac307a…
DEBUG 04-26 09:43:33 p2p  net    p2p.host.peers.events.peerAdded ##15ac307a… 52.176.7.10:30303
DEBUG 04-26 09:43:33 p2p  net    p2p.host.nodeTable.events.nodeEntryAdded ##865a6325…
DEBUG 04-26 09:43:33 p2p  net    p2p.host.nodeTable.events.nodeEntryAdded ##6332792c…
DEBUG 04-26 09:43:33 p2p  net    p2p.host.nodeTable.events.nodeEntryAdded ##a979fb57…
DEBUG 04-26 09:43:33 p2p  net    Hello: Parity-Ethereum/v2.2.9-stable-5d5b372-20190203/x86_64-linux-gnu/rustc1.31.1 V[5] ##865a6325… (eth,63) 30303
DEBUG 04-26 09:43:33 p2p  net    New session for capability eth; idOffset: 16
DEBUG 04-26 09:43:33 p2p  net    p2p.host.peer.register ##865a6325…
DEBUG 04-26 09:43:33 p2p  net    p2p.host.nodeTable.events.nodeEntryAdded ##669f45b6…
DEBUG 04-26 09:43:33 p2p  net    p2p.host.peers.events.peerAdded ##669f45b6… 52.74.57.123:30303
DEBUG 04-26 09:43:33 p2p  net    p2p.host.nodeTable.events.nodeEntryAdded ##78de8a09…
DEBUG 04-26 09:43:33 p2p  ethcap 865a6325…|Parity-Ethereum/v2.2.9-stable-5d5b372-20190203/x86_64-linux-gnu/rustc1.31.1 Status: 63 / 3 / #41941023…, TD: 19323759260255103 = #04f18ed6…
DEBUG 04-26 09:43:33 p2p  sync   865a6325…|Parity-Ethereum/v2.2.9-stable-5d5b372-20190203/x86_64-linux-gnu/rustc1.31.1 Discovered new highest difficulty
INFO  04-26 09:43:33 p2p  sync   865a6325…|Parity-Ethereum/v2.2.9-stable-5d5b372-20190203/x86_64-linux-gnu/rustc1.31.1 Starting full sync
DEBUG 04-26 09:43:33 p2p  peer   865a6325…|Parity-Ethereum/v2.2.9-stable-5d5b372-20190203/x86_64-linux-gnu/rustc1.31.1 Requesting 1 block headers starting from #04f18ed6… from ##865a6325…
DEBUG 04-26 09:43:33 p2p  net    p2p.host.nodeTable.events.nodeEntryAdded ##158f8aab…
DEBUG 04-26 09:43:33 p2p  net    865a6325…|Parity-Ethereum/v2.2.9-stable-5d5b372-20190203/x86_64-linux-gnu/rustc1.31.1 GetBlockHeaders (4253711 max: 1 skip: 0)
DEBUG 04-26 09:43:33 p2p  sync   865a6325…|Parity-Ethereum/v2.2.9-stable-5d5b372-20190203/x86_64-linux-gnu/rustc1.31.1 BlocksHeaders (1 entries) 
DEBUG 04-26 09:43:33 p2p  peer   865a6325…|Parity-Ethereum/v2.2.9-stable-5d5b372-20190203/x86_64-linux-gnu/rustc1.31.1 Requesting 1 block headers starting from 470069 from ##865a6325…
DEBUG 04-26 09:43:34 p2p  sync   865a6325…|Parity-Ethereum/v2.2.9-stable-5d5b372-20190203/x86_64-linux-gnu/rustc1.31.1 BlocksHeaders (0 entries) : NoMoreHeaders
DEBUG 04-26 09:43:34 p2p  peer   865a6325…|Parity-Ethereum/v2.2.9-stable-5d5b372-20190203/x86_64-linux-gnu/rustc1.31.1 Requesting 1 block headers starting from 470069 from ##865a6325…
DEBUG 04-26 09:43:34 p2p  sync   865a6325…|Parity-Ethereum/v2.2.9-stable-5d5b372-20190203/x86_64-linux-gnu/rustc1.31.1 BlocksHeaders (0 entries) : NoMoreHeaders
DEBUG 04-26 09:43:34 p2p  peer   865a6325…|Parity-Ethereum/v2.2.9-stable-5d5b372-20190203/x86_64-linux-gnu/rustc1.31.1 Requesting 1 block headers starting from 470069 from ##865a6325…
DEBUG 04-26 09:43:34 p2p  sync   865a6325…|Parity-Ethereum/v2.2.9-stable-5d5b372-20190203/x86_64-linux-gnu/rustc1.31.1 BlocksHeaders (0 entries) : NoMoreHeaders
DEBUG 04-26 09:43:34 p2p  peer   865a6325…|Parity-Ethereum/v2.2.9-stable-5d5b372-20190203/x86_64-linux-gnu/rustc1.31.1 Requesting 1 block headers starting from 470069 from ##865a6325…
DEBUG 04-26 09:43:34 p2p  sync   865a6325…|Parity-Ethereum/v2.2.9-stable-5d5b372-20190203/x86_64-linux-gnu/rustc1.31.1 BlocksHeaders (0 entries) : NoMoreHeaders
DEBUG 04-26 09:43:34 p2p  peer   865a6325…|Parity-Ethereum/v2.2.9-stable-5d5b372-20190203/x86_64-linux-gnu/rustc1.31.1 Requesting 1 block headers starting from 470069 from ##865a6325…
DEBUG 04-26 09:43:34 p2p  sync   865a6325…|Parity-Ethereum/v2.2.9-stable-5d5b372-20190203/x86_64-linux-gnu/rustc1.31.1 BlocksHeaders (0 entries) : NoMoreHeaders
DEBUG 04-26 09:43:34 p2p  peer   865a6325…|Parity-Ethereum/v2.2.9-stable-5d5b372-20190203/x86_64-linux-gnu/rustc1.31.1 Requesting 1 block headers starting from 470069 from ##865a6325…
DEBUG 04-26 09:43:34 p2p  sync   865a6325…|Parity-Ethereum/v2.2.9-stable-5d5b372-20190203/x86_64-linux-gnu/rustc1.31.1 BlocksHeaders (0 entries) : NoMoreHeaders
DEBUG 04-26 09:43:34 p2p  peer   865a6325…|Parity-Ethereum/v2.2.9-stable-5d5b372-20190203/x86_64-linux-gnu/rustc1.31.1 Requesting 1 block headers starting from 470069 from ##865a6325…
DEBUG 04-26 09:43:34 p2p  sync   865a6325…|Parity-Ethereum/v2.2.9-stable-5d5b372-20190203/x86_64-linux-gnu/rustc1.31.1 BlocksHeaders (0 entries) : NoMoreHeaders
DEBUG 04-26 09:43:34 p2p  peer   865a6325…|Parity-Ethereum/v2.2.9-stable-5d5b372-20190203/x86_64-linux-gnu/rustc1.31.1 Requesting 1 block headers starting from 470069 from ##865a6325…
DEBUG 04-26 09:43:34 p2p  sync   865a6325…|Parity-Ethereum/v2.2.9-stable-5d5b372-20190203/x86_64-linux-gnu/rustc1.31.1 BlocksHeaders (0 entries) : NoMoreHeaders
DEBUG 04-26 09:43:34 p2p  peer   865a6325…|Parity-Ethereum/v2.2.9-stable-5d5b372-20190203/x86_64-linux-gnu/rustc1.31.1 Requesting 1 block headers starting from 470069 from ##865a6325…
DEBUG 04-26 09:43:34 p2p  sync   865a6325…|Parity-Ethereum/v2.2.9-stable-5d5b372-20190203/x86_64-linux-gnu/rustc1.31.1 BlocksHeaders (0 entries) : NoMoreHeaders
DEBUG 04-26 09:43:34 p2p  peer   865a6325…|Parity-Ethereum/v2.2.9-stable-5d5b372-20190203/x86_64-linux-gnu/rustc1.31.1 Requesting 1 block headers starting from 470069 from ##865a6325…
DEBUG 04-26 09:43:34 p2p  sync   865a6325…|Parity-Ethereum/v2.2.9-stable-5d5b372-20190203/x86_64-linux-gnu/rustc1.31.1 BlocksHeaders (0 entries) : NoMoreHeaders
DEBUG 04-26 09:43:34 p2p  peer   865a6325…|Parity-Ethereum/v2.2.9-stable-5d5b372-20190203/x86_64-linux-gnu/rustc1.31.1 Requesting 1 block headers starting from 470069 from ##865a6325…

Aleth keeps asking node 865a6325 for blocks starting with 470069 but it doesn't have any, which is strange given that it's a Ropsten boot node: https://github.com/ethereum/aleth/blob/e80e19770e2ab60d2ba8fbace27a7f8b1d006f02/libp2p/Common.cpp#L261-L265

Aleth will occasionally connect to the node which has the fork (6332792c…) and sync some blocks:

DEBUG 04-26 09:44:28 p2p  peer   865a6325…|Parity-Ethereum/v2.2.9-stable-5d5b372-20190203/x86_64-linux-gnu/rustc1.31.1 Requesting 1 block headers starting from 470069 from ##865a6325…
DEBUG 04-26 09:44:28 p2p  sync   6332792c…|Parity-Ethereum/v2.3.4-beta-0e95db1-20190220/x86_64-linux-gnu/rustc1.32.0 BlocksHeaders (1 entries) 
DEBUG 04-26 09:44:28 p2p  peer   6332792c…|Parity-Ethereum/v2.3.4-beta-0e95db1-20190220/x86_64-linux-gnu/rustc1.32.0 Requesting 1024 block headers starting from 470070 from ##6332792c…
DEBUG 04-26 09:44:28 p2p  sync   865a6325…|Parity-Ethereum/v2.2.9-stable-5d5b372-20190203/x86_64-linux-gnu/rustc1.31.1 BlocksHeaders (0 entries) : NoMoreHeaders
DEBUG 04-26 09:44:28 p2p  peer   865a6325…|Parity-Ethereum/v2.2.9-stable-5d5b372-20190203/x86_64-linux-gnu/rustc1.31.1 Requesting 1024 block headers starting from 471094 from ##865a6325…
DEBUG 04-26 09:44:28 p2p  sync   865a6325…|Parity-Ethereum/v2.2.9-stable-5d5b372-20190203/x86_64-linux-gnu/rustc1.31.1 BlocksHeaders (0 entries) : NoMoreHeaders
DEBUG 04-26 09:44:28 p2p  peer   865a6325…|Parity-Ethereum/v2.2.9-stable-5d5b372-20190203/x86_64-linux-gnu/rustc1.31.1 Requesting 1024 block headers starting from 471094 from ##865a6325…
DEBUG 04-26 09:44:28 p2p  sync   865a6325…|Parity-Ethereum/v2.2.9-stable-5d5b372-20190203/x86_64-linux-gnu/rustc1.31.1 BlocksHeaders (0 entries) : NoMoreHeaders
DEBUG 04-26 09:44:28 p2p  peer   865a6325…|Parity-Ethereum/v2.2.9-stable-5d5b372-20190203/x86_64-linux-gnu/rustc1.31.1 Requesting 1024 block headers starting from 471094 from ##865a6325…
halfalicious commented 5 years ago

This ultimately looks like a peering issue - if Aleth had at least 2 peers which are on the canonical longest Ropsten chain, it would go through a chain reorg and sync on the correct chain.

halfalicious commented 4 years ago

Hitting this again when syncing Aleth (built from source, head = c47760657321d216c74bc9d5849a2857da29d7e1) from genesis on Ropsten.