-
Notifications
You must be signed in to change notification settings - Fork 31
Description
After bitcoindevkit/bdk#937 all changsets are monotone except for LocalChain
. After bitcoindevkit/bdk#1002 it becomes much easier to make LocalChain
monotone too. The reason you want this is so that changesets can be applied in any order. Without this the user's application has to make sure each changeset is applied to the persistence baclkend in order and so should lock the backend and the chain until it has successfully written to disk.
The approach to doing this is simple: Make it possible to insert chain data that does not necessarily connect to the existing chain when applying a changeset. Rather just make sense of each fact provided by a changeset i.e. "at this height there existed a block with this hash which was a child of a block at this height with this hash" etc. This allows LocalChain
to keep track of multiple chains and have multiple tips. it only needs to index by height the longest one (with tiebreak by blockhash -- verify this claim with respect to consensus rules I think you will find this is a good enough approximation).
This doesn't need to be done before 1.0-alpha.1
but should be done before 1.0
Metadata
Metadata
Assignees
Labels
Type
Projects
Status