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

0xmovses/goverened gas pool spec #118

Open
wants to merge 5 commits into
base: l-monninger/governed-gas-pool
Choose a base branch
from

Conversation

l-monninger
Copy link
Collaborator

Description

Type of Change

  • New feature
  • Bug fix
  • Breaking change
  • Performance improvement
  • Refactoring
  • Dependency update
  • Documentation update
  • Tests

Which Components or Systems Does This Change Impact?

  • Validator Node
  • Full Node (API, Indexer, etc.)
  • Move/Aptos Virtual Machine
  • Aptos Framework
  • Aptos CLI/SDK
  • Developer Infrastructure
  • Other (specify)

How Has This Been Tested?

Key Areas to Review

Checklist

  • I have read and followed the CONTRIBUTING doc
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I identified and added all stakeholders and component owners affected by this change as reviewers
  • I tested both happy and unhappy path of the functionality
  • I have made corresponding changes to the documentation

spec aptos_framework::governed_gas_pool {
/// <high-level-req>
/// No.: 1
/// Requirement: The GovernedGasPool resource must exist at the aptos_framework address after initialization.
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct.

/// Enforcement: Formally verified via [high-level-req-1](initialize).
///
/// No.: 2
/// Requirement: Only the aptos_framework address is allowed to initialize the GovernedGasPool.
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct.

/// Enforcement: Formally verified via [high-level-req-2](initialize).
///
/// No.: 3
/// Requirement: Deposits into the GovernedGasPool must be reflected in the pool's balance.
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would say you want to prove above that initialization creates a resource account distinct from the aptos_framework address. Then deposits into the GovernedGasPool are reflected in that account's balance.

/// Enforcement: Formally verified via [high-level-req-3](deposit), [high-level-req-3.1](deposit_from).
///
/// No.: 4
/// Requirement: Only the aptos_framework address can fund accounts from the GovernedGasPool.
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct.

/// Enforcement: Formally verified via [high-level-req-4](fund).
///
/// No.: 5
/// Requirement: Gas fees must be deposited into the GovernedGasPool whenever specified by the configuration.
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a requirement on transaction_validation.spec.move or transaction_fee.spec.move.

spec module {
/// [high-level-req-1]
/// The GovernedGasPool resource must exist at aptos_framework after initialization.
invariant exists<GovernedGasPool>(@aptos_framework);
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The GovernGasPool exists for the aptos_framework cannot be an invariant. You would need an exists implies, i.e., ==>. One thing the GovernedGasPool existing could imply is that the resource account for the GovernedGasPool exists.

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

Successfully merging this pull request may close these issues.

2 participants