reposts with edits (aka third-party metadata) #49
Labels
No labels
area: devops
area: discovery
area: docs
area: livestream
area: proposal
consider soon
Epic
good first issue
hacktoberfest
help wanted
icebox
level: 1
level: 2
level: 3
level: 4
needs: exploration
needs: grooming
needs: priority
needs: repro
needs: tech design
on hold
priority: blocker
priority: high
priority: low
priority: medium
resilience
Tom's Wishlist
type: bug
type: discussion
type: improvement
type: new feature
type: refactor
type: task
type: testing
unplanned
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: LBRYCommunity/types#49
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
Proposed solution
Add two new fields to ClaimReference as follows
editsanddeletionsare used to change parts of the referenced claim.deletionsincludes a field that is not in the referenced claim, ignore itdeletionsincludes a repeated field that is in the reference claim, then any values indeletionsshould be removed from the referenced claimdeletionsincludes a non-repeated field that is in the reference claim, delete those fields from that claim (the value in thedeletedfield does not matter. it can be anything except the default value for that field)editsincludes fields that the referenced claim does not include, or if it includes repeated fields, treat them as added to the claimeditsincludes non-repeated fields that are also in the referenced claim, treat them as overwriting the existing fieldsDeletions must be applied first, and edits applied after.
The
typeof thedeletionsandeditsClaims must match the type of the claim that is referenced. if it does not match, the edits will not make sense and downstream apps may ignore them or even ignore the claim as a whole.Downstream apps should make clear to users which values come from the underlying claim and which come from edits/deletions.
If a referenced claim is updated after it is referenced, the values in
deletionsandeditsmay no longer make sense. Downstream apps should highlight to the user any fields that were updated in the referenced claim after being edited/deleted.Outstanding Questions
Corner Cases
durationin the claim is set to 5 minutesdurationto be 3 minutes using theeditsfielddurationin the metadata to 6 minutes (which is now correct for the new video)durationof 3 minutes, which is now wrongIn addition to the claim hash, if
ClaimReferencealso hasclaim_tx_hashandclaim_tx_noutfields some of these corner cases can be handled better. This would allow applying the change set onto the claim that was reposted and then considering any new changes since the repost was made.I believe this would be redundant since you can use the time of the repost itself to determine the order the changes should be applied. In other words, you can compute the claim_tx_hash and claim_tx_nout dynamically without using precious blockchain space.
Howdy guys - how are things going with this issue? Is it being actively worked on?
@moodyjon to investigate this approach with eye to become owner of this issue
https://github.com/lbryio/types/search?q=ClaimReference
ClaimReferencealso appears as a member ofClaimList, so the effect of adding deletions, edits toClaimReferencemay be overly broad. Would it be preferred instead to say that only reposts can have edits? And to get edits into aClaimList, you have to repost first, then include the repost in your collection?I've been working on
_inflate_outputs()in lbry-sdk. That's where one could apply deletions/edits before outputting a search/resolve result.https://github.com/lbryio/lbry-sdk/blob/a7d7efecc7aa8aa5ef666b16358ad1b2066e8eb1/lbry/wallet/ledger.py#L786In lbry-sdk,
jsonrpc_stream_update()callsClaim.update(**kwargs)to do its work. Generating aClaimReferencewith deletions/edits would be a method override specific toRepost.Finally, if the reposted edited fields are to be searchable,
prepare_claim_metadata_batch()' should apply the edits similar to how_inflate_outputs()` does so.34c5ab2e56/hub/elastic_sync/db.py (L30)