Handle multibranch

With ucoin 0.12 coming, the multibranch feature will change a bit the way we handle network data :

On the network side :

  • We need to check for current block of every node
  • A node should be considered "synced" if it's last known block is the majority of all "last blocks" known in the network

On the requests and data handling side :

  • We should return data encapsulated like in the cache, in a dict :
    • with a field "data" containing the request response
    • with a field "metadata" containing the block of the requested node

The client should display data validity. A parameter should be available, saying "Blocks to validate data : K". The number K is how many blocks we wait after a data was written in the blockchain to consider the data validated.

I was thinking of a field with 3 states :

  • "Not-validated" (data not found on the blockchain, for signatures, transactions, posted but not validated yet)
  • "Being validated (XX%)" (data found in a block, but we are waiting for K blocks to be mined after this data. Typically, XX = (current_block - data_block)/K )
  • "Validated" : Enough blocks were mined This field could be displayed as a table cell, a popup...

Finally, transactions parsing will change a bit since we now transactions wont be validated as soon as a node returns it.

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information