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

Implement P-chain ACP-103 complexity calculations #3209

Merged
merged 285 commits into from
Aug 5, 2024

Conversation

StephenButtolph
Copy link
Contributor

Why this should be merged

This PR introduces the methods required to calculate complexity of P-chain transactions.

Refactored logic out of #3188.

  • The bandwidth complexity is fully implemented.
  • The DBRead and DBWrite complexities are implemented, but may require additional configuration.
  • The Compute complexity is not implemented in this PR.

How this works

  • Bandwidth complexity is just the number of bytes per transaction/input/output.
  • DBReads is the number of reads that will be performed against disk for the operations.
  • DBWrites is the number of writes (and deletes) that will be performed against disk for the operations.
  • Compute is not implemented, as it requires additional benchmarking.

How this was tested

  • Valid transactions are included for every transaction type to ensure that any future breaking changes are caught by CI.
  • The bandwidth complexity is tested against the actual serialized format.

@StephenButtolph StephenButtolph changed the base branch from master to simplify-static-fee-calculations July 28, 2024 00:20
Base automatically changed from simplify-static-fee-calculations to master July 30, 2024 16:29
vms/platformvm/txs/fee/calculator_test.go Outdated Show resolved Hide resolved
vms/platformvm/txs/fee/calculator_test.go Outdated Show resolved Hide resolved
vms/platformvm/txs/fee/complexity.go Outdated Show resolved Hide resolved
vms/platformvm/txs/fee/complexity.go Show resolved Hide resolved
vms/platformvm/txs/fee/complexity_test.go Show resolved Hide resolved
@StephenButtolph StephenButtolph added this pull request to the merge queue Aug 5, 2024
Merged via the queue into master with commit f145d6b Aug 5, 2024
21 checks passed
@StephenButtolph StephenButtolph deleted the implement-acp-103-tx-metering branch August 5, 2024 18:22
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.

5 participants