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

Rent is opaque to clients #7413

Closed
2 tasks
rob-solana opened this issue Dec 10, 2019 · 12 comments
Closed
2 tasks

Rent is opaque to clients #7413

rob-solana opened this issue Dec 10, 2019 · 12 comments
Labels
locked issue stale [bot only] Added to stale content; results in auto-close after a week.
Milestone

Comments

@rob-solana
Copy link
Contributor

rob-solana commented Dec 10, 2019

Problem

information about expected rent payments is unavailable to clients without a fair amount of work

Proposed Solution

add a show-rent command to the cli

  • enhance rpc.get_minimum_balance_for_rent_exemption() to return rent/epoch
  • plumb show-rent to that rpc

see #7410 for an example of useful "show-rent" type information

@rob-solana rob-solana added this to the Supertubes v0.22.0 milestone Dec 10, 2019
@rob-solana rob-solana changed the title rent is opaque to clients Rent is opaque to clients Dec 12, 2019
@mvines mvines modified the milestones: Tofino v0.23.0, The Future! Jan 16, 2020
@mvines
Copy link
Member

mvines commented Mar 4, 2020

Along these lines, confusion can easily arise when you run a command like this:

$ solana balance foo_pubkey
0
$ solana transfer <foo_pubkey> 0.000000001
22VqweiY54ntzztwR9StT4K7tKM4maLMV2WdHxoQHfF6G5ufuUoi4zzLu9M7J5GdSQVUGZHUYTDhSHMYomG9YcBV
$ solana balance foo_pubkey
0

What?

The transfer succeeded but since the amount sent is below the minimum rent, foo_pubkey was rent collected and immediately returns to zero balance

@garious
Copy link
Contributor

garious commented Mar 25, 2020

Rent info should be added to solana fees

@jstarry
Copy link
Member

jstarry commented Apr 17, 2020

Came across a few more confusing points about rent collection from a client's perspective..

Rent delinquent account: An account with a non-zero balance (so hasn't been deleted from storage) but does not have sufficient funds to pay the rent due in the current epoch.

  1. Rent delinquent accounts can be accessed in instructions as long as they are not writable. Also, in this case, rent will not be deducted. This means free data storage until someone notices what you're doing and sends you a lamport 😝

  2. Rent delinquent accounts cannot be accessed in instructions if they are writable, but rent will only be collected if the transaction succeeds. This is confusing because the transaction error may have occurred because the account doesn't exist. However after this error, the account is still queryable by RPC and accessible by a subsequent instruction if treated as read-only.

  3. Rent delinquent accounts are hard to delete because of Parse and Print PoH #1 and Consider multi-threaded testnet #2. I think the only ways are if you send it lamports or reference it in a contrived instruction that treats the account as writable and succeeds. Notably, a client may try to transfer funds out of a rent delinquent account to delete it but that transaction will always fail. Very confusing.


For #1 and #3 it seems like archivers would be incentivized to clear out rent delinquent accounts.

For #2 I think we should collect rent on instruction failures. Does it warrant a new issue?

@jstarry
Copy link
Member

jstarry commented Apr 17, 2020

Also, it would be great if we made it easier for clients to calculate short-term rent!

@ryoqun
Copy link
Member

ryoqun commented Apr 17, 2020

@jstarry Thanks for writing up a issue for rent! All of problems are because of lazy rent collection. Fortunately, we'll go away from lazy one to eager rent collection because of these various UX problems and performance problems! #9527
Also, I've came up with a gaming for rent collection (I've written about it at the PR's description).

Recently, I've been caring rents a lot. :)

CC: @sakridge

@jstarry
Copy link
Member

jstarry commented Apr 17, 2020

Great, thanks for sharing @ryoqun! Eager rent collection removes the existence of "rent delinquent accounts" entirely which sounds great!

@jstarry
Copy link
Member

jstarry commented May 17, 2020

@ryoqun after reading about eager rent collection, I think we will still have rent delinquent accounts. This is because rent is collected over the course of the epoch. So rent delinquent accounts can exist for at least a full epoch (minus one slot). Is that right?

Anyways, it's a much less severe problem! But still something I think we need to consider.

@ryoqun
Copy link
Member

ryoqun commented May 18, 2020

@jstarry Yeah, that's still the case. Basically, the main purpose of eager rent collection is to protect the cluster. Sorry, but ux/dx was second citizen. ;)

Also, I've re-read your comment.. :)

For #2 I think we should collect rent on instruction failures. Does it warrant a new issue?

Yeah, I think so too. :) A kind-of DX/UX bug. Afaic, not critical.

Rent delinquent accounts can be accessed in instructions as long as they are not writable.

Well, I didn't know this. Is this really true? I think this is a bug. For concurrent execution thing of programs, I think we ended up like this. But I think this is still a kind of dx/ux bug. Afaic, not critical.

archivers would be incentivized to clear out rent delinquent accounts.

Out of curiosity, how archivers are incentivized in your thinking? I thought archivers only cares for transactions, oh rent reward? In that case, validators are too. But these ill-designed incentives are gone with eager rent collection.

@jstarry
Copy link
Member

jstarry commented May 19, 2020

@ryoqun thanks for your response!

I realized my definition of "rent delinquent" accounts is actually not valid if we remove lazy rent collection and only use eager rent collection. Anyways, agreed that both ux "bugs" are not critical 👍

Out of curiosity, how archivers are incentivized in your thinking? I thought archivers only cares for transactions, oh rent reward? In that case, validators are too. But these ill-designed incentives are gone with eager rent collection.

Yes, rent rewards was my thinking. Agreed that those incentives are gone now 👍

@stale
Copy link

stale bot commented Jun 2, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@stale stale bot added the stale [bot only] Added to stale content; results in auto-close after a week. label Jun 2, 2021
@stale
Copy link

stale bot commented Jun 18, 2021

This stale issue has been automatically closed. Thank you for your contributions.

@stale stale bot closed this as completed Jun 18, 2021
@github-actions
Copy link
Contributor

github-actions bot commented Apr 3, 2022

This issue has been automatically locked since there has not been any activity in past 7 days after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 3, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
locked issue stale [bot only] Added to stale content; results in auto-close after a week.
Projects
None yet
Development

No branches or pull requests

5 participants