zingolib
zingolib copied to clipboard
zingo-cli keeps console logging about the server being 'behind'
In testing balance calculation in a fresh wallet (from an imported key), I encountered this oddity:
2023-10-19T02:18:16.114877Z WARN zingolib::lightclient: Server's latest block(2252364) is behind ours(2252375)
2023-10-19T02:18:28.508528Z WARN zingolib::lightclient: Server's latest block(2252280) is behind ours(2252375)
2023-10-19T02:18:30.519874Z WARN zingolib::lightclient: Server's latest block(2252339) is behind ours(2252375)
2023-10-19T02:18:48.167404Z WARN zingolib::lightclient: Server's latest block(2252286) is behind ours(2252375)
2023-10-19T02:18:50.180858Z WARN zingolib::lightclient: Server's latest block(2252348) is behind ours(2252375)
2023-10-19T02:18:52.324340Z WARN zingolib::lightclient: Server's latest block(2252356) is behind ours(2252375)
2023-10-19T02:19:07.863690Z WARN zingolib::lightclient: Server's latest block(2252276) is behind ours(2252375)
2023-10-19T02:19:09.790099Z WARN zingolib::lightclient: Server's latest block(2252293) is behind ours(2252375)
2023-10-19T02:19:11.765516Z WARN zingolib::lightclient: Server's latest block(2252355) is behind ours(2252375)
2023-10-19T02:19:29.348251Z WARN zingolib::lightclient: Server's latest block(2252276) is behind ours(2252375)
2023-10-19T02:19:31.472026Z WARN zingolib::lightclient: Server's latest block(2252333) is behind ours(2252375)
2023-10-19T02:19:53.136543Z WARN zingolib::lightclient: Server's latest block(2252278) is behind ours(2252375)
2023-10-19T02:20:11.596574Z WARN zingolib::lightclient: Server's latest block(2252276) is behind ours(2252375)
Two things are puzzling:
- How could the wallet possibly have a newer block than the server, considering its entire lifetime it has been pulling from this particular server?
- Notice how it claims the server's height keeps changing? In fact, it's changing by bouncing up and down.
This server is my own, and AFAIK it has no bug. It's just zebra, and has been serving many wallet apps across devices just fine. So.. this looks like a zingo bug.
The server hasn't rebooted. The zebra node and lightwallet server are on the same machine. Both are in a steady state. And while the zingo-cli keeps reporting that the server is bouncing around, here is the log tail on the lightwallet server:
{"app":"lightwalletd","level":"info","msg":"Waiting for block: 2555048","time":"2023-10-19T02:10:14Z"}
{"app":"lightwalletd","level":"info","msg":"Waiting for block: 2555049","time":"2023-10-19T02:12:24Z"}
{"app":"lightwalletd","level":"info","msg":"Waiting for block: 2555050","time":"2023-10-19T02:13:32Z"}
{"app":"lightwalletd","level":"info","msg":"Waiting for block: 2555051","time":"2023-10-19T02:13:34Z"}
{"app":"lightwalletd","level":"info","msg":"Waiting for block: 2555052","time":"2023-10-19T02:14:15Z"}
{"app":"lightwalletd","level":"info","msg":"Waiting for block: 2555053","time":"2023-10-19T02:16:10Z"}
{"app":"lightwalletd","level":"info","msg":"Waiting for block: 2555054","time":"2023-10-19T02:16:16Z"}
{"app":"lightwalletd","level":"info","msg":"Waiting for block: 2555055","time":"2023-10-19T02:16:39Z"}
{"app":"lightwalletd","level":"info","msg":"Waiting for block: 2555056","time":"2023-10-19T02:18:54Z"}
{"app":"lightwalletd","level":"info","msg":"Waiting for block: 2555057","time":"2023-10-19T02:19:53Z"}
Looks pretty steady to me.
It's also interesting to note that zingo-cli's "ours" block number is 2252375 while the server is at 2554534. So not only is the CLI reporting the server bouncing around, the cli is actually two thousand blocks behind where the server actually is