cothority icon indicating copy to clipboard operation
cothority copied to clipboard

Target height signed alonside forward-link

Open Gilthoniel opened this issue 5 years ago • 5 comments

Backwards incompatible

We can only insure that From and To have been verified and signed by the conodes but you can't be sure of the position of the forward-link if you don't have access to the target block which happens in catch up scenarios.

It would nice and cheap to append the target height to the forward-link so that it can be verified easily when the block is stored.

Gilthoniel avatar May 23 '19 12:05 Gilthoniel

well you can calculate the height of the forward-link if you have the indexes of the 'from' and 'to' blocks. Would that be enough?

ineiti avatar May 24 '19 07:05 ineiti

Unfortunately no because for instance during catch up, the target block (To) is not yet stored and then you don't know the index. But that's what I'm doing when the block is known yes.

Gilthoniel avatar May 24 '19 07:05 Gilthoniel

OK - I think I don't know exactly how the catching up works - wouldn't you have at least one of the blocks, and then being able to look up the height, and infer the destination-index, too?

Anyway, if this doesn't work, then you could store in fact any two of the following fields:

  • from-index
  • to-index
  • height The third can then be calculated from the other two. And I'm sure that sooner or later you'd want to not only have the height, but also one of the indexes...

ineiti avatar May 24 '19 09:05 ineiti

I guess it doesn't matter between height or the to-index (from is necessarily available) as you can go from one to another if the information is signed and thus you can trust it.

Gilthoniel avatar May 24 '19 09:05 Gilthoniel

So should it be from and height then? Supposing it's easier to calculate the to from those two...

ineiti avatar May 24 '19 15:05 ineiti