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 fee APIs #3286

Merged
merged 12 commits into from
Aug 15, 2024
Merged

Add P-chain fee APIs #3286

merged 12 commits into from
Aug 15, 2024

Conversation

StephenButtolph
Copy link
Contributor

Why this should be merged

This PR:

  1. Exposes the dynamic fee configuration after Etna is activated.
  2. Exposes the dynamic fee state of the chain.

How this works

Adds APIs to the service + client.

How this was tested

  • Manual testing. This will be e2e tested when it is incorporated into the wallet.

@StephenButtolph StephenButtolph added this to the v1.11.11 milestone Aug 15, 2024
Copy link
Contributor

@ARR4N ARR4N left a comment

Choose a reason for hiding this comment

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

Changes don't require my re-review.

vms/platformvm/service.go Show resolved Hide resolved
vms/platformvm/service.go Show resolved Hide resolved
defer s.vm.ctx.Lock.Unlock()

reply.State = s.vm.state.GetFeeState()
reply.Price = s.vm.DynamicFeeConfig.MinGasPrice.MulExp(
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there shared code that performs this calculation? I'm guessing the price is used somewhere internally, and this is at risk of diverging.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not sure how better to share this... This function takes in 3 params to calculate the price... Any helper would also take in 3 params and just call this function... No?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will change this in a breakout

vms/platformvm/service_test.go Outdated Show resolved Hide resolved
@StephenButtolph StephenButtolph added this pull request to the merge queue Aug 15, 2024
Merged via the queue into master with commit 9a9244f Aug 15, 2024
21 checks passed
@StephenButtolph StephenButtolph deleted the dynamic-fees-api branch August 15, 2024 18:14
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