Skip to content

Commit

Permalink
[Backport] Always include UnpaidExecution, not just when revenue is n…
Browse files Browse the repository at this point in the history
…onzero (#5510)

Backport #5369 to stable2407, which was already backported to v1.14 in
#5370
  • Loading branch information
seadanda authored Aug 28, 2024
1 parent c9e5cf1 commit a38e8d5
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 5 deletions.
9 changes: 4 additions & 5 deletions polkadot/runtime/parachains/src/coretime/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,10 @@ fn mk_coretime_call<T: Config>(call: crate::coretime::CoretimeCalls) -> Instruct

fn do_notify_revenue<T: Config>(when: BlockNumber, raw_revenue: Balance) -> Result<(), XcmError> {
let dest = Junction::Parachain(T::BrokerId::get()).into_location();
let mut message = Vec::new();
let mut message = vec![Instruction::UnpaidExecution {
weight_limit: WeightLimit::Unlimited,
check_origin: None,
}];
let asset = Asset { id: AssetId(Location::here()), fun: Fungible(raw_revenue) };
let dummy_xcm_context = XcmContext { origin: None, message_id: [0; 32], topic: None };

Expand All @@ -384,10 +387,6 @@ fn do_notify_revenue<T: Config>(when: BlockNumber, raw_revenue: Balance) -> Resu

message.extend(
[
Instruction::UnpaidExecution {
weight_limit: WeightLimit::Unlimited,
check_origin: None,
},
ReceiveTeleportedAsset(assets_reanchored),
DepositAsset {
assets: Wild(AllCounted(1)),
Expand Down
15 changes: 15 additions & 0 deletions prdoc/pr_5510.prdoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Schema: Polkadot SDK PRDoc Schema (prdoc) v1.0.0
# See doc at https://raw.githubusercontent.com/paritytech/polkadot-sdk/master/prdoc/schema_user.json

title: Fix failing XCM from relay to Coretime Chain when revenue is zero

doc:
- audience: Runtime Dev
description: |
The coretime assigner now always includes UnpaidExecution when calling `notify_revenue` via a
`Transact`, not just when revenue is nonzero. This fixes an issue where the XCM would fail to
process on the receiving side.

crates:
- name: polkadot-runtime-parachains
bump: patch

0 comments on commit a38e8d5

Please sign in to comment.