From 3ad36a26bbc4db8d8af13085431f008ec0e00a7d Mon Sep 17 00:00:00 2001 From: MrPai <1164934857@qq.com> Date: Fri, 28 Jul 2023 16:51:55 +0800 Subject: [PATCH] Chore: update default xcm weight (#1946) * update default weight * decrease ci time * Update ump.rs * update script --- .github/workflows/benchmark.yml | 7 +---- pallets/traits/src/ump.rs | 7 ++--- scripts/helper/src/commands/launch.ts | 5 ++++ scripts/helper/src/config/heiko.json | 34 +++++++++++++++++++++++++ scripts/helper/src/config/parallel.json | 34 +++++++++++++++++++++++++ 5 files changed, 78 insertions(+), 9 deletions(-) diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index 1ff35079f..7b14903df 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -2,12 +2,7 @@ name: Benchmark # Controls when the action will run. on: - # Triggers the workflow on push or pull request events but only for the master branch - push: - branches: - - master - pull_request: - branches: [master] + workflow_dispatch: # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: diff --git a/pallets/traits/src/ump.rs b/pallets/traits/src/ump.rs index ad2b54ee9..17faf32bc 100644 --- a/pallets/traits/src/ump.rs +++ b/pallets/traits/src/ump.rs @@ -296,10 +296,11 @@ pub struct XcmWeightFeeMisc { impl Default for XcmWeightFeeMisc { fn default() -> Self { - let default_weight = 10_000_000_000u64; - let default_fee = 10_000_000_000; + let default_weight = 20_000_000_000u64; + let default_fee = 15_000_000_000; + let default_proof_size: u64 = 64 * 1024; XcmWeightFeeMisc { - weight: Weight::from_ref_time(default_weight), + weight: Weight::from_parts(default_weight, default_proof_size), fee: default_fee, } } diff --git a/scripts/helper/src/commands/launch.ts b/scripts/helper/src/commands/launch.ts index 6daf840c1..98d3abcc0 100644 --- a/scripts/helper/src/commands/launch.ts +++ b/scripts/helper/src/commands/launch.ts @@ -134,6 +134,11 @@ async function para({ logger, options: { paraWs, network } }: ActionParameters) ) } + for (const { xcmCall, feeMisc } of config.xcmHelper) { + logger.info(`Update ${xcmCall} WeightFeeMisc`) + call.push(api.tx.sudo.sudo(api.tx.xcmHelper.updateXcmWeightFee(xcmCall, feeMisc))) + } + logger.info('Submit parachain batches.') await api.tx.utility.batchAll(call).signAndSend(signer, { nonce: await nextNonce(api, signer) }) } diff --git a/scripts/helper/src/config/heiko.json b/scripts/helper/src/config/heiko.json index c14e76bb4..71d58e1c7 100644 --- a/scripts/helper/src/config/heiko.json +++ b/scripts/helper/src/config/heiko.json @@ -424,5 +424,39 @@ "assetType": {"Xcm":{"parents":1, "interior":{"X3":[{"Parachain": 2085},{"PalletInstance": 6},{"GeneralIndex": 1000}]}}}, "unitsPerSecond":"731957253696" } + ], + "xcmHelper":[ + { + "xcmCall": "Bond", + "feeMisc": {"weight": {"refTime":20000000000,"proofSize":65536},"fee":20000000000} + }, + { + "xcmCall": "BondExtra", + "feeMisc": {"weight": {"refTime":20000000000,"proofSize":65536},"fee":20000000000} + }, + { + "xcmCall": "UnBond", + "feeMisc": {"weight": {"refTime":20000000000,"proofSize":65536},"fee":20000000000} + }, + { + "xcmCall": "ReBond", + "feeMisc": {"weight": {"refTime":20000000000,"proofSize":65536},"fee":20000000000} + }, + { + "xcmCall": "WithdrawUnbonded", + "feeMisc": {"weight": {"refTime":20000000000,"proofSize":65536},"fee":20000000000} + }, + { + "xcmCall": "Nominate", + "feeMisc": {"weight": {"refTime":20000000000,"proofSize":65536},"fee":20000000000} + }, + { + "xcmCall": "Contribute", + "feeMisc": {"weight": {"refTime":20000000000,"proofSize":65536},"fee":20000000000} + }, + { + "xcmCall": "Withdraw", + "feeMisc": {"weight": {"refTime":20000000000,"proofSize":65536},"fee":20000000000} + } ] } diff --git a/scripts/helper/src/config/parallel.json b/scripts/helper/src/config/parallel.json index f2540dac1..d301b1192 100644 --- a/scripts/helper/src/config/parallel.json +++ b/scripts/helper/src/config/parallel.json @@ -447,5 +447,39 @@ "assetType": {"Xcm":{"parents":1, "interior":{"X2":[{"Parachain": 2000},{"GeneralKey": {"length":2,"data":"0x0000000000000000000000000000000000000000000000000000000000000000"}}]}}}, "unitsPerSecond":"196078431372549" } + ], + "xcmHelper":[ + { + "xcmCall": "Bond", + "feeMisc": {"weight": {"refTime":20000000000,"proofSize":65536},"fee":20000000000} + }, + { + "xcmCall": "BondExtra", + "feeMisc": {"weight": {"refTime":20000000000,"proofSize":65536},"fee":20000000000} + }, + { + "xcmCall": "UnBond", + "feeMisc": {"weight": {"refTime":20000000000,"proofSize":65536},"fee":20000000000} + }, + { + "xcmCall": "ReBond", + "feeMisc": {"weight": {"refTime":20000000000,"proofSize":65536},"fee":20000000000} + }, + { + "xcmCall": "WithdrawUnbonded", + "feeMisc": {"weight": {"refTime":20000000000,"proofSize":65536},"fee":20000000000} + }, + { + "xcmCall": "Nominate", + "feeMisc": {"weight": {"refTime":20000000000,"proofSize":65536},"fee":20000000000} + }, + { + "xcmCall": "Contribute", + "feeMisc": {"weight": {"refTime":20000000000,"proofSize":65536},"fee":20000000000} + }, + { + "xcmCall": "Withdraw", + "feeMisc": {"weight": {"refTime":20000000000,"proofSize":65536},"fee":20000000000} + } ] }