Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add takeover_estimate to resolve response #1031

Open
tzarebczan opened this issue Dec 14, 2017 · 3 comments
Open

Add takeover_estimate to resolve response #1031

tzarebczan opened this issue Dec 14, 2017 · 3 comments
Labels
area: jsonrpc level: 2 Some knowledge of the existing code is recommended Tom's Wishlist type: improvement Existing (or partially existing) functionality needs to be changed

Comments

@tzarebczan
Copy link
Contributor

tzarebczan commented Dec 14, 2017

The Issue

To support the app in showing users how long they need to wait for their vanity claim resolution (lbryio/lbry-desktop#633 (comment)), the daemon should return the estimated takeover time with the resolve call.

Keep in mind that effective amount is only valid once the claim is active...so we have the original claim amounts, but no information for supports...but supports will play a large role in the bidding process. So unless we identify and count up supports to show a "pending takeover amount", this can only show the original bid, which doesn't paint the entire story...works for now until lbryio/lbrycrd#203 is solved though.

Grin's old code for takeover time:

// 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);
@tzarebczan tzarebczan added the type: improvement Existing (or partially existing) functionality needs to be changed label Dec 14, 2017
@lyoshenka
Copy link
Member

lyoshenka commented Dec 15, 2017

keep in mind, this is an approximate takeover time, and should be presented as such. secondsPerBlock is an approximation

@lyoshenka lyoshenka added needs level level: 1 No knowledge of the existing code required area: jsonrpc and removed needs labels labels Jan 9, 2018
@lyoshenka lyoshenka added level: 2 Some knowledge of the existing code is recommended and removed level: 1 No knowledge of the existing code required labels Feb 6, 2018
@alyssaoc
Copy link
Contributor

alyssaoc commented Dec 4, 2018

@tzarebczan Is this still an open issue?

@tzarebczan
Copy link
Contributor Author

Yes, needs to be prioritized

@tzarebczan tzarebczan removed their assignment Dec 6, 2018
@lyoshenka lyoshenka changed the title Add takeover time to claim resolution Add takeover_estimate to resolve response Jan 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: jsonrpc level: 2 Some knowledge of the existing code is recommended Tom's Wishlist type: improvement Existing (or partially existing) functionality needs to be changed
Projects
None yet
Development

No branches or pull requests

5 participants