Skip to content

Commit

Permalink
Chore: update default xcm weight (#1946)
Browse files Browse the repository at this point in the history
* update default weight

* decrease ci time

* Update ump.rs

* update script
  • Loading branch information
mclyk committed Jul 28, 2023
1 parent 9cd3cbc commit 3ad36a2
Show file tree
Hide file tree
Showing 5 changed files with 78 additions and 9 deletions.
7 changes: 1 addition & 6 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
7 changes: 4 additions & 3 deletions pallets/traits/src/ump.rs
Original file line number Diff line number Diff line change
Expand Up @@ -296,10 +296,11 @@ pub struct XcmWeightFeeMisc<Weight, Balance> {

impl Default for XcmWeightFeeMisc<Weight, Balance> {
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,
}
}
Expand Down
5 changes: 5 additions & 0 deletions scripts/helper/src/commands/launch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) })
}
Expand Down
34 changes: 34 additions & 0 deletions scripts/helper/src/config/heiko.json
Original file line number Diff line number Diff line change
Expand Up @@ -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}
}
]
}
34 changes: 34 additions & 0 deletions scripts/helper/src/config/parallel.json
Original file line number Diff line number Diff line change
Expand Up @@ -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}
}
]
}

0 comments on commit 3ad36a2

Please sign in to comment.