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

Integrate with V1 algo for tests #2469

Draft
wants to merge 174 commits into
base: master
Choose a base branch
from

Conversation

MitchTurner
Copy link
Member

@MitchTurner MitchTurner commented Nov 30, 2024

Linked Issues/PRs

Description

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]

MitchTurner and others added 30 commits October 30, 2024 17:26
…to feature/init-task-for-v1-gas-price-service
@rymnc rymnc force-pushed the chore/add-tests-for-v1-gas-service branch 3 times, most recently from 8d219d2 to ff8243c Compare December 25, 2024 18:37
@rymnc rymnc force-pushed the chore/add-tests-for-v1-gas-service branch from ff8243c to eb202cf Compare December 25, 2024 18:55

/// 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,
Copy link
Member

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

@@ -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> {
Copy link
Member

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 ?

Copy link
Member Author

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.

Copy link
Member

@rymnc rymnc left a 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/sub_services.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);
Copy link
Member

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.

Copy link
Member Author

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.

crates/fuel-core/src/service/sub_services.rs Outdated Show resolved Hide resolved
crates/fuel-core/src/service/sub_services.rs Outdated Show resolved Hide resolved
tests/tests/gas_price.rs Outdated Show resolved Hide resolved
tests/tests/gas_price.rs Outdated Show resolved Hide resolved
tests/tests/gas_price.rs Outdated Show resolved Hide resolved
driver.kill().await
});

// // rollback 50 blocks
Copy link
Member

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?

tests/tests/gas_price.rs Outdated Show resolved Hide resolved
MitchTurner and others added 8 commits January 6, 2025 11:14
## 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]>
rymnc added a commit that referenced this pull request Jan 8, 2025
## 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]>
@rymnc rymnc force-pushed the chore/add-tests-for-v1-gas-service branch from dd287e8 to 31fd51f Compare January 9, 2025 04:38
rymnc and others added 2 commits January 9, 2025 14:20
…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]>
@rymnc rymnc added the release label Jan 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants