Skip to content
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
832c864
Unpaid execution to Ethereum
yrong May 21, 2025
b70ad21
Add a custom SnowbridgeUnpaidRemoteExporter
yrong May 22, 2025
14f37be
Add base_fee back
yrong May 23, 2025
85343c0
Polish comment
yrong May 23, 2025
069b814
Add prdoc
yrong May 23, 2025
ad0c944
Merge branch 'master' into unpaid-execution-to-ethereum
yrong May 23, 2025
b984fdb
Add delivery fees to UnpaidRemoteExporter and remove the custom one
yrong May 23, 2025
d0cadac
AllowExplicitUnpaidExecution from AH root location
yrong May 23, 2025
e136ea8
Apply suggestions from code review
bkontur May 23, 2025
4f27913
Update Cargo.lock
bkontur May 23, 2025
1413bb1
Update prdoc/pr_8599.prdoc
bkontur May 23, 2025
eb47f82
Merge branch 'master' into unpaid-execution-to-ethereum
bkontur May 23, 2025
65c2f06
Merge branch 'master' into unpaid-execution-to-ethereum
yrong May 23, 2025
b48fecf
Snowbridge V1: unpaid execution (#20)
yrong May 28, 2025
69dee36
Merge branch 'master' into unpaid-execution-to-ethereum
yrong May 28, 2025
c51cbcd
Update prdoc
yrong May 28, 2025
4cf2753
Polish prdoc
yrong May 28, 2025
bc08753
Merge branch 'master' into unpaid-execution-to-ethereum
yrong May 28, 2025
2a3c139
Fix prdoc
yrong May 28, 2025
ce0053b
Merge branch 'unpaid-execution-to-ethereum' of https://github.com/yro…
yrong May 28, 2025
d7bbaca
Merge branch 'master' into unpaid-execution-to-ethereum
bkontur May 29, 2025
3542649
Fix breaking tests
yrong May 29, 2025
155cb10
Merge branch 'master' into unpaid-execution-to-ethereum
acatangiu May 29, 2025
e1e6ee4
Update prdoc
yrong May 29, 2025
7a16197
Merge branch 'unpaid-execution-to-ethereum' of https://github.com/yro…
yrong May 29, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ use xcm_builder::{
SiblingParachainAsNative, SiblingParachainConvertsVia, SignedAccountId32AsNative,
SignedToAccountId32, SingleAssetExchangeAdapter, SovereignPaidRemoteExporter,
SovereignSignedViaLocation, StartsWith, StartsWithExplicitGlobalConsensus, TakeWeightCredit,
TrailingSetTopicAsId, UsingComponents, WeightInfoBounds, WithComputedOrigin,
WithLatestLocationConverter, WithUniqueTopic, XcmFeeManagerFromComponents,
TrailingSetTopicAsId, UnpaidRemoteExporter, UsingComponents, WeightInfoBounds,
WithComputedOrigin, WithLatestLocationConverter, WithUniqueTopic, XcmFeeManagerFromComponents,
};
use xcm_executor::XcmExecutor;

Expand Down Expand Up @@ -454,14 +454,18 @@ pub type XcmRouter = WithUniqueTopic<(
// GlobalConsensus with a pausable flag, if the flag is set true then the Router is paused
PausableExporter<
crate::SnowbridgeSystemFrontend,
SovereignPaidRemoteExporter<
(
(
UnpaidRemoteExporter<
bridging::to_ethereum::EthereumNetworkExportTableV2,
XcmpQueue,
UniversalLocation,
>,
SovereignPaidRemoteExporter<
bridging::to_ethereum::EthereumNetworkExportTable,
),
XcmpQueue,
UniversalLocation,
>,
XcmpQueue,
UniversalLocation,
>,
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since UnpaidRemoteExporter now supports attaching a fee, how about applying it to the Snowbridge V1 route as well?

That would eliminate the need to maintain a balance for AH’s sovereign account on BH.

@vgeddes @acatangiu WDYT?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how long do you plan to support Snowbridge v1 for? might not be worth the change if its lifetime is limited anyway (lower risks of breaking something)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As we discussed internally, it’s likely that we will run V1 along side with V2 for quite some time.

Btw, aside from changing this line

let fee = Asset::from((Location::parent(), fee.total())).into();
to set the fee to zero, I don’t see many changes required.

There might be some cleanup needed, but considering that our integration tests cover most cases, I’m not too concerned about the breaking things.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A seperate PR for this: yrong#20

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Thanks Ron.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@acatangiu @bkontur I've merged yrong#20. Please take another look at your convenience.

),
>,
)>;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ pub type Barrier = TrailingSetTopicAsId<
ParentOrParentsPlurality,
Equals<RelayTreasuryLocation>,
Equals<SnowbridgeFrontendLocation>,
Equals<AssetHubLocation>,
)>,
// Subscriptions for version tracking are OK.
AllowSubscriptionsFrom<ParentRelayOrSiblingParachains>,
Expand Down
9 changes: 6 additions & 3 deletions polkadot/xcm/xcm-builder/src/universal_exports.rs
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,6 @@ impl<Bridges: ExporterFor, Router: SendXcm, UniversalLocation: Get<InteriorLocat
*msg = Some(xcm);
return Err(NotApplicable)
};
ensure!(maybe_payment.is_none(), Unroutable);

// `xcm` should already end with `SetTopic` - if it does, then extract and derive into
// an onward topic ID.
Expand All @@ -301,12 +300,16 @@ impl<Bridges: ExporterFor, Router: SendXcm, UniversalLocation: Get<InteriorLocat
if let Some(forward_id) = maybe_forward_id {
message.0.push(SetTopic(forward_id));
}
validate_send::<Router>(bridge, message).inspect_err(|err| {
let (v, mut cost) = validate_send::<Router>(bridge, message).inspect_err(|err| {
if let NotApplicable = err {
// We need to make sure that msg is not consumed in case of `NotApplicable`.
*msg = Some(xcm);
}
})
})?;
if let Some(bridge_payment) = maybe_payment {
cost.push(bridge_payment);
}
Ok((v, cost))
}

fn deliver(validation: Self::Ticket) -> Result<XcmHash, SendError> {
Expand Down
14 changes: 14 additions & 0 deletions prdoc/pr_8599.prdoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
title: Snowbridge: Unpaid execution when bridging to Ethereum
doc:
- audience: Runtime Dev
description: |-
Since all fees in Snowbridge V2 will be estimated on the fly and injected into the XCM, there is
no need to preconfigure a bridge fee using SovereignPaidRemoteExporter. Additionally, we want to
avoid maintaining Asset Hub’s sovereign account on Bridge Hub.
crates:
- name: snowbridge-runtime-common
bump: patch
- name: bridge-hub-westend-runtime
bump: patch
- name: asset-hub-westend-runtime
bump: patch
Loading