Skip to content

Commit

Permalink
Merge branch 'master' into mordamax-patch-10
Browse files Browse the repository at this point in the history
  • Loading branch information
mordamax authored Dec 8, 2024
2 parents 22f63b7 + 0175f82 commit 293dad6
Show file tree
Hide file tree
Showing 62 changed files with 535 additions and 207 deletions.
6 changes: 3 additions & 3 deletions .github/scripts/cmd/cmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def setup_logging():
%(prog)s --runtime westend rococo --pallet pallet_balances pallet_multisig --quiet --clean
'''

parser_bench = subparsers.add_parser('bench', help='Runs benchmarks', epilog=bench_example, formatter_class=argparse.RawDescriptionHelpFormatter)
parser_bench = subparsers.add_parser('bench', help='Runs benchmarks (old CLI)', epilog=bench_example, formatter_class=argparse.RawDescriptionHelpFormatter)

for arg, config in common_args.items():
parser_bench.add_argument(arg, **config)
Expand All @@ -69,7 +69,7 @@ def setup_logging():


"""
BENCH OLD
BENCH OMNI
"""

bench_example = '''**Examples**:
Expand All @@ -86,7 +86,7 @@ def setup_logging():
%(prog)s --runtime westend rococo --pallet pallet_balances pallet_multisig --quiet --clean
'''

parser_bench_old = subparsers.add_parser('bench-old', help='Runs benchmarks (Old CLI)', epilog=bench_example, formatter_class=argparse.RawDescriptionHelpFormatter)
parser_bench_old = subparsers.add_parser('bench-omni', help='Runs benchmarks (frame omni bencher)', epilog=bench_example, formatter_class=argparse.RawDescriptionHelpFormatter)

for arg, config in common_args.items():
parser_bench_old.add_argument(arg, **config)
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/cmd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,9 @@ jobs:
echo "RUNNER=ubuntu-latest" >> $GITHUB_OUTPUT
fi
echo "RUNNER=$RUNNER"
echo "IMAGE=$IMAGE"
# Get PR branch name, because the issue_comment event does not contain the PR branch name
get-pr-branch:
needs: [set-image]
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/command-backport.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ jobs:
backport:
name: Backport pull request
runs-on: ubuntu-latest
environment: release

# The 'github.event.pull_request.merged' ensures that it got into master:
if: >
Expand Down
2 changes: 1 addition & 1 deletion .gitlab/pipeline/zombienet/parachain-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,4 @@ zombienet-parachain-template-smoke:
- ls -ltr $(pwd)/artifacts
- cargo test -p template-zombienet-tests --features zombienet --tests minimal_template_block_production_test
- cargo test -p template-zombienet-tests --features zombienet --tests parachain_template_block_production_test
# - cargo test -p template-zombienet-tests --features zombienet --tests solochain_template_block_production_test
- cargo test -p template-zombienet-tests --features zombienet --tests solochain_template_block_production_test
4 changes: 2 additions & 2 deletions bridges/snowbridge/pallets/inbound-queue/src/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ fn test_submit_happy_path() {
.into(),
nonce: 1,
message_id: [
11, 25, 133, 51, 23, 68, 111, 211, 132, 94, 254, 17, 194, 252, 198, 233, 10, 193,
156, 93, 72, 140, 65, 69, 79, 155, 154, 28, 141, 166, 171, 255,
97, 161, 116, 204, 182, 115, 192, 144, 130, 243, 240, 193, 122, 154, 108, 91, 247,
41, 226, 237, 202, 158, 238, 239, 210, 8, 147, 131, 84, 146, 171, 176,
],
fee_burned: 110000000000,
}
Expand Down
1 change: 1 addition & 0 deletions bridges/snowbridge/primitives/router/src/inbound/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,7 @@ where
// Call create_asset on foreign assets pallet.
Transact {
origin_kind: OriginKind::Xcm,
fallback_max_weight: None,
call: (
create_call_index,
asset_id,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ pub fn xcm_transact_paid_execution(
VersionedXcm::from(Xcm(vec![
WithdrawAsset(fees.clone().into()),
BuyExecution { fees, weight_limit },
Transact { origin_kind, call },
Transact { origin_kind, call, fallback_max_weight: None },
RefundSurplus,
DepositAsset {
assets: All.into(),
Expand All @@ -53,7 +53,7 @@ pub fn xcm_transact_unpaid_execution(

VersionedXcm::from(Xcm(vec![
UnpaidExecution { weight_limit, check_origin },
Transact { origin_kind, call },
Transact { origin_kind, call, fallback_max_weight: None },
]))
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ fn transfer_and_transact_in_same_xcm(

// xcm to be executed at dest
let xcm_on_dest = Xcm(vec![
Transact { origin_kind: OriginKind::Xcm, call },
Transact { origin_kind: OriginKind::Xcm, call, fallback_max_weight: None },
ExpectTransactStatus(MaybeErrorCode::Success),
// since this is the last hop, we don't need to further use any assets previously
// reserved for fees (there are no further hops to cover transport fees for); we
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,11 @@ fn create_agent() {
let remote_xcm = VersionedXcm::from(Xcm(vec![
UnpaidExecution { weight_limit: Unlimited, check_origin: None },
DescendOrigin(Parachain(origin_para).into()),
Transact { origin_kind: OriginKind::Xcm, call: create_agent_call.encode().into() },
Transact {
origin_kind: OriginKind::Xcm,
call: create_agent_call.encode().into(),
fallback_max_weight: None,
},
]));

// Rococo Global Consensus
Expand Down Expand Up @@ -138,7 +142,11 @@ fn create_channel() {
let create_agent_xcm = VersionedXcm::from(Xcm(vec![
UnpaidExecution { weight_limit: Unlimited, check_origin: None },
DescendOrigin(Parachain(origin_para).into()),
Transact { origin_kind: OriginKind::Xcm, call: create_agent_call.encode().into() },
Transact {
origin_kind: OriginKind::Xcm,
call: create_agent_call.encode().into(),
fallback_max_weight: None,
},
]));

let create_channel_call =
Expand All @@ -147,7 +155,11 @@ fn create_channel() {
let create_channel_xcm = VersionedXcm::from(Xcm(vec![
UnpaidExecution { weight_limit: Unlimited, check_origin: None },
DescendOrigin(Parachain(origin_para).into()),
Transact { origin_kind: OriginKind::Xcm, call: create_channel_call.encode().into() },
Transact {
origin_kind: OriginKind::Xcm,
call: create_channel_call.encode().into(),
fallback_max_weight: None,
},
]));

// Rococo Global Consensus
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ fn transfer_and_transact_in_same_xcm(

// xcm to be executed at dest
let xcm_on_dest = Xcm(vec![
Transact { origin_kind: OriginKind::Xcm, call },
Transact { origin_kind: OriginKind::Xcm, call, fallback_max_weight: None },
ExpectTransactStatus(MaybeErrorCode::Success),
// since this is the last hop, we don't need to further use any assets previously
// reserved for fees (there are no further hops to cover transport fees for); we
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ fn fellows_whitelist_call() {
)
.encode()
.into(),
fallback_max_weight: None
}
]))),
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,11 @@ fn relay_commands_add_registrar() {
dest: bx!(VersionedLocation::from(Location::new(0, [Parachain(1004)]))),
message: bx!(VersionedXcm::from(Xcm(vec![
UnpaidExecution { weight_limit: Unlimited, check_origin: None },
Transact { origin_kind, call: add_registrar_call.encode().into() }
Transact {
origin_kind,
call: add_registrar_call.encode().into(),
fallback_max_weight: None
}
]))),
});

Expand Down Expand Up @@ -107,7 +111,11 @@ fn relay_commands_add_registrar_wrong_origin() {
dest: bx!(VersionedLocation::from(Location::new(0, [Parachain(1004)]))),
message: bx!(VersionedXcm::from(Xcm(vec![
UnpaidExecution { weight_limit: Unlimited, check_origin: None },
Transact { origin_kind, call: add_registrar_call.encode().into() }
Transact {
origin_kind,
call: add_registrar_call.encode().into(),
fallback_max_weight: None
}
]))),
});

Expand Down Expand Up @@ -194,7 +202,11 @@ fn relay_commands_kill_identity() {
dest: bx!(VersionedLocation::from(Location::new(0, [Parachain(1004)]))),
message: bx!(VersionedXcm::from(Xcm(vec![
UnpaidExecution { weight_limit: Unlimited, check_origin: None },
Transact { origin_kind, call: kill_identity_call.encode().into() }
Transact {
origin_kind,
call: kill_identity_call.encode().into(),
fallback_max_weight: None
}
]))),
});

Expand Down Expand Up @@ -252,7 +264,11 @@ fn relay_commands_kill_identity_wrong_origin() {
dest: bx!(VersionedLocation::from(Location::new(0, [Parachain(1004)]))),
message: bx!(VersionedXcm::from(Xcm(vec![
UnpaidExecution { weight_limit: Unlimited, check_origin: None },
Transact { origin_kind, call: kill_identity_call.encode().into() }
Transact {
origin_kind,
call: kill_identity_call.encode().into(),
fallback_max_weight: None
}
]))),
});

Expand Down Expand Up @@ -298,7 +314,11 @@ fn relay_commands_add_remove_username_authority() {
dest: bx!(VersionedLocation::from(Location::new(0, [Parachain(1004)]))),
message: bx!(VersionedXcm::from(Xcm(vec![
UnpaidExecution { weight_limit: Unlimited, check_origin: None },
Transact { origin_kind, call: add_username_authority.encode().into() }
Transact {
origin_kind,
call: add_username_authority.encode().into(),
fallback_max_weight: None
}
]))),
});

Expand Down Expand Up @@ -383,7 +403,11 @@ fn relay_commands_add_remove_username_authority() {
dest: bx!(VersionedLocation::from(Location::new(0, [Parachain(1004)]))),
message: bx!(VersionedXcm::from(Xcm(vec![
UnpaidExecution { weight_limit: Unlimited, check_origin: None },
Transact { origin_kind, call: remove_username_authority.encode().into() }
Transact {
origin_kind,
call: remove_username_authority.encode().into(),
fallback_max_weight: None
}
]))),
});

Expand Down Expand Up @@ -443,7 +467,11 @@ fn relay_commands_add_remove_username_authority_wrong_origin() {
dest: bx!(VersionedLocation::from(Location::new(0, [Parachain(1004)]))),
message: bx!(VersionedXcm::from(Xcm(vec![
UnpaidExecution { weight_limit: Unlimited, check_origin: None },
Transact { origin_kind, call: add_username_authority.encode().into() }
Transact {
origin_kind,
call: add_username_authority.encode().into(),
fallback_max_weight: None
}
]))),
});

Expand Down Expand Up @@ -483,6 +511,7 @@ fn relay_commands_add_remove_username_authority_wrong_origin() {
Transact {
origin_kind: OriginKind::SovereignAccount,
call: remove_username_authority.encode().into(),
fallback_max_weight: None,
}
]))),
});
Expand Down
2 changes: 2 additions & 0 deletions cumulus/parachains/pallets/ping/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ pub mod pallet {
})
.encode()
.into(),
fallback_max_weight: None,
}]),
) {
Ok((hash, cost)) => {
Expand Down Expand Up @@ -214,6 +215,7 @@ pub mod pallet {
})
.encode()
.into(),
fallback_max_weight: None,
}]),
) {
Ok((hash, cost)) =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,11 @@ impl<Call> XcmWeightInfo<Call> for AssetHubRococoXcmWeight<Call> {
fn transfer_reserve_asset(assets: &Assets, _dest: &Location, _xcm: &Xcm<()>) -> Weight {
assets.weigh_assets(XcmFungibleWeight::<Runtime>::transfer_reserve_asset())
}
fn transact(_origin_type: &OriginKind, _call: &DoubleEncoded<Call>) -> Weight {
fn transact(
_origin_type: &OriginKind,
_fallback_max_weight: &Option<Weight>,
_call: &DoubleEncoded<Call>,
) -> Weight {
XcmGeneric::<Runtime>::transact()
}
fn hrmp_new_channel_open_request(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,11 @@ impl<Call> XcmWeightInfo<Call> for AssetHubWestendXcmWeight<Call> {
fn transfer_reserve_asset(assets: &Assets, _dest: &Location, _xcm: &Xcm<()>) -> Weight {
assets.weigh_assets(XcmFungibleWeight::<Runtime>::transfer_reserve_asset())
}
fn transact(_origin_type: &OriginKind, _call: &DoubleEncoded<Call>) -> Weight {
fn transact(
_origin_type: &OriginKind,
_fallback_max_weight: &Option<Weight>,
_call: &DoubleEncoded<Call>,
) -> Weight {
XcmGeneric::<Runtime>::transact()
}
fn hrmp_new_channel_open_request(
Expand Down
14 changes: 12 additions & 2 deletions cumulus/parachains/runtimes/assets/test-utils/src/test_cases.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1205,14 +1205,20 @@ pub fn create_and_manage_foreign_assets_for_local_consensus_parachain_assets_wor
let xcm = Xcm(vec![
WithdrawAsset(buy_execution_fee.clone().into()),
BuyExecution { fees: buy_execution_fee.clone(), weight_limit: Unlimited },
Transact { origin_kind: OriginKind::Xcm, call: foreign_asset_create.into() },
Transact {
origin_kind: OriginKind::Xcm,
call: foreign_asset_create.into(),
fallback_max_weight: None,
},
Transact {
origin_kind: OriginKind::SovereignAccount,
call: foreign_asset_set_metadata.into(),
fallback_max_weight: None,
},
Transact {
origin_kind: OriginKind::SovereignAccount,
call: foreign_asset_set_team.into(),
fallback_max_weight: None,
},
ExpectTransactStatus(MaybeErrorCode::Success),
]);
Expand Down Expand Up @@ -1318,7 +1324,11 @@ pub fn create_and_manage_foreign_assets_for_local_consensus_parachain_assets_wor
let xcm = Xcm(vec![
WithdrawAsset(buy_execution_fee.clone().into()),
BuyExecution { fees: buy_execution_fee.clone(), weight_limit: Unlimited },
Transact { origin_kind: OriginKind::Xcm, call: foreign_asset_create.into() },
Transact {
origin_kind: OriginKind::Xcm,
call: foreign_asset_create.into(),
fallback_max_weight: None,
},
ExpectTransactStatus(MaybeErrorCode::from(DispatchError::BadOrigin.encode())),
]);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,11 @@ impl<Call> XcmWeightInfo<Call> for BridgeHubRococoXcmWeight<Call> {
fn transfer_reserve_asset(assets: &Assets, _dest: &Location, _xcm: &Xcm<()>) -> Weight {
assets.weigh_assets(XcmFungibleWeight::<Runtime>::transfer_reserve_asset())
}
fn transact(_origin_type: &OriginKind, _call: &DoubleEncoded<Call>) -> Weight {
fn transact(
_origin_type: &OriginKind,
_fallback_max_weight: &Option<Weight>,
_call: &DoubleEncoded<Call>,
) -> Weight {
XcmGeneric::<Runtime>::transact()
}
fn hrmp_new_channel_open_request(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,11 @@ impl<Call> XcmWeightInfo<Call> for BridgeHubWestendXcmWeight<Call> {
fn transfer_reserve_asset(assets: &Assets, _dest: &Location, _xcm: &Xcm<()>) -> Weight {
assets.weigh_assets(XcmFungibleWeight::<Runtime>::transfer_reserve_asset())
}
fn transact(_origin_type: &OriginKind, _call: &DoubleEncoded<Call>) -> Weight {
fn transact(
_origin_type: &OriginKind,
_fallback_max_weight: &Option<Weight>,
_call: &DoubleEncoded<Call>,
) -> Weight {
XcmGeneric::<Runtime>::transact()
}
fn hrmp_new_channel_open_request(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ impl CoretimeInterface for CoretimeAllocator {
Instruction::Transact {
origin_kind: OriginKind::Native,
call: request_core_count_call.encode().into(),
fallback_max_weight: Some(Weight::from_parts(1_000_000_000, 200_000)),
},
]);

Expand Down Expand Up @@ -164,6 +165,7 @@ impl CoretimeInterface for CoretimeAllocator {
Instruction::Transact {
origin_kind: OriginKind::Native,
call: request_revenue_info_at_call.encode().into(),
fallback_max_weight: Some(Weight::from_parts(1_000_000_000, 200_000)),
},
]);

Expand Down Expand Up @@ -192,6 +194,7 @@ impl CoretimeInterface for CoretimeAllocator {
Instruction::Transact {
origin_kind: OriginKind::Native,
call: credit_account_call.encode().into(),
fallback_max_weight: Some(Weight::from_parts(1_000_000_000, 200_000)),
},
]);

Expand Down Expand Up @@ -256,6 +259,7 @@ impl CoretimeInterface for CoretimeAllocator {
Instruction::Transact {
origin_kind: OriginKind::Native,
call: assign_core_call.encode().into(),
fallback_max_weight: Some(Weight::from_parts(1_000_000_000, 200_000)),
},
]);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,11 @@ impl<Call> XcmWeightInfo<Call> for CoretimeRococoXcmWeight<Call> {
fn transfer_reserve_asset(assets: &Assets, _dest: &Location, _xcm: &Xcm<()>) -> Weight {
assets.weigh_assets(XcmFungibleWeight::<Runtime>::transfer_reserve_asset())
}
fn transact(_origin_type: &OriginKind, _call: &DoubleEncoded<Call>) -> Weight {
fn transact(
_origin_type: &OriginKind,
_fallback_max_weight: &Option<Weight>,
_call: &DoubleEncoded<Call>,
) -> Weight {
XcmGeneric::<Runtime>::transact()
}
fn hrmp_new_channel_open_request(
Expand Down
Loading

0 comments on commit 293dad6

Please sign in to comment.