Skip to content

Commit

Permalink
Merge pull request #1020 from UniqueNetwork/ci/node-only-xcm-fixes
Browse files Browse the repository at this point in the history
Node-only/xcm fixes
  • Loading branch information
CertainLach authored Oct 24, 2023
2 parents 35c1755 + 0e311d1 commit c7ac6d0
Show file tree
Hide file tree
Showing 22 changed files with 4,036 additions and 4,837 deletions.
4 changes: 2 additions & 2 deletions .baedeker/xcm-opal.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ local relay = {
spec: {Genesis:{
chain: relay_spec,
modify:: m.genericRelay($, hrmp = [
[$.parachains.opal.paraId, $.parachains.westmint.paraId, 8, 512],
[$.parachains.westmint.paraId, $.parachains.opal.paraId, 8, 512],
// [$.parachains.opal.paraId, $.parachains.westmint.paraId, 8, 512],
// [$.parachains.westmint.paraId, $.parachains.opal.paraId, 8, 512],
]),
}},
nodes: {
Expand Down
16 changes: 7 additions & 9 deletions .baedeker/xcm-quartz.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ local relay = {
spec: {Genesis:{
chain: relay_spec,
modify:: m.genericRelay($, hrmp = std.join([], [
[[$.parachains[a].paraId, $.parachains[b].paraId, 8, 512], [$.parachains[b].paraId, $.parachains[a].paraId, 8, 512]],
for [a, b] in [
['quartz', 'karura'],
['quartz', 'moonriver'],
['quartz', 'statemine'],
['quartz', 'shiden'],
]
// [[$.parachains[a].paraId, $.parachains[b].paraId, 8, 512], [$.parachains[b].paraId, $.parachains[a].paraId, 8, 512]],
// for [a, b] in [
// ['quartz', 'karura'],
// ['quartz', 'moonriver'],
// ['quartz', 'statemine'],
// ['quartz', 'shiden'],
// ]
])),
}},
nodes: {
Expand Down Expand Up @@ -60,7 +60,6 @@ local karura = {
[name]: {
bin: $.bin,
wantedKeys: 'para',
legacyRpc: true,
},
for name in ['alice', 'bob']
},
Expand All @@ -80,7 +79,6 @@ local moonriver = {
[name]: {
bin: $.bin,
wantedKeys: 'para-nimbus',
legacyRpc: true,
},
for name in ['alith', 'baltathar']
},
Expand Down
13 changes: 5 additions & 8 deletions .baedeker/xcm-unique.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ local relay = {
modify:: m.genericRelay($, hrmp = std.join([], [
[[$.parachains[a].paraId, $.parachains[b].paraId, 8, 512], [$.parachains[b].paraId, $.parachains[a].paraId, 8, 512]],
for [a, b] in [
['unique', 'acala'],
['unique', 'moonbeam'],
['unique', 'statemint'],
['unique', 'astar'],
['unique', 'polkadex'],
// ['unique', 'acala'],
// ['unique', 'moonbeam'],
// ['unique', 'statemint'],
// ['unique', 'astar'],
// ['unique', 'polkadex'],
]
])),
}},
Expand Down Expand Up @@ -61,7 +61,6 @@ local acala = {
[name]: {
bin: $.bin,
wantedKeys: 'para',
legacyRpc: true,
},
for name in ['alice', 'bob']
},
Expand All @@ -81,7 +80,6 @@ local moonbeam = {
[name]: {
bin: $.bin,
wantedKeys: 'para-nimbus',
legacyRpc: true,
},
for name in ['alith', 'baltathar']
},
Expand Down Expand Up @@ -116,7 +114,6 @@ local astar = {
[name]: {
bin: $.bin,
wantedKeys: 'para',
legacyRpc: true,
},
for name in ['alice', 'bob']
},
Expand Down
2 changes: 1 addition & 1 deletion .docker/Dockerfile-astar.j2
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,4 @@ RUN --mount=type=cache,target=/cargo-home/registry \
FROM ubuntu:22.04 as builder-astar

COPY --from=builder-astar-bin /unique_parachain/Astar/astar /bin/astar
ENTRYPOINT ["/bin/astar-collator"]
ENTRYPOINT ["/bin/astar"]
6 changes: 3 additions & 3 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ DESTINATION_SPEC_VERSION=v942057
POLKADOT_MAINNET_BRANCH=release-v1.0.0
STATEMINT_BUILD_BRANCH=release-parachains-v9430
ACALA_BUILD_BRANCH=2.21.0
MOONBEAM_BUILD_BRANCH=runtime-2501
MOONBEAM_BUILD_BRANCH=runtime-2500
ASTAR_BUILD_BRANCH=v5.18.0
UNIQUE_MAINNET_BRANCH=release-v943061
UNIQUE_REPLICA_FROM=wss://ws.unique.network:443
Expand All @@ -17,13 +17,13 @@ POLKADEX_BUILD_BRANCH=v1.1.0
KUSAMA_MAINNET_BRANCH=release-v1.0.0
STATEMINE_BUILD_BRANCH=release-parachains-v9430
KARURA_BUILD_BRANCH=release-karura-2.21.0
MOONRIVER_BUILD_BRANCH=runtime-2501
MOONRIVER_BUILD_BRANCH=runtime-2500
SHIDEN_BUILD_BRANCH=v5.18.0
QUARTZ_MAINNET_BRANCH=release-v943061
QUARTZ_REPLICA_FROM=wss://ws-quartz.unique.network:443

UNIQUEWEST_MAINNET_BRANCH=release-v1.0.0
WESTMINT_BUILD_BRANCH=parachains-v9435
WESTMINT_BUILD_BRANCH=parachains-v9430
OPAL_MAINNET_BRANCH=release-v943061
OPAL_REPLICA_FROM=wss://ws-opal.unique.network:443

Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/node-only-update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -162,11 +162,11 @@ jobs:
inputs: |
.baedeker/node-only.jsonnet
snippet:(import 'baedeker-library/ops/rewrites.libsonnet').rewriteNodePaths({'bin/polkadot':{dockerImage:'${{ steps.polkadot.outputs.name }}'}})
ephemeral:snippet:(import 'baedeker-library/ops/rewrites.libsonnet').rewriteNodePaths({'bin/unique':{dockerImage:'${{ steps.mainnet.outputs.name }}'}}, extra_node_mixin = {legacyRpc: true})
ephemeral:snippet:(import 'baedeker-library/ops/rewrites.libsonnet').rewriteNodePaths({'bin/unique':{dockerImage:'${{ steps.mainnet.outputs.name }}'}})
- name: Run Parallel tests before Node Parachain upgrade
working-directory: ${{ matrix.mainnet_branch }}/tests
if: success() || failure()
if: success()
run: |
yarn
yarn add mochawesome
Expand All @@ -191,11 +191,11 @@ jobs:
# Chain should always be built with the mainnet spec, this we first set binary for all nodes expect one, then set mainnet binary for the last node, and then force chainspec to be still generated from mainnet
inputs: |
snippet:(import 'baedeker-library/ops/rewrites.libsonnet').rewriteNodePaths({'bin/unique':{dockerImage:'${{ steps.latest.outputs.name }}'}}, leave = 1, for_chain = false)
snippet:(import 'baedeker-library/ops/rewrites.libsonnet').rewriteNodePaths({'bin/unique':{dockerImage:'${{ steps.mainnet.outputs.name }}'}}, extra_node_mixin = {legacyRpc: true}, for_chain = false)
snippet:(import 'baedeker-library/ops/rewrites.libsonnet').rewriteNodePaths({'bin/unique':{dockerImage:'${{ steps.mainnet.outputs.name }}'}}, for_chain = false)
snippet:(import 'baedeker-library/ops/rewrites.libsonnet').rewriteNodePaths({'bin/unique':{dockerImage:'${{ steps.mainnet.outputs.name }}'}})
- name: Ensure network is alive
if: success() || failure() # run this step even if previous step failed
if: success()
run: |
./tests/scripts/wait_for_first_block.sh
env:
Expand Down
11 changes: 10 additions & 1 deletion .github/workflows/xcm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -326,11 +326,20 @@ jobs:
path: ${{ steps.bdk.outputs.composeProject }}
retention-days: 2

- name: Run XCM tests
- name: Yarn install
working-directory: tests
run: |
yarn install
yarn add mochawesome
- name: Call HRMP initialization
working-directory: tests
run: |
yarn ts-node --esm src/util/createHrmp.ts ${{matrix.network}}
- name: Run XCM tests
working-directory: tests
run: |
# Wanted by both wait_for_first_block
export RPC_URL="${RELAY_OPAL_HTTP_URL:-${RELAY_QUARTZ_HTTP_URL:-${RELAY_UNIQUE_HTTP_URL:-}}}"
./scripts/wait_for_first_block.sh
Expand Down
14 changes: 7 additions & 7 deletions tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "Unique Chain Tests",
"main": "",
"devDependencies": {
"@polkadot/typegen": "10.9.1",
"@polkadot/typegen": "10.10.1",
"@types/chai": "^4.3.3",
"@types/chai-as-promised": "^7.1.5",
"@types/chai-like": "^1.1.1",
Expand Down Expand Up @@ -138,12 +138,12 @@
"homepage": "",
"dependencies": {
"@openzeppelin/contracts": "^4.9.2",
"@polkadot/api": "10.9.1",
"@polkadot/rpc-core": "^10.9.1",
"@polkadot/util": "12.3.2",
"@polkadot/util-crypto": "12.3.2",
"@polkadot/wasm-crypto-asmjs": "^7.2.1",
"@polkadot/wasm-crypto-wasm": "^7.2.1",
"@polkadot/api": "10.10.1",
"@polkadot/rpc-core": "^10.10.1",
"@polkadot/util": "12.5.1",
"@polkadot/util-crypto": "12.5.1",
"@polkadot/wasm-crypto-asmjs": "^7.2.2",
"@polkadot/wasm-crypto-wasm": "^7.2.2",
"@rmrk-team/evm-contracts": "^1.2.1",
"@typechain/web3-v1": "^6.0.3",
"chai-as-promised": "^7.1.1",
Expand Down
21 changes: 12 additions & 9 deletions tests/src/interfaces/augment-api-consts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import type { ApiTypes, AugmentedConst } from '@polkadot/api-base/types';
import type { Option, U8aFixed, Vec, bool, u128, u16, u32, u64, u8 } from '@polkadot/types-codec';
import type { Codec, ITuple } from '@polkadot/types-codec/types';
import type { H160, Perbill, Permill } from '@polkadot/types/interfaces/runtime';
import type { FrameSupportPalletId, FrameSystemLimitsBlockLength, FrameSystemLimitsBlockWeights, PalletReferendaTrackInfo, SpVersionRuntimeVersion, SpWeightsRuntimeDbWeight, SpWeightsWeightV2Weight, UpDataStructsCollectionLimits, XcmV3MultiLocation } from '@polkadot/types/lookup';
import type { FrameSupportPalletId, FrameSystemLimitsBlockLength, FrameSystemLimitsBlockWeights, PalletReferendaTrackInfo, SpVersionRuntimeVersion, SpWeightsRuntimeDbWeight, SpWeightsWeightV2Weight, StagingXcmV3MultiLocation, UpDataStructsCollectionLimits } from '@polkadot/types/lookup';

export type __AugmentedConst<ApiType extends ApiTypes> = AugmentedConst<ApiType>;

Expand Down Expand Up @@ -79,13 +79,6 @@ declare module '@polkadot/api-base/types/consts' {
**/
[key: string]: Codec;
};
collatorSelection: {
licenceBondIdentifier: U8aFixed & AugmentedConst<ApiType>;
/**
* Generic const
**/
[key: string]: Codec;
};
common: {
/**
* Maximum admins per collection.
Expand Down Expand Up @@ -518,6 +511,16 @@ declare module '@polkadot/api-base/types/consts' {
**/
[key: string]: Codec;
};
utility: {
/**
* The limit on the number of batched calls.
**/
batchedCallsLimit: u32 & AugmentedConst<ApiType>;
/**
* Generic const
**/
[key: string]: Codec;
};
vesting: {
/**
* The minimum amount transferred to call `vested_transfer`.
Expand All @@ -539,7 +542,7 @@ declare module '@polkadot/api-base/types/consts' {
/**
* Self chain location.
**/
selfLocation: XcmV3MultiLocation & AugmentedConst<ApiType>;
selfLocation: StagingXcmV3MultiLocation & AugmentedConst<ApiType>;
/**
* Generic const
**/
Expand Down
30 changes: 24 additions & 6 deletions tests/src/interfaces/augment-api-errors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,10 @@ declare module '@polkadot/api-base/types/errors' {
* Empty property keys are forbidden
**/
EmptyPropertyKey: AugmentedError<ApiType>;
/**
* Fungible tokens hold no ID, and the default value of TokenId for a fungible collection is 0.
**/
FungibleItemsHaveNoId: AugmentedError<ApiType>;
/**
* Only ASCII letters, digits, and symbols `_`, `-`, and `.` are allowed
**/
Expand Down Expand Up @@ -327,6 +331,10 @@ declare module '@polkadot/api-base/types/errors' {
* Account is not a member
**/
NotMember: AugmentedError<ApiType>;
/**
* Prime account is not a member
**/
PrimeAccountNotMember: AugmentedError<ApiType>;
/**
* Proposal must exist
**/
Expand Down Expand Up @@ -737,10 +745,6 @@ declare module '@polkadot/api-base/types/errors' {
* Tried to set data for fungible item.
**/
FungibleItemsDontHaveData: AugmentedError<ApiType>;
/**
* Fungible tokens hold no ID, and the default value of TokenId for Fungible collection is 0.
**/
FungibleItemsHaveNoId: AugmentedError<ApiType>;
/**
* Only a fungible collection could be possibly broken; any fungible token is valid.
**/
Expand Down Expand Up @@ -966,8 +970,8 @@ declare module '@polkadot/api-base/types/errors' {
**/
NoSubscription: AugmentedError<ApiType>;
/**
* There was some other issue (i.e. not to do with routing) in sending the message. Perhaps
* a lack of space for buffering the message.
* There was some other issue (i.e. not to do with routing) in sending the message.
* Perhaps a lack of space for buffering the message.
**/
SendFailure: AugmentedError<ApiType>;
/**
Expand Down Expand Up @@ -1223,6 +1227,10 @@ declare module '@polkadot/api-base/types/errors' {
* Account is not a member
**/
NotMember: AugmentedError<ApiType>;
/**
* Prime account is not a member
**/
PrimeAccountNotMember: AugmentedError<ApiType>;
/**
* Proposal must exist
**/
Expand Down Expand Up @@ -1358,6 +1366,16 @@ declare module '@polkadot/api-base/types/errors' {
**/
[key: string]: AugmentedError<ApiType>;
};
utility: {
/**
* Too many calls batched.
**/
TooManyCalls: AugmentedError<ApiType>;
/**
* Generic error
**/
[key: string]: AugmentedError<ApiType>;
};
vesting: {
/**
* The vested transfer amount is too low
Expand Down
Loading

0 comments on commit c7ac6d0

Please sign in to comment.