Skip to content

Gas storage fee mechanism #3418

@moul

Description

@moul

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.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Status

✅ Done

Status

Done

Relationships

None yet

Development

No branches or pull requests

Issue actions