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

feat(gas_price_service_v1): include max_da_gas_price to control volatility #2541

Merged
merged 10 commits into from
Jan 9, 2025

Conversation

rymnc
Copy link
Member

@rymnc rymnc commented Jan 8, 2025

Linked Issues/PRs

Description

Adds a new config param max_da_gas_price, which new_scaled_da_gas_price depends upon while mutating it.

Checklist

  • Breaking changes are clearly marked as such in the PR description and changelog
  • New behavior is reflected in tests
  • The specification matches the implemented behavior (link update PR if changes are needed)

Before requesting review

  • I have reviewed the code myself
  • I have created follow-up issues caused by this PR and linked them here

After merging, notify other teams

[Add or remove entries as needed]

@rymnc rymnc added the no changelog Skip the CI check of the changelog modification label Jan 8, 2025
@rymnc rymnc self-assigned this Jan 8, 2025
@rymnc rymnc force-pushed the chore/max-da-gas-price branch from 0108782 to 4fd0ee2 Compare January 8, 2025 18:02
@@ -540,6 +548,12 @@ impl AlgorithmUpdaterV1 {
.saturating_mul(self.gas_price_factor.into())
}

fn max_scaled_da_gas_price(&self) -> u64 {
// note: here we make sure that a correct maximum is used; hacky :(
max(self.max_da_gas_price, self.min_da_gas_price + 1)
Copy link
Member

Choose a reason for hiding this comment

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

Probably can just use min_da_gas_price without the + 1, but maybe there is a weird edge case I missing.

Copy link
Member Author

Choose a reason for hiding this comment

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

yup, detected and fixed

Copy link
Member Author

Choose a reason for hiding this comment

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

addressed in 4c42380

Comment on lines +523 to +527
max(
self.min_scaled_da_gas_price(),
maybe_new_scaled_da_gas_price,
),
self.max_scaled_da_gas_price(),
Copy link
Member

Choose a reason for hiding this comment

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

Let's add some tests for this.

Copy link
Member Author

Choose a reason for hiding this comment

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

addressed in 4c42380

@rymnc rymnc requested a review from MitchTurner January 8, 2025 18:22
@rymnc rymnc marked this pull request as ready for review January 8, 2025 18:22
@rymnc rymnc requested review from MitchTurner and Voxelot January 9, 2025 04:20
@rymnc rymnc force-pushed the chore/max-da-gas-price branch from 7ad61f7 to 261045f Compare January 9, 2025 10:35
Copy link
Contributor

@rafal-ch rafal-ch left a comment

Choose a reason for hiding this comment

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

LGTM 👍

bin/fuel-core/src/cli/run.rs Show resolved Hide resolved
@rymnc rymnc merged commit ae40ee4 into chore/add-tests-for-v1-gas-service Jan 9, 2025
51 of 61 checks passed
@rymnc rymnc deleted the chore/max-da-gas-price branch January 9, 2025 17:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no changelog Skip the CI check of the changelog modification
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants