difftreelog
Merge branch 'develop' into tests/parallel-ci
in: master
15 files changed
.docker/Dockerfile-try-runtimediffbeforeafterboth--- a/.docker/Dockerfile-try-runtime
+++ b/.docker/Dockerfile-try-runtime
@@ -46,5 +46,4 @@
echo "Fork from: $REPLICA_FROM\n" && \
cargo build --features=$FEATURE --release
-
-CMD cargo run --features=try-runtime,$FEATURE --release -- try-runtime on-runtime-upgrade live --uri $REPLICA_FROM
+CMD cargo run --features=try-runtime,$FEATURE --release -- try-runtime --no-spec-name-check on-runtime-upgrade live --uri $REPLICA_FROM
.github/workflows/market-test_v2.ymldiffbeforeafterboth--- a/.github/workflows/market-test_v2.yml
+++ b/.github/workflows/market-test_v2.yml
@@ -91,12 +91,20 @@
rm -rf .env
cp .env.docker .env
+# Temporary disable node readyness check. Have to dig into the script logic.
+# - name: Wait for chain up and running
+# working-directory: tests
+# run: |
+# yarn install
+# node scripts/readyness.js
+# echo "Ready to start tests"
+# env:
+# RPC_URL: http://127.0.0.1:9933/
+
- name: Wait for chain up and running
- working-directory: tests
run: |
- yarn install
- node scripts/readyness.js
- echo "Ready to start tests"
+ sleep 1200s
+ echo "Ready to start Market e2e tests"
- name: Show content of .env file and Generate accounts
working-directory: qa-tests
@@ -184,7 +192,6 @@
- name: Clean Workspace
if: always()
uses: AutoModality/action-clean@v1.1.0
-
.github/workflows/node-only-update_v2.ymldiffbeforeafterboth164162165 - name: Run tests before Node Parachain upgrade163 - name: Run tests before Node Parachain upgrade166 working-directory: ${{ matrix.mainnet_branch }}/tests164 working-directory: ${{ matrix.mainnet_branch }}/tests167 run: |165 run: |168 yarn install166 yarn install169 yarn add mochawesome167 yarn add mochawesome170 echo "Ready to start tests"168 echo "Ready to start tests"171 yarn polkadot-types169 yarn polkadot-types172 NOW=$(date +%s) && yarn test --reporter mochawesome --reporter-options reportFilename=test-${NOW}170 NOW=$(date +%s) && yarn test --reporter mochawesome --reporter-options reportFilename=test-before-${NOW}173 env:171 env:174 RPC_URL: http://127.0.0.1:9933/172 RPC_URL: http://127.0.0.1:9933/175173179 if: success() || failure() # run this step even if previous step failed177 if: success() || failure() # run this step even if previous step failed180 with:178 with:181 name: Tests before node upgrade ${{ matrix.network }} # Name of the check run which will be created179 name: Tests before node upgrade ${{ matrix.network }} # Name of the check run which will be created182 path: ${{ matrix.mainnet_branch }}/tests/mochawesome-report/test-*.json # Path to test results180 path: ${{ matrix.mainnet_branch }}/tests/mochawesome-report/test-before-*.json # Path to test results183 reporter: mochawesome-json181 reporter: mochawesome-json184 fail-on-error: 'false'182 fail-on-error: 'false'185225 222 226 - name: Send SIGUSR1 to polkadot-launch process223 - name: Send SIGUSR1 to polkadot-launch process227 if: success() || failure()224 if: success() || failure()228 run: |225 run: |229 #Get PID of polkadot-launch226 #Get PID of polkadot-launch230 ContainerID=$(docker ps -aqf "name=node-parachain")227 ContainerID=$(docker ps -aqf "name=node-parachain")231 PID=$(docker exec node-parachain pidof 'polkadot-launch')228 PID=$(docker exec node-parachain pidof 'polkadot-launch')232 echo "Polkadot-launch PID: $PID"229 sleep 30s230 echo -e "Show logs of node-parachain container.\n"231 docker logs ${ContainerID}232 echo -e "\n"233 #Send SIGUSR1 signal to $PID233 echo -e "Restart polkadot-launch process: $PID\n"234 docker exec node-parachain kill -SIGUSR1 ${PID}234 docker exec node-parachain kill -SIGUSR1 ${PID}235 echo "SIGUSR1 sent to Polkadot-launch PID: $PID"235 echo "SIGUSR1 sent to Polkadot-launch PID: $PID"236 docker logs ${ContainerID}236 docker logs ${ContainerID}237 237 238 - name: Get chain logs in case of docker image crashed after Polkadot Launch restart238 - name: Get chain logs in case of docker image crashed after Polkadot Launch restart239 if: failure() # run this step only at failure239 if: failure() # run this step only at failure245 docker exec node-parachain cat /polkadot-launch/dave.log245 docker exec node-parachain cat /polkadot-launch/dave.log246 docker exec node-parachain cat /polkadot-launch/charlie.log 246 docker exec node-parachain cat /polkadot-launch/charlie.log 247247248 # 🌗 All parachain collators restarted with the new binaries.249 - name: Check if docker logs consist messages related to testing of Node Parachain Upgrade.248 - name: Check if docker logs consist messages related to testing of Node Parachain Upgrade.250 if: success()249 if: success()251 run: |250 run: |294 ## TODO: Remove next two blocks before switch to Parrallel & Sequental tests. Uncoment commented blocks.293 ## TODO: Remove next two blocks before switch to Parrallel & Sequental tests. Uncoment commented blocks.295 - name: Run tests after Node Parachain upgrade294 - name: Run tests after Node Parachain upgrade296 working-directory: ${{ matrix.mainnet_branch }}/tests295 working-directory: ${{ matrix.mainnet_branch }}/tests297 run: |296 run: |298 yarn install297 yarn install299 yarn add mochawesome298 yarn add mochawesome300 node scripts/readyness.js299 echo "Ready to start tests"301 echo "Ready to start tests"300 yarn polkadot-types302 yarn polkadot-types301 NOW=$(date +%s) && yarn test --reporter mochawesome --reporter-options reportFilename=test-after-${NOW}303 NOW=$(date +%s) && yarn test --reporter mochawesome --reporter-options reportFilename=test-${NOW}304 env:302 env:305 RPC_URL: http://127.0.0.1:9933/303 RPC_URL: http://127.0.0.1:9933/306304310 if: success() || failure() # run this step even if previous step failed308 if: success() || failure() # run this step even if previous step failed311 with:309 with:312 name: Tests after node upgrade ${{ matrix.network }} # Name of the check run which will be created310 name: Tests after node upgrade ${{ matrix.network }} # Name of the check run which will be created313 path: ${{ matrix.mainnet_branch }}/tests/mochawesome-report/test-*.json # Path to test results311 path: ${{ matrix.mainnet_branch }}/tests/mochawesome-report/test-after-*.json # Path to test results314 reporter: mochawesome-json312 reporter: mochawesome-json315 fail-on-error: 'false'313 fail-on-error: 'false'316314Cargo.lockdiffbeforeafterboth--- a/Cargo.lock
+++ b/Cargo.lock
@@ -6711,6 +6711,24 @@
]
[[package]]
+name = "pallet-unique-scheduler-v2"
+version = "0.1.0"
+dependencies = [
+ "frame-benchmarking",
+ "frame-support",
+ "frame-system",
+ "log",
+ "pallet-preimage",
+ "parity-scale-codec 3.2.1",
+ "scale-info",
+ "sp-core",
+ "sp-io",
+ "sp-runtime",
+ "sp-std",
+ "substrate-test-utils",
+]
+
+[[package]]
name = "pallet-utility"
version = "4.0.0-dev"
source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe"
@@ -8576,7 +8594,7 @@
[[package]]
name = "quartz-runtime"
-version = "0.9.27"
+version = "0.9.29"
dependencies = [
"app-promotion-rpc",
"cumulus-pallet-aura-ext",
@@ -12568,7 +12586,7 @@
[[package]]
name = "unique-runtime"
-version = "0.9.27"
+version = "0.9.29"
dependencies = [
"app-promotion-rpc",
"cumulus-pallet-aura-ext",
README.mddiffbeforeafterboth--- a/README.md
+++ b/README.md
@@ -92,7 +92,7 @@
```
git clone https://github.com/paritytech/polkadot.git
cd polkadot
-git checkout release-v0.9.27
+git checkout release-v0.9.29
cargo build --release
```
runtime/common/construct_runtime/mod.rsdiffbeforeafterboth--- a/runtime/common/construct_runtime/mod.rs
+++ b/runtime/common/construct_runtime/mod.rs
@@ -57,8 +57,8 @@
Inflation: pallet_inflation::{Pallet, Call, Storage} = 60,
Unique: pallet_unique::{Pallet, Call, Storage, Event<T>} = 61,
- #[runtimes(opal)]
- Scheduler: pallet_unique_scheduler::{Pallet, Call, Storage, Event<T>} = 62,
+ // #[runtimes(opal)]
+ // Scheduler: pallet_unique_scheduler::{Pallet, Call, Storage, Event<T>} = 62,
Configuration: pallet_configuration::{Pallet, Call, Storage} = 63,
runtime/common/mod.rsdiffbeforeafterboth--- a/runtime/common/mod.rs
+++ b/runtime/common/mod.rs
@@ -20,7 +20,10 @@
pub mod ethereum;
pub mod instance;
pub mod runtime_apis;
+
+#[cfg(feature = "scheduler")]
pub mod scheduler;
+
pub mod sponsoring;
pub mod weights;
runtime/opal/Cargo.tomldiffbeforeafterboth--- a/runtime/opal/Cargo.toml
+++ b/runtime/opal/Cargo.toml
@@ -168,7 +168,7 @@
"pallet-foreign-assets/std"
]
limit-testing = ['pallet-unique/limit-testing', 'up-data-structs/limit-testing']
-opal-runtime = ['refungible', 'scheduler', 'rmrk', 'app-promotion', 'foreign-assets']
+opal-runtime = ['refungible', 'rmrk', 'app-promotion', 'foreign-assets']
refungible = []
scheduler = []
runtime/opal/src/lib.rsdiffbeforeafterboth--- a/runtime/opal/src/lib.rs
+++ b/runtime/opal/src/lib.rs
@@ -50,7 +50,7 @@
spec_name: create_runtime_str!(RUNTIME_NAME),
impl_name: create_runtime_str!(RUNTIME_NAME),
authoring_version: 1,
- spec_version: 927030,
+ spec_version: 929030,
impl_version: 0,
apis: RUNTIME_API_VERSIONS,
transaction_version: 2,
runtime/quartz/Cargo.tomldiffbeforeafterboth--- a/runtime/quartz/Cargo.toml
+++ b/runtime/quartz/Cargo.toml
@@ -10,7 +10,7 @@
license = 'GPLv3'
name = 'quartz-runtime'
repository = 'https://github.com/UniqueNetwork/unique-chain'
-version = '0.9.27'
+version = '0.9.29'
[package.metadata.docs.rs]
targets = ['x86_64-unknown-linux-gnu']
runtime/quartz/src/lib.rsdiffbeforeafterboth--- a/runtime/quartz/src/lib.rs
+++ b/runtime/quartz/src/lib.rs
@@ -50,7 +50,7 @@
spec_name: create_runtime_str!(RUNTIME_NAME),
impl_name: create_runtime_str!(RUNTIME_NAME),
authoring_version: 1,
- spec_version: 927030,
+ spec_version: 929030,
impl_version: 0,
apis: RUNTIME_API_VERSIONS,
transaction_version: 2,
runtime/unique/Cargo.tomldiffbeforeafterboth--- a/runtime/unique/Cargo.toml
+++ b/runtime/unique/Cargo.toml
@@ -10,7 +10,7 @@
license = 'GPLv3'
name = 'unique-runtime'
repository = 'https://github.com/UniqueNetwork/unique-chain'
-version = '0.9.27'
+version = '0.9.29'
[package.metadata.docs.rs]
targets = ['x86_64-unknown-linux-gnu']
runtime/unique/src/lib.rsdiffbeforeafterboth--- a/runtime/unique/src/lib.rs
+++ b/runtime/unique/src/lib.rs
@@ -50,7 +50,7 @@
spec_name: create_runtime_str!(RUNTIME_NAME),
impl_name: create_runtime_str!(RUNTIME_NAME),
authoring_version: 1,
- spec_version: 927030,
+ spec_version: 929030,
impl_version: 0,
apis: RUNTIME_API_VERSIONS,
transaction_version: 2,
tests/scripts/readyness.jsdiffbeforeafterboth--- a/tests/scripts/readyness.js
+++ b/tests/scripts/readyness.js
@@ -25,6 +25,7 @@
}
catch(e) {
await sleep(10000);
+ console.log(e);
}
}
}
tests/src/eth/proxyContract.test.tsdiffbeforeafterboth--- /dev/null
+++ b/tests/src/eth/proxyContract.test.ts
@@ -0,0 +1,152 @@
+// Copyright 2019-2022 Unique Network (Gibraltar) Ltd.
+// This file is part of Unique Network.
+
+// Unique Network is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+
+// Unique Network is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License
+// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.
+
+import {IKeyringPair} from '@polkadot/types/types';
+
+import {itEth, expect, usingEthPlaygrounds, EthUniqueHelper} from './util';
+
+describe('EVM payable contracts', () => {
+ let donor: IKeyringPair;
+
+ before(async function() {
+ await usingEthPlaygrounds(async (_, privateKey) => {
+ donor = await privateKey({filename: __filename});
+ });
+ });
+
+ itEth('Update proxy contract', async({helper}) => {
+ const deployer = await helper.eth.createAccountWithBalance(donor);
+ const caller = await helper.eth.createAccountWithBalance(donor);
+ const proxyContract = await deployProxyContract(helper, deployer);
+
+ const realContractV1 = await deployRealContractV1(helper, deployer);
+ const realContractV1proxy = new helper.web3!.eth.Contract(realContractV1.options.jsonInterface, proxyContract.options.address, {from: caller, gas: helper.eth.DEFAULT_GAS});
+ await proxyContract.methods.updateVersion(realContractV1.options.address).send();
+
+ await realContractV1proxy.methods.flip().send();
+ await realContractV1proxy.methods.flip().send();
+ await realContractV1proxy.methods.flip().send();
+ const value1 = await realContractV1proxy.methods.getValue().call();
+ const flipCount1 = await realContractV1proxy.methods.getFlipCount().call();
+ expect(flipCount1).to.be.equal('3');
+ expect(value1).to.be.equal(true);
+
+ const realContractV2 = await deployRealContractV2(helper, deployer);
+ const realContractV2proxy = new helper.web3!.eth.Contract(realContractV2.options.jsonInterface, proxyContract.options.address, {from: caller, gas: helper.eth.DEFAULT_GAS});
+ await proxyContract.methods.updateVersion(realContractV2.options.address).send();
+
+ await realContractV2proxy.methods.flip().send();
+ await realContractV2proxy.methods.flip().send();
+ await realContractV2proxy.methods.setStep(5).send();
+ await realContractV2proxy.methods.increaseFlipCount().send();
+ const value2 = await realContractV2proxy.methods.getValue().call();
+ const flipCount2 = await realContractV2proxy.methods.getFlipCount().call();
+ expect(value2).to.be.equal(true);
+ expect(flipCount2).to.be.equal('6');
+ });
+
+ async function deployProxyContract(helper: EthUniqueHelper, deployer: string) {
+ return await helper.ethContract.deployByCode(deployer, 'ProxyContract', `
+ // SPDX-License-Identifier: UNLICENSED
+ pragma solidity ^0.8.6;
+
+ contract ProxyContract {
+ event NewEvent(uint data);
+ receive() external payable {}
+ bytes32 private constant implementationSlot = bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1);
+ constructor() {}
+ function updateVersion(address newContractAddress) external {
+ bytes32 slot = implementationSlot;
+ assembly {
+ sstore(slot, newContractAddress)
+ }
+ }
+ fallback() external {
+ bytes32 slot = implementationSlot;
+ assembly {
+ let ptr := mload(0x40)
+ let contractAddress := sload(slot)
+
+ calldatacopy(ptr, 0, calldatasize())
+
+ let result := delegatecall(gas(), contractAddress, ptr, calldatasize(), 0, 0)
+ let size := returndatasize()
+
+ returndatacopy(ptr, 0, size)
+
+ switch result
+ case 0 { revert(ptr, size) }
+ default { return(ptr, size) }
+ }
+ }
+ }
+
+ interface RealContract {
+ function flip() external;
+ function getValue() external view returns (bool);
+ function getFlipCount() external view returns (uint);
+ }`);
+ }
+
+ async function deployRealContractV1(helper: EthUniqueHelper, deployer: string) {
+ return await helper.ethContract.deployByCode(deployer, 'RealContractV1', `
+ // SPDX-License-Identifier: UNLICENSED
+ pragma solidity ^0.8.6;
+
+ contract RealContractV1 {
+ bool value = false;
+ uint flipCount = 0;
+ function flip() external {
+ value = !value;
+ flipCount++;
+ }
+ function getValue() external view returns (bool) {
+ return value;
+ }
+ function getFlipCount() external view returns (uint) {
+ return flipCount;
+ }
+ }`);
+ }
+
+ async function deployRealContractV2(helper: EthUniqueHelper, deployer: string) {
+ return await helper.ethContract.deployByCode(deployer, 'RealContractV2', `
+ // SPDX-License-Identifier: UNLICENSED
+ pragma solidity ^0.8.6;
+
+ contract RealContractV2 {
+ bool value = false;
+ uint flipCount = 10;
+ uint step = 1;
+ function flip() external {
+ value = !value;
+ flipCount--;
+ }
+ function setStep(uint value) external {
+ step = value;
+ }
+ function increaseFlipCount() external {
+ flipCount = flipCount + step;
+ }
+ function getValue() external view returns (bool) {
+ return value;
+ }
+ function getFlipCount() external view returns (uint) {
+ return flipCount;
+ }
+ }`);
+ }
+});
\ No newline at end of file