lbryio / lbry-desktop

A browser and wallet for LBRY, the decentralized, user-controlled content marketplace.
https://lbry.tech
MIT License
3.56k stars 414 forks source link

Publishing - Show takeover time if claim is being outbid #633

Open tzarebczan opened 7 years ago

tzarebczan commented 7 years ago
## The Issue Breaking out issues discussed (mostly by me) from https://github.com/lbryio/lbry-app/issues/214 Currently, when taking over a claim held by someone else, users are not notified how long it will take for their claim to successfully complete the takeover process (i.e. resolve at the requested vanity name). They can see this information in the #content channel on Slack, but otherwise its a mystery. When a user is overbidding on an existing claim, the App should tell them how long it will take until their bid is the highest at the vanity name. If this requires some daemon side work, let me know and I can open an issue there. ### Expected behaviour LBRY app shows how long it will take to outbid successfully ### Actual behaviour No indication that there is a delay in the takeover process ## System Configuration

Anything Else

Screenshots

tzarebczan commented 7 years ago

Something to think about: Do we also take into consideration other "waiting to take over claims" when showing the user the minimum bid amount? If so, how do we do that if the effective amount is 0 while the takeover is in process. I think it takes 6 blocks for an effective amount to show properly.

lyoshenka commented 7 years ago

Here's some code I wrote a while ago to calculate the takeover time (or maybe the daemon should return this?)

// the following is based on https://lbry.io/faq/claimtrie-implementation
const lastTakeoverHeight = claimsForName['nLastTakeoverHeight'],
maxDelay = 4032, // 7 days of blocks at 2.5min per block
activationDelay = Math.min(maxDelay, Math.floor((claimBlockHeight - lastTakeoverHeight) / 32)),
takeoverHeight = claimBlockHeight + activationDelay,
secondsPerBlock = 161, // in theory this should be 150, but in practice its closer to 161
takeoverTime = Date.now() + ((takeoverHeight - currentHeight) * secondsPerBlock * 1000);
liamcardenas commented 6 years ago

@tzarebczan can you open up a daemon side issue?

liamcardenas commented 6 years ago

@tzarebczan did you have time to open up a daemon side issue yet?

tzarebczan commented 6 years ago

Sorry, I'm still behind on follow up on my github issues :)

Just opened https://github.com/lbryio/lbry/issues/1031, will mark it dependent.