fuel-core
fuel-core copied to clipboard
Upgrade fuel core to use V1 gas price algo/updater
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.
assigning to myself
Completed with https://github.com/FuelLabs/fuel-core/pull/2469