stacks-network / sbtc

Repo containing sbtc
GNU General Public License v3.0
284 stars 8 forks source link

[Feature]: Store bitcoin block anchoring Stacks blocks #754

Open djordon opened 3 weeks ago

djordon commented 3 weeks ago

Feature - Store bitcoin block anchoring Stacks blocks

1. Description

Before we write stacks blocks to the database we fetch the bitcoin block that anchors the Stacks block and we write that to the database. But we do not check for whether we know about that bitcoin block at all. It's possible that we don't.

I don't think this is a critical issue though since the signers all follow their bitcoin node for blockchain information. If a Stacks block is anchored to a block that is not on the canonical bitcoin blockchain then we will ignore it anyway.

1.1 Context & Purpose

2. Technical Details:

Store the anchor bitcoin block in the database if we do not have a record of it before writing the Stacks block to the database.

2.1 Acceptance Criteria:

3. Related Issues and Pull Requests (optional):

This looks similar to https://github.com/stacks-network/sbtc/issues/731, since they'll use the same code.

aldur commented 2 weeks ago

To be investigated on whether it is a requirement (e.g. critical bug) or a nice to have.