fuel-core icon indicating copy to clipboard operation
fuel-core copied to clipboard

Upgrade fuel core to use V1 gas price algo/updater

Open MitchTurner opened this issue 1 year ago • 2 comments

MitchTurner avatar Aug 28 '24 13:08 MitchTurner

We have some versioning going on with the algorithm:


#[derive(Debug, Clone, PartialEq)]
pub enum Algorithm {
    V0(AlgorithmV0),
    V1(AlgorithmV1),
}
impl GasPriceAlgorithm for Algorithm {
    fn next_gas_price(&self) -> u64 {
        match self {
            Algorithm::V0(v0) => v0.calculate(),
            Algorithm::V1(v1) => v1.calculate(0),
        }
    }
    fn worst_case_gas_price(&self, height: BlockHeight) -> u64 {
        match self {
            Algorithm::V0(v0) => v0.worst_case(height.into()),
            Algorithm::V1(v1) => v1.calculate(0),
        }
    }
}

I don't think we need that. I think we can just depend on a single algorithm and change it as we improve it. Shouldn't be a problem.

MitchTurner avatar Sep 11 '24 13:09 MitchTurner

assigning to myself

rymnc avatar Oct 02 '24 10:10 rymnc

Completed with https://github.com/FuelLabs/fuel-core/pull/2469

MitchTurner avatar Jan 15 '25 18:01 MitchTurner