-
Notifications
You must be signed in to change notification settings - Fork 417
feat: storage deposit #4035
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
feat: storage deposit #4035
Conversation
🛠 PR Checks SummaryAll Automated Checks passed. ✅ Manual Checks (for Reviewers):
Read More🤖 This bot helps streamline PR reviews by verifying automated checks and providing guidance for contributors and reviewers. ✅ Automated Checks (for Contributors):🟢 Maintainers must be able to edit this pull request (more info) ☑️ Contributor Actions:
☑️ Reviewer Actions:
📚 Resources:Debug
|
Codecov ReportAttention: Patch coverage is
📢 Thoughts on this report? Let us know! |
Closes #3418 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall direction looks great, just needs some changes. Please call me after changes.
I'll take a look! |
superseded by #4281 |
Solution for : #3418
BREAKING CHANGES
New Message Flag
AddPkg Additional Logic
send
flag to send tokens to the realm.deposit
flag to specify how much GNOT to include for storage fees.-deposit
flag was used in place of-send
within AddPkg.Purpose
Paying for Storage
Whenever data is stored in a realm (e.g., via
SetObject
), an amount of GNOT is locked as a “storage deposit.”Reclaiming Storage & Deposit
When stored data is removed, the corresponding deposit is released back to the user.
Encouraging Efficient Storage
Users must pay to keep data on-chain, incentivizing them to store only what is necessary.
High-Level Design
The system imposes a GNOT deposit for stored data. Each realm tracks its total number of bytes in use and the total tokens locked for that storage. After each message is processed, the net change in storage usage is calculated, and the appropriate amount of GNOT is locked or unlocked. By default, deposit tracking is aggregated per realm rather than per user. Any user refunds or reward mechanisms for freeing storage are determined by the realm.
Usage Tracking
Realm-Level Tracking
Global VM Parameters
Message-Level Fields
MsgCall
/MsgRun
/AddPkg
): The user can specify how many GNOT to deposit for potential storage usage.Deposit & Retrieval Flow
Make a
MsgCall
/MsgRun
/AddPkg
CallDuring Execution
Anyone Can Free Storage
Tools
gnokey query vm/qstorage -data <realm_path>
: Shows a realm’s locked tokens and current storage usage.Storage:
directive can be added to file tests to display storage usage across realms.Future Improvements