-
Notifications
You must be signed in to change notification settings - Fork 689
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
Direct XCM ExportMessage
fees for different bridges to different receiver accounts
#2021
Direct XCM ExportMessage
fees for different bridges to different receiver accounts
#2021
Conversation
fd93ccc
to
33d3ed7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. During review, I realized that I've been sure that we will be distributing fees between different bridges at the sending chain (AH). But obviously I was wrong and BH is the right place to do that.
AccountId: Clone + Into<[u8; 32]>, | ||
ReceiverAccount: Get<Option<AccountId>>, | ||
> FeeManager for XcmFeesToAccount<XcmConfig, WaivedLocations, AccountId, ReceiverAccount> | ||
ReceiverAccount: Get<AccountId>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do not know if there was some design solution behind having Get<Option<AccountId>>
in the previous version? Maybe some storage parameter was intended to be used - so fees still may be burnt unless governance has configured chain properly? But in any case - new version looks cleaner to me, just stumbled upon it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think Get<Option<AccountId>>
was needed in order to support the case where we wanted to waive the fees for some locations and burn the ones for the other locations using the XcmFeeToAccount
.
But now, that we have a separate component for handling fees, we can use XcmFeeManagerFromComponents
to specify the set of waived locations and the handling logic independently. And we can use XcmFeeManagerFromComponents<WaivedLocations, ()>
for the scenario above.
cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/xcm_config.rs
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
This is also good for Snowbridge. In our case a portion of the collected export fee will be routed to the sovereign account of the parachain from which the computed origin descends. So we will likely implement a custom XcmFeesToAccount that does this routing. |
I still think the appropriate place for this is in |
I experimented with this a bit, but I'm not sure if I understood correctly. I tried to add a
Each instruction could have a different destination, and some instructions might not have any destination at all (would be executed only locally). So considering that this destination is not "ultimate", do you think it would still make sense to add it ?
I'm not sure if this is possible. From what I understand, the intermediate destinations unfold as we execute the sub-parts of the XCM message on different chains, and the XCM itself doesn't hold a state across multiple chains. Only if we add a separate |
What does "intermediate destinations unfold as we execute the sub-parts" mean? Why is it not as simple as looking into the |
cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/xcm_config.rs
Outdated
Show resolved
Hide resolved
Sorry, you're right. I don't remember what I was thinking about. Anyway, yes, it would work if we parse the entire message beforehand. But still I think we would have multiple branches, and not an ultimate destination and the route to it. |
…tytech#2021) * reject delivery transactions with at least one obsolete message * clippy * allow empty delivery transactions with rewards confirmations BUT only when there's no room left in the unrewarded relayers vector * clippy * allow empty delivery transactions if no message slots in unrewarded relayers vector
* unrewarded_relayers for ReceiveMessagesProofInfo only * simplify return * removed comment * appends_to_stored_nonce
…tytech#2021) * reject delivery transactions with at least one obsolete message * clippy * allow empty delivery transactions with rewards confirmations BUT only when there's no room left in the unrewarded relayers vector * clippy * allow empty delivery transactions if no message slots in unrewarded relayers vector
* unrewarded_relayers for ReceiveMessagesProofInfo only * simplify return * removed comment * appends_to_stored_nonce
…tytech#2021) * reject delivery transactions with at least one obsolete message * clippy * allow empty delivery transactions with rewards confirmations BUT only when there's no room left in the unrewarded relayers vector * clippy * allow empty delivery transactions if no message slots in unrewarded relayers vector
* unrewarded_relayers for ReceiveMessagesProofInfo only * simplify return * removed comment * appends_to_stored_nonce
…tytech#2021) * reject delivery transactions with at least one obsolete message * clippy * allow empty delivery transactions with rewards confirmations BUT only when there's no room left in the unrewarded relayers vector * clippy * allow empty delivery transactions if no message slots in unrewarded relayers vector
* unrewarded_relayers for ReceiveMessagesProofInfo only * simplify return * removed comment * appends_to_stored_nonce
…tytech#2021) * reject delivery transactions with at least one obsolete message * clippy * allow empty delivery transactions with rewards confirmations BUT only when there's no room left in the unrewarded relayers vector * clippy * allow empty delivery transactions if no message slots in unrewarded relayers vector
* unrewarded_relayers for ReceiveMessagesProofInfo only * simplify return * removed comment * appends_to_stored_nonce
…tytech#2021) * reject delivery transactions with at least one obsolete message * clippy * allow empty delivery transactions with rewards confirmations BUT only when there's no room left in the unrewarded relayers vector * clippy * allow empty delivery transactions if no message slots in unrewarded relayers vector
* unrewarded_relayers for ReceiveMessagesProofInfo only * simplify return * removed comment * appends_to_stored_nonce
…tytech#2021) * reject delivery transactions with at least one obsolete message * clippy * allow empty delivery transactions with rewards confirmations BUT only when there's no room left in the unrewarded relayers vector * clippy * allow empty delivery transactions if no message slots in unrewarded relayers vector
* unrewarded_relayers for ReceiveMessagesProofInfo only * simplify return * removed comment * appends_to_stored_nonce
…tytech#2021) * reject delivery transactions with at least one obsolete message * clippy * allow empty delivery transactions with rewards confirmations BUT only when there's no room left in the unrewarded relayers vector * clippy * allow empty delivery transactions if no message slots in unrewarded relayers vector
* unrewarded_relayers for ReceiveMessagesProofInfo only * simplify return * removed comment * appends_to_stored_nonce
…tytech#2021) * reject delivery transactions with at least one obsolete message * clippy * allow empty delivery transactions with rewards confirmations BUT only when there's no room left in the unrewarded relayers vector * clippy * allow empty delivery transactions if no message slots in unrewarded relayers vector
* unrewarded_relayers for ReceiveMessagesProofInfo only * simplify return * removed comment * appends_to_stored_nonce
…tytech#2021) * reject delivery transactions with at least one obsolete message * clippy * allow empty delivery transactions with rewards confirmations BUT only when there's no room left in the unrewarded relayers vector * clippy * allow empty delivery transactions if no message slots in unrewarded relayers vector
* unrewarded_relayers for ReceiveMessagesProofInfo only * simplify return * removed comment * appends_to_stored_nonce
…tytech#2021) * reject delivery transactions with at least one obsolete message * clippy * allow empty delivery transactions with rewards confirmations BUT only when there's no room left in the unrewarded relayers vector * clippy * allow empty delivery transactions if no message slots in unrewarded relayers vector
* unrewarded_relayers for ReceiveMessagesProofInfo only * simplify return * removed comment * appends_to_stored_nonce
…tytech#2021) * reject delivery transactions with at least one obsolete message * clippy * allow empty delivery transactions with rewards confirmations BUT only when there's no room left in the unrewarded relayers vector * clippy * allow empty delivery transactions if no message slots in unrewarded relayers vector
* unrewarded_relayers for ReceiveMessagesProofInfo only * simplify return * removed comment * appends_to_stored_nonce
…tytech#2021) * reject delivery transactions with at least one obsolete message * clippy * allow empty delivery transactions with rewards confirmations BUT only when there's no room left in the unrewarded relayers vector * clippy * allow empty delivery transactions if no message slots in unrewarded relayers vector
* unrewarded_relayers for ReceiveMessagesProofInfo only * simplify return * removed comment * appends_to_stored_nonce
* reject delivery transactions with at least one obsolete message * clippy * allow empty delivery transactions with rewards confirmations BUT only when there's no room left in the unrewarded relayers vector * clippy * allow empty delivery transactions if no message slots in unrewarded relayers vector
Related to #1549 and paritytech/parity-bridges-common#2554