Conversation
| //! Use `alloy` through our re-export in this module to implement Eth ABI. | ||
|
|
||
| mod builtin; | ||
| pub mod custom; |
There was a problem hiding this comment.
Should be either exist inside bultin or outside of pallet-revive. I would prefer the latter (for example implement Precompile on pallet_xcm. Then we can remove all the dependencies to xcm from pallet_revive.
There was a problem hiding this comment.
I think given the cutoff date for stable2506, it might be fine to leave it where it is and then move it
acatangiu
left a comment
There was a problem hiding this comment.
high-level everything looks good, I would also like to see it integrated with asset-hub-westend-runtime too not just mock runtime from pallet-revive
|
|
||
| match input { | ||
| IXcmCalls::xcmSend(IXcm::xcmSendCall { destination, message }) => { | ||
| let final_destination = xcm::VersionedLocation::decode_all(&mut &destination[..]) |
There was a problem hiding this comment.
This precompile will be updated to only support the latest versions, since Versioned* types only support the latest 3 XCM versions. With this, XCMs crafted in SCs should always be upgradable. Probably the pattern here (for mad people) is to put XCMs in a storage item so you can update them when needed. We need another higher level precompile to make everyone's lives easier
|
You should get your editor under control. Or run |
|
/cmd fmt |
substrate/frame/revive/src/lib.rs
Outdated
| /// The weigher used to calculate XCM execution costs | ||
| #[pallet::no_default_bounds] | ||
| type XcmWeigher: xcm_executor::traits::WeightBounds<<Self as frame_system::Config>::RuntimeCall>; |
There was a problem hiding this comment.
Can't we add this bound to the existing Xcm associated type? I think its all implemented by pallet_xcm anyways.
There was a problem hiding this comment.
Since we moving the precompile anyways would it make sense to make changes in pallet_xcm to achieve this?
There was a problem hiding this comment.
The right thing to do would be to define the pre-compile in pallet_xcm.
There was a problem hiding this comment.
This pre-compile does not charge any weight whatsoever. Please look into the already existing xcm_execute and xcm_send functions in this pallet. It is just migrating existing logic to a pre-compile.
| /// The weigher used to calculate XCM execution costs | ||
| #[pallet::no_default_bounds] | ||
| type XcmWeigher: xcm_executor::traits::WeightBounds< | ||
| <Self as frame_system::Config>::RuntimeCall, | ||
| >; |
There was a problem hiding this comment.
Can't we just add the bound to the Xcm associated type? It is all implemented by pallet_xcm anyways AFAIK.
There was a problem hiding this comment.
No, this is currently a runtime configuration object, also being set to the xcm-executor, not pallet-xcm. We should consolidate it somehow to not have to set it twice (pallet-revive and xcm-executor), but this is not trivial and “nice-to-have” at this point IMO
There was a problem hiding this comment.
When suggesting to move it to builtin I assumed you would add it to the Production type alias. As this is the way to expose Builtin pre-compiles. However, this won't be possible since builtin pre-compiles are forced to use a different address range.
And since we are planning to move it out of the pallet eventually we need to use an external address range. Otherwise we won't be able to migrate it.
Sorry for the confusion. Just move the xcm.rs as direct sub module of precompiles.rs.
|
@Brianspha @franciscoaguirre I agree with @athei that the XCM precompiles should be implemented by pallet-xcm and not pallet-revive. @athei wdyt? |
Regarding the interface, I believe it is mature enough. There is some query-related functionality we might want to add to this precompile later but that's not part of this PR. As for tomorrow's deadline, I’d be cautious about migrating the precompile to |
…olkadot-sdk into spha/xcm_precompile
|
All GitHub workflows were cancelled due to failure one of the required jobs. |
I don't think it is realistic to have this pre-compile in a state that I feel comfortable to expose it until today anyways. And its value without query support is kinda non existent anyways. I don't get the rush. |
|
@athei I agree this belongs in |
|
Closing the PR since we need to move all xcm related dependencies to pallet-xcm |
This PR adds the XCM precompile (with `xcmSend`, `xcmExecute` and `weightMessage` functionalities) to `pallet-xcm`. This follows the discussion we had on the now closed [PR](#8471), which attempted to add the precompile to `pallet-revive`, but that approach would have introduced unwanted cyclic dependencies. That's why we decided to migrate the precompile to `pallet-xcm`, avoiding adding unnecessary dependencies to `pallet-revive`. This PR should also encapsulate unit tests in `precompiles.rs` as well as integration tests under `cumulus/parachains/integration-tests/emulated/tests`. See tracking parent [issue](#6718) --------- Co-authored-by: cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Siphamandla Mjoli <brianm445@yahoo.com> Co-authored-by: Siphamandla Mjoli <siphamandla@parity.io> Co-authored-by: Alexander Theißen <alex.theissen@me.com> Co-authored-by: Francisco Aguirre <franciscoaguirreperez@gmail.com> Co-authored-by: PG Herveou <pgherveou@gmail.com>
This PR adds the XCM precompile (with `xcmSend`, `xcmExecute` and `weightMessage` functionalities) to `pallet-xcm`. This follows the discussion we had on the now closed [PR](#8471), which attempted to add the precompile to `pallet-revive`, but that approach would have introduced unwanted cyclic dependencies. That's why we decided to migrate the precompile to `pallet-xcm`, avoiding adding unnecessary dependencies to `pallet-revive`. This PR should also encapsulate unit tests in `precompiles.rs` as well as integration tests under `cumulus/parachains/integration-tests/emulated/tests`. See tracking parent [issue](#6718) --------- Co-authored-by: cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Siphamandla Mjoli <brianm445@yahoo.com> Co-authored-by: Siphamandla Mjoli <siphamandla@parity.io> Co-authored-by: Alexander Theißen <alex.theissen@me.com> Co-authored-by: Francisco Aguirre <franciscoaguirreperez@gmail.com> Co-authored-by: PG Herveou <pgherveou@gmail.com>
Create a unified precompile address that handles
xcmExecuteandxcmSendoperations for devs to call viasolidityusingabiencodings.See tracking parent issue