Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

reporter: bootstrapping: Submit multiple headers at once #60

Closed
vitsalis opened this issue Sep 19, 2022 · 2 comments · Fixed by #63
Closed

reporter: bootstrapping: Submit multiple headers at once #60

vitsalis opened this issue Sep 19, 2022 · 2 comments · Fixed by #63

Comments

@vitsalis
Copy link
Member

There has been an implementation for this, but it fails in the case that one of the submitted headers is an already existing one. In order to reproduce:

  1. Start babylond and vigilante in a local environment using a btcd node (following the instructions on README).
  2. Let babylond sync with BTC and stop the vigilante.
  3. Restart the vigilante. The vigilante is going to try to submit multiple headers in a message, of which some of them are duplicates (it resubmits headers that are k-deep in babylond). The whole message fails due to those duplicate headers.

I implemented a hotfix for now, but we should try to implement this feature nonetheless.

A compromise could be:

  1. Try to submit the tx with all the headers.
  2. If it fails, remove the header that has the lowest height and retry (1). Do this until success.
    In the worst case, this would degrade to the performance of doing a separate query for all headers.

cc @SebastianElvis @gusin13

@SebastianElvis
Copy link
Member

The duplicate header submission is expected since vigilante does not trust the blocks that are not k-deep.

From my side the tx does not fail. Instead the duplicate headers are rejected but the others are accepted. Is this an issue?

@SebastianElvis
Copy link
Member

Catched up with all the chats in the infra channel. Then I would suggest the following mechanism: given a list of headers, check if it's contained in btclightclient. Upon finding the last block that is not contained, forward all blocks since this one to btclightclient. Will do a PR shortly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants