Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[encointer] Barrier error for unpaid superuser XCM authorizeUpgrade from relay #244

Closed
brenzi opened this issue Mar 18, 2024 · 5 comments
Closed

Comments

@brenzi
Copy link
Contributor

brenzi commented Mar 18, 2024

In order to test the upcoming 1.2 release for Encointer, we upgraded Encointer on rococo to commit 35048df which worked well. Then, to test new storage migrations, we wanted to test a newer commit 503e481 but executing XCM failed there.

As we almost copy-pasted the Barrier setting from asset hub, this could be relevant for other system chains too.

pub type Barrier = TrailingSetTopicAsId<
DenyThenTry<
DenyReserveTransferToRelayChain,
(
TakeWeightCredit,
// Expected responses are OK.
AllowKnownQueryResponses<PolkadotXcm>,
// Allow XCMs with some computed origins to pass through.
WithComputedOrigin<
(
// If the message is one that immediately attempts to pay for execution, then
// allow it.
AllowTopLevelPaidExecutionFrom<Everything>,
// Parent, its pluralities (i.e. governance bodies), parent's treasury and
// sibling bridge hub get free execution.
AllowExplicitUnpaidExecutionFrom<(ParentOrParentsPlurality,)>,
// Subscriptions for version tracking are OK.
AllowSubscriptionsFrom<ParentRelayOrSiblingParachains>,
),
UniversalLocation,
ConstU32<8>,
>,
),
>,
>;

We tried sending XCMv3 and XCMv4. Here's the send authorizeUpgrade call for XCM V4

Apply that with chopsticks

npx @acala-network/chopsticks@latest xcm -r=configs/rococo.yml -p=configs/encointer-rococo.yml

Yields messageQueue.ProcessingFailed: Unsupported

