pod
pod copied to clipboard
Enable efficient fetching of latest version of the document
Given the following scenario:
Doc1:
Node A: v0 | v1 | v2 | v3
Node B: v0 | | | ?
When B
requests the latest versions (only from a version onwards) from A
, A
:
- Gather all versions that
B
has access to, with all data within. As this will be needed as well by the signature state consensus issue. - Send them to
B
Then B
:
- Stores versions
- For latest one, add entry to new table
document_latest
that points to latest document version - In case that B has missing access to a version of the document, then fill with headers-only and overridable block version. (debatable if needed)
Changes:
- New p2p endpoint that returns all versions that a collaborator has access to, given a start version:
{
DocIdentifier: docID,
FromNonce: fromNonce,
}
- Add Simple Index table to find latest document versions.
- Every new document update need to update the latest version value
- Remove logic to iterate over versions (
search
) to find the latest onGetLatestDocumentVersion
, just access thelatest document
table