Remove claim expiration #21
Labels
No labels
area: devops
area: discovery
area: docs
area: livestream
area: proposal
consider soon
Epic
good first issue
hacktoberfest
hard fork
help wanted
icebox
Invalid
level: 0
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
soft fork
Tom's Wishlist
type: bug
type: discussion
type: improvement
type: new feature
type: refactor
type: task
type: testing
unplanned
work in progress
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: LBRYCommunity/lbrycrd#21
Loading…
Add table
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?
As discovered by @jimmykiselak
Expired claims are not kept track of by claimtrie.cpp , thus they are not updateable using OP_UPDATE_CLAIM. Name owners can only reclaim the expired claim through OP_CLAIM_NAME , which means that all supports must be updated as well.
Expired claims should be kept track of, so they can be updated.
This is a hard fork and will require reindexing. We have roughly till the end of August to fix this issue in a simple way (see related issue https://github.com/lbryio/lbrycrd/issues/20 ) . Otherwise there needs to be exceptions made for early blocks.
@kaykurokawa looks like we'd need to do something this month if we're going to address this.
What would it look like to just have claims never expire? It seems like this may be more desirable. Doing some quick math, 1e9 pieces (1 billion) would require 5000 updates per block just to keep content published.
@kauffj / @kaykurokawa / @jackrobison I remember discussing this on one of the calls, not sure if we had to take any action.
Our oldest claim was in block 2806, so it expires at 265780, which will be roughly November 1st.
@kaykurokawa @jackrobison what are the downsides to having claims never expire? The only one I can think of is that its nice to be able to prune expired claims from the cliamtrie. Anything else?
a) Already stated but worth stating again: Old names that people claimed with a lot of credits and lost the key for can be reclaimed
b) There are several ways in which the value of a claim is no longer of any use, and is effectively "expired". For example : claims can become effectively "expired" by us updating the lbry schema in a non backwards compatible manner. Claims can also become effectively "expired" if they no longer exist in the DHT. We don't need to take any action when these things happen, because the claims will just expire on its own.
c) storing things in the claimtrie is expensive because every full node has to bring the entire claimtrie into memory for every block in order to calculate the claimtrie hash. (this is more expensive than storing an unspent from a transaction because only the unspents that are used in the block need to be brought into memory ). If we just let it grow for all the lifespan of lbrycrd and nothing expired, eventually it will reach a point where it will take too long to calculate the claim trie hash ( Note that we have to store 32 bytes per claim). Miners can more effectively control the growth of the claim trie by imposing transaction fees IF the claims have a set expiration date. If claims never expire, you are essentially asking the miner "Can you store this thing in your memory during the entirety of lbrycrd existence", which miners will have a hard time pricing.
In conclusion, claims should definitely expire.
Also should note that the original question on this issue was:
Should expired claims be update able , as opposed to should claims expire.
Making expired claims update able is not that costly since expired claims do not enter the claim trie, they just need to be kept track of the same way an unspent transaction is.
@kaykurokawa thank you for writing up these comments, useful and informative.
It seems like there's a tradeoff here between having a large claimtrie, and having to issue lots of updates to keep names from expiring. Maybe we should figure out what our claimtrie "capacity" is? e.g. how many claims can we have before we exceed some limit (either miner RAM or txns/second). Then we'll know which bottleneck we're likely to hit first.
@kaykurokawa do you also see there as being scaling issues around requiring regular claim updates? If LBRY is supporting 1e9+ pieces of content and they need to be updated every X seconds, what values make sense so that the system works from a total and transactional capacity perspective?
(At 32 bytes per claim, 1e9 pieces of content is only 32GB, which doesn't seem crazy to require of miners at that scale.)
I think @lyoshenka is right, lets start by verifying/measuring how well the lbrycrd code responds to claimtrie size increases (memory usage, claimtrie update speed, discover any possible bugs that can occur from being stress tested, there should probably be an RPC command to return the amount of memory claimtrie is using) There has really been no testing done at all in this area so I think its necessary. This is about 40 hours of work.
The code changes to remove expiration and thorough testing will take about 80 to 120 hours worth of work
@kaykurokawa could you break down the 80-120 hours into smaller items with time estimates on those items. aim for items that are a 5 at most, and break up anything bigger than that into subitems. make a separate issue for each of those subitems and add them to this epic. lemme know if you want help with this
Claim expiration will be removed by https://github.com/lbryio/lbrycrd/pull/115