From bee9cdbfaa17ac8dd26d8bea5dd2cc35f5aad96f Mon Sep 17 00:00:00 2001 From: Tom Jeatt Date: Wed, 27 Sep 2023 14:01:31 +0100 Subject: [PATCH 01/12] chore: update docs to show VDOT between Interlay and Bifrost --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 8d5f0c97..a773a384 100644 --- a/README.md +++ b/README.md @@ -16,6 +16,7 @@ All channels support transfers in both directions. | ------------------ | --------- | | acala | INTR IBTC | | astar | INTR IBTC | +| bifrost | VDOT | | parallel | INTR IBTC | | polkadot | DOT | | polkadot asset hub | USDT | From 73e0ce9ced93f6fa2c00452a54a1616a7a28e482 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 20 Nov 2023 21:40:28 +0000 Subject: [PATCH 02/12] chore(deps): bump axios from 0.27.2 to 1.6.2 Bumps [axios](https://github.com/axios/axios) from 0.27.2 to 1.6.2. - [Release notes](https://github.com/axios/axios/releases) - [Changelog](https://github.com/axios/axios/blob/v1.x/CHANGELOG.md) - [Commits](https://github.com/axios/axios/compare/v0.27.2...v1.6.2) --- updated-dependencies: - dependency-name: axios dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- package.json | 2 +- yarn.lock | 24 +++++++++++++++--------- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/package.json b/package.json index 762f716d..86857cb0 100644 --- a/package.json +++ b/package.json @@ -45,7 +45,7 @@ "@polkadot/api": "^10.9.1", "@polkadot/apps-config": "^0.132.1", "@polkadot/types": "^10.9.1", - "axios": "^0.27.2", + "axios": "^1.6.2", "lodash": "^4.17.20" }, "devDependencies": { diff --git a/yarn.lock b/yarn.lock index 99ec4832..cfc08b96 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4978,13 +4978,14 @@ axios@^0.24.0: dependencies: follow-redirects "^1.14.4" -axios@^0.27.2: - version "0.27.2" - resolved "https://registry.yarnpkg.com/axios/-/axios-0.27.2.tgz#207658cc8621606e586c85db4b41a750e756d972" - integrity sha512-t+yRIyySRTp/wua5xEr+z1q60QmLq8ABsS5O9Me1AsE5dfKqgnCFzwiCZZ/cGNd1lq4/7akDWMxdhVlucjmnOQ== +axios@^1.6.2: + version "1.6.2" + resolved "https://registry.yarnpkg.com/axios/-/axios-1.6.2.tgz#de67d42c755b571d3e698df1b6504cde9b0ee9f2" + integrity sha512-7i24Ri4pmDRfJTR7LDBhsOTtcm+9kjX5WiY1X3wIisx6G9So3pfMkEiU7emUBe46oceVImccTEM3k6C5dbVW8A== dependencies: - follow-redirects "^1.14.9" + follow-redirects "^1.15.0" form-data "^4.0.0" + proxy-from-env "^1.1.0" babel-jest@^27.5.1: version "27.5.1" @@ -6838,10 +6839,10 @@ flatten@^1.0.2: resolved "https://registry.yarnpkg.com/flatten/-/flatten-1.0.3.tgz#c1283ac9f27b368abc1e36d1ff7b04501a30356b" integrity sha512-dVsPA/UwQ8+2uoFe5GHtiBMu48dWLTdsuEd7CKGlZlD78r1TTWBvDuFaFGKCo/ZfEr95Uk56vZoX86OsHkUeIg== -follow-redirects@^1.14.4, follow-redirects@^1.14.9: - version "1.15.2" - resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.2.tgz#b460864144ba63f2681096f274c4e57026da2c13" - integrity sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA== +follow-redirects@^1.14.4, follow-redirects@^1.15.0: + version "1.15.3" + resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.3.tgz#fe2f3ef2690afce7e82ed0b44db08165b207123a" + integrity sha512-1VzOtuEM8pC9SFU1E+8KfTjZyMztRsgEfwQl44z8A25uy13jSzTj6dyK2Df52iV0vgHCfBwLhDWevLn95w5v6Q== for-each@^0.3.3: version "0.3.3" @@ -9799,6 +9800,11 @@ propagate@^2.0.0: resolved "https://registry.yarnpkg.com/propagate/-/propagate-2.0.1.tgz#40cdedab18085c792334e64f0ac17256d38f9a45" integrity sha512-vGrhOavPSTz4QVNuBNdcNXePNdNMaO1xj9yBeH1ScQPjk/rhg9sSlCXPhMkFuaNNW/syTvYqsnbIJxMBfRbbag== +proxy-from-env@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/proxy-from-env/-/proxy-from-env-1.1.0.tgz#e102f16ca355424865755d2c9e8ea4f24d58c3e2" + integrity sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg== + pseudomap@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/pseudomap/-/pseudomap-1.0.2.tgz#f052a28da70e618917ef0a8ac34c1ae5a68286b3" From ed137e0d06dd73c17c39b2fb37d18935bf340802 Mon Sep 17 00:00:00 2001 From: Brendon Votteler Date: Mon, 18 Dec 2023 09:31:12 +0200 Subject: [PATCH 03/12] test: disable hydra tests - rpc too flaky --- .github/workflows/xcm-tests.yml | 1 - scripts/interlay-chopsticks-test.ts | 13 ++++++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/.github/workflows/xcm-tests.yml b/.github/workflows/xcm-tests.yml index 31941958..eedeb0cc 100644 --- a/.github/workflows/xcm-tests.yml +++ b/.github/workflows/xcm-tests.yml @@ -69,7 +69,6 @@ jobs: -r scripts/configs/polkadot.yml \ -p scripts/configs/interlay.yml \ -p scripts/configs/statemint.yml \ - -p scripts/configs/hydradx.yml \ -p scripts/configs/acala.yml \ -p scripts/configs/parallel.yml \ -p scripts/configs/bifrost-polkadot.yml \ diff --git a/scripts/interlay-chopsticks-test.ts b/scripts/interlay-chopsticks-test.ts index e40f9a2c..9b53ae30 100644 --- a/scripts/interlay-chopsticks-test.ts +++ b/scripts/interlay-chopsticks-test.ts @@ -25,18 +25,21 @@ async function main(): Promise { // relaychain gets its port last after all parachains. interlay: { adapter: new InterlayAdapter(), endpoints: ['ws://127.0.0.1:8000'] }, statemint: { adapter: new StatemintAdapter(), endpoints: ['ws://127.0.0.1:8001'] }, - hydra: { adapter: new HydraAdapter(), endpoints: ['ws://127.0.0.1:8002'] }, - acala: { adapter: new AcalaAdapter(), endpoints: ['ws://127.0.0.1:8003'] }, + // disable hydra - rpc too flaky to use in regular test runs + // hydra: { adapter: new HydraAdapter(), endpoints: ['ws://127.0.0.1:8002'] }, + acala: { adapter: new AcalaAdapter(), endpoints: ['ws://127.0.0.1:8002'] }, // disable astar - rpc currently is too fragile for use in recurring tests // astar: { adapter: new AstarAdapter(), endpoints: ['ws://127.0.0.1:8004'] }, - parallel: { adapter: new ParallelAdapter(), endpoints: ['ws://127.0.0.1:8004'] }, - bifrost_polkadot: { adapter: new BifrostPolkadotAdapter(), endpoints: ['ws://127.0.0.1:8005']}, - polkadot: { adapter: new PolkadotAdapter(), endpoints: ['ws://127.0.0.1:8006'] }, + parallel: { adapter: new ParallelAdapter(), endpoints: ['ws://127.0.0.1:8003'] }, + bifrost_polkadot: { adapter: new BifrostPolkadotAdapter(), endpoints: ['ws://127.0.0.1:8004']}, + polkadot: { adapter: new PolkadotAdapter(), endpoints: ['ws://127.0.0.1:8005'] }, }; const filterCases: Partial[] = [ {from: "astar"}, {to: "astar"}, + {from: "hydra"}, + {to: "hydra"}, ]; await runTestCasesAndExit(adaptersEndpoints, filterCases); From 8bae7b4d6b639503e391d91e14ad4891f2a26ef7 Mon Sep 17 00:00:00 2001 From: Brendon Votteler Date: Mon, 18 Dec 2023 09:37:30 +0200 Subject: [PATCH 04/12] chore: remove unused import --- scripts/interlay-chopsticks-test.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/scripts/interlay-chopsticks-test.ts b/scripts/interlay-chopsticks-test.ts index 9b53ae30..f4e96c7d 100644 --- a/scripts/interlay-chopsticks-test.ts +++ b/scripts/interlay-chopsticks-test.ts @@ -4,7 +4,6 @@ import { PolkadotAdapter } from "../src/adapters/polkadot"; import { InterlayAdapter } from "../src/adapters/interlay"; import { StatemintAdapter } from "../src/adapters/statemint"; -import { HydraAdapter } from "../src/adapters/hydradx"; import { AcalaAdapter } from "../src/adapters/acala"; import { ParallelAdapter } from "../src/adapters/parallel"; import { BifrostPolkadotAdapter } from "../src/adapters/bifrost"; From c205084f9c2b86eb5d6b7a9bb0b2c3aec0dd39c2 Mon Sep 17 00:00:00 2001 From: Brendon Votteler Date: Thu, 21 Dec 2023 10:03:49 +0200 Subject: [PATCH 05/12] Revert "chore: remove unused import" This reverts commit 8bae7b4d6b639503e391d91e14ad4891f2a26ef7. --- scripts/interlay-chopsticks-test.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/interlay-chopsticks-test.ts b/scripts/interlay-chopsticks-test.ts index f4e96c7d..9b53ae30 100644 --- a/scripts/interlay-chopsticks-test.ts +++ b/scripts/interlay-chopsticks-test.ts @@ -4,6 +4,7 @@ import { PolkadotAdapter } from "../src/adapters/polkadot"; import { InterlayAdapter } from "../src/adapters/interlay"; import { StatemintAdapter } from "../src/adapters/statemint"; +import { HydraAdapter } from "../src/adapters/hydradx"; import { AcalaAdapter } from "../src/adapters/acala"; import { ParallelAdapter } from "../src/adapters/parallel"; import { BifrostPolkadotAdapter } from "../src/adapters/bifrost"; From 82d64584c55f19da49d4212d7a4550fa151254c5 Mon Sep 17 00:00:00 2001 From: Brendon Votteler Date: Thu, 21 Dec 2023 10:03:54 +0200 Subject: [PATCH 06/12] Revert "test: disable hydra tests - rpc too flaky" This reverts commit ed137e0d06dd73c17c39b2fb37d18935bf340802. --- .github/workflows/xcm-tests.yml | 1 + scripts/interlay-chopsticks-test.ts | 13 +++++-------- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/.github/workflows/xcm-tests.yml b/.github/workflows/xcm-tests.yml index eedeb0cc..31941958 100644 --- a/.github/workflows/xcm-tests.yml +++ b/.github/workflows/xcm-tests.yml @@ -69,6 +69,7 @@ jobs: -r scripts/configs/polkadot.yml \ -p scripts/configs/interlay.yml \ -p scripts/configs/statemint.yml \ + -p scripts/configs/hydradx.yml \ -p scripts/configs/acala.yml \ -p scripts/configs/parallel.yml \ -p scripts/configs/bifrost-polkadot.yml \ diff --git a/scripts/interlay-chopsticks-test.ts b/scripts/interlay-chopsticks-test.ts index 9b53ae30..e40f9a2c 100644 --- a/scripts/interlay-chopsticks-test.ts +++ b/scripts/interlay-chopsticks-test.ts @@ -25,21 +25,18 @@ async function main(): Promise { // relaychain gets its port last after all parachains. interlay: { adapter: new InterlayAdapter(), endpoints: ['ws://127.0.0.1:8000'] }, statemint: { adapter: new StatemintAdapter(), endpoints: ['ws://127.0.0.1:8001'] }, - // disable hydra - rpc too flaky to use in regular test runs - // hydra: { adapter: new HydraAdapter(), endpoints: ['ws://127.0.0.1:8002'] }, - acala: { adapter: new AcalaAdapter(), endpoints: ['ws://127.0.0.1:8002'] }, + hydra: { adapter: new HydraAdapter(), endpoints: ['ws://127.0.0.1:8002'] }, + acala: { adapter: new AcalaAdapter(), endpoints: ['ws://127.0.0.1:8003'] }, // disable astar - rpc currently is too fragile for use in recurring tests // astar: { adapter: new AstarAdapter(), endpoints: ['ws://127.0.0.1:8004'] }, - parallel: { adapter: new ParallelAdapter(), endpoints: ['ws://127.0.0.1:8003'] }, - bifrost_polkadot: { adapter: new BifrostPolkadotAdapter(), endpoints: ['ws://127.0.0.1:8004']}, - polkadot: { adapter: new PolkadotAdapter(), endpoints: ['ws://127.0.0.1:8005'] }, + parallel: { adapter: new ParallelAdapter(), endpoints: ['ws://127.0.0.1:8004'] }, + bifrost_polkadot: { adapter: new BifrostPolkadotAdapter(), endpoints: ['ws://127.0.0.1:8005']}, + polkadot: { adapter: new PolkadotAdapter(), endpoints: ['ws://127.0.0.1:8006'] }, }; const filterCases: Partial[] = [ {from: "astar"}, {to: "astar"}, - {from: "hydra"}, - {to: "hydra"}, ]; await runTestCasesAndExit(adaptersEndpoints, filterCases); From 0ca8a0c234278037ccbc6681680fe9e50b33c830 Mon Sep 17 00:00:00 2001 From: Brendon Votteler Date: Thu, 21 Dec 2023 10:19:43 +0200 Subject: [PATCH 07/12] test: use modified amount to check ED for hydra --- scripts/chopsticks-test.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/scripts/chopsticks-test.ts b/scripts/chopsticks-test.ts index 5c8ed53c..c00537e7 100644 --- a/scripts/chopsticks-test.ts +++ b/scripts/chopsticks-test.ts @@ -137,6 +137,17 @@ async function checkTransfer(fromChain: ChainName, toChain: ChainName, token: st // check existential deposit by sending exactly `actualFee + ed + [1 planck]`. The function // will throw an error if the ed is set too low. let amountToSend = actualFee.add(expectedEd).add(FN.fromInner("1", actualFee.getPrecision())); + + if (toChain === "hydra") { + // bump amount to send by a few percent for XCM to HydraDX + // token/HDX price pair changes can make this fail due to change from previous tx + const bumpRate = 0.1; + amountToSend = amountToSend.mul(FN.fromInner(1 + bumpRate)); + ret = { + message: `Modified ED check for ${token} to ${toChain} - price changes in ${token}/HDX can cause false negatives. Bumped test amount by ${bumpRate * 100}%`, + result: ResultCode.WARN + }; + } await sendTx(fromChain, toChain, token, bridge, amountToSend, TestCase.ExistentialDeposit); return ret; From 1e212c2adafab49c3cc9fee6e40c49434ceabda0 Mon Sep 17 00:00:00 2001 From: Brendon Votteler Date: Thu, 21 Dec 2023 10:40:38 +0200 Subject: [PATCH 08/12] chore: only apply multiplier to fee, not entire amount --- scripts/chopsticks-test.ts | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/scripts/chopsticks-test.ts b/scripts/chopsticks-test.ts index c00537e7..d71cd270 100644 --- a/scripts/chopsticks-test.ts +++ b/scripts/chopsticks-test.ts @@ -136,15 +136,17 @@ async function checkTransfer(fromChain: ChainName, toChain: ChainName, token: st // check existential deposit by sending exactly `actualFee + ed + [1 planck]`. The function // will throw an error if the ed is set too low. - let amountToSend = actualFee.add(expectedEd).add(FN.fromInner("1", actualFee.getPrecision())); + const dust = FN.fromInner("1", actualFee.getPrecision()); + let amountToSend = actualFee.add(expectedEd).add(dust); if (toChain === "hydra") { - // bump amount to send by a few percent for XCM to HydraDX - // token/HDX price pair changes can make this fail due to change from previous tx + // bump fees in amount to send by a few percent for XCM to HydraDX + // token/HDX price pair changes can make this fail due to pair changes from previous tx increasing fee required const bumpRate = 0.1; - amountToSend = amountToSend.mul(FN.fromInner(1 + bumpRate)); + const bumpedFee = actualFee.mul(FN.fromInner(1 + bumpRate)); + amountToSend = bumpedFee.add(expectedEd).add(dust); ret = { - message: `Modified ED check for ${token} to ${toChain} - price changes in ${token}/HDX can cause false negatives. Bumped test amount by ${bumpRate * 100}%`, + message: `Modified ED check for ${token} to ${toChain} - price changes in ${token}/HDX can cause false negatives. Bumped assumed fees by ${bumpRate * 100}%`, result: ResultCode.WARN }; } From f8acf44bf9a3e8b08403aa9df3926b7c642ddc8b Mon Sep 17 00:00:00 2001 From: Brendon Votteler Date: Thu, 21 Dec 2023 11:09:52 +0200 Subject: [PATCH 09/12] fix: incorrect use of FN.fromInner, accept WARN results without triggering a retry --- scripts/chopsticks-test.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/scripts/chopsticks-test.ts b/scripts/chopsticks-test.ts index d71cd270..ce8e9be9 100644 --- a/scripts/chopsticks-test.ts +++ b/scripts/chopsticks-test.ts @@ -142,11 +142,11 @@ async function checkTransfer(fromChain: ChainName, toChain: ChainName, token: st if (toChain === "hydra") { // bump fees in amount to send by a few percent for XCM to HydraDX // token/HDX price pair changes can make this fail due to pair changes from previous tx increasing fee required - const bumpRate = 0.1; - const bumpedFee = actualFee.mul(FN.fromInner(1 + bumpRate)); + const bumpRate = new FN(1.1); + const bumpedFee = actualFee.mul(bumpRate); amountToSend = bumpedFee.add(expectedEd).add(dust); ret = { - message: `Modified ED check for ${token} to ${toChain} - price changes in ${token}/HDX can cause false negatives. Bumped assumed fees by ${bumpRate * 100}%`, + message: `Modified ED check for ${token} to ${toChain} - price changes in ${token}/HDX can cause false negatives. Bumped assumed fees by ${bumpRate.minus(FN.ONE).toNumber() * 100}%`, result: ResultCode.WARN }; } @@ -171,7 +171,8 @@ async function retryCheckTransfer( ): Promise>> { const result = await checkTransfer(fromChain, toChain, token, bridge); - if (result.result === ResultCode.OK) { + // OK or WARN are fine, only retry on failures + if (result.result === ResultCode.OK || result.result === ResultCode.WARN) { return result; } From e564662ccc570b2a0e62320a148187f3d2d57b83 Mon Sep 17 00:00:00 2001 From: Brendon Votteler Date: Thu, 21 Dec 2023 11:35:30 +0200 Subject: [PATCH 10/12] test: undo WARN/OK handling, instead log test result message if it exists regardless of status --- scripts/chopsticks-test.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/scripts/chopsticks-test.ts b/scripts/chopsticks-test.ts index ce8e9be9..696e2d65 100644 --- a/scripts/chopsticks-test.ts +++ b/scripts/chopsticks-test.ts @@ -147,7 +147,7 @@ async function checkTransfer(fromChain: ChainName, toChain: ChainName, token: st amountToSend = bumpedFee.add(expectedEd).add(dust); ret = { message: `Modified ED check for ${token} to ${toChain} - price changes in ${token}/HDX can cause false negatives. Bumped assumed fees by ${bumpRate.minus(FN.ONE).toNumber() * 100}%`, - result: ResultCode.WARN + result: ResultCode.OK }; } await sendTx(fromChain, toChain, token, bridge, amountToSend, TestCase.ExistentialDeposit); @@ -171,8 +171,7 @@ async function retryCheckTransfer( ): Promise>> { const result = await checkTransfer(fromChain, toChain, token, bridge); - // OK or WARN are fine, only retry on failures - if (result.result === ResultCode.OK || result.result === ResultCode.WARN) { + if (result.result === ResultCode.OK) { return result; } @@ -274,8 +273,11 @@ export async function runTestCasesAndExit( process.stdout.write(`Testing ${token} transfer from ${from} to ${to}... `); const result = await retryCheckTransfer(from, to, token, bridge, 2); console.log(ResultCode[result.result]); - if (result.result != ResultCode.OK) { + if (result.message?.length > 0) { console.log(iconOf(result.result), result.message); + } + + if (result.result != ResultCode.OK) { problematicTestCases.push({from: from as ChainName, to: to as ChainName, token, icon: iconOf(result.result), message: result.message}); if (aggregateTestResult == ResultCode.OK || (aggregateTestResult == ResultCode.WARN && result.result == ResultCode.FAIL)) { // only 'increase' the aggregate error From 7eb0ad862d14154126246eb7c46f965ad28eb9e0 Mon Sep 17 00:00:00 2001 From: Brendon Votteler Date: Thu, 21 Dec 2023 12:00:32 +0200 Subject: [PATCH 11/12] chore: add multiple wss endpoints to kusama config --- scripts/configs/kusama.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/configs/kusama.yml b/scripts/configs/kusama.yml index be92115d..7a8e2b24 100644 --- a/scripts/configs/kusama.yml +++ b/scripts/configs/kusama.yml @@ -1,5 +1,6 @@ -# endpoint: wss://kusama-rpc.dwellir.com -endpoint: wss://kusama-rpc.polkadot.io +endpoint: + - wss://kusama-rpc.dwellir.com + - wss://kusama-rpc.dwellir.com mock-signature-host: true block: ${env.KUSAMA_BLOCK_NUMBER} db: ./db.sqlite From 3a2f5c5e2e54ef1d6e9314c975f522a65b0917ee Mon Sep 17 00:00:00 2001 From: Brendon Votteler Date: Thu, 21 Dec 2023 12:27:22 +0200 Subject: [PATCH 12/12] testing: switch order of polkadot wss endpoints in config --- scripts/configs/polkadot.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/configs/polkadot.yml b/scripts/configs/polkadot.yml index 19b90551..466357f3 100644 --- a/scripts/configs/polkadot.yml +++ b/scripts/configs/polkadot.yml @@ -1,6 +1,6 @@ endpoint: - - wss://rpc.polkadot.io - wss://polkadot-rpc.dwellir.com + - wss://rpc.polkadot.io mock-signature-host: true block: ${env.POLKADOT_BLOCK_NUMBER} db: ./db.sqlite