xcm::weight                  TRACE: FixedWeightBounds message: Xcm([Transact { origin_kind: Superuser, require_weight_at_most: Weight { ref_time: 4000000, proof_size: 100 }, call: "0x01025254b692414f6cd14dc96353eb1323beef8538373eccc268c390357e22b04b7d00" }, SetTopic([6, 124, 134, 201, 16, 109, 26, 229, 183, 186, 118, 102, 38, 5, 192, 211, 203, 208, 105, 70, 83, 156, 31, 107, 164, 28, 189, 2, 22, 126, 70, 33])])
xcm::execute                 TRACE: origin: Location { parents: 1, interior: Here }, message: Xcm([Transact { origin_kind: Superuser, require_weight_at_most: Weight { ref_time: 4000000, proof_size: 100 }, call: "0x01025254b692414f6cd14dc96353eb1323beef8538373eccc268c390357e22b04b7d00" }, SetTopic([6, 124, 134, 201, 16, 109, 26, 229, 183, 186, 118, 102, 38, 5, 192, 211, 203, 208, 105, 70, 83, 156, 31, 107, 164, 28, 189, 2, 22, 126, 70, 33])]), weight_credit: Weight { ref_time: 0, proof_size: 0 }
xcm::barriers                TRACE: TrailingSetTopicAsId origin: Location { parents: 1, interior: Here }, instructions: [Transact { origin_kind: Superuser, require_weight_at_most: Weight { ref_time: 4000000, proof_size: 100 }, call: "0x01025254b692414f6cd14dc96353eb1323beef8538373eccc268c390357e22b04b7d00" }, SetTopic([6, 124, 134, 201, 16, 109, 26, 229, 183, 186, 118, 102, 38, 5, 192, 211, 203, 208, 105, 70, 83, 156, 31, 107, 164, 28, 189, 2, 22, 126, 70, 33])], max_weight: Weight { ref_time: 2004000000, proof_size: 100 }, properties: Properties { weight_credit: Weight { ref_time: 0, proof_size: 0 }, message_id: None }
xcm::barriers                TRACE: TakeWeightCredit origin: Location { parents: 1, interior: Here }, instructions: [Transact { origin_kind: Superuser, require_weight_at_most: Weight { ref_time: 4000000, proof_size: 100 }, call: "0x01025254b692414f6cd14dc96353eb1323beef8538373eccc268c390357e22b04b7d00" }], max_weight: Weight { ref_time: 2004000000, proof_size: 100 }, properties: Properties { weight_credit: Weight { ref_time: 0, proof_size: 0 }, message_id: Some([6, 124, 134, 201, 16, 109, 26, 229, 183, 186, 118, 102, 38, 5, 192, 211, 203, 208, 105, 70, 83, 156, 31, 107, 164, 28, 189, 2, 22, 126, 70, 33]) }
xcm::barriers                TRACE: AllowKnownQueryResponses origin: Location { parents: 1, interior: Here }, instructions: [Transact { origin_kind: Superuser, require_weight_at_most: Weight { ref_time: 4000000, proof_size: 100 }, call: "0x01025254b692414f6cd14dc96353eb1323beef8538373eccc268c390357e22b04b7d00" }], max_weight: Weight { ref_time: 2004000000, proof_size: 100 }, properties: Properties { weight_credit: Weight { ref_time: 0, proof_size: 0 }, message_id: Some([6, 124, 134, 201, 16, 109, 26, 229, 183, 186, 118, 102, 38, 5, 192, 211, 203, 208, 105, 70, 83, 156, 31, 107, 164, 28, 189, 2, 22, 126, 70, 33]) }
xcm::barriers                TRACE: WithComputedOrigin origin: Location { parents: 1, interior: Here }, instructions: [Transact { origin_kind: Superuser, require_weight_at_most: Weight { ref_time: 4000000, proof_size: 100 }, call: "0x01025254b692414f6cd14dc96353eb1323beef8538373eccc268c390357e22b04b7d00" }], max_weight: Weight { ref_time: 2004000000, proof_size: 100 }, properties: Properties { weight_credit: Weight { ref_time: 0, proof_size: 0 }, message_id: Some([6, 124, 134, 201, 16, 109, 26, 229, 183, 186, 118, 102, 38, 5, 192, 211, 203, 208, 105, 70, 83, 156, 31, 107, 164, 28, 189, 2, 22, 126, 70, 33]) }
xcm::barriers                TRACE: AllowTopLevelPaidExecutionFrom origin: Location { parents: 1, interior: Here }, instructions: [Transact { origin_kind: Superuser, require_weight_at_most: Weight { ref_time: 4000000, proof_size: 100 }, call: "0x01025254b692414f6cd14dc96353eb1323beef8538373eccc268c390357e22b04b7d00" }], max_weight: Weight { ref_time: 2004000000, proof_size: 100 }, properties: Properties { weight_credit: Weight { ref_time: 0, proof_size: 0 }, message_id: Some([6, 124, 134, 201, 16, 109, 26, 229, 183, 186, 118, 102, 38, 5, 192, 211, 203, 208, 105, 70, 83, 156, 31, 107, 164, 28, 189, 2, 22, 126, 70, 33]) }
xcm::barriers                TRACE: AllowExplicitUnpaidExecutionFrom origin: Location { parents: 1, interior: Here }, instructions: [Transact { origin_kind: Superuser, require_weight_at_most: Weight { ref_time: 4000000, proof_size: 100 }, call: "0x01025254b692414f6cd14dc96353eb1323beef8538373eccc268c390357e22b04b7d00" }], max_weight: Weight { ref_time: 2004000000, proof_size: 100 }, properties: Properties { weight_credit: Weight { ref_time: 0, proof_size: 0 }, message_id: Some([6, 124, 134, 201, 16, 109, 26, 229, 183, 186, 118, 102, 38, 5, 192, 211, 203, 208, 105, 70, 83, 156, 31, 107, 164, 28, 189, 2, 22, 126, 70, 33]) }
xcm::barriers                TRACE: AllowSubscriptionsFrom origin: Location { parents: 1, interior: Here }, instructions: [Transact { origin_kind: Superuser, require_weight_at_most: Weight { ref_time: 4000000, proof_size: 100 }, call: "0x01025254b692414f6cd14dc96353eb1323beef8538373eccc268c390357e22b04b7d00" }], max_weight: Weight { ref_time: 2004000000, proof_size: 100 }, properties: Properties { weight_credit: Weight { ref_time: 0, proof_size: 0 }, message_id: Some([6, 124, 134, 201, 16, 109, 26, 229, 183, 186, 118, 102, 38, 5, 192, 211, 203, 208, 105, 70, 83, 156, 31, 107, 164, 28, 189, 2, 22, 126, 70, 33]) }
xcm::should_execute          TRACE: did not pass barrier: origin: Location { parents: 1, interior: Here }, instructions: [Transact { origin_kind: Superuser, require_weight_at_most: Weight { ref_time: 4000000, proof_size: 100 }, call: "0x01025254b692414f6cd14dc96353eb1323beef8538373eccc268c390357e22b04b7d00" }], max_weight: Weight { ref_time: 2004000000, proof_size: 100 }, properties: Properties { weight_credit: Weight { ref_time: 0, proof_size: 0 }, message_id: Some([6, 124, 134, 201, 16, 109, 26, 229, 183, 186, 118, 102, 38, 5, 192, 211, 203, 208, 105, 70, 83, 156, 31, 107, 164, 28, 189, 2, 22, 126, 70, 33]) }
xcm::should_execute          TRACE: did not pass barrier: origin: Location { parents: 1, interior: Here }, instructions: [Transact { origin_kind: Superuser, require_weight_at_most: Weight { ref_time: 4000000, proof_size: 100 }, call: "0x01025254b692414f6cd14dc96353eb1323beef8538373eccc268c390357e22b04b7d00" }], max_weight: Weight { ref_time: 2004000000, proof_size: 100 }, properties: Properties { weight_credit: Weight { ref_time: 0, proof_size: 0 }, message_id: Some([6, 124, 134, 201, 16, 109, 26, 229, 183, 186, 118, 102, 38, 5, 192, 211, 203, 208, 105, 70, 83, 156, 31, 107, 164, 28, 189, 2, 22, 126, 70, 33]) }
xcm::execute                 TRACE: Barrier blocked execution! Error: <wasm:stripped>. (origin: Location { parents: 1, interior: Here }, message: Xcm([Transact { origin_kind: Superuser, require_weight_at_most: Weight { ref_time: 4000000, proof_size: 100 }, call: "0x01025254b692414f6cd14dc96353eb1323beef8538373eccc268c390357e22b04b7d00" }, SetTopic([6, 124, 134, 201, 16, 109, 26, 229, 183, 186, 118, 102, 38, 5, 192, 211, 203, 208, 105, 70, 83, 156, 31, 107, 164, 28, 189, 2, 22, 126, 70, 33])]), properties: Properties { weight_credit: Weight { ref_time: 0, proof_size: 0 }, message_id: Some([6, 124, 134, 201, 16, 109, 26, 229, 183, 186, 118, 102, 38, 5, 192, 211, 203, 208, 105, 70, 83, 156, 31, 107, 164, 28, 189, 2, 22, 126, 70, 33]) })
@franciscoaguirre
Copy link
Contributor

The relevant barrier there is AllowExplicitUnpaidExecution.
You need to add an UnpaidExecution instruction at the top of your XCM.

@brenzi
Copy link
Contributor Author

brenzi commented Mar 18, 2024

ah, will try. that wasn't necessary with XCMv3....

@brenzi
Copy link
Contributor Author

brenzi commented Mar 18, 2024

confirmed. this call worked with chopsticks: 0xff00630003000100ad0f03082f000006020224f40091018c01025254b692414f6cd14dc96353eb1323beef8538373eccc268c390357e22b04b7d00

@brenzi brenzi closed this as completed Mar 18, 2024
@franciscoaguirre
Copy link
Contributor

@brenzi
Copy link
Contributor Author

brenzi commented Mar 18, 2024

addendum. The next attempt failed because weights changed, too. The call which is expected to fix that is this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants