-
Notifications
You must be signed in to change notification settings - Fork 22
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
Pay EVM gas fees with tokens via HydraDX pallet #206
Conversation
✅ Deploy Preview for docs-oz-polkadot canceled.
|
…ait bounds using balances and assets configs
Chose to use |
…ire pallet multi assets
…patibility with orml currencies
…nged for security reasons
@4meta5 I removed this from EVM milestone since we are not shipping this. We can include as part of a later milestone if we decide to ship this |
Closed because extremely stale at this point, blockers are documented clearly in the PR description for anyone wishing to take up this work in the future. |
Some changes must be made to safely config
HydraDX-node/pallet-transaction-multi-payment
forevm-template
HydraDX/tx-multi usage blockers
evm-template
EVM config violates key assumptions built into the current version ofHydraDX-node/pallet-transaction-multi-payment
. The configurations that violate these assumptions include:These settings were chosen intentionally to maximize Ethereum compatibility for developers building and using the EVM. They are not subject to change.
Unfortunately,
HydraDX-node/pallet-transaction-multi-payment
does not expect this config and, moreover, has hardcoded assumptions to the contrary that lead to unexpected behavior:reset_payment_currency
extrinsic incorrectly routes native balance operations to the foreign asset handler because it assumes the EvmAssetId != NativeAssetId.Config::MultiCurrency
has bounds not satisfied bypallet-assets
(tried here to wrap it without luck). The only out of the box config forConfig::MultiCurrency
isorml-tokens
ororml-currencies
, the latter of the two still to use these pallets as is becausepallet-assets
is not supported.orml-currencies usage blockers
orml-currencies
is a pallet that allows ORML users to route native asset execution to a separate path than foreign asset execution. It supportspallet-balances + orml-tokens
but does not support out of the boxpallet-balances + pallet-assets
.Making
orml-currencies
work withpallet-assets
is the same work required to resolve the problem outlined inHydraDX/tx-multi
. By enablingpallet-assets
to replaceorml-tokens
in theorml-currencies
config, it would enablepallet-assets
to be used inHydraDX/tx-multi
as originally intended.Code Changes
evm-template/runtime/src/defi.rs
HydraDX-node/transaction-multi-payment
. Additional approaches were compared and contrasted in an internal doc titled "Choosing an Implementation to Pay Gas Fees with Any Token".HydraDX-node
&&open-runtime-module-library
to useHydraDX-Node/pallet-transaction-multi-payment
HydraDX-node
,open-runtime-module-library
fork dependencies topolkadot-sdk
andfrontier
version used locally (polkadot-v1.7.0
when last updated). ImportHydraDX-Node/transacton_multi_payment
into deps.orml-tokens
,orml-currencies
to satisfytransaction-multi-payment::Config::MultiCurrency
trait bounds. Justification: https://substrate.stackexchange.com/questions/8410/orml-tokens-vs-pallet-assetsHydraDX/transaction-multi-payment
for theevm-template
runtime at the top of the PR description.Next Steps
Following steps are sequential and should not be pursued in parallel:
pallet-assets + pallet-balances
bytx-multi-payment
instead oforml-tokens
nororml-currencies
tx-multi-payment
to support EvmCurrency = NativeCurrencyId (so thatreset_payment
does not incorrectly route execution away frompallet-balances
, could be solved by the write pallet impl in the top TODO)tx-multi-payment
precompiletx-multi-payment
precompile generic over signature schemeHydraDX-node