Skip to content

Commit

Permalink
Remove redundant code.
Browse files Browse the repository at this point in the history
  • Loading branch information
surangap committed Jun 17, 2024
1 parent 9a6c0c9 commit 834687d
Showing 1 changed file with 0 additions and 35 deletions.
35 changes: 0 additions & 35 deletions runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1075,41 +1075,6 @@ impl pallet_evm_chain_id::Config for Runtime {
}

// Start frontier/EVM stuff

/// Current approximation of the gas/s consumption considering
/// EVM execution over compiled WASM (on 4.4Ghz CPU).
/// Given the 500ms Weight, from which 75% only are used for transactions,
// TODO: optimize for the correct value for block gas limit(i.e correct value for 11_250_000 * 2) or
// WEIGHT_PER_GAS
/// the total EVM execution gas limit is: GAS_PER_SECOND * 1 * 0.75 ~= 11_250_000 * 2.
pub const GAS_PER_SECOND: u64 = 30_000_000;

/// Approximate ratio of the amount of Weight per Gas.
/// u64 works for approximations because Weight is a very small unit compared to gas.
pub const WEIGHT_PER_GAS: u64 = WEIGHT_REF_TIME_PER_SECOND / GAS_PER_SECOND;

pub struct FutureverseGasWeightMapping;

impl pallet_evm::GasWeightMapping for FutureverseGasWeightMapping {
fn gas_to_weight(gas: u64, without_base_weight: bool) -> Weight {
let mut weight = gas.saturating_mul(WEIGHT_PER_GAS);

if without_base_weight {
weight = weight.saturating_sub(
<Runtime as frame_system::Config>::BlockWeights::get()
.get(frame_support::dispatch::DispatchClass::Normal)
.base_extrinsic
.ref_time(),
);
}

Weight::from_all(weight)
}
fn weight_to_gas(weight: Weight) -> u64 {
weight.div(WEIGHT_PER_GAS).ref_time()
}
}

const BLOCK_GAS_LIMIT: u64 = 75_000_000;
// Default value from Frontier
const MAX_POV_SIZE: u64 = 5 * 1024 * 1024;
Expand Down

0 comments on commit 834687d

Please sign in to comment.