diff --git a/.github/workflows/crates.yml b/.github/workflows/crates.yml index 52c8b0c423..5c71ef03ca 100644 --- a/.github/workflows/crates.yml +++ b/.github/workflows/crates.yml @@ -10,7 +10,7 @@ jobs: steps: - uses: hecrj/setup-rust-action@v1 with: - rust-version: 'nightly-2020-08-20' + rust-version: 'nightly-2021-06-29' targets: 'wasm32-unknown-unknown' - name: Checkout the source code uses: actions/checkout@master @@ -18,14 +18,12 @@ jobs: submodules: true - name: Check targets are installed correctly run: rustup target list --installed - - name: Install build tools - run: cargo install --git https://github.com/alexcrichton/wasm-gc --force - name: Build doc run: cargo doc --all --all-features --no-deps - name: Push index.html - run: echo "" > ./target/doc/index.html + run: echo "" > ./target/doc/index.html - name: Push CNAME - run: echo "crates.plasmnet.io" > ./target/doc/CNAME + run: echo "crates.astar.network" > ./target/doc/CNAME - name: Deploy uses: peaceiris/actions-gh-pages@v3 with: diff --git a/.github/workflows/crates_frame.yml b/.github/workflows/crates_frame.yml deleted file mode 100644 index aa8a8bf46d..0000000000 --- a/.github/workflows/crates_frame.yml +++ /dev/null @@ -1,40 +0,0 @@ -name: Crates frame publish -on: - release: - types: [created] -jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: hecrj/setup-rust-action@v1 - with: - rust-version: 'nightly-2020-08-20' - targets: 'wasm32-unknown-unknown' - - name: Checkout the source code - uses: actions/checkout@master - with: - submodules: true - - name: Check targets are installed correctly - run: rustup target list --installed - - name: Install build tools - run: cargo install --git https://github.com/alexcrichton/wasm-gc --force - - name: Crates login - run: cargo login ${{ secrets.CRATES_TOKEN }} - - name: Publish ovmi - run: cd ovmi/lib && cargo publish - - name: Publish operator - run: cd ../../frame/operator && cargo publish - - name: Publish trading - run: cd ../trading && cargo publish - - name: Publish plasm-rewards - run: cd ../plasm-rewards && cargo publish - - name: Publish dapps-staking - run: cd ../dapps-staking && cargo publish - - name: Publish plasm-lockdrop - run: cd ../plasm-lockdrop && cargo publish - - name: Publish plasm-validator - run: cd ../plasm-validator && cargo publish - - name: Publish ovm - run: cd ../ovm && cargo publish - - name: Publish plasma - run: cd ../plasma && cargo publish diff --git a/.github/workflows/dockerpush.yml b/.github/workflows/dockerpush.yml deleted file mode 100644 index ed6bd9507b..0000000000 --- a/.github/workflows/dockerpush.yml +++ /dev/null @@ -1,42 +0,0 @@ -name: Docker Image CI -on: - push: - branches: - - master - - dusty - tags: - - v* -jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: hecrj/setup-rust-action@v1 - with: - rust-version: 'nightly-2020-08-20' - targets: 'wasm32-unknown-unknown' - - name: Checkout the source code - uses: actions/checkout@master - with: - submodules: true - - name: Check targets are installed correctly - run: rustup target list --installed - - name: Install build tools - run: cargo install --git https://github.com/alexcrichton/wasm-gc --force - - name: Build optimized binary - run: cargo build --release --verbose --target-dir third-party/docker/target-debian - - name: Get the version - id: get_version - run: echo ::set-output name=tag::${GITHUB_REF#refs/tags/v} - - uses: azure/docker-login@v1 - with: - username: ${{ secrets.REGISTRY_USERNAME }} - password: ${{ secrets.REGISTRY_PASSWORD }} - - name: Docker build and push - run: | - TAG=${{ steps.get_version.outputs.tag }} - if [ `echo $TAG | grep 'refs'` ]; then TAG='latest'; fi - echo ${{ steps.get_version.outputs.tag }} - echo $TAG - cd third-party/docker - docker build . -t staketechnologies/plasm-node:$TAG - docker push staketechnologies/plasm-node:$TAG diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 08e77ece36..37f5d5666e 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -7,15 +7,11 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ubuntu-latest, macOS-latest, windows-latest] + os: [ubuntu-latest, macOS-latest] steps: - - name: Install LLVM (windows only) - if: runner.os == 'Windows' - run: choco install llvm - - uses: hecrj/setup-rust-action@v1 with: - rust-version: 'nightly-2020-08-20' + rust-version: 'nightly-2021-06-29' targets: 'wasm32-unknown-unknown' - name: Checkout the source code @@ -26,38 +22,16 @@ jobs: - name: Check targets are installed correctly run: rustup target list --installed - - name: Install build tools - run: cargo install --git https://github.com/alexcrichton/wasm-gc --force - - name: Run all tests run: cargo test --all - name: Build optimized binary run: cargo build --release --verbose - - name: Upload binary archive into IPFS - if: runner.os != 'Windows' - run: | - cd target/release - tar cfJ plasm-node-${{ matrix.os }}-x86_64.tar.xz plasm-node - curl "https://ipfs.infura.io:5001/api/v0/add" -F file=@plasm-node-${{ matrix.os }}-x86_64.tar.xz - - uses: actions/upload-artifact@master - if: runner.os != 'Windows' - with: - name: plasm-node-${{ matrix.os }}-x86_64.tar.xz - path: target/release/plasm-node-${{ matrix.os }}-x86_64.tar.xz - - - name: Upload binary archive into IPFS (windows only) - if: runner.os == 'Windows' - run: | - cd target/release - tar czf plasm-node-${{ matrix.os }}-x86_64.tar.gz plasm-node.exe - curl "https://ipfs.infura.io:5001/api/v0/add" -F file=@plasm-node-${{ matrix.os }}-x86_64.tar.gz - uses: actions/upload-artifact@master - if: runner.os == 'Windows' with: - name: plasm-node-${{ matrix.os }}-x86_64.tar.gz - path: target/release/plasm-node-${{ matrix.os }}-x86_64.tar.gz + name: astar-${{ matrix.os }}-x86_64 + path: target/release/astar-collator nix: runs-on: ubuntu-latest diff --git a/Cargo.lock b/Cargo.lock index 1bd9c1f4f6..d7ac2a4f29 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -57,7 +57,7 @@ dependencies = [ "aes", "block-cipher", "ghash", - "subtle 2.4.0", + "subtle 2.4.1", ] [[package]] @@ -133,9 +133,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.41" +version = "1.0.42" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15af2628f6890fe2609a3b91bef4c83450512802e59489f9c1cb1fa5df064a61" +checksum = "595d3cfa7a60d4555cb5067b99f07142a08ea778de5cf993f7b75c7d8fabc486" [[package]] name = "approx" @@ -185,6 +185,56 @@ version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9b34d609dfbaf33d6889b2b7106d3ca345eacad44200913df5ba02bfd31d2ba9" +[[package]] +name = "astar-collator" +version = "2.2.0" +dependencies = [ + "cumulus-client-cli", + "cumulus-client-consensus-relay-chain", + "cumulus-client-network", + "cumulus-client-service", + "cumulus-primitives-core", + "cumulus-primitives-parachain-inherent", + "frame-system", + "hex", + "jsonrpc-core", + "lazy_static", + "log", + "pallet-transaction-payment", + "parity-scale-codec", + "polkadot-cli", + "polkadot-parachain", + "polkadot-primitives", + "polkadot-service", + "sc-basic-authorship", + "sc-chain-spec", + "sc-cli", + "sc-client-api", + "sc-client-db", + "sc-consensus", + "sc-consensus-babe", + "sc-executor", + "sc-network", + "sc-offchain", + "sc-rpc", + "sc-service", + "sc-telemetry", + "sc-tracing", + "sc-transaction-pool", + "serde", + "shiden-runtime", + "sp-consensus", + "sp-core", + "sp-inherents", + "sp-runtime", + "sp-timestamp", + "sp-transaction-pool", + "sp-trie", + "structopt", + "substrate-build-script-utils", + "vergen", +] + [[package]] name = "async-attributes" version = "1.1.2" @@ -806,9 +856,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.0.68" +version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a72c244c1ff497a746a7e1fb3d14bd08420ecda70c8f25c7112f2781652d787" +checksum = "e70cc2f62c6ce1868963827bd677764c62d07c3d9a3e1fb1177ee1a9ab199eb2" dependencies = [ "jobserver", ] @@ -995,12 +1045,11 @@ checksum = "ea221b5284a47e40033bf9b66f35f984ec0ea2931eb03505246cd27a963f981b" [[package]] name = "cpp_demangle" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44919ecaf6f99e8e737bc239408931c9a01e9a6c74814fee8242dd2506b65390" +checksum = "8ea47428dc9d2237f3c6bc134472edfd63ebba0af932e783506dcfd66f10d18a" dependencies = [ "cfg-if 1.0.0", - "glob", ] [[package]] @@ -1236,7 +1285,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b584a330336237c1eecd3e94266efb216c56ed91225d634cb2991c5f3fd1aeab" dependencies = [ "generic-array 0.14.4", - "subtle 2.4.0", + "subtle 2.4.1", ] [[package]] @@ -1539,14 +1588,14 @@ dependencies = [ [[package]] name = "curve25519-dalek" -version = "2.1.2" +version = "2.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "434e1720189a637d44fe464f4df1e6eb900b4835255b14354497c78af37d9bb8" +checksum = "4a9b85542f99a2dfa2a1b8e192662741c9859a846b296bef1c92ef9b58b5a216" dependencies = [ "byteorder", "digest 0.8.1", "rand_core 0.5.1", - "subtle 2.4.0", + "subtle 2.4.1", "zeroize", ] @@ -1559,7 +1608,7 @@ dependencies = [ "byteorder", "digest 0.9.0", "rand_core 0.5.1", - "subtle 2.4.0", + "subtle 2.4.1", "zeroize", ] @@ -1602,13 +1651,14 @@ dependencies = [ [[package]] name = "derive_more" -version = "0.99.14" +version = "0.99.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cc7b9cef1e351660e5443924e4f43ab25fbbed3e9a5f052df3677deb4d6b320" +checksum = "40eebddd2156ce1bb37b20bbe5151340a31828b1f2d22ba4141f3531710e38df" dependencies = [ "convert_case", "proc-macro2", "quote", + "rustc_version 0.3.3", "syn", ] @@ -2619,9 +2669,9 @@ checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" [[package]] name = "hex-literal" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76505e26b6ca3bbdbbb360b68472abbb80998c5fa5dc43672eca34f28258e138" +checksum = "21e4590e13640f19f249fe3e4eca5113bc4289f2497710378190e7f4bd96f45b" [[package]] name = "hex_fmt" @@ -2815,9 +2865,9 @@ dependencies = [ [[package]] name = "hyper" -version = "0.14.9" +version = "0.14.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07d6baa1b441335f3ce5098ac421fb6547c46dda735ca1bc6d0153c838f9dd83" +checksum = "7728a72c4c7d72665fde02204bcbd93b247721025b222ef78606f14513e0fd03" dependencies = [ "bytes 1.0.1", "futures-channel", @@ -2963,9 +3013,9 @@ dependencies = [ [[package]] name = "instant" -version = "0.1.9" +version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61124eeebbd69b8190558df225adf7e4caafce0d743919e5d6b19652314ec5ec" +checksum = "bee0328b1209d157ef001c94dd85b4f8f64139adb0eac2659f4b08382b2f474d" dependencies = [ "cfg-if 1.0.0", ] @@ -3215,7 +3265,7 @@ dependencies = [ "beef", "futures-channel", "futures-util", - "hyper 0.14.9", + "hyper 0.14.10", "log", "serde", "serde_json", @@ -3331,9 +3381,9 @@ checksum = "3576a87f2ba00f6f106fdfcd16db1d698d648a26ad8e0573cad8537c3c362d2a" [[package]] name = "libc" -version = "0.2.97" +version = "0.2.98" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12b8adadd720df158f4d70dfe7ccc6adb0472d7c55ca83445f6a5ab3e36f8fb6" +checksum = "320cfe77175da3a483efed4bc0adc1968ca050b098ce4f2f1c13a56626128790" [[package]] name = "libloading" @@ -3819,7 +3869,7 @@ dependencies = [ "hmac-drbg", "rand 0.7.3", "sha2 0.8.2", - "subtle 2.4.0", + "subtle 2.4.1", "typenum", ] @@ -5160,9 +5210,9 @@ checksum = "be5e13c266502aadf83426d87d81a0f5d1ef45b8027f5a471c360abfe4bfae92" [[package]] name = "parity-ws" -version = "0.10.0" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e02a625dd75084c2a7024f07c575b61b782f729d18702dabb3cdbf31911dc61" +checksum = "322d72dfe461b8b9e367d057ceace105379d64d5b03907d23c481ccf3fbf8aa4" dependencies = [ "byteorder", "bytes 0.4.12", @@ -5423,56 +5473,6 @@ version = "0.3.19" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3831453b3449ceb48b6d9c7ad7c96d5ea673e9b470a1dc578c2ce6521230884c" -[[package]] -name = "plasm-collator" -version = "2.1.0" -dependencies = [ - "cumulus-client-cli", - "cumulus-client-consensus-relay-chain", - "cumulus-client-network", - "cumulus-client-service", - "cumulus-primitives-core", - "cumulus-primitives-parachain-inherent", - "frame-system", - "hex", - "jsonrpc-core", - "lazy_static", - "log", - "pallet-transaction-payment", - "parity-scale-codec", - "polkadot-cli", - "polkadot-parachain", - "polkadot-primitives", - "polkadot-service", - "sc-basic-authorship", - "sc-chain-spec", - "sc-cli", - "sc-client-api", - "sc-client-db", - "sc-consensus", - "sc-consensus-babe", - "sc-executor", - "sc-network", - "sc-offchain", - "sc-rpc", - "sc-service", - "sc-telemetry", - "sc-tracing", - "sc-transaction-pool", - "serde", - "shiden-runtime", - "sp-consensus", - "sp-core", - "sp-inherents", - "sp-runtime", - "sp-timestamp", - "sp-transaction-pool", - "sp-trie", - "structopt", - "substrate-build-script-utils", - "vergen", -] - [[package]] name = "platforms" version = "1.1.0" @@ -7033,6 +7033,15 @@ dependencies = [ "semver 0.9.0", ] +[[package]] +name = "rustc_version" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0dfe2087c51c460008730de8b57e6a320782fbfb312e1f4d520e6c6fae155ee" +dependencies = [ + "semver 0.11.0", +] + [[package]] name = "rustc_version" version = "0.4.0" @@ -7681,7 +7690,7 @@ dependencies = [ "sp-application-crypto", "sp-core", "sp-keystore", - "subtle 2.4.0", + "subtle 2.4.1", ] [[package]] @@ -8134,13 +8143,13 @@ checksum = "021b403afe70d81eea68f6ea12f6b3c9588e5d536a94c3bf80f15e7faa267862" dependencies = [ "arrayref", "arrayvec 0.5.2", - "curve25519-dalek 2.1.2", + "curve25519-dalek 2.1.3", "getrandom 0.1.16", "merlin", "rand 0.7.3", "rand_core 0.5.1", "sha2 0.8.2", - "subtle 2.4.0", + "subtle 2.4.1", "zeroize", ] @@ -8335,9 +8344,9 @@ dependencies = [ [[package]] name = "sha-1" -version = "0.9.6" +version = "0.9.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c4cfa741c5832d0ef7fab46cabed29c2aae926db0b11bb2069edd8db5e64e16" +checksum = "1a0c8611594e2ab4ebbf06ec7cbbf0a99450b8570e96cbf5188b5d5f6ef18d81" dependencies = [ "block-buffer 0.9.0", "cfg-if 1.0.0", @@ -8394,7 +8403,7 @@ dependencies = [ [[package]] name = "shiden-runtime" -version = "2.1.0" +version = "2.2.0" dependencies = [ "cumulus-pallet-parachain-system", "cumulus-pallet-xcm", @@ -8405,14 +8414,17 @@ dependencies = [ "frame-system", "frame-system-rpc-runtime-api", "pallet-balances", + "pallet-identity", "pallet-sudo", "pallet-transaction-payment", "pallet-transaction-payment-rpc-runtime-api", + "pallet-utility", "pallet-vesting", "parachain-info", "parity-scale-codec", "polkadot-parachain", "serde", + "smallvec 1.6.1", "sp-api", "sp-block-builder", "sp-core", @@ -8539,7 +8551,7 @@ dependencies = [ "ring", "rustc_version 0.2.3", "sha2 0.9.5", - "subtle 2.4.0", + "subtle 2.4.1", "x25519-dalek", ] @@ -8577,7 +8589,7 @@ dependencies = [ "httparse", "log", "rand 0.7.3", - "sha-1 0.9.6", + "sha-1 0.9.7", ] [[package]] @@ -8592,7 +8604,7 @@ dependencies = [ "httparse", "log", "rand 0.8.4", - "sha-1 0.9.6", + "sha-1 0.9.7", ] [[package]] @@ -9519,9 +9531,9 @@ checksum = "2d67a5a62ba6e01cb2192ff309324cb4875d0c451d55fe2319433abe7a05a8ee" [[package]] name = "subtle" -version = "2.4.0" +version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e81da0851ada1f3e9d4312c704aa4f8806f0f9d69faaf8df2f3464b4a9437c2" +checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" [[package]] name = "syn" @@ -9536,9 +9548,9 @@ dependencies = [ [[package]] name = "synstructure" -version = "0.12.4" +version = "0.12.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b834f2d66f734cb897113e34aaff2f1ab4719ca946f9a7358dba8f8064148701" +checksum = "474aaa926faa1603c40b7885a9eaea29b444d1cb2850cb7c0e37bb1a4182f4fa" dependencies = [ "proc-macro2", "quote", @@ -9560,9 +9572,9 @@ checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" [[package]] name = "target-lexicon" -version = "0.12.0" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64ae3b39281e4b14b8123bdbaddd472b7dfe215e444181f2f9d2443c2444f834" +checksum = "b0652da4c4121005e9ed22b79f6c5f2d9e2752906b53a33e9490489ba421a6fb" [[package]] name = "tempfile" @@ -10270,7 +10282,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8326b2c654932e3e4f9196e69d08fdf7cfd718e1dc6f66b347e6024a0c961402" dependencies = [ "generic-array 0.14.4", - "subtle 2.4.0", + "subtle 2.4.1", ] [[package]] @@ -10968,9 +10980,9 @@ dependencies = [ [[package]] name = "zeroize" -version = "1.3.0" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4756f7db3f7b5574938c3eb1c117038b8e07f95ee6718c0efad4ac21508f1efd" +checksum = "eeafe61337cb2c879d328b74aa6cd9d794592c82da6be559fdf11493f02a2d18" dependencies = [ "zeroize_derive", ] diff --git a/Cargo.toml b/Cargo.toml index 75cd953086..c00cacc14c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,5 +9,5 @@ exclude = [ ] [profile.release] -# Plasm runtime requires unwinding. +# Astar runtime requires unwinding. panic = "unwind" diff --git a/LICENSE b/LICENSE index f288702d2f..91d264cd14 100644 --- a/LICENSE +++ b/LICENSE @@ -652,7 +652,7 @@ Also add information on how to contact you by electronic and paper mail. If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode: - Copyright (C) + Astar Copyright (C) 2019 Stake Technologies Inc. This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. diff --git a/README.md b/README.md index cbb8359186..f868ba52ae 100644 --- a/README.md +++ b/README.md @@ -1,143 +1,34 @@ -
plasm_web3
+# Astar Network · [![GitHub license](https://img.shields.io/badge/license-GPLv3-blue)](#LICENSE) [![CI Status](https://github.com/PlasmNetwork/Astar/workflows/Integration/badge.svg)](https://github.com/PlasmNetwork/Astar/actions) -[![CI](https://github.com/staketechnologies/Plasm/workflows/Integration/badge.svg)](https://github.com/staketechnologies/Plasm/actions) +

