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

fix: fixed the available balance computation when stake is involved #435

Merged
merged 1 commit into from
Oct 20, 2020

Conversation

frol
Copy link
Collaborator

@frol frol commented Oct 14, 2020

Currently, we did not hit the corner case since there are only a few accounts that do real stake.

See https://nomicon.io/Economics/README.html#state-stake

def check_storage_cost(account):
    # Compute requiredAmount given size of the account.
    requiredAmount = sizeOf(account) * storageAmountPerByte
    return Ok() if account.amount + account.locked >= requiredAmount else Error(requiredAmount)

and also the matching implementation in nearcore: https://github.com/near/nearcore/blob/a480d6eb3d9c6542100efdc6364eb89daac69383/core/runtime-configs/src/lib.rs#L75-L95

/cc @icerove

@frol frol requested a review from chadoh as a code owner October 14, 2020 21:12
@frol frol requested a review from ilblackdragon October 14, 2020 21:18
@chadoh
Copy link
Contributor

chadoh commented Aug 27, 2021

Do I understand correctly that this means that the same token balance can be used both for storage staking and delegation/validator staking? That the same pot of tokens can do double-duty for storage & delegation?

@chadoh
Copy link
Contributor

chadoh commented Aug 27, 2021

If this is true, we need to update this document https://docs.near.org/docs/concepts/storage-staking#how-does-nears-design-align-incentives

Storage-staked tokens are unavailable for other uses, such as validation staking. This increases the yield that validators will receive.

@frol
Copy link
Collaborator Author

frol commented Sep 3, 2021

That the same pot of tokens can do double-duty for storage & delegation?

@chadoh Correct. Indeed, the documentation needs to be updated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants