Skip to content

Commit

Permalink
Proof of concept: Add a new runtime that uses pallet_contracts (parit…
Browse files Browse the repository at this point in the history
…ytech#186)

* seal: Copy over a legacy version of pallet_contracts from substrate

* seal: Fix substrate dependency pathes and add as dependency to runtime

* seal: Adapt pallet to current substrate version

* seal: Add contracts pallet to runtime

* seal: Implement rpc runtime api

* seal: Update to latest rpc output format

* seal: Replace child trie by prefix trie

* seal: Add contracts endpoint to the client

* seal: fixup rpc test

* Fix whitespace issue

Co-authored-by: Sergei Shulepov <[email protected]>

* seal: Move pallet out of the runtime directory

* seal: Create a seperate runtime for contracts

* Move parachains to top level directory

* seal: Disable rent for easier testing

Co-authored-by: Sergei Shulepov <[email protected]>
  • Loading branch information
athei and pepyakin authored Aug 7, 2020
1 parent 9e28ea6 commit bda46b0
Show file tree
Hide file tree
Showing 63 changed files with 13,517 additions and 148 deletions.
438 changes: 302 additions & 136 deletions Cargo.lock

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ members = [
"runtime",
"test/runtime",
"test/client",
"test/parachain/runtime",
"test/parachain/",
"rococo-parachains",
"rococo-parachains/runtime",
"rococo-parachains/contracts-runtime",
"upward-message",
]

Expand Down
13 changes: 9 additions & 4 deletions test/parachain/Cargo.toml → rococo-parachains/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ hex-literal = "0.2.1"

# Parachain dependencies
parachain-runtime = { package = "cumulus-test-parachain-runtime", path = "runtime" }
parachain-contracts-runtime = { package = "cumulus-contracts-parachain-runtime", path = "contracts-runtime" }

# Substrate dependencies
sp-runtime = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "rococo-branch" }
Expand All @@ -47,11 +48,15 @@ sc-finality-grandpa = { git = "https://github.com/paritytech/substrate", branch
sc-informant = { git = "https://github.com/paritytech/substrate", branch = "rococo-branch" }
sc-chain-spec = { git = "https://github.com/paritytech/substrate", branch = "rococo-branch" }

# RPC related dependencies
pallet-contracts-rpc = { path = "./pallets/contracts/rpc" }
jsonrpc-core = "14.2.0"

# Cumulus dependencies
cumulus-consensus = { path = "../../consensus" }
cumulus-collator = { path = "../../collator" }
cumulus-network = { path = "../../network" }
cumulus-primitives = { path = "../../primitives" }
cumulus-consensus = { path = "../consensus" }
cumulus-collator = { path = "../collator" }
cumulus-network = { path = "../network" }
cumulus-primitives = { path = "../primitives" }

# Polkadot dependencies
polkadot-primitives = { git = "https://github.com/paritytech/polkadot", branch = "rococo-branch" }
Expand Down
File renamed without changes.
88 changes: 88 additions & 0 deletions rococo-parachains/contracts-runtime/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
[package]
name = 'cumulus-contracts-parachain-runtime'
version = '0.1.0'
authors = ["Parity Technologies <[email protected]>"]
edition = '2018'

[dependencies]
serde = { version = "1.0.101", optional = true, features = ["derive"] }
codec = { package = "parity-scale-codec", version = "1.3.0", default-features = false, features = ["derive"] }

# Substrate dependencies
sp-std = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "rococo-branch" }
sp-api = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "rococo-branch" }
sp-io = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "rococo-branch" }
sp-version = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "rococo-branch" }
sp-runtime = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "rococo-branch" }
sp-core = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "rococo-branch" }
sp-session = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "rococo-branch" }
sp-offchain = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "rococo-branch" }
sp-block-builder = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "rococo-branch" }
sp-transaction-pool = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "rococo-branch" }
sp-inherents = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "rococo-branch" }

frame-support = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "rococo-branch" }
frame-executive = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "rococo-branch" }
frame-system = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "rococo-branch" }
pallet-balances = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "rococo-branch" }
pallet-randomness-collective-flip = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "rococo-branch" }
pallet-timestamp = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "rococo-branch" }
pallet-sudo = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "rococo-branch" }
pallet-transaction-payment = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "rococo-branch" }

# In-Tree Fork of seal that does not use child trie nor storage transactions
pallet-contracts = { path = "../pallets/contracts", default-features = false }
pallet-contracts-primitives = { path = "../pallets/contracts/common", default-features = false }
pallet-contracts-rpc-runtime-api = { path = "../pallets/contracts/rpc/runtime-api", default-features = false }

# Cumulus dependencies
cumulus-runtime = { path = "../../runtime", default-features = false }
cumulus-parachain-upgrade = { path = "../../parachain-upgrade", default-features = false }
cumulus-message-broker = { path = "../../message-broker", default-features = false }
cumulus-upward-message = { path = "../../upward-message", default-features = false }
cumulus-primitives = { path = "../../primitives", default-features = false }

# Polkadot dependencies
polkadot-parachain = { git = "https://github.com/paritytech/polkadot", branch = "rococo-branch", default-features = false }

[build-dependencies]
wasm-builder-runner = { package = "substrate-wasm-builder-runner", version = "1.0.6" }

[features]
default = [ "std" ]
std = [
"codec/std",
"serde",
"sp-api/std",
"sp-std/std",
"sp-io/std",
"sp-core/std",
"sp-runtime/std",
"sp-version/std",
"sp-offchain/std",
"sp-session/std",
"sp-block-builder/std",
"sp-transaction-pool/std",
"sp-inherents/std",
"frame-support/std",
"frame-executive/std",
"frame-system/std",
"pallet-balances/std",
"pallet-contracts/std",
"pallet-contracts-primitives/std",
"pallet-contracts-rpc-runtime-api/std",
"pallet-randomness-collective-flip/std",
"pallet-timestamp/std",
"pallet-sudo/std",
"pallet-transaction-payment/std",
"cumulus-runtime/std",
"cumulus-parachain-upgrade/std",
"cumulus-message-broker/std",
"cumulus-upward-message/std",
"cumulus-primitives/std",
"polkadot-parachain/std",
]
# Will be enabled by the `wasm-builder` when building the runtime for WASM.
runtime-wasm = [
"cumulus-upward-message/runtime-wasm",
]
File renamed without changes.
Loading

0 comments on commit bda46b0

Please sign in to comment.