Conversation
|
/cmd fmt |
| /// @notice Execute an XCM message locally with the caller's origin | ||
| /// @param message The XCM message to send | ||
| /// @param weight The maximum amount of weight to be used to execute the message | ||
| function xcmExecute(bytes calldata message, Weight calldata weight) external; |
There was a problem hiding this comment.
We don't return anything from either xcmExecute or xcmSend, should we at least let the caller know if it was successful? Or we just revert?
There was a problem hiding this comment.
What about emitting an event @franciscoaguirre
We get that out of the box from calling pallet_xcm::send() or pallet_xcm::execute() - e.g. here
There was a problem hiding this comment.
We don't return anything from either
xcmExecuteorxcmSend, should we at least let the caller know if it was successful? Or we just revert?
From the call to the precompile, we get back whatever gets returned from pallet_xcm::send() or pallet_xcm::execute(). It's just that we don't explicitly set it in the interface because we don't know its type in advance
There was a problem hiding this comment.
I don't like this interface. In practice, as @franciscoaguirre pointed out, how would you even know if it succeeded or not?
I suggest to version the interface in one way or the other, such that it will remain stable (then return values are possible - even if they are just untyped bytes[] the caller at least get's a chance to decode them, can be added later).
There was a problem hiding this comment.
FWIW if the precompile reverts on errors, callers can at least check the call success variable in Solidity. But versioning it explicitly still seems like a good idea to me. Unless to whatever this is calling into is absolutely stable forever? I can't really imagine that.
There was a problem hiding this comment.
And those things should be documented in the interface as well.
There was a problem hiding this comment.
And pleases also consider this: Given the precompile reverts on error, any change in the conditions when reverts happen is a breaking change. Unless I am missing things I don't yet see how this will work out unless we get a mapping of exactly one (versioned) interface to one precompile contract address.
…om/paritytech/polkadot-sdk into tb/integ_xcm_precompile_pallet_xcm
|
@tiagobndr @franciscoaguirre should |
|
/cmd fmt |
I followed the same convention ( |
acatangiu
left a comment
There was a problem hiding this comment.
Looks good. Left a couple of comments.
|
/cmd fmt |
|
Review required! Latest push from author must always be reviewed |
|
athei
left a comment
There was a problem hiding this comment.
Sorry have to block until my comment is addressed. When adding the dispatchable weight to the pre-charged weight it also needs to be added to the actual weight. Otherwise it is only included once. Or am I wrong here?
|
@athei I commited in faceac5 a small fix regarding weights. The The benchmarked weight for |
|
All GitHub workflows were cancelled due to failure one of the required jobs. |
|
Ahh yes I get it now. I missed that you are calling into a dispatch able that already includes its own weight. Thought you were calling into the executor directly. |
* master: (62 commits) release/build-macos-binaries: add missing FEATURES argument (#8816) Add XCM Precompile to `pallet-xcm` (#8693) [Release|CI/CD] Exclude test runtimes from the runtimes build (#8820) Add freebsd sysinfo for telemetry (#7985) release-reusable-rc-build: add optional `features` input that can be considered for nodes building (#8755) [Staking] Cleanups and some improvements (#8701) Fix typos in 3 files in Implementers Guide (#8799) Update `RemoteExporter` docs to reflect removal of `forward_id_for` (#8795) Snowbridge: enforce fee when registering Polkadot native asset (#8725) Bump the ci_dependencies group across 1 directory with 7 updates (#8788) Docker hub 'master' image short sha (#8790) [Release|CI/CD] Combine branch-off and RC automation flows (#8754) Move Transaction depth limit checks (#8750) Add genesis presets for remaining runtimes in polkadot-parachain-bin (#8426) Do not make pallet-identity benchmarks signature-dependent (#8179) Introduction of Approval Slashes [Disabling Strategy Stage 4] (#6827) [AHM] Prepare For Westend Cleanup (#8715) Actually use RP offset in YAP parachain (#8745) [AHM] Relax the requirement for RC-Client to receive +1 session reports (#8702) Don't read storage items in logging (#8749) ...
|
@tiagobndr @Brianspha my review comments were dismissed entirely. Why? Developer experience wise, this is a disaster. This isn't done yet, please fix with a follow up PR. Also don't forget to document it externally on our docs (here / here). |
|
But wait. Didn't we discuss that you detect whether this failed by catching the panic? But I guess this is really bad because in Solidity panics are silently ignored by default (lol). |
@xermicus you’re right that the DevEx could be improved. We opened PR #9023 to address this — would really appreciate your feedback on it when you have a moment |
|
Ah that's great, thanks! Didn't see 9023, happy to take a look once it's ready. Just think about it from this perspective: You are a Solidity dev (know nothing about Polkadot) and try to do XCM. I was already asked exactly this a couple times. Ideally our interfaces together with doc comments and broader documentation are written well enough so we don't need to hand hold them at all. |
This brings in `unstable2507` Polkadot SDK, and integrates new features. Integrated breaking changes to be verified by the original authors: - [ ] paritytech/polkadot-sdk#7953 @kianenigma @Ank4n acatangiu#13 - [x] paritytech/polkadot-sdk#8684 @nkpar - [x] paritytech/polkadot-sdk#8693 @tiagobndr @franciscoaguirre - [x] paritytech/polkadot-sdk#9137 @franciscoaguirre fixes #837 --------- Co-authored-by: Branislav Kontur <[email protected]> Co-authored-by: Kian Paimani <[email protected]> Co-authored-by: kianenigma <[email protected]> Co-authored-by: Christian Langenbacher <[email protected]>
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 <[email protected]> Co-authored-by: Siphamandla Mjoli <[email protected]> Co-authored-by: Alexander Theißen <[email protected]> Co-authored-by: Francisco Aguirre <[email protected]> Co-authored-by: PG Herveou <[email protected]>
This PR adds the XCM precompile (with
xcmSend,xcmExecuteandweightMessagefunctionalities) topallet-xcm.This follows the discussion we had on the now closed PR, 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 topallet-xcm, avoiding adding unnecessary dependencies topallet-revive.This PR should also encapsulate unit tests in
precompiles.rsas well as integration tests undercumulus/parachains/integration-tests/emulated/tests.See tracking parent issue