-
Notifications
You must be signed in to change notification settings - Fork 803
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
Snowbridge v2 - Outbound Queue #6706
base: master
Are you sure you want to change the base?
Conversation
Co-authored-by: Vincent Geddes <117534+vgeddes@users.noreply.github.com>
}) | ||
.collect(); | ||
|
||
let message = InboundMessage { |
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.
Why is this called InboundMessage
? It's going from Polkadot to Ethereum, right?
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.
Yeah, it's a bit confusing, InboundMessage
here is in the context of Ethereum, the receiver end.
Maybe renaming it to OutboundMessage
makes more sense here.
@@ -0,0 +1,3 @@ | |||
# Ethereum System | |||
|
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.
Pallet deployed on Bridge Hub. |
Just to better have this thing mapped in the READMEs
|
||
let command = Command::CreateAgent {}; | ||
|
||
Self::send(origin_location.clone(), command, fee)?; |
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.
Can this command fail? What happens if the storage has the agent but the actual command fails?
bridges/snowbridge/primitives/outbound-router/src/v2/convert.rs
Outdated
Show resolved
Hide resolved
let _ = self.next(); | ||
} | ||
|
||
// Try to get ENA again if it is after PNA |
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.
Why is it first ENA then PNA and then ENA again? Why can't it be PNA again afterwards?
Co-authored-by: Francisco Aguirre <franciscoaguirreperez@gmail.com>
Co-authored-by: Francisco Aguirre <franciscoaguirreperez@gmail.com>
Co-authored-by: Francisco Aguirre <franciscoaguirreperez@gmail.com>
Co-authored-by: Francisco Aguirre <franciscoaguirreperez@gmail.com>
Co-authored-by: Francisco Aguirre <franciscoaguirreperez@gmail.com>
Co-authored-by: Francisco Aguirre <franciscoaguirreperez@gmail.com>
Co-authored-by: Francisco Aguirre <franciscoaguirreperez@gmail.com>
Co-authored-by: Francisco Aguirre <franciscoaguirreperez@gmail.com>
Co-authored-by: Francisco Aguirre <franciscoaguirreperez@gmail.com>
Context
This PR is for implement the design in SnowbridgeV2, essentially moving from ordered messaging system to an unordered one.
It focus more on outbound changes, inbound changes will be addressed in another PR.
The point is that we want to make V2 work side by side with V1, so add new routes/pallets specific for V2 and leave legacy codes untouched is important.
This PR is also based on XCM V5 with new instructions like
AliasOrigin
,InitiateTransfer
in place.Initial PR yrong#4 has been internally reviewed, companion changes required for other components of the bridge including:
Contract
Relayer
Workflow
on AH we add a custom exporter returns a lower fee(without the execution cost on Ethereum including), essentially predict the route by content of XCM, more details in Predicate route table by Xcm #6074 and thanks for the review from @bkontur
On BH also add a new exporter to handle V2 specific xcm, convert the xcm to a
Message
structure which will be executed on Ethereum.In
OutboundQueue
store the message into a Merkle tree as V1 before, and add the pending message with the fee attached intoPendingOrder
storage. Code here for detail. The off-chain relayer should check if relaying the message with the fee attached is profitable.In
OutboundQueue
add a new extrinsic submit_delivery_proof in which to verify theMessage
has been delivered to Ethereum, only after that add the fee toRewardLeger
which can be redeemed by the relayer later, more details in Relayer rewards paid to specified location account #6578Review notes
Simulated test is the entry point how to build XCM for V2, also a good candidate to dig deep into the process.
cargo test -p bridge-hub-westend-integration-tests --lib tests::snowbridge_v2_outbound -- --nocapture