The current version of node service is using getheaders & headers msg to sync the chain with peers.
While the node receives headers msg, it propagates them in a dedicated channel and checks if we have all ancestors of the chaintip (checkSync function). However, the code does not take into account the headers msg limit: max 3000 headers/msg that's why if u try to sync with testnet or mainnet, only 3000 blocks will be synced.
We should maybe re-send a getheaders msg in such cases.
The current version of node service is using
getheaders
&headers
msg to sync the chain with peers.While the node receives
headers
msg, it propagates them in a dedicated channel and checks if we have all ancestors of the chaintip (checkSync
function). However, the code does not take into account theheaders
msg limit: max 3000 headers/msg that's why if u try to sync with testnet or mainnet, only 3000 blocks will be synced.We should maybe re-send a
getheaders
msg in such cases.https://github.com/vulpemventures/neutrino-elements/blob/beeb0cb147d2741cf340a3b0ab57f15455c18687/pkg/node/cmd_headers.go#L11-L27