Skip to content

[Feature Request] Aggregator V2 + Governed Gas Pool#248

Description

@0xIcarus

馃殌 Feature Request

Move the Governed Gas Pool鈥檚 accounting off direct Coin mutations and onto Aggregator V2 counters so gas-fee deposits, treasury inflows, and staking-reward withdrawals can execute in parallel without read/write conflicts.

Motivation

Currently every gas-fee deposit or reward withdrawal locks the pool鈥檚 CoinStore, limiting throughput during heavy traffic. Using Aggregator V2 lets us keep precise running totals without forcing transactions to serialize, improving gas-collection scalability.

Pitch

  1. Extend GovernedGasPoolExtension with Aggregator V2 fields (e.g., gas-fee total, treasury total).
  2. Initialize those aggregators during initialize / initialize_governed_gas_pool_extension.
  3. Update deposit/withdraw functions to:
    a) continue moving the actual coins/FA into the pool
    b) mirror the amount into the corresponding aggregator via add/sub
  4. Expose new views (or event data) so governance tools can read aggregator snapshots without blocking parallelism.
  5. Guard changes behind the existing FA feature flag (if needed) and migrate counters during init.

Willing to open a PR?

Yes, once the plan is approved.

Alternatives

  1. Stay on plain CoinStore bookkeeping (keeps sequential bottlenecks).
  2. Use off-chain accounting only (loses on-chain verifiability).

Additional context

  1. Docs to touch: governed_gas_pool.move, .spec.move, and aptos-framework/doc/governed_gas_pool.md.
  2. Tests: extend initialize_for_test, treasury/gas deposit tests, and add aggregator-specific checks.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions