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

Gas storage fee mechanism #3418

Open
moul opened this issue Dec 28, 2024 · 0 comments
Open

Gas storage fee mechanism #3418

moul opened this issue Dec 28, 2024 · 0 comments

Comments

@moul
Copy link
Member

moul commented Dec 28, 2024

Description:
Implement a system to manage storage fees for transactions by locking GNOT proportional to additional storage usage. This ensures fair accounting for storage costs and provides incentives for efficient storage use.

Details:

  • Transactions that increase storage should lock GNOT from the StorageAllowance field in MsgCall/MsgRun.
  • GNOT locked for storage should be calculated based on a storage price set in genesis (r/sys/params.CURRENT_STORAGE_PRICE.string), initially 1B GNOT / 10TB.
  • When storage is freed, return GNOT to the caller as bytes freed / CURRENT_STORAGE_PRICE.
  • The default StorageAllowance should be defined in r/sys/params as a reasonable maximum, adjustable per transaction.

Governance and Parameters:

  • Storage price adjustments must be handled through governance (r/gov).
  • Track total GNOT locked (LOCKED_GNOT) and total bytes stored per realm.
  • Ensure LOCKED_GNOT / BYTES >= CURRENT_STORAGE_PRICE to prevent underfunding as prices decrease.

Future Consideration:

  • Add SUBSIDIZED_GNOT (for each realm) to allow realms to subsidize storage costs for transactions.

Next Steps:

Open questions and suggestions in this issue before proceeding.

If possible, define pseudocode or interfaces for the mechanism before starting implementation.

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

No branches or pull requests

1 participant