Closed jeffallen closed 6 years ago
Some more/related problems:
It looks like we need some kind of function called "verifyStoreAndUpdateForwardLinks" which encapsulates all of that into one function.
On consistent vs. complete. Linus and I think that the promise skipchain makes to local apps (i.e. verifiers for evoting) is that the blocks stored in the local DB have consistent links to each other, but that there might be holes in the chain, so that we can get the benefits of the skipchain.
But: making the rule that all backlinks of all newly discovered blocks are traversed in order to preserve consistency means we'll always fetch to completeness, because we will fetch back link 0 of each newly discovered block, marching all the way back until the last block that we have in our DB.
Still got to think about this some.
I think this issue is closed with the latest changes to the skipchain:
Does that make sense?
Imainge that a node has blocks with indexes: 0 -> <- 1. It is asked to make a forward link to block 3. It calls syncChain to find block 2, and integrates it into it's DB. It now has:
0 -> <- 1 <- 2
This issue is to fix that so that once 2 is fetched, the forward link on 1 will be also updated.