Repository: aptos-labs/aptos-core
File: aptos-move/aptos-gas-schedule/src/gas_schedule/transaction.rs (Rust)

Code before:
            2_0000_0000, // 2 APT
        ],
        [
            dependency_per_module: InternalGas,
            { 15.. => "dependency_per_module" },
            74460,
        ],
        [
            dependency_per_byte: InternalGasPerByte,
            { 15.. => "dependency_per_byte" },
            42,
        ],
        [
            max_num_dependencies: NumModules,
            { 15.. => "max_num_dependencies" },
            512,
        ],
        [
            max_total_dependency_size: NumBytes,
            { 15.. => "max_total_dependency_size" },
            1024 * 1024 * 12 / 10, // 1.2 MB
        ],
        [
            keyless_multiplier: NumBytes,
            { 16.. => "keyless_multiplier" },
            150,
        ]
    ]
);

use gas_params::*;

impl TransactionGasParameters {
    // TODO(Gas): Right now we are relying on this to avoid div by zero errors when using the all-zero
    //            gas parameters. See if there's a better way we can handle this.
    pub fn scaling_factor(&self) -> GasScalingFactor {
        match u64::from(self.gas_unit_scaling_factor) {
            0 => 1.into(),
            x => x.into(),
        }
    }

    /// Calculate the intrinsic gas for the transaction based upon its size in bytes.
    pub fn calculate_intrinsic_gas(
        &self,
        transaction_size: NumBytes,
        multiplier: NumBytes,
    ) -> impl GasExpression<VMGasParameters, Unit = InternalGasUnit> {
        let excess = transaction_size
            .checked_sub(self.large_transaction_cutoff)
            .unwrap_or_else(|| 0.into());

Review comment (suggestion):
So instead of a multiplier approach, why don't we just have a separate `keyless_charge`?

We are planning on recalibrating the gas parameters soon, and a multiplier
1. Makes calibration harder as I need to add special handling for it
2. May result in bigger-then-intended changes in the cost for keyless when we adjust the regular intrinsic cost, especially when the person making the change doesn't realize the two are connected

Code after:
            2_0000_0000, // 2 APT
        ],
        [
            dependency_per_module: InternalGas,
            { 15.. => "dependency_per_module" },
            74460,
        ],
        [
            dependency_per_byte: InternalGasPerByte,
            { 15.. => "dependency_per_byte" },
            42,
        ],
        [
            max_num_dependencies: NumModules,
            { 15.. => "max_num_dependencies" },
            512,
        ],
        [
            max_total_dependency_size: NumBytes,
            { 15.. => "max_total_dependency_size" },
            1024 * 1024 * 12 / 10, // 1.2 MB
        ],
        [
            keyless_base_cost: InternalGas,
            { 17.. => "keyless.base" },
            414_000_000,
        ]
    ]
);

use gas_params::*;

impl TransactionGasParameters {
    // TODO(Gas): Right now we are relying on this to avoid div by zero errors when using the all-zero
    //            gas parameters. See if there's a better way we can handle this.
    pub fn scaling_factor(&self) -> GasScalingFactor {
        match u64::from(self.gas_unit_scaling_factor) {
            0 => 1.into(),
            x => x.into(),
        }
    }

    /// Calculate the intrinsic gas for the transaction based upon its size in bytes.
    pub fn calculate_intrinsic_gas(
        &self,
        transaction_size: NumBytes,
    ) -> impl GasExpression<VMGasParameters, Unit = InternalGasUnit> {
        let excess = transaction_size
            .checked_sub(self.large_transaction_cutoff)
            .unwrap_or_else(|| 0.into());