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 Fee for Validation Only #81

Open
wants to merge 4 commits into
base: movement
Choose a base branch
from
Open

Conversation

l-monninger
Copy link
Collaborator

Description

Adds a gas fee charge for validation and other discarded transactions. This is intended to address movementlabsxyz/movement#490

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?

  1. Unit tests still pass.
  2. e2e testing with

Key Areas to Review

Identify the relationship between the FeeStatement, unwrap_or_discard, and the actual gas charged in VMOutput.

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

Self {
// todo: ideally this would be set by governance, which means adjusting `unwrap_or_discard` to accept some kind of reference and provide it here.
// this is currently based on base gas: https://aptos.dev/en/network/blockchain/base-gas
total_charge_gas_units: std::env::var("APTOS_BASE_GAS_UNITS")
Copy link
Collaborator

Choose a reason for hiding this comment

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

Would it be a bit wasteful to query environment every time VMOutput::empty_with_status() is called somewhere deep in the code?

Comment on lines +57 to +59
.unwrap_or("2_100_000".to_string())
.parse()
.unwrap_or(2_000_000),
Copy link
Collaborator

Choose a reason for hiding this comment

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

There should be just one source of truth on the default value, so if env::var fails, the default literal value should be used instead. Parsing fixed strings feels a bit like a daft code path.

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