-
Notifications
You must be signed in to change notification settings - Fork 689
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
Contracts expose pallet-xcm #1248
Merged
Changes from 7 commits
Commits
Show all changes
126 commits
Select commit
Hold shift + click to select a range
251e8cd
boilerplate type changes
pgherveou 3b1cc37
Add pallet_xcm::execute
pgherveou 22430a3
wip
pgherveou c6e1f49
add other xcm_methods
pgherveou bf66839
add benchmarks
pgherveou a348bd9
build fixes
pgherveou b2a9f4e
fix
pgherveou d20d6ca
fix post-rebase missing imports
pgherveou 8388585
Revert "boilerplate type changes"
pgherveou 4bae246
Use trait instead of tight coupling
pgherveou 0675899
add mock_network setup
pgherveou 2049b57
fixes
pgherveou be04741
fix clippy
pgherveou b7875ad
quick fixes
pgherveou c312b98
simplify
pgherveou 5983dbd
move stuff to pallet_xcm_extension
pgherveou 7484d32
fmt
pgherveou b40f92c
headr
pgherveou c3f7d40
missing headers
pgherveou a08e41b
fix missing comment
pgherveou 376a6b3
fixes
pgherveou 5b883d6
Merge branch 'master' into pg/xcm
pgherveou 967616c
Merge branch 'master' into pg/xcm
pgherveou d2b5ba3
refactoring
pgherveou d7fe1bc
fix build
pgherveou c15adab
missing type in node/runtime
pgherveou e15c7eb
format cargo.toml
pgherveou 971b167
more zepter fixes
pgherveou 3dba8d1
fixes
pgherveou be1a46d
missing trait implementation
pgherveou a4d706c
fix tests
pgherveou b15ea88
fixes
pgherveou b938df4
fmt fix
pgherveou fcc37f5
zepter format
pgherveou 9cc990f
fix doc links
pgherveou 7ff220b
rm println!
pgherveou bdf0ae7
add tests comments
pgherveou 14e1514
worst case
pgherveou e9d2cdf
simplify XCM
pgherveou c9f8f35
add docs
pgherveou 151175b
Filter out transact calls
pgherveou 43f38d2
fmt
pgherveou 4583e03
move ensure to it's own function for benchmark
pgherveou ceb3fc8
fix error handling
pgherveou db7c479
doc fixes
pgherveou cd8281e
fix weight
pgherveou c004909
improve weight
pgherveou 526abbd
XCMAdapter -> XcmAdapter
pgherveou 0a98a89
XCM<T> -> Xcm<T>
pgherveou 1d1f40a
Update substrate/frame/contracts/src/xcm.rs
pgherveou e01cb2c
Update substrate/frame/contracts/src/xcm.rs
pgherveou 2c7735b
Update substrate/frame/contracts/src/xcm.rs
pgherveou 4e3de86
Update substrate/frame/contracts/src/xcm.rs
pgherveou e52f85f
s/xcm message/message
pgherveou d78ec47
typo
pgherveou 435de45
fix build issues
pgherveou c4d87ff
fix fmt
pgherveou 4363e6d
More doc fix changes
pgherveou ac39a50
Apply suggestions from code review
pgherveou 0bf6e1a
address PR comments
pgherveou ddf485a
Add reentrency test
pgherveou 975ef56
Simplify tests
pgherveou 448c9d4
Apply suggestions from code review
pgherveou 132e203
PR review comment
pgherveou 7bf716d
Fix lint
pgherveou 6a7a8bd
return proper error code
pgherveou 8c1c118
Merge branch 'master' into pg/xcm
pgherveou 06a5c9a
fix compilation issues after rebase
pgherveou b47f660
lint
pgherveou 06cf121
Merge branch 'master' of https://github.com/paritytech/polkadot-sdk i…
0949455
".git/.scripts/commands/bench/bench.sh" --subcommand=runtime --runtim…
14fed0e
Update substrate/frame/contracts/src/tests/test_xcm.rs
pgherveou e694941
simplify mock_network
pgherveou 72f15c1
fix return type in comment
pgherveou c8f39e7
Contracts expose pallet-xcm - tweaks (#2062)
pgherveou 54e2803
Add copyright
pgherveou ce637dc
reuse QueryHandler
pgherveou 582467d
Contracts: Add XCM traits to interface with contracts
pgherveou 79535cb
Update polkadot/xcm/xcm-executor/src/traits/controller.rs
pgherveou 0a02451
Update doc
pgherveou 262e17c
Merge branch 'pg/xcm_contracts_update' into pg/xcm
pgherveou 9413874
use Outcome return value for xcm_execute
pgherveou 18c6bb4
Use outcome in controller
pgherveou b9b2ccc
Merge branch 'pg/xcm_contracts_update' into pg/xcm
pgherveou 198d692
add docstring
pgherveou e3ce2e0
Event consistency
pgherveou 6342962
Add more docs
pgherveou a2fde63
Update polkadot/xcm/xcm-executor/src/traits/controller.rs
pgherveou 0ae8763
fix doc
pgherveou 034150c
fix CI
pgherveou 7848e2f
move to xcm-builder
pgherveou b7155b6
move to pallet-xcm
pgherveou 34329e5
Update doc links
pgherveou 07439dd
Merge branch 'master' into pg/xcm_contracts_update
pgherveou b37d169
wip
pgherveou de8f1a9
Merge branch 'pg/xcm_contracts_update' into pg/xcm
pgherveou 7cd84a2
update xcm stuff
pgherveou 8ac21da
Bench compile fix
pgherveou 7ee5d08
add missing use
pgherveou e13b51b
Merge branch 'pg/xcm_contracts_update' into pg/xcm
pgherveou 2359fa0
fix test
pgherveou 41215d3
mock-network crate
pgherveou e515180
Merge branch 'master' into pg/xcm
pgherveou 8b0f8ac
revert bad merge
pgherveou 3526658
move fixtures files
pgherveou 784f8df
rm pallet-xcm dep
pgherveou 0b5517a
fix xcm deps
pgherveou 7b3ad3d
fix tests
pgherveou 0b4c840
fix lint
pgherveou 80e0c53
fixes
pgherveou 59d67a0
fix
pgherveou 9a9d572
fix
pgherveou 3adde14
fixed deps moved to pallet-contracts-mock-network
pgherveou c70aca5
Review https://github.com/paritytech/polkadot-sdk/pull/1248#discussio…
pgherveou 5d63636
Review https://github.com/paritytech/polkadot-sdk/pull/1248#discussio…
pgherveou 57b7ca5
PR review https://github.com/paritytech/polkadot-sdk/pull/1248#discus…
pgherveou 10f22fb
PR review https://github.com/paritytech/polkadot-sdk/pull/1248#discus…
pgherveou 162ad54
PR review https://github.com/paritytech/polkadot-sdk/pull/1248#discus…
pgherveou 3a4a251
rm macro_export
pgherveou dab8314
Temporary remove xcm_query and xcm_take_response fns
pgherveou e3161c9
misc removed stuff from query
pgherveou 4128aa6
fix doc
pgherveou f0df85b
rm more stuff from query & take_response
pgherveou b48a8f9
fmt
pgherveou 7c72e24
Merge branch 'master' into pg/xcm
pgherveou b34e245
doc test
pgherveou File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think these crates are going to move into their own repo (cc @KiChjang ), so that should partially address your concern.
I don't see how we could bring xcm features to SC without bringing in these dependencies though... 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, makes sense.
Not my call, but I would strive to have things in the dep graph be correct before landing this PR. Else the slippery slope to a janky cluster of deps crossing boundaries will likely happen.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree you don't necessarily want to use xcm when using pallet-contracts, you might not even have access to it
Ideally we want contracts, at the pallet level, to allow xcm but not enforce knowing about it
It's good that you can disable the capability, but still relying on this dependencies sounds too much when I don't want to deal with xcm as a solochain developer for example
The only way to take this out of the dependencies would be to have a different crate, something like "xcm-powered-contracts", which is ugly. The other thing we could do is feature gate this, so at least some things are not even compiled if you don't want XCM. However, dependencies can't be defined per feature 😢
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The reasoning is that even solo chain might eventually want to use xcm, to communicate messages over bridges for example. That's why we want xcm to be part of the config, rather than using other type of indirection like dispatching runtime call or building ad-hoc SC chain extension, which has been how team have interfaced with XCM so far.
We could feature gate everything but I think this is not necessary as the compiler should just strip pallet_xcm code if you use the default
()
noop trait.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes XCM is not specific to being a parachain. It is a language to express intent. It will also be used for contract <-> runtime communication. In an ideal world it would also be used inside a transaction instead of the unstable encoded
Call
.Hence there is no reason to jump though all these hoops and add all the complexity just to make it optional.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so I initially I used tight coupling , but I think having an Xcm configuration trait provide a few advantage:
T::Xcm::some_xcm_foo(..)
rather than<T as pallet_xcm::Config>::xcm_foo(..)
T::
by<T as Config>
to get the pallet to compilepallet_xcm::Config
straight away.Happy to update if you feel strongly that we should use tight coupling on the pallet.