Tracking issue for issues around sync correctness, getting confused downloading blocks, etc.
Hangs and Panics:
Logging:
Failed to write to hedge histogram: ValueOutOfRangeResizeDisabled logs (issue: tower-rs/tower#475, fix: tower-rs/tower#484)Performance:
Duplicate Downloads:
Duplicate/AlreadyVerified errors in the checkpoint verifier (#1259)AlreadyVerified log level to traceCleanup:
Reduce Sync Restarts:
BlockHashes, due to a zebrad bugWork out if we need to remove duplicate downloads using:
obtain_tips, as done in the current code].Design Questions:
Database:
Notes on Sled TreesDocumentation:
Performance improvements:
zcashd instances on Testnet (#1222)Possible Future Work:
@teor2345 I think we don't need the sync to be able to go forward a block at a time, since as new blocks are generated we'll get them through gossip (to be implemented in #889).
On the BLOCK_TIMEOUT question, there are actually two timeouts -- the one applied in the timeout layer and the one used internally in the peer set's state machine (set to 10 seconds). So if we want to have timeouts greater than 10 seconds we'll need to update that timeout as well. With a 1-second latency allowance that would be 1.8 Mbps. Maybe that's too high, although I don't think that it's unreasonable for the server use case that Zebra aims for.
I think it would be fine to increase the timeout to a somewhat larger value, and increase the lookahead limit to compensate. What's a reasonable target speed?
@teor2345 I think we don't need the sync to be able to go forward a block at a time, since as new blocks are generated we'll get them through gossip (to be implemented in #889).
Sounds good, and I guess it's ok to lag slightly in our first release. I'll update that TODO.
On the
BLOCK_TIMEOUTquestion, there are actually two timeouts -- the one applied in the timeout layer and the one used internally in the peer set's state machine (set to 10 seconds). So if we want to have timeouts greater than 10 seconds we'll need to update that timeout as well. With a 1-second latency allowance that would be 1.8 Mbps. Maybe that's too high, although I don't think that it's unreasonable for the server use case that Zebra aims for.I think it would be fine to increase the timeout to a somewhat larger value, and increase the lookahead limit to compensate. What's a reasonable target speed?
I'm not sure if we need to make any changes here.
Requiring less than 10 Mbps is reasonable for servers. And a latency of 1 second should cover most servers, wifi, and even some mobile internet. But I don't know the exact answer, because download speed also depends on peer speeds and peer latency. We should do some testing 馃
Do we expect people to be able to run Zebra over Tor?
Because that will decrease our bandwidth, and significantly increase our latency:
For Tor via exits, it seems like 6 seconds should be enough for most blocks:
https://metrics.torproject.org/torperf.html?start=2020-05-15&end=2020-08-13&server=public&filesize=1mb
For Tor via onion services, we'd need to allow 20 seconds per block:
https://metrics.torproject.org/torperf.html?start=2020-05-15&end=2020-08-13&server=onion&filesize=1mb
(Note that these are the 1 MB graphs, there are also 5 MB graphs, but we only need 2 MB.)
Sounds good, and I guess it's ok to lag slightly in our first release. I'll update that TODO.
To clarify, I don't think we'll be lagging here -- in initial block sync, we'll sync up to the current chain tip, and we'll stay in sync through block gossip.
I'm not sure if we need to make any changes here.
Okay, let's do nothing for now. I don't think that we can run Zebra over Tor anyways, since the Bitcoin protocol isn't really compatible with Tor.
Updated the list of checks with rationale about sync behavior.
I updated the list of outstanding issues, I'll check them off as I submit PRs.
Even after these changes, Zebra still doesn't limit the number of requests which are waiting for peer responses, or handle peer reputation. So I've added them to the "future work" section.
I don't think it makes sense for us to limit the number of requests waiting for peer responses, because I don't think that there's a way for us to work out in a principled way what an appropriate limit for the number of in-flight requests should be. Instead I think it would be better to use backpressure from the peer set to block new requests when the peer set is at capacity, which is what we already do. If this isn't working well, I would prefer to try to figure out why, and how we could improve it. Perhaps this could be addressed by setting the peer set's target size to a smaller parameter.
Yeah, that was basically the conclusion I came to after thinking about it a bit more.
It might also be something we want to document for users - if they are on a slower network, try setting the target peerset size lower.
I have split this tracking issue into "First Alpha" and "Future Releases".
What is left here for the Alpha release now?
I have removed #1183 from the Alpha milestone and #1182 is done.
Do we also want to implement the logging tickets?
How much of the testing (if any) has been done?
These bugs make testing really difficult:
I still can't get Zebra to reliably sync to the tip. So we haven't done enough testing yet - we need to do a full sync after we've fixed all the common errors.
@hdevalence said on discord that tower-rs/tower#475 is fixed by tower-rs/tower#484.
For some reason the ticket is still open.
Can we move this out of Alpha Release milestone now that #1183 is closed?
Can we move this out of Alpha Release milestone now that #1183 is closed?
What should we do about these first alpha testing tasks?
We're still making changes that might affect sync behaviour.
These sound to me more like ongoing checks that should be done by developers to validate their changes whenever they make changes to the sync code (or changes that may affect it) rather than finite one-time only tasks.
If these checks can't be automated my suggestion would be to add these to the PR template as a reminder for developers. Otherwise, if we can automate, let's create a ticket to implement these checks in our CI after the alpha.
I think it will be good to document somewhere(maybe in the main README) machine specifications to sync the mainnet up to current tip. This is recommended RAM, disk space, CPU, etc. With those specs we can document an estimated time to be in sync, something like "at the moment of writing, with the recommended specs, sync up to block XXXXX will take around XX time" This way developers and users can rent appropriate services or try locally and know what to expect.
I think it will be good to document somewhere(maybe in the main README) machine specifications to sync the mainnet up to current tip. This is recommended RAM, disk space, CPU, etc. With those specs we can document an estimated time to be in sync, something like "at the moment of writing, with the recommended specs, sync up to block XXXXX will take around XX time" This way developers and users can rent appropriate services or try locally and know what to expect.
We have some similar details in #1374
I see, sorry i didn't saw that. Thanks.
There isn't anything specific to be done for "testing on mainnet", so I removed those items, and moved this ticket out of the first alpha release.
adding #862 to this epic
adding #862 to this epic
That ticket modifies the state service interface, which impacts sync and verification. So it doesn't really belong in sync correctness.
The state service cleanup in #1302 might be a better place for it.