Closed
Conversation
(cherry picked from commit 83e503b)
(cherry picked from commit 4adc37e)
(cherry picked from commit b683911) # Conflicts: # frame/ethereum/src/lib.rs
(cherry picked from commit cce4c61)
(cherry picked from commit 55eb01b)
(cherry picked from commit dcc01ce)
(cherry picked from commit 6d6713f)
(cherry picked from commit df7d606)
(cherry picked from commit f83e027)
(cherry picked from commit b8043b3)
(cherry picked from commit f3d73cd)
(cherry picked from commit 8afb33f)
Contributor
Author
|
Closing by now. #741 does some minor refactor so external code can interface with |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR introduces a new
transact_xcmdispatchable.Co-authored by @girazoki
Relates to
@nanocryk 's paritytech/polkadot#5657
Motivation
pallet-ethereum.Origin and account
The origin parachain
Acan send a Transact Xcm to Frontier-enabled parachainBusing aMultiLocationorigin extended with aDescendOrigininstruction. The resultantHashfor thisMultiLocationis the sender's controlled account in parachainB. This way, the sender's controlled account in parachainBis as-if it was the only possible derivation from the sender's controlled account in parachainA.XcmEthereumTransactionvariant is added toRawOriginand we ensure this to be the origin when allowing calls to the new dispatchable.Check and validate
Multiple Xcm fragments are part of the same inherent extrinsic, and current
UncheckedExtrinsic::checkandCheckedExtrinsic::validateimplementations - which are part of transaction pool submission and validation - will not be executed.Ethereum Xcm transactions are instead validated directly within the dispatchable body using the same logic as the rest of the existing code paths.
Xcm payload to transaction conversion
transact_xcminput contains all the data necessary to perform a conversion toethereum::TransactionV2type.EthereumXcmFeeis a custom enum meant to provide two options to build the message in the origin chain:ManualEthereumXcmFee: fee is know in advance, and can be used to buildLegacy,EIP2930andEIP1559transaction types.AutoEthereumXcmFee: fee is not known in advance, and allows to choose fromLow,MediumandHighpre-configured gas fees. We introduce this option because cross-chain messages will be processed in a future unknown block, and users might want to execute the transaction using the (potentially congestion-based) on-chain fee rate.The
EthereumXcmTransactionis converted to a TransactionV2, populating signature fields with bogus data. We can do this because we assume:1.
recover_signeris not needed - which is part of promoting anUncheckedExtrinsicto aCheckedExtrinsic.2. We already know the parachain
Asender controls the derived account in parachainB.3. Current chain id is used.
4. The next nonce for the derived account will be used to execute the transaction.
Restrictions
Currently we deliberately disabled
TransactionAction::Create. The reasons are: