-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Integrate with V1 algo for tests #2469
base: master
Are you sure you want to change the base?
Conversation
…data_tests.rs Co-authored-by: Rafał Chabowski <[email protected]>
…-be-received-out-of-order
…to feature/init-task-for-v1-gas-price-service
8d219d2
to
ff8243c
Compare
ff8243c
to
eb202cf
Compare
|
||
/// The minimum allowed gas price | ||
#[arg(long = "min-gas-price", default_value = "0", env)] | ||
pub min_gas_price: u64, | ||
|
||
/// The percentage threshold for gas price increase | ||
#[arg(long = "gas-price-threshold-percent", default_value = "50", env)] | ||
pub gas_price_threshold_percent: u64, | ||
pub gas_price_threshold_percent: u8, |
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.
this is a breaking change
crates/fuel-core/src/service/adapters/fuel_gas_price_provider.rs
Outdated
Show resolved
Hide resolved
crates/fuel-core/src/service/adapters/fuel_gas_price_provider.rs
Outdated
Show resolved
Hide resolved
@@ -30,20 +30,27 @@ mod tests; | |||
#[derive(Debug)] | |||
/// Receives the next gas price algorithm via a shared `BlockGasPriceAlgo` instance | |||
pub struct FuelGasPriceProvider<A> { | |||
// // Scale the gas price down by this factor, for e.g. Wei to Gwei | |||
// scaling_factor: u64, | |||
algorithm: SharedGasPriceAlgo<A>, | |||
} | |||
|
|||
impl<A> Clone for FuelGasPriceProvider<A> { |
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.
do we need this impl if we just restrict A: Clone
?
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.
We don't really care if A: Clone
though, this is more precise.
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.
Added changes in-line that need to be made before merging. there are a few questions as well.
crates/fuel-core/src/service/adapters/fuel_gas_price_provider.rs
Outdated
Show resolved
Hide resolved
config.clone().into(), | ||
tracing::debug!("da_committer_url: {:?}", config.da_committer_url); | ||
let committer_api = BlockCommitterHttpApi::new(config.da_committer_url.clone()); | ||
let da_source = BlockCommitterDaBlockCosts::new(committer_api, None); |
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.
if we are using None
here as the polling interval and not taking in the value from config we should omit it and just use the default in the da source.
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 was able to remove the Option
, but its not for poll interval, it's for latest_recorded_height
, which we now set internally.
tests/tests/gas_price.rs
Outdated
driver.kill().await | ||
}); | ||
|
||
// // rollback 50 blocks |
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.
@MitchTurner should this be uncommented?
## Linked Issues/PRs <!-- List of related issues/PRs --> ## Description <!-- List of detailed changes --> In the case we are syncing from an existing network, it is possible for the L2 blocks to sync slower than the DA costs, in which case you will try to apply DA costs to an algorithm that is missing the corresponding unrecorded L2 blocks. This PR - introduces a `latest_l2_height` to the `DaSourceService` which will filter out any DA bundles that include L2 blocks after the current height - moves the recorded height concept into the `DaSourceService` where it probably should have been to begin with ## Checklist - [ ] Breaking changes are clearly marked as such in the PR description and changelog - [ ] New behavior is reflected in tests - [ ] [The specification](https://github.com/FuelLabs/fuel-specs/) 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] - [ ] [Rust SDK](https://github.com/FuelLabs/fuels-rs/) - [ ] [Sway compiler](https://github.com/FuelLabs/sway/) - [ ] [Platform documentation](https://github.com/FuelLabs/devrel-requests/issues/new?assignees=&labels=new+request&projects=&template=NEW-REQUEST.yml&title=%5BRequest%5D%3A+) (for out-of-organization contributors, the person merging the PR will do this) - [ ] Someone else? --------- Co-authored-by: Aaryamann Challani <[email protected]>
## Linked Issues/PRs <!-- List of related issues/PRs --> - #2469 ## Description <!-- List of detailed changes --> - Adds a data retrieval service that fetches L2 and L1 cost data for gas price v1 simulations ## Checklist - [x] Breaking changes are clearly marked as such in the PR description and changelog - [x] New behavior is reflected in tests - [x] [The specification](https://github.com/FuelLabs/fuel-specs/) matches the implemented behavior (link update PR if changes are needed) ### Before requesting review - [x] I have reviewed the code myself - [x] 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] - [ ] [Rust SDK](https://github.com/FuelLabs/fuels-rs/) - [ ] [Sway compiler](https://github.com/FuelLabs/sway/) - [ ] [Platform documentation](https://github.com/FuelLabs/devrel-requests/issues/new?assignees=&labels=new+request&projects=&template=NEW-REQUEST.yml&title=%5BRequest%5D%3A+) (for out-of-organization contributors, the person merging the PR will do this) - [ ] Someone else? --------- Co-authored-by: rymnc <[email protected]> Co-authored-by: Mitchell Turner <[email protected]>
dd287e8
to
31fd51f
Compare
…atility (#2541) ## Linked Issues/PRs <!-- List of related issues/PRs --> - #2469 ## Description <!-- List of detailed changes --> 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](https://github.com/FuelLabs/fuel-specs/) 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] - [ ] [Rust SDK](https://github.com/FuelLabs/fuels-rs/) - [ ] [Sway compiler](https://github.com/FuelLabs/sway/) - [ ] [Platform documentation](https://github.com/FuelLabs/devrel-requests/issues/new?assignees=&labels=new+request&projects=&template=NEW-REQUEST.yml&title=%5BRequest%5D%3A+) (for out-of-organization contributors, the person merging the PR will do this) - [ ] Someone else? --------- Co-authored-by: Brandon Kite <[email protected]> Co-authored-by: Mitchell Turner <[email protected]>
Linked Issues/PRs
Description
Checklist
Before requesting review
After merging, notify other teams
[Add or remove entries as needed]