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

ACP-103: Finalize complexity calculations #3548

Merged
merged 13 commits into from
Nov 15, 2024

Conversation

StephenButtolph
Copy link
Contributor

@StephenButtolph StephenButtolph commented Nov 14, 2024

Why this should be merged

This PR resolves the TODOs in tx complexity calculations for ACP-103.

How this works

Introduces the complexity dimension (loosely treating 1 complexity unit as 1 micro-second of CPU time.)

TimePerSECP256K1Verification = 200 us
TimePerBLSAggregation        = 5 us
TimePerBLSVerification       = 1000 us

GasPerSECP256K1Verification = TimePerSECP256K1Verification * GasPerComputeTime =   800 gas/signature
GasPerBLSAggregation        = TimePerBLSAggregation * GasPerComputeTime        =    20 gas/key
GasPerBLSVerification       = TimePerBLSVerification * GasPerComputeTime       = 4_000 gas/signature

GasOverheadPerWarp     = 20 * GasPerDBRead
GasPerWarpVerification = GasPerBLSAggregation * numKeys + GasPerBLSVerification + GasOverheadPerWarp

This PR also updates and documents reads and writes for various transactions

How this was tested

  • Updated unit tests
  • Expanded and added benchmarks

Need to be documented in RELEASES.md?

No.

@StephenButtolph StephenButtolph added this to the v1.11.13 milestone Nov 14, 2024
@StephenButtolph StephenButtolph self-assigned this Nov 14, 2024
@StephenButtolph StephenButtolph marked this pull request as ready for review November 14, 2024 20:08
Copy link
Contributor

@michaelkaplan13 michaelkaplan13 left a comment

Choose a reason for hiding this comment

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

LGTM aside from merge conflicts

@StephenButtolph StephenButtolph added this pull request to the merge queue Nov 15, 2024
Merged via the queue into master with commit 5a188b8 Nov 15, 2024
23 checks passed
@StephenButtolph StephenButtolph deleted the acp-103-finalize-complexities branch November 15, 2024 16:27
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.

3 participants