+ +

-Our mission is to build a scalable infrastructure for Web3.0. The Plasm Network will be the leading scalable smart contract network on Polkadot, supporting cutting-edge layer 2 solutions, such as Plasma, State Channels and Rollups. +Astar Network is a dApps hub on Polkadot with unique features like dApps Staking, supporting mulit-virtual machine (EVM & WAsM), and offers layer2 solutions from day 1. Shiden Network is our sister network on Kusama. -Documentation ----------- +## Trying it out -* [Documentation](https://docs.plasmnet.io/) -* [Slide Deck](https://drive.google.com/file/d/1V6GlROaK4Thk7FMUCnepCAGwAMM_f9QR/view?usp=sharing) +Simply go to [docs.astar.network](https://docs.astar.network) and follow the +[installation](https://docs.astar.network/build/smart-contracts) instructions. You can +also try out one of the [core features](https://docs.astar.network/learn/core-features). -Whitepaper ----------- +## Contributing -* [Whitepaper](https://github.com/staketechnologies/plasmdocs/blob/master/wp/en.pdf) -* [Whitepaper(JP)](https://github.com/staketechnologies/plasmdocs/blob/master/wp/jp.pdf) +Currently, we have 2 production networks: -Community ---------- +- [Astar Network](https://astar.network/): formerly known as Plasm Network, and our future Parachain on Polkadot Network +- [Shiden Network](https://shiden.astar.network/): Parachain of Kusama Network and our canary release for Astar Network -* Common group: [Telegram](https://t.me/PlasmOfficial) -* Technical group: [Discord](https://discord.gg/Z3nC9U4) -* Subscribe on [Twitter](https://twitter.com/Plasm_Network) +And 2 test networks: -Table of Contents ------------------ +- [Dusty Network](https://github.com/PlasmNetwork/Astar/tree/development/dusty): an independent test network with the latest cutting edge features before it is introduced to Astar Network +- [Shibuya Network](https://github.com/PlasmNetwork/Astar/tree/development/shibuya): a Parachain test network with the latest cutting edge features related to XMCP, collators, and other cross chain operations that is planned to be rolled out to Shiden Network -* [Introduction](https://github.com/staketechnologies/Plasm/tree/master#introduction) -* [Install Plasm](https://github.com/staketechnologies/Plasm/tree/master#install-plasm) -* [Plasm Validator Program](https://github.com/staketechnologies/Plasm/tree/master#plasm-validator-program) -* [Examples](https://github.com/staketechnologies/Plasm/tree/master#examples) +In the future we will gradually change this structure to have a single test network. +For details, please read the [Contribution Guidelines](./CONTRIBUTING.md). -Introduction -============ +If you would like to be the validator, please check out [our tutorial](https://docs.astar.network/build/validator-guide) and join [Discord tech channel](https://discord.gg/wUcQt3R). -Plasm Network is a scalable and interoperable infrastructure for Web3.0. Since Plasm Network is built with [Parity’s Substrate framework](https://www.substrate.io/), it can be a future [Polkadot](https://polkadot.network/) Parachain that also acts as a scalable smart contract platform. The Polkadot Relaychain, by design, does not support smart contracts. This allows Plasm the opportunity to fill in this gap. Scalability is obviously one of the most crucial demands DApp developers have. Ideally, the developers can build whatever applications on Plasm Network without having to consider its scalability. +## LICENSE -Based on the above, Plasm has some features. -- **[Optimistic Virtual Machine](https://docs.plasmnet.io/learn/optimistic-virtual-machine)** -- **[DApps Reward](https://docs.plasmnet.io/learn/dapps-reward)** -- **[Operator Trading](https://docs.plasmnet.io/learn/operator-trading)** -- **[Lockdrop](https://docs.plasmnet.io/learn/lockdrop)** - -Once Polkadot is launched, we will connect our root chain to Polkadot, and we aim to be one of the parachains. -vision - -Install Plasm -============= - -* Plasm node binaries [releases](https://github.com/staketechnologies/Plasm/releases). -* Node [custom types](https://github.com/staketechnologies/Plasm/tree/master/bin/node/cli/res/custom_types.json). - -> Latest version you can try to build from source. - -Building from source --------------------- - -Ensure you have Rust and the support software: - - curl https://sh.rustup.rs -sSf | sh - # on Windows download and run rustup-init.exe - # from https://rustup.rs instead - - rustup update nightly - rustup target add wasm32-unknown-unknown --toolchain nightly - -You will also need to install the following dependencies: - -* Linux: `sudo apt install cmake git clang libclang-dev build-essential` -* Mac: `brew install cmake git llvm` -* Windows: Download and install the Pre Build Windows binaries of LLVM from http://releases.llvm.org/download.html - -Install additional build tools: - - cargo +nightly install --git https://github.com/alexcrichton/wasm-gc - -Install the Plasm node from git source: - - cargo +nightly install --locked --force --git https://github.com/staketechnologies/Plasm --tag v1.5.0-dusty plasm-cli - -Run node on [Dusty Network](https://telemetry.polkadot.io/#list/Dusty): - - plasm-node - -Or run on your local development network: - - plasm-node --dev - -Building with Nix ------------------ - -Install Nix package manager: - - curl https://nixos.org/nix/install | sh - -Run on your Nix shell: - - git clone https://github.com/staketechnologies/Plasm && cd Plasm - nix-shell nix/shell.nix --run "cargo run --release" - -Plasm Validator Program -======================= - -Currently, we have 2 networks, [Dusty Network](https://telemetry.polkadot.io/#list/Dusty) and [Plasm Network](https://telemetry.polkadot.io/#list/Plasm). Dusty is our canary R&D chain like Kusama. The stable validators on Dusty can be the first validators on Plasm mainnet. We are looking for 100 validators on the Plasm Network. - -If you would like to be the validator, please check out [our tutorial](https://docs.plasmnet.io/workshop-and-tutorial/untitled) and join [Discord tech channel](https://discord.gg/wUcQt3R) - -Examples -======== - -You can see our demo and presentation: -* [Version1](https://www.youtube.com/watch?v=T70iEgyuXbw&feature=youtu.be): 2019/04/25 CLI Demo -* [Version2](https://youtu.be/5MoO3Epgvv0): 2019/05/22 UI Demo No explanations yet. -* [Subzero Summit](https://www.youtube.com/watch?v=OyKvA_vx1z0): 2020/04 Presentation at Subzero Summit -* [DOT CON][https://www.youtube.com/watch?v=og0yUFdYyLY]: 2019/10 Presentation at DOT CON - -Future Works ------------- -Here are the key milestones. - -1. Start the 2nd Lockdrop on Dusty Network (July) -1. Start the 2nd Lockdrop on Plasm Network (August) -1. Support the Optimistic Virtual Machine (September to October) -1. Start the 3nd Lockdrop on Plasm Network (During Polkadot Parachain Auction) -1. Start the 3nd Lockdrop on Plasm Network (During Polkadot Parachain Auction) -1. Become a Polkadot Parachain. (TBA) - -If you have any questions, please ask us on [Discord](https://discord.gg/Z3nC9U4) - -Contacts --------- - -**Maintainers** - -* [Public_Sate](https://twitter.com/public_sate) -* [Task Ohmori](https://twitter.com/taskooh?lang=en) -* [Aleksandr Krupenkin](https://github.com/akru) -* [Sota Watanabe](https://twitter.com/WatanabeSota) - -* * * - -Plasm is licensed under the GPLv3.0 by Stake Technologies Inc. +Astar is licensed under the GPLv3.0 by Stake Technologies Inc. diff --git a/bin/collator/Cargo.toml b/bin/collator/Cargo.toml index 102ec5d1bc..f1e6327cbe 100644 --- a/bin/collator/Cargo.toml +++ b/bin/collator/Cargo.toml @@ -1,16 +1,15 @@ [package] -name = "plasm-collator" -version = "2.1.0" +name = "astar-collator" +version = "2.2.0" authors = ["Stake Technologies "] -description = "Plasm node implementation in Rust." +description = "Astar collator implementation in Rust." build = "build.rs" edition = "2018" -default-run = "plasm-collator" +default-run = "astar-collator" [[bin]] -name = "plasm-collator" +name = "astar-collator" path = "bin/main.rs" -required-features = ["cli"] [lib] crate-type = ["cdylib", "rlib"] @@ -52,7 +51,7 @@ sc-consensus-babe = { git = "https://github.com/paritytech/substrate", branch = # RPC related dependencies jsonrpc-core = "15.1.0" -# plasm-specific dependencies +# astar-specific dependencies shiden-runtime = { path = "../../runtime/shiden" } # frame dependencies @@ -85,8 +84,7 @@ structopt = { version = "0.3.8", optional = true } vergen = { version = "3.0.4", optional = true } [features] -default = ["cli"] -cli = [ +default = [ "sc-cli", "polkadot-cli", "sc-service", diff --git a/bin/collator/bin/main.rs b/bin/collator/bin/main.rs index 75b52128e7..dde53fff83 100644 --- a/bin/collator/bin/main.rs +++ b/bin/collator/bin/main.rs @@ -1,7 +1,7 @@ -//! Plasm Parachain Collator. +//! Astar collator binary. #![warn(missing_docs)] fn main() -> Result<(), sc_cli::Error> { - plasm_collator::run() + astar_collator::run() } diff --git a/bin/collator/src/command.rs b/bin/collator/src/command.rs index 74bb86e56e..7fba12b05c 100644 --- a/bin/collator/src/command.rs +++ b/bin/collator/src/command.rs @@ -85,7 +85,7 @@ impl SubstrateCli for RelayChainCli { "Shiden parachain collator\n\nThe command-line arguments provided first will be \ passed to the parachain node, while the arguments provided after -- will be passed \ to the relaychain node.\n\n\ - plasm-collator [parachain-args] -- [relaychain-args]" + astar-collator [parachain-args] -- [relaychain-args]" .into() } @@ -94,7 +94,7 @@ impl SubstrateCli for RelayChainCli { } fn support_url() -> String { - "https://github.com/staketechnologies/Plasm/issues/new".into() + "https://github.com/AstarNetwork/Astar/issues/new".into() } fn copyright_start_year() -> i32 { diff --git a/bin/collator/src/lib.rs b/bin/collator/src/lib.rs index 4de97e70b8..5a3b642e9b 100644 --- a/bin/collator/src/lib.rs +++ b/bin/collator/src/lib.rs @@ -1,4 +1,4 @@ -//! Plasm CLI library. +//! Astar collator library. #![warn(missing_docs)] #![warn(unused_extern_crates)] @@ -10,12 +10,8 @@ pub mod chain_spec; #[macro_use] mod service; -#[cfg(feature = "cli")] mod cli; -#[cfg(feature = "cli")] mod command; -#[cfg(feature = "cli")] pub use cli::*; -#[cfg(feature = "cli")] pub use command::*; diff --git a/runtime/shiden/Cargo.toml b/runtime/shiden/Cargo.toml index 6626e9592b..370da58583 100644 --- a/runtime/shiden/Cargo.toml +++ b/runtime/shiden/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "shiden-runtime" -version = "2.1.0" +version = "2.2.0" authors = ["Stake Technologies "] edition = "2018" build = "build.rs" @@ -9,6 +9,7 @@ build = "build.rs" # third-party dependencies serde = { version = "1.0.106", optional = true } codec = { package = "parity-scale-codec", version = "2.0", default-features = false, features = ["derive"] } +smallvec = "1.6.1" # primitives sp-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.7", default-features = false } @@ -27,6 +28,8 @@ sp-version = { git = "https://github.com/paritytech/substrate", branch = "polkad # frame dependencies frame-executive = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.7", default-features = false } pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.7", default-features = false } +pallet-identity = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.7", default-features = false } +pallet-utility = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.7", default-features = false } pallet-vesting = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.7", default-features = false } pallet-sudo = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.7", default-features = false } frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.7", default-features = false } @@ -71,6 +74,8 @@ std = [ "frame-system/std", "frame-system-rpc-runtime-api/std", "pallet-balances/std", + "pallet-identity/std", + "pallet-utility/std", "pallet-vesting/std", "sp-offchain/std", "sp-session/std", diff --git a/runtime/shiden/src/lib.rs b/runtime/shiden/src/lib.rs index a812426b6d..0e1fc7c8ac 100644 --- a/runtime/shiden/src/lib.rs +++ b/runtime/shiden/src/lib.rs @@ -9,7 +9,8 @@ use frame_support::{ traits::Filter, weights::{ constants::{BlockExecutionWeight, ExtrinsicBaseWeight, WEIGHT_PER_SECOND}, - DispatchClass, IdentityFee, Weight, + DispatchClass, Weight, WeightToFeeCoefficient, WeightToFeeCoefficients, + WeightToFeePolynomial, }, }; use frame_system::limits::{BlockLength, BlockWeights}; @@ -26,6 +27,7 @@ use sp_runtime::{ ApplyExtrinsicResult, FixedPointNumber, Perbill, Perquintill, }; use sp_std::prelude::*; + #[cfg(any(feature = "std", test))] use sp_version::NativeVersion; use sp_version::RuntimeVersion; @@ -66,7 +68,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_name: create_runtime_str!("shiden"), impl_name: create_runtime_str!("shiden"), authoring_version: 1, - spec_version: 2, + spec_version: 3, impl_version: 0, apis: RUNTIME_API_VERSIONS, transaction_version: 1, @@ -87,11 +89,11 @@ const AVERAGE_ON_INITIALIZE_RATIO: Perbill = Perbill::from_percent(10); /// We allow `Normal` extrinsics to fill up the block up to 75%, the rest can be used /// by Operational extrinsics. const NORMAL_DISPATCH_RATIO: Perbill = Perbill::from_percent(75); -/// We allow for 2 seconds of compute with a 6 second average block time. -const MAXIMUM_BLOCK_WEIGHT: Weight = 2 * WEIGHT_PER_SECOND; +/// We allow for 0.5 seconds of compute with a 6 second average block time. +const MAXIMUM_BLOCK_WEIGHT: Weight = WEIGHT_PER_SECOND / 2; parameter_types! { - pub const BlockHashCount: BlockNumber = 250; + pub const BlockHashCount: BlockNumber = 2400; pub const Version: RuntimeVersion = VERSION; pub RuntimeBlockLength: BlockLength = BlockLength::max_with_normal_ratio(5 * 1024 * 1024, NORMAL_DISPATCH_RATIO); @@ -167,6 +169,36 @@ impl frame_system::Config for Runtime { type OnSetCode = cumulus_pallet_parachain_system::ParachainSetCode; } +parameter_types! { + pub const BasicDeposit: Balance = 10 * SDN; // 258 bytes on-chain + pub const FieldDeposit: Balance = 25 * MILLISDN; // 66 bytes on-chain + pub const SubAccountDeposit: Balance = 2 * SDN; // 53 bytes on-chain + pub const MaxSubAccounts: u32 = 100; + pub const MaxAdditionalFields: u32 = 100; + pub const MaxRegistrars: u32 = 20; +} + +impl pallet_identity::Config for Runtime { + type Event = Event; + type Currency = Balances; + type BasicDeposit = BasicDeposit; + type FieldDeposit = FieldDeposit; + type SubAccountDeposit = SubAccountDeposit; + type MaxSubAccounts = MaxSubAccounts; + type MaxAdditionalFields = MaxAdditionalFields; + type MaxRegistrars = MaxRegistrars; + type Slashed = (); + type ForceOrigin = frame_system::EnsureRoot<::AccountId>; + type RegistrarOrigin = frame_system::EnsureRoot<::AccountId>; + type WeightInfo = (); +} + +impl pallet_utility::Config for Runtime { + type Event = Event; + type Call = Call; + type WeightInfo = (); +} + parameter_types! { // We do anything the parent chain tells us in this runtime. pub const ReservedDmpWeight: Weight = MAXIMUM_BLOCK_WEIGHT / 2; @@ -262,16 +294,42 @@ impl pallet_vesting::Config for Runtime { } parameter_types! { - pub const TransactionByteFee: Balance = 10 * MILLISDN; + pub const TransactionByteFee: Balance = MILLISDN / 100; pub const TargetBlockFullness: Perquintill = Perquintill::from_percent(25); pub AdjustmentVariable: Multiplier = Multiplier::saturating_from_rational(1, 100_000); pub MinimumMultiplier: Multiplier = Multiplier::saturating_from_rational(1, 1_000_000_000u128); } +/// Handles converting a weight scalar to a fee value, based on the scale and granularity of the +/// node's balance type. +/// +/// This should typically create a mapping between the following ranges: +/// - [0, MAXIMUM_BLOCK_WEIGHT] +/// - [Balance::min, Balance::max] +/// +/// Yet, it can be used for any other sort of change to weight-fee. Some examples being: +/// - Setting it to `0` will essentially disable the weight fee. +/// - Setting it to `1` will cause the literal `#[weight = x]` values to be charged. +pub struct WeightToFee; +impl WeightToFeePolynomial for WeightToFee { + type Balance = Balance; + fn polynomial() -> WeightToFeeCoefficients { + // in Shiden, extrinsic base weight (smallest non-zero weight) is mapped to 1/10 mSDN: + let p = MILLISDN; + let q = 10 * Balance::from(ExtrinsicBaseWeight::get()); + smallvec::smallvec![WeightToFeeCoefficient { + degree: 1, + negative: false, + coeff_frac: Perbill::from_rational(p % q, q), + coeff_integer: p / q, + }] + } +} + impl pallet_transaction_payment::Config for Runtime { type OnChargeTransaction = pallet_transaction_payment::CurrencyAdapter; type TransactionByteFee = TransactionByteFee; - type WeightToFee = IdentityFee; + type WeightToFee = WeightToFee; type FeeMultiplierUpdate = TargetedFeeAdjustment; } @@ -287,17 +345,20 @@ construct_runtime!( NodeBlock = generic::Block, UncheckedExtrinsic = UncheckedExtrinsic { - System: frame_system::{Pallet, Call, Storage, Config, Event}, - TransactionPayment: pallet_transaction_payment::{Pallet, Storage}, - Sudo: pallet_sudo::{Pallet, Call, Storage, Event, Config}, + System: frame_system::{Pallet, Call, Storage, Config, Event} = 10, + Utility: pallet_utility::{Pallet, Call, Event} = 11, + Identity: pallet_identity::{Pallet, Call, Storage, Event} = 12, - ParachainSystem: cumulus_pallet_parachain_system::{Pallet, Call, Storage, Inherent, Event, ValidateUnsigned} = 20, + ParachainSystem: cumulus_pallet_parachain_system::{Pallet, Call, Storage, Inherent, Event} = 20, ParachainInfo: parachain_info::{Pallet, Storage, Config} = 21, - Balances: pallet_balances::{Pallet, Call, Storage, Config, Event} = 30, - Vesting: pallet_vesting::{Pallet, Call, Storage, Config, Event} = 31, + TransactionPayment: pallet_transaction_payment::{Pallet, Storage} = 30, + Balances: pallet_balances::{Pallet, Call, Storage, Config, Event} = 31, + Vesting: pallet_vesting::{Pallet, Call, Storage, Config, Event} = 32, CumulusXcm: cumulus_pallet_xcm::{Pallet, Call, Event, Origin} = 50, + + Sudo: pallet_sudo::{Pallet, Call, Storage, Event, Config} = 99, } ); diff --git a/third-party/nix/release.nix b/third-party/nix/release.nix index f3128faa8a..f9ebd2546a 100644 --- a/third-party/nix/release.nix +++ b/third-party/nix/release.nix @@ -3,7 +3,7 @@ let pkgs = import { overlays = [ moz_overlay ]; }; - channel = pkgs.rustChannelOf { date = "2021-03-23"; channel = "nightly"; }; + channel = pkgs.rustChannelOf { date = "2021-06-29"; channel = "nightly"; }; in { inherit pkgs; rust-nightly = channel.rust.override { diff --git a/third-party/systemd/oracle.service b/third-party/systemd/oracle.service deleted file mode 100644 index 0999e45332..0000000000 --- a/third-party/systemd/oracle.service +++ /dev/null @@ -1,14 +0,0 @@ -[Unit] -Description=Plasm lockdrop oracle service -After=network-online.target -Wants=network-online.target - -[Service] -Type=simple -RemainAfterExit=no -Restart=on-failure -RestartSec=5s -ExecStart=/usr/local/bin/plasm-node oracle --ethereum-endpoint https://ropsten.infura.io/v3/ - -[Install] -WantedBy=multi-user.target diff --git a/third-party/systemd/plasm.service b/third-party/systemd/plasm.service index 1c35b0117d..91f610c4b9 100644 --- a/third-party/systemd/plasm.service +++ b/third-party/systemd/plasm.service @@ -1,5 +1,5 @@ [Unit] -Description=Plasm validator service +Description=Astar node service After=network-online.target Wants=network-online.target @@ -8,7 +8,8 @@ Type=simple RemainAfterExit=no Restart=on-failure RestartSec=5s -ExecStart=/usr/local/bin/plasm-node --name plasm-validator --validator +User=astar +ExecStart=/usr/local/bin/astar-collator [Install] WantedBy=multi-user.target