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

[Feature]: Add a bitcoin block start height to the signers #685

Open
1 of 2 tasks
djordon opened this issue Oct 20, 2024 · 2 comments · Fixed by #1093 · May be fixed by #1087
Open
1 of 2 tasks

[Feature]: Add a bitcoin block start height to the signers #685

djordon opened this issue Oct 20, 2024 · 2 comments · Fixed by #1093 · May be fixed by #1087
Assignees
Labels
sbtc signer binary The sBTC Bootstrap Signer.

Comments

@djordon
Copy link
Collaborator

djordon commented Oct 20, 2024

Feature - Add a bitcoin block start height to the signers

1. Description

We should have a bitcoin start height for which all signers will have bitcoin and stacks block headers for. This issue is about making sure that the signers have a common idea for when to begin their bridging activities, and provides a foundational assumption that we can use in other areas.

1.1 Context & Purpose

Having a common bitcoin and stacks height solves a few problems.

  • The signers need a good stopping point when backfilling bitcoin and stacks blocks.
  • It also allows us to make simplifying assumptions in the block observer when fetching deposit requests. Specifically, it allows us to know that we can safely write the deposit request into the database in the code that originally closed [Feature]: Block observer is skipping certain deposit requests #522.

I expect that it will solve other problems since we can rely on the fact that the signers start with the same basic blockchain information.

2. Technical Details:

The natural choice for this bitcoin block start height is the stacks Nakamoto start height, since that is easy to fetch and can be used consistently in both testnet and mainnet. It also frees us from adding another variable in the config.

2.1 Acceptance Criteria:

  • We have a process that fetches bitcoin blocks on boot up until the bitcoin start height.
  • We have a process that fetches stacks blocks on boot up until their associated bitcoin anchor height is the bitcoin start height.

3. Related Issues and Pull Requests (optional):

4. Appendix (new)

The block observer loads all blocks that need processing in memory before proceeding. This is not the best thing for us to do because we could need to process thousands of blocks at one time. Since each block takes up around ~1.5 MBs this could take up a lot of memory. Instead we should use the getblockheader RPC to get the headers and fetch the actual block when processing it.

@djordon
Copy link
Collaborator Author

djordon commented Dec 12, 2024

The stacks side of this was not completed in #1093

@aldur
Copy link
Collaborator

aldur commented Dec 20, 2024

Status update: the Bitcoin side is out there, the Stacks side is still missing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sbtc signer binary The sBTC Bootstrap Signer.
Projects
Status: In Review
3 participants