Issue #131 - Node Sync Optimization#149
Conversation
| } | ||
|
|
||
| // applyTimeouts removes reuqests from the queue that have timed out | ||
| func (c *Controller) applyTimeouts(queue map[uint64]blockSyncRequest) []blockSyncRequest { |
There was a problem hiding this comment.
this behavior is not strictly related to the controller itself and I see you perform more operations over the queue, why don't convert the queue map into its own type like type queue map[uint64]blockSyncRequest{} and more this method and queuing/dequeueing to methods of that type, that way you can encapsulate all the behavior of this queue there
There was a problem hiding this comment.
We could do this and generally I prefer that approach but in this case there's very little to the queue.
One spot to add, two spots to remove, and it's not going to be used from anywhere else.
There was a problem hiding this comment.
@andrewnguyen22 thoughts on this? I honestly ultimately don't mind keeping it as-is but might be a little cleaner to have a custom type
Description
This PR updates the node syncing functionality in
controller/consensus.goto optimize synchronization and handle unexpected blocks.Changes Made
blockSyncRequestwas created to track these requests in the queue.rateScaleFactorsetting to allow node runners to increase or decrease their block request ratesCloses
Issue: #131