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

Add P-chain dynamic fees execution #3251

Merged
merged 143 commits into from
Aug 28, 2024
Merged

Conversation

StephenButtolph
Copy link
Contributor

@StephenButtolph StephenButtolph commented Jul 30, 2024

Why this should be merged

This adds the dynamic fee logic into P-chain block building and execution.

How this works

  1. When the time is advanced, the capacity is increased and the excess is decreased.
  2. After the time has been advanced, the fee calculator is created to charge the minimum fee based on the excess.
  3. The complexity of every transaction in the block is accumulated.
  4. The capacity is decreased and the excess is increased based on the accumulated complexity of the block.
    a. This will return an error (and cause block verification to fail) if the capacity would go negative.

How this was tested

  • Added unit tests for new functionality.

@StephenButtolph StephenButtolph changed the base branch from combined-dynamic-fees-2 to implement-acp-103-tx-builder July 31, 2024 19:15
Base automatically changed from implement-acp-103-tx-builder to master August 13, 2024 17:38
@StephenButtolph StephenButtolph changed the base branch from master to dynamic-fees-api August 13, 2024 18:30
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This file needed to be moved because of the introduction of the "github.com/ava-labs/avalanchego/vms/platformvm". As that caused a circular dependency.

@StephenButtolph StephenButtolph changed the base branch from master to improve-p-tx-creation-3 August 26, 2024 17:34
Base automatically changed from improve-p-tx-creation-3 to master August 27, 2024 19:55
@StephenButtolph StephenButtolph added this pull request to the merge queue Aug 28, 2024
Merged via the queue into master with commit 82bf033 Aug 28, 2024
21 checks passed
@StephenButtolph StephenButtolph deleted the dynamic-fees-execution branch August 28, 2024 20:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

4 participants