Skip to content

Commit

Permalink
Merge branch 'master' into cancun-support
Browse files Browse the repository at this point in the history
  • Loading branch information
RomarQ committed May 23, 2024
2 parents 9254410 + a814c93 commit f182832
Show file tree
Hide file tree
Showing 5 changed files with 998 additions and 741 deletions.
14 changes: 7 additions & 7 deletions runtime/moonriver/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ pub mod currency {

/// Maximum weight per block
pub const MAXIMUM_BLOCK_WEIGHT: Weight = Weight::from_parts(WEIGHT_REF_TIME_PER_SECOND, u64::MAX)
.saturating_div(2)
.saturating_mul(2)
.set_proof_size(relay_chain::MAX_POV_SIZE as u64);

pub const MILLISECS_PER_BLOCK: u64 = 6_000;
Expand Down Expand Up @@ -383,8 +383,8 @@ impl pallet_evm_chain_id::Config for Runtime {}

/// 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,
/// the total EVM execution gas limit is: GAS_PER_SECOND * 0.500 * 0.75 ~= 15_000_000.
/// Given the 2s Weight, from which 75% only are used for transactions,
/// the total EVM execution gas limit is: GAS_PER_SECOND * 2 * 0.75 ~= 60_000_000.
pub const GAS_PER_SECOND: u64 = 40_000_000;

/// Approximate ratio of the amount of Weight per Gas.
Expand All @@ -411,15 +411,15 @@ parameter_types! {
pub MaximumMultiplier: Multiplier = Multiplier::from(100_000u128);
pub PrecompilesValue: MoonriverPrecompiles<Runtime> = MoonriverPrecompiles::<_>::new();
pub WeightPerGas: Weight = Weight::from_parts(WEIGHT_PER_GAS, 0);
/// The amount of gas per pov. A ratio of 4 if we convert ref_time to gas and we compare
/// 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
/// )
/// We should re-check `xcm_config::Erc20XcmBridgeTransferGasLimit` when changing this value
pub const GasLimitPovSizeRatio: u64 = 4;
pub const GasLimitPovSizeRatio: u64 = 16;
/// The amount of gas per storage (in bytes): BLOCK_GAS_LIMIT / BLOCK_STORAGE_LIMIT
/// The current definition of BLOCK_STORAGE_LIMIT is 40 KB, resulting in a value of 366.
/// The current definition of BLOCK_STORAGE_LIMIT is 160 KB, resulting in a value of 366.
pub GasLimitStorageGrowthRatio: u64 = 366;
}

Expand Down Expand Up @@ -1802,7 +1802,7 @@ mod tests {
#[test]
fn test_storage_growth_ratio_is_correct() {
// This is the highest amount of new storage that can be created in a block 40 KB
let block_storage_limit = 40 * 1024;
let block_storage_limit = 160 * 1024;
let expected_storage_growth_ratio = BlockGasLimit::get()
.low_u64()
.saturating_div(block_storage_limit);
Expand Down
2 changes: 1 addition & 1 deletion runtime/moonriver/src/xcm_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -681,7 +681,7 @@ parameter_types! {

// To be able to support almost all erc20 implementations,
// we provide a sufficiently hight gas limit.
pub Erc20XcmBridgeTransferGasLimit: u64 = 200_000;
pub Erc20XcmBridgeTransferGasLimit: u64 = 800_000;
}

impl pallet_erc20_xcm_bridge::Config for Runtime {
Expand Down
4 changes: 2 additions & 2 deletions runtime/moonriver/tests/xcm_mock/parachain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -822,8 +822,8 @@ impl pallet_timestamp::Config for Runtime {
use sp_core::U256;

const MAX_POV_SIZE: u64 = 5 * 1024 * 1024;
/// Block storage limit in bytes. Set to 40 KB.
const BLOCK_STORAGE_LIMIT: u64 = 40 * 1024;
/// Block storage limit in bytes. Set to 160 KB.
const BLOCK_STORAGE_LIMIT: u64 = 160 * 1024;

parameter_types! {
pub BlockGasLimit: U256 = U256::from(u64::MAX);
Expand Down
50 changes: 25 additions & 25 deletions test/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,47 +16,47 @@
"author": "",
"license": "ISC",
"dependencies": {
"@acala-network/chopsticks": "0.9.10",
"@acala-network/chopsticks": "0.10.2",
"@moonbeam-network/api-augment": "0.2902.0",
"@moonwall/cli": "^5.1.4",
"@moonwall/util": "^5.1.4",
"@moonwall/cli": "5.2.0",
"@moonwall/util": "5.2.0",
"@openzeppelin/contracts": "4.9.6",
"@polkadot/api": "10.12.6",
"@polkadot/api-augment": "10.12.6",
"@polkadot/api-derive": "10.12.6",
"@polkadot/apps-config": "0.135.1",
"@polkadot/api": "11.1.1",
"@polkadot/api-augment": "11.1.1",
"@polkadot/api-derive": "11.1.1",
"@polkadot/apps-config": "0.137.1",
"@polkadot/keyring": "12.6.2",
"@polkadot/rpc-provider": "10.12.6",
"@polkadot/types": "10.12.6",
"@polkadot/types-codec": "10.12.6",
"@polkadot/rpc-provider": "11.1.1",
"@polkadot/types": "11.1.1",
"@polkadot/types-codec": "11.1.1",
"@polkadot/util": "12.6.2",
"@polkadot/util-crypto": "12.6.2",
"@substrate/txwrapper-core": "7.3.0",
"@substrate/txwrapper-substrate": "7.3.0",
"@vitest/ui": "1.4.0",
"@zombienet/utils": "0.0.24",
"@substrate/txwrapper-core": "7.4.0",
"@substrate/txwrapper-substrate": "7.4.0",
"@vitest/ui": "1.6.0",
"@zombienet/utils": "0.0.25",
"chalk": "5.3.0",
"eth-object": "github:aurora-is-near/eth-object#master",
"ethers": "6.11.1",
"ethers": "6.12.1",
"json-bigint": "1.0.0",
"json-stable-stringify": "1.1.1",
"merkle-patricia-tree": "4.2.4",
"node-fetch": "3.3.2",
"octokit": "^3.2.0",
"randomness": "1.6.8",
"octokit": "^4.0.2",
"randomness": "1.6.9",
"rlp": "3.0.0",
"semver": "7.6.0",
"semver": "7.6.2",
"solc": "0.8.25",
"tsx": "4.7.2",
"viem": "2.9.9",
"vitest": "1.4.0",
"web3": "4.7.0",
"yaml": "2.4.1"
"tsx": "4.10.5",
"viem": "2.12.0",
"vitest": "1.6.0",
"web3": "4.8.0",
"yaml": "2.4.2"
},
"devDependencies": {
"@types/debug": "4.1.12",
"@types/json-bigint": "^1.0.4",
"@types/node": "20.12.4",
"@types/node": "20.12.12",
"@types/semver": "7.5.8",
"@types/yargs": "17.0.32",
"@typescript-eslint/eslint-plugin": "7.5.0",
Expand All @@ -66,7 +66,7 @@
"eslint": "8.57.0",
"eslint-plugin-unused-imports": "3.1.0",
"prettier": "2.8.8",
"typescript": "5.4.3",
"typescript": "5.4.5",
"yargs": "17.7.2"
},
"engines": {
Expand Down
Loading

0 comments on commit f182832

Please sign in to comment.