diff --git a/operator/precompiles/batch/src/mock.rs b/operator/precompiles/batch/src/mock.rs index b834a37b..5b51a83e 100644 --- a/operator/precompiles/batch/src/mock.rs +++ b/operator/precompiles/batch/src/mock.rs @@ -123,7 +123,6 @@ pub type PCall = BatchPrecompileCall; mock_account!(Batch, |_| MockAccount::from_u64(1)); mock_account!(Revert, |_| MockAccount::from_u64(2)); -const MAX_POV_SIZE: u64 = 5 * 1024 * 1024; /// Block storage limit in bytes. Set to 40 KB. const BLOCK_STORAGE_LIMIT: u64 = 40 * 1024; @@ -131,10 +130,7 @@ parameter_types! { pub BlockGasLimit: U256 = U256::from(u64::MAX); pub PrecompilesValue: Precompiles = Precompiles::new(); pub const WeightPerGas: Weight = Weight::from_parts(1, 0); - pub GasLimitPovSizeRatio: u64 = { - let block_gas_limit = BlockGasLimit::get().min(u64::MAX.into()).low_u64(); - block_gas_limit.saturating_div(MAX_POV_SIZE) - }; + pub const GasLimitPovSizeRatio: u64 = 0; pub GasLimitStorageGrowthRatio: u64 = { let block_gas_limit = BlockGasLimit::get().min(u64::MAX.into()).low_u64(); block_gas_limit.saturating_div(BLOCK_STORAGE_LIMIT) diff --git a/operator/precompiles/collective/src/mock.rs b/operator/precompiles/collective/src/mock.rs index 6705d921..8a27223e 100644 --- a/operator/precompiles/collective/src/mock.rs +++ b/operator/precompiles/collective/src/mock.rs @@ -124,7 +124,6 @@ pub type Precompiles = PrecompileSetBuilder< pub type PCall = CollectivePrecompileCall; -const MAX_POV_SIZE: u64 = 5 * 1024 * 1024; /// Block storage limit in bytes. Set to 40 KB. const BLOCK_STORAGE_LIMIT: u64 = 40 * 1024; @@ -132,10 +131,7 @@ parameter_types! { pub BlockGasLimit: U256 = U256::from(u64::MAX); pub PrecompilesValue: Precompiles = Precompiles::new(); pub const WeightPerGas: Weight = Weight::from_parts(1, 0); - pub GasLimitPovSizeRatio: u64 = { - let block_gas_limit = BlockGasLimit::get().min(u64::MAX.into()).low_u64(); - block_gas_limit.saturating_div(MAX_POV_SIZE) - }; + pub const GasLimitPovSizeRatio: u64 = 0; pub GasLimitStorageGrowthRatio : u64 = { let block_gas_limit = BlockGasLimit::get().min(u64::MAX.into()).low_u64(); block_gas_limit.saturating_div(BLOCK_STORAGE_LIMIT) diff --git a/operator/precompiles/conviction-voting/src/mock.rs b/operator/precompiles/conviction-voting/src/mock.rs index d6d6d3a2..b0e43275 100644 --- a/operator/precompiles/conviction-voting/src/mock.rs +++ b/operator/precompiles/conviction-voting/src/mock.rs @@ -109,7 +109,6 @@ impl pallet_balances::Config for Runtime { type DoneSlashHandler = (); } -const MAX_POV_SIZE: u64 = 5 * 1024 * 1024; /// Block storage limit in bytes. Set to 40 KB. const BLOCK_STORAGE_LIMIT: u64 = 40 * 1024; @@ -117,10 +116,7 @@ parameter_types! { pub BlockGasLimit: U256 = U256::from(u64::MAX); pub PrecompilesValue: Precompiles = Precompiles::new(); pub const WeightPerGas: Weight = Weight::from_parts(1, 0); - pub GasLimitPovSizeRatio: u64 = { - let block_gas_limit = BlockGasLimit::get().min(u64::MAX.into()).low_u64(); - block_gas_limit.saturating_div(MAX_POV_SIZE) - }; + pub const GasLimitPovSizeRatio: u64 = 0; pub GasLimitStorageGrowthRatio : u64 = { let block_gas_limit = BlockGasLimit::get().min(u64::MAX.into()).low_u64(); block_gas_limit.saturating_div(BLOCK_STORAGE_LIMIT) diff --git a/operator/precompiles/erc20-balances/src/mock.rs b/operator/precompiles/erc20-balances/src/mock.rs index ebfc4dcf..aaa2a64d 100644 --- a/operator/precompiles/erc20-balances/src/mock.rs +++ b/operator/precompiles/erc20-balances/src/mock.rs @@ -108,7 +108,6 @@ pub type Precompiles = PrecompileSetBuilder< pub type PCall = Erc20BalancesPrecompileCall; -const MAX_POV_SIZE: u64 = 5 * 1024 * 1024; /// Block storage limit in bytes. Set to 40 KB. const BLOCK_STORAGE_LIMIT: u64 = 40 * 1024; @@ -116,10 +115,7 @@ parameter_types! { pub BlockGasLimit: U256 = U256::from(u64::MAX); pub PrecompilesValue: Precompiles = Precompiles::new(); pub const WeightPerGas: Weight = Weight::from_parts(1, 0); - pub GasLimitPovSizeRatio: u64 = { - let block_gas_limit = BlockGasLimit::get().min(u64::MAX.into()).low_u64(); - block_gas_limit.saturating_div(MAX_POV_SIZE) - }; + pub const GasLimitPovSizeRatio: u64 = 0; pub GasLimitStorageGrowthRatio: u64 = { let block_gas_limit = BlockGasLimit::get().min(u64::MAX.into()).low_u64(); block_gas_limit.saturating_div(BLOCK_STORAGE_LIMIT) diff --git a/operator/precompiles/identity/src/mock.rs b/operator/precompiles/identity/src/mock.rs index 36ee0f68..b984730f 100644 --- a/operator/precompiles/identity/src/mock.rs +++ b/operator/precompiles/identity/src/mock.rs @@ -110,7 +110,6 @@ impl pallet_balances::Config for Runtime { type DoneSlashHandler = (); } -const MAX_POV_SIZE: u64 = 5 * 1024 * 1024; /// Block storage limit in bytes. Set to 40 KB. const BLOCK_STORAGE_LIMIT: u64 = 40 * 1024; @@ -118,10 +117,7 @@ parameter_types! { pub BlockGasLimit: U256 = U256::from(u64::MAX); pub PrecompilesValue: Precompiles = Precompiles::new(); pub const WeightPerGas: Weight = Weight::from_parts(1, 0); - pub GasLimitPovSizeRatio: u64 = { - let block_gas_limit = BlockGasLimit::get().min(u64::MAX.into()).low_u64(); - block_gas_limit.saturating_div(MAX_POV_SIZE) - }; + pub const GasLimitPovSizeRatio: u64 = 0; pub GasLimitStorageGrowthRatio: u64 = { let block_gas_limit = BlockGasLimit::get().min(u64::MAX.into()).low_u64(); block_gas_limit.saturating_div(BLOCK_STORAGE_LIMIT) diff --git a/operator/precompiles/preimage/src/mock.rs b/operator/precompiles/preimage/src/mock.rs index 9e4407af..2c520ef1 100644 --- a/operator/precompiles/preimage/src/mock.rs +++ b/operator/precompiles/preimage/src/mock.rs @@ -101,7 +101,6 @@ impl pallet_balances::Config for Runtime { type DoneSlashHandler = (); } -const MAX_POV_SIZE: u64 = 5 * 1024 * 1024; /// Block storage limit in bytes. Set to 40 KB. const BLOCK_STORAGE_LIMIT: u64 = 40 * 1024; @@ -109,10 +108,7 @@ parameter_types! { pub BlockGasLimit: U256 = U256::from(u64::MAX); pub PrecompilesValue: Precompiles = Precompiles::new(); pub const WeightPerGas: Weight = Weight::from_parts(1, 0); - pub GasLimitPovSizeRatio: u64 = { - let block_gas_limit = BlockGasLimit::get().min(u64::MAX.into()).low_u64(); - block_gas_limit.saturating_div(MAX_POV_SIZE) - }; + pub const GasLimitPovSizeRatio: u64 = 0; pub GasLimitStorageGrowthRatio: u64 = { let block_gas_limit = BlockGasLimit::get().min(u64::MAX.into()).low_u64(); block_gas_limit.saturating_div(BLOCK_STORAGE_LIMIT) diff --git a/operator/precompiles/proxy/src/mock.rs b/operator/precompiles/proxy/src/mock.rs index f3fc144d..3985182e 100644 --- a/operator/precompiles/proxy/src/mock.rs +++ b/operator/precompiles/proxy/src/mock.rs @@ -150,7 +150,6 @@ impl EnsureAddressOrigin for EnsureAddressAlways { } } -const MAX_POV_SIZE: u64 = 5 * 1024 * 1024; /// Block storage limit in bytes. Set to 40 KB. const BLOCK_STORAGE_LIMIT: u64 = 40 * 1024; @@ -158,10 +157,7 @@ parameter_types! { pub BlockGasLimit: U256 = U256::from(u64::MAX); pub PrecompilesValue: Precompiles = Precompiles::new(); pub const WeightPerGas: Weight = Weight::from_parts(1, 0); - pub GasLimitPovSizeRatio: u64 = { - let block_gas_limit = BlockGasLimit::get().min(u64::MAX.into()).low_u64(); - block_gas_limit.saturating_div(MAX_POV_SIZE) - }; + pub const GasLimitPovSizeRatio: u64 = 0; pub GasLimitStorageGrowthRatio: u64 = { let block_gas_limit = BlockGasLimit::get().min(u64::MAX.into()).low_u64(); block_gas_limit.saturating_div(BLOCK_STORAGE_LIMIT) diff --git a/operator/precompiles/referenda/src/mock.rs b/operator/precompiles/referenda/src/mock.rs index 4de6a257..661c11db 100644 --- a/operator/precompiles/referenda/src/mock.rs +++ b/operator/precompiles/referenda/src/mock.rs @@ -152,10 +152,7 @@ parameter_types! { pub BlockGasLimit: U256 = U256::from(u64::MAX); pub PrecompilesValue: TestPrecompiles = TestPrecompiles::new(); pub const WeightPerGas: Weight = Weight::from_parts(1, 0); - pub GasLimitPovSizeRatio: u64 = { - let block_gas_limit = BlockGasLimit::get().min(u64::MAX.into()).low_u64(); - block_gas_limit.saturating_div(MAX_POV_SIZE) - }; + pub const GasLimitPovSizeRatio: u64 = 0; pub GasLimitStorageGrowthRatio: u64 = { let block_gas_limit = BlockGasLimit::get().min(u64::MAX.into()).low_u64(); block_gas_limit.saturating_div(BLOCK_STORAGE_LIMIT) diff --git a/operator/runtime/mainnet/src/configs/mod.rs b/operator/runtime/mainnet/src/configs/mod.rs index 4a0602c0..57e73af9 100644 --- a/operator/runtime/mainnet/src/configs/mod.rs +++ b/operator/runtime/mainnet/src/configs/mod.rs @@ -995,13 +995,10 @@ parameter_types! { pub PrecompilesValue: Precompiles = DataHavenPrecompiles::::new(); pub WeightPerGas: Weight = Weight::from_parts(WEIGHT_PER_GAS, 0); pub SuicideQuickClearLimit: u32 = 0; - /// The amount of gas per pov. A ratio of 16 if we convert ref_time to gas and we compare - /// it with the pov_size for a block. E.g. - /// ceil( - /// (max_extrinsic.ref_time() / max_extrinsic.proof_size()) / WEIGHT_PER_GAS - /// ) + /// The amount of gas per pov. Set to 0 because DataHaven is a solo chain and we don't + /// account for POV (Proof-of-Validity) size constraints like parachains do. /// We should re-check `xcm_config::Erc20XcmBridgeTransferGasLimit` when changing this value - pub const GasLimitPovSizeRatio: u64 = 16; + pub const GasLimitPovSizeRatio: u64 = 0; /// The amount of gas per storage (in bytes): BLOCK_GAS_LIMIT / BLOCK_STORAGE_LIMIT /// (60_000_000 / 160 kb) pub GasLimitStorageGrowthRatio: u64 = 366; diff --git a/operator/runtime/stagenet/src/configs/mod.rs b/operator/runtime/stagenet/src/configs/mod.rs index e923ab67..3a0bde15 100644 --- a/operator/runtime/stagenet/src/configs/mod.rs +++ b/operator/runtime/stagenet/src/configs/mod.rs @@ -992,13 +992,10 @@ parameter_types! { pub PrecompilesValue: Precompiles = DataHavenPrecompiles::::new(); pub WeightPerGas: Weight = Weight::from_parts(WEIGHT_PER_GAS, 0); pub SuicideQuickClearLimit: u32 = 0; - /// The amount of gas per pov. A ratio of 16 if we convert ref_time to gas and we compare - /// it with the pov_size for a block. E.g. - /// ceil( - /// (max_extrinsic.ref_time() / max_extrinsic.proof_size()) / WEIGHT_PER_GAS - /// ) + /// The amount of gas per pov. Set to 0 because DataHaven is a solo chain and we don't + /// account for POV (Proof-of-Validity) size constraints like parachains do. /// We should re-check `xcm_config::Erc20XcmBridgeTransferGasLimit` when changing this value - pub const GasLimitPovSizeRatio: u64 = 16; + pub const GasLimitPovSizeRatio: u64 = 0; /// The amount of gas per storage (in bytes): BLOCK_GAS_LIMIT / BLOCK_STORAGE_LIMIT /// (60_000_000 / 160 kb) pub GasLimitStorageGrowthRatio: u64 = 366; diff --git a/operator/runtime/testnet/src/configs/mod.rs b/operator/runtime/testnet/src/configs/mod.rs index 72d7f3df..57f40fb0 100644 --- a/operator/runtime/testnet/src/configs/mod.rs +++ b/operator/runtime/testnet/src/configs/mod.rs @@ -995,13 +995,10 @@ parameter_types! { pub PrecompilesValue: Precompiles = DataHavenPrecompiles::::new(); pub WeightPerGas: Weight = Weight::from_parts(WEIGHT_PER_GAS, 0); pub SuicideQuickClearLimit: u32 = 0; - /// The amount of gas per pov. A ratio of 16 if we convert ref_time to gas and we compare - /// it with the pov_size for a block. E.g. - /// ceil( - /// (max_extrinsic.ref_time() / max_extrinsic.proof_size()) / WEIGHT_PER_GAS - /// ) + /// The amount of gas per pov. Set to 0 because DataHaven is a solo chain and we don't + /// account for POV (Proof-of-Validity) size constraints like parachains do. /// We should re-check `xcm_config::Erc20XcmBridgeTransferGasLimit` when changing this value - pub const GasLimitPovSizeRatio: u64 = 16; + pub const GasLimitPovSizeRatio: u64 = 0; /// The amount of gas per storage (in bytes): BLOCK_GAS_LIMIT / BLOCK_STORAGE_LIMIT /// (60_000_000 / 160 kb) pub GasLimitStorageGrowthRatio: u64 = 366; diff --git a/test/datahaven/suites/dev/stagenet/eth-fee/test-eth-fee-history.ts b/test/datahaven/suites/dev/stagenet/eth-fee/test-eth-fee-history.ts index a29719c3..754b1c2b 100644 --- a/test/datahaven/suites/dev/stagenet/eth-fee/test-eth-fee-history.ts +++ b/test/datahaven/suites/dev/stagenet/eth-fee/test-eth-fee-history.ts @@ -62,7 +62,7 @@ describeSuite({ feeResults.baseFeePerGas.length, "baseFeePerGas should always the requested block range + 1 (the next derived base fee)" ).toBe(block_count + 1); - expect(feeResults.gasUsedRatio).to.be.deep.eq(Array(block_count).fill(0.0105225)); + expect(feeResults.gasUsedRatio).to.be.deep.eq(Array(block_count).fill(0.00773915)); expect( feeResults.reward.length, "should return two-dimensional reward list for the requested block range"