vulpemventures / neutrino-elements

MIT License
3 stars 4 forks source link

neutrino should be able to sync chain with height > 3000 #16

Closed louisinger closed 2 years ago

louisinger commented 2 years ago

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.

https://github.com/vulpemventures/neutrino-elements/blob/beeb0cb147d2741cf340a3b0ab57f15455c18687/pkg/node/cmd_headers.go#L11-L27

tiero commented 2 years ago

Status of this?

sekulicd commented 2 years ago

Status of this?

This can be closed.