-
Notifications
You must be signed in to change notification settings - Fork 810
Implement ACP-226 Math #4289
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 ACP-226 Math #4289
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds ACP-226 math package that implements dynamic minimum block delay calculations. The package provides functionality for calculating target delays based on excess values using exponential pricing mechanisms similar to those found in ACP-176.
Key changes:
- Implements core ACP-226 math functions for target delay excess calculations
- Adds comprehensive test coverage for all mathematical operations
- Provides serialization/deserialization utilities for state management
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| vms/evm/acp226/acp226.go | Core implementation of ACP-226 math functions including target delay calculations, excess updates, and state serialization |
| vms/evm/acp226/acp226_test.go | Comprehensive test suite covering all mathematical operations, edge cases, and benchmarks |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Co-authored-by: Stephen Buttolph <stephen@avalabs.org> Signed-off-by: Ceyhun Onur <ceyhunonur54@gmail.com>
Co-authored-by: Stephen Buttolph <stephen@avalabs.org> Signed-off-by: Ceyhun Onur <ceyhunonur54@gmail.com>
Co-authored-by: Stephen Buttolph <stephen@avalabs.org> Signed-off-by: Ceyhun Onur <ceyhunonur54@gmail.com>
Co-authored-by: Stephen Buttolph <stephen@avalabs.org> Signed-off-by: Ceyhun Onur <ceyhunonur54@gmail.com>
Co-authored-by: Stephen Buttolph <stephen@avalabs.org> Signed-off-by: Ceyhun Onur <ceyhunonur54@gmail.com>
|
closes ava-labs/coreth#1230 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assume we can come up with some way of combining the math with everything acp176 related, since most of the code is super similar, but it looks correct
Why this should be merged
Adds relevant excess calculation and math functions for acp-226
https://github.com/avalanche-foundation/ACPs/blob/main/ACPs/226-dynamic-minimum-block-times/README.md#minimumblockdelayexcess
This is a very similar package as in https://github.com/ava-labs/coreth/tree/master/plugin/evm/upgrade/acp176
How this works
Adds functions from https://github.com/ava-labs/coreth/tree/master/plugin/evm/upgrade/acp176 with acp-226 parameters defined in the spec.
How this was tested
added tests
Need to be documented in RELEASES.md?
probably not