Skip to content

Commit

Permalink
Add more documentation for the TargetAccount variant. (paritytech#625)
Browse files Browse the repository at this point in the history
  • Loading branch information
tomusdrw authored and serban300 committed Apr 10, 2024
1 parent 16cb5c2 commit f88acaa
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions bridges/modules/call-dispatch/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,16 @@ pub enum CallOrigin<SourceChainAccountId, TargetChainAccountPublic, TargetChainS
/// The account can be identified by `TargetChainAccountPublic`. The proof that the
/// `SourceChainAccountId` controls `TargetChainAccountPublic` is the `TargetChainSignature`
/// over `(Call, SourceChainAccountId).encode()`.
///
/// NOTE sending messages using this origin (or any other) does not have replay protection!
/// The assumption is that both the source account and the target account is controlled by
/// the same entity, so source-chain replay protection is sufficient.
/// As a consequence, it's extremely important for the target chain user to never produce
/// a signature with their target-private key on something that could be sent over the bridge,
/// i.e. if the target user signs `(<some-source-account-id>, Call::Transfer(X, 5))`
/// The owner of `some-source-account-id` can send that message multiple times, which would
/// result with multiple transfer calls being dispatched on the target chain.
/// So please, NEVER USE YOUR PRIVATE KEY TO SIGN SOMETHING YOU DON'T FULLY UNDERSTAND!
TargetAccount(SourceChainAccountId, TargetChainAccountPublic, TargetChainSignature),

/// Call is sent by the `SourceChainAccountId` on the source chain. On the target chain it is
Expand Down

0 comments on commit f88acaa

Please sign in to comment.