From f3e2a00a733ad9b018d4c99c7aa6aac7a2d81435 Mon Sep 17 00:00:00 2001 From: Mihajlo Pavlovic Date: Fri, 21 Jun 2024 13:42:53 +0200 Subject: [PATCH 1/3] OriginTrail Devnet prerelease v6.5.0 (#3217) * Updated Simulation script for LinearSum, updated dkg-evm-module package (#3215) * Add support for BASE blockchain (#3216) * Default config update * Fix package path for base integration * Add base-service implementation * Add Hub contracts for devnet and testnet * Version bump * Fix baseTokenTicker in BaseService * Update dkg.js version. Add typesrcipt dependecy for hardhat support * Set version to 6.5.0 --------- Co-authored-by: Uladzislau Hubar <71610423+u-hubar@users.noreply.github.com> --- config/config.json | 29 + package-lock.json | 1412 ++++++++++++++++- package.json | 6 +- src/constants/constants.js | 1 + .../implementation/base/base-service.js | 25 + .../mocks/blockchain-module-manager-mock.js | 3 +- .../simulation.js | 22 +- 7 files changed, 1463 insertions(+), 35 deletions(-) create mode 100644 src/modules/blockchain/implementation/base/base-service.js diff --git a/config/config.json b/config/config.json index 9b1d8b10a..cbc91c4b3 100644 --- a/config/config.json +++ b/config/config.json @@ -443,6 +443,16 @@ "rpcEndpoints": ["https://rpc.chiadochain.net"], "operatorFee": 0 } + }, + "base:84532": { + "enabled": false, + "package": "./blockchain/implementation/base/base-service.js", + + "config": { + "hubContractAddress": "0x144eDa5cbf8926327cb2cceef168A121F0E4A299", + "rpcEndpoints": ["https://sepolia.base.org"], + "operatorFee": 0 + } } } }, @@ -617,6 +627,16 @@ "rpcEndpoints": ["https://rpc.chiadochain.net"], "operatorFee": 0 } + }, + "base:84532": { + "enabled": false, + "package": "./blockchain/implementation/base/base-service.js", + + "config": { + "hubContractAddress": "0x6C861Cb69300C34DfeF674F7C00E734e840C29C0", + "rpcEndpoints": ["https://sepolia.base.org"], + "operatorFee": 0 + } } } }, @@ -791,6 +811,15 @@ "gasPriceOracleLink": "https://api.gnosisscan.io/api?module=proxy&action=eth_gasPrice", "operatorFee": 0 } + }, + "base:8453": { + "enabled": false, + "package": "./blockchain/implementation/base/base-service.js", + + "config": { + "hubContractAddress": "", + "operatorFee": 0 + } } } }, diff --git a/package-lock.json b/package-lock.json index 490bddcd9..dfe3dfd33 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "origintrail_node", - "version": "6.4.0", + "version": "6.4.1", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "origintrail_node", - "version": "6.4.0", + "version": "6.4.1", "license": "ISC", "dependencies": { "@comunica/query-sparql": "^2.4.3", @@ -25,7 +25,7 @@ "axios": "^1.6.0", "cors": "^2.8.5", "deep-extend": "^0.6.0", - "dkg-evm-module": "^4.3.0", + "dkg-evm-module": "^4.3.3", "dotenv": "^16.0.1", "ethers": "^5.7.2", "express": "^4.18.1", @@ -68,7 +68,7 @@ "chai": "^4.3.6", "d3": "^7.8.5", "d3-node": "^3.0.0", - "dkg.js": "^6.1.2", + "dkg.js": "^6.3.0", "eslint": "^8.23.0", "eslint-config-airbnb": "^19.0.4", "eslint-config-prettier": "^8.5.0", @@ -2712,6 +2712,26 @@ "sparqlalgebrajs": "^4.2.0" } }, + "node_modules/@cspotcode/source-map-support": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz", + "integrity": "sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==", + "dependencies": { + "@jridgewell/trace-mapping": "0.3.9" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/@cspotcode/source-map-support/node_modules/@jridgewell/trace-mapping": { + "version": "0.3.9", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz", + "integrity": "sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==", + "dependencies": { + "@jridgewell/resolve-uri": "^3.0.3", + "@jridgewell/sourcemap-codec": "^1.4.10" + } + }, "node_modules/@cucumber/ci-environment": { "version": "9.1.0", "resolved": "https://registry.npmjs.org/@cucumber/ci-environment/-/ci-environment-9.1.0.tgz", @@ -4142,7 +4162,6 @@ "version": "3.1.2", "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", - "dev": true, "engines": { "node": ">=6.0.0" } @@ -4159,8 +4178,7 @@ "node_modules/@jridgewell/sourcemap-codec": { "version": "1.4.15", "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz", - "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==", - "dev": true + "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==" }, "node_modules/@jridgewell/trace-mapping": { "version": "0.3.25", @@ -4580,6 +4598,79 @@ "resolved": "https://registry.npmjs.org/@openzeppelin/contracts/-/contracts-4.9.6.tgz", "integrity": "sha512-xSmezSupL+y9VkHZJGDoCBpmnB2ogM13ccaYDWqJTfS3dbuHkgjuwDFUmaFauBCboQMGB/S5UqUl2y54X99BmA==" }, + "node_modules/@polkadot-api/json-rpc-provider": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/@polkadot-api/json-rpc-provider/-/json-rpc-provider-0.0.1.tgz", + "integrity": "sha512-/SMC/l7foRjpykLTUTacIH05H3mr9ip8b5xxfwXlVezXrNVLp3Cv0GX6uItkKd+ZjzVPf3PFrDF2B2/HLSNESA==", + "optional": true + }, + "node_modules/@polkadot-api/json-rpc-provider-proxy": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/@polkadot-api/json-rpc-provider-proxy/-/json-rpc-provider-proxy-0.0.1.tgz", + "integrity": "sha512-gmVDUP8LpCH0BXewbzqXF2sdHddq1H1q+XrAW2of+KZj4woQkIGBRGTJHeBEVHe30EB+UejR1N2dT4PO/RvDdg==", + "optional": true + }, + "node_modules/@polkadot-api/metadata-builders": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/@polkadot-api/metadata-builders/-/metadata-builders-0.0.1.tgz", + "integrity": "sha512-GCI78BHDzXAF/L2pZD6Aod/yl82adqQ7ftNmKg51ixRL02JpWUA+SpUKTJE5MY1p8kiJJIo09P2um24SiJHxNA==", + "optional": true, + "dependencies": { + "@polkadot-api/substrate-bindings": "0.0.1", + "@polkadot-api/utils": "0.0.1" + } + }, + "node_modules/@polkadot-api/observable-client": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/@polkadot-api/observable-client/-/observable-client-0.1.0.tgz", + "integrity": "sha512-GBCGDRztKorTLna/unjl/9SWZcRmvV58o9jwU2Y038VuPXZcr01jcw/1O3x+yeAuwyGzbucI/mLTDa1QoEml3A==", + "optional": true, + "dependencies": { + "@polkadot-api/metadata-builders": "0.0.1", + "@polkadot-api/substrate-bindings": "0.0.1", + "@polkadot-api/substrate-client": "0.0.1", + "@polkadot-api/utils": "0.0.1" + }, + "peerDependencies": { + "rxjs": ">=7.8.0" + } + }, + "node_modules/@polkadot-api/substrate-bindings": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/@polkadot-api/substrate-bindings/-/substrate-bindings-0.0.1.tgz", + "integrity": "sha512-bAe7a5bOPnuFVmpv7y4BBMRpNTnMmE0jtTqRUw/+D8ZlEHNVEJQGr4wu3QQCl7k1GnSV1wfv3mzIbYjErEBocg==", + "optional": true, + "dependencies": { + "@noble/hashes": "^1.3.1", + "@polkadot-api/utils": "0.0.1", + "@scure/base": "^1.1.1", + "scale-ts": "^1.6.0" + } + }, + "node_modules/@polkadot-api/substrate-bindings/node_modules/@noble/hashes": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.4.0.tgz", + "integrity": "sha512-V1JJ1WTRUqHHrOSh597hURcMqVKVGL/ea3kv0gSnEdsEZ0/+VyPghM1lMNGc00z7CIQorSvbKpuJkxvuHbvdbg==", + "optional": true, + "engines": { + "node": ">= 16" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/@polkadot-api/substrate-client": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/@polkadot-api/substrate-client/-/substrate-client-0.0.1.tgz", + "integrity": "sha512-9Bg9SGc3AwE+wXONQoW8GC00N3v6lCZLW74HQzqB6ROdcm5VAHM4CB/xRzWSUF9CXL78ugiwtHx3wBcpx4H4Wg==", + "optional": true + }, + "node_modules/@polkadot-api/utils": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/@polkadot-api/utils/-/utils-0.0.1.tgz", + "integrity": "sha512-3j+pRmlF9SgiYDabSdZsBSsN5XHbpXOAce1lWj56IEEaFZVjsiCaxDOA7C9nCcgfVXuvnbxqqEGQvnY+QfBAUw==", + "optional": true + }, "node_modules/@polkadot/api": { "version": "9.14.2", "resolved": "https://registry.npmjs.org/@polkadot/api/-/api-9.14.2.tgz", @@ -5690,12 +5781,42 @@ "integrity": "sha512-161JhCC1csjH3GE5mPLEd7HbWtwNSPJBg3p1Ksz9SFlTzj/bgEwudiRN2y5i0MoLGCIJRYKyKGMxVnd29PzNjg==", "optional": true }, + "node_modules/@substrate/connect-known-chains": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/@substrate/connect-known-chains/-/connect-known-chains-1.1.6.tgz", + "integrity": "sha512-JwtdGbnK3ZqrY1qp3Ifr/p648sp9hG0Q715h4nRghnqZJnMQIiLKaFkcLnvrAiYQD3zNTYDztHidy5Q/u0TcbQ==", + "optional": true + }, "node_modules/@substrate/connect/node_modules/eventemitter3": { "version": "4.0.7", "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.7.tgz", "integrity": "sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw==", "optional": true }, + "node_modules/@substrate/light-client-extension-helpers": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/@substrate/light-client-extension-helpers/-/light-client-extension-helpers-0.0.6.tgz", + "integrity": "sha512-girltEuxQ1BvkJWmc8JJlk4ZxnlGXc/wkLcNguhY+UoDEMBK0LsdtfzQKIfrIehi4QdeSBlFEFBoI4RqPmsZzA==", + "optional": true, + "dependencies": { + "@polkadot-api/json-rpc-provider": "0.0.1", + "@polkadot-api/json-rpc-provider-proxy": "0.0.1", + "@polkadot-api/observable-client": "0.1.0", + "@polkadot-api/substrate-client": "0.0.1", + "@substrate/connect-extension-protocol": "^2.0.0", + "@substrate/connect-known-chains": "^1.1.4", + "rxjs": "^7.8.1" + }, + "peerDependencies": { + "smoldot": "2.x" + } + }, + "node_modules/@substrate/light-client-extension-helpers/node_modules/@substrate/connect-extension-protocol": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@substrate/connect-extension-protocol/-/connect-extension-protocol-2.0.0.tgz", + "integrity": "sha512-nKu8pDrE3LNCEgJjZe1iGXzaD6OSIDD4Xzz/yo4KO9mQ6LBvf49BVrt4qxBFGL6++NneLiWUZGoh+VSd4PyVIg==", + "optional": true + }, "node_modules/@substrate/smoldot-light": { "version": "0.7.9", "resolved": "https://registry.npmjs.org/@substrate/smoldot-light/-/smoldot-light-0.7.9.tgz", @@ -5741,6 +5862,26 @@ "node": ">= 6" } }, + "node_modules/@tsconfig/node10": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.11.tgz", + "integrity": "sha512-DcRjDCujK/kCk/cUe8Xz8ZSpm8mS3mNNpta+jGCA6USEDfktlNvm1+IuZ9eTcDbNk41BHwpHHeW+N1lKCz4zOw==" + }, + "node_modules/@tsconfig/node12": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/@tsconfig/node12/-/node12-1.0.11.tgz", + "integrity": "sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag==" + }, + "node_modules/@tsconfig/node14": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@tsconfig/node14/-/node14-1.0.3.tgz", + "integrity": "sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow==" + }, + "node_modules/@tsconfig/node16": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@tsconfig/node16/-/node16-1.0.4.tgz", + "integrity": "sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA==" + }, "node_modules/@types/argparse": { "version": "1.0.38", "resolved": "https://registry.npmjs.org/@types/argparse/-/argparse-1.0.38.tgz", @@ -6277,6 +6418,11 @@ "integrity": "sha512-Xg+9RwCg/0p32teKdGMPTPnVXKD0w3DfHnFTficozsAgsvq2XenPJq/MYpzzQ/v8zrOyJn6Ds39VA4JIDwFfqw==", "dev": true }, + "node_modules/arg": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", + "integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==" + }, "node_modules/argparse": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", @@ -7872,6 +8018,11 @@ "sha.js": "^2.4.8" } }, + "node_modules/create-require": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz", + "integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==" + }, "node_modules/cross-fetch": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-4.0.0.tgz", @@ -9037,24 +9188,545 @@ "version": "4.0.2", "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", - "dev": true, "engines": { "node": ">=0.3.1" } }, "node_modules/dkg-evm-module": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/dkg-evm-module/-/dkg-evm-module-4.3.0.tgz", - "integrity": "sha512-1aZFPCiWu9zCAR9Y+Tg1EHKw9jd7HAiaHiV76BmpOSTd6f3hmsfpufNqvGLtqYmK4t3aEQwka9IsmysXP03JmA==", + "version": "4.3.3", + "resolved": "https://registry.npmjs.org/dkg-evm-module/-/dkg-evm-module-4.3.3.tgz", + "integrity": "sha512-94u6LGzq8LDSDt/IUxiFrmrMVvxu9B3N5NdcrfP9hIEgx4M0D3srsEj76L1rPrJ9MaBm8IW/i4M7rNpSK/FnBg==", "dependencies": { "@openzeppelin/contracts": "^4.9.3", + "@polkadot/api": "^11.0.3", + "@polkadot/keyring": "^12.6.2", + "@polkadot/util": "^12.6.2", + "@polkadot/util-crypto": "^12.6.2", "@prb/math": "^2.5.0", "dotenv": "^16.0.3", "hardhat": "^2.22.5", "hardhat-deploy": "^0.11.25", - "hardhat-deploy-ethers": "^0.3.0-beta.13" + "hardhat-deploy-ethers": "^0.3.0-beta.13", + "ts-node": "^10.9.2", + "typescript": "^5.4.5" + } + }, + "node_modules/dkg-evm-module/node_modules/@noble/hashes": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.4.0.tgz", + "integrity": "sha512-V1JJ1WTRUqHHrOSh597hURcMqVKVGL/ea3kv0gSnEdsEZ0/+VyPghM1lMNGc00z7CIQorSvbKpuJkxvuHbvdbg==", + "engines": { + "node": ">= 16" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/dkg-evm-module/node_modules/@polkadot/api": { + "version": "11.3.1", + "resolved": "https://registry.npmjs.org/@polkadot/api/-/api-11.3.1.tgz", + "integrity": "sha512-q4kFIIHTLvKxM24b0Eo8hJevsPMme+aITJGrDML9BgdZYTRN14+cu5nXiCsQvaEamdyYj+uCXWe2OV9X7pPxsA==", + "dependencies": { + "@polkadot/api-augment": "11.3.1", + "@polkadot/api-base": "11.3.1", + "@polkadot/api-derive": "11.3.1", + "@polkadot/keyring": "^12.6.2", + "@polkadot/rpc-augment": "11.3.1", + "@polkadot/rpc-core": "11.3.1", + "@polkadot/rpc-provider": "11.3.1", + "@polkadot/types": "11.3.1", + "@polkadot/types-augment": "11.3.1", + "@polkadot/types-codec": "11.3.1", + "@polkadot/types-create": "11.3.1", + "@polkadot/types-known": "11.3.1", + "@polkadot/util": "^12.6.2", + "@polkadot/util-crypto": "^12.6.2", + "eventemitter3": "^5.0.1", + "rxjs": "^7.8.1", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/dkg-evm-module/node_modules/@polkadot/api-augment": { + "version": "11.3.1", + "resolved": "https://registry.npmjs.org/@polkadot/api-augment/-/api-augment-11.3.1.tgz", + "integrity": "sha512-Yj+6rb6h0WwY3yJ+UGhjGW+tyMRFUMsKQuGw+eFsXdjiNU9UoXsAqA2dG7Q1F+oeX/g+y2gLGBezNoCwbl6HfA==", + "dependencies": { + "@polkadot/api-base": "11.3.1", + "@polkadot/rpc-augment": "11.3.1", + "@polkadot/types": "11.3.1", + "@polkadot/types-augment": "11.3.1", + "@polkadot/types-codec": "11.3.1", + "@polkadot/util": "^12.6.2", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/dkg-evm-module/node_modules/@polkadot/api-base": { + "version": "11.3.1", + "resolved": "https://registry.npmjs.org/@polkadot/api-base/-/api-base-11.3.1.tgz", + "integrity": "sha512-b8UkNL00NN7+3QaLCwL5cKg+7YchHoKCAhwKusWHNBZkkO6Oo2BWilu0dZkPJOyqV9P389Kbd9+oH+SKs9u2VQ==", + "dependencies": { + "@polkadot/rpc-core": "11.3.1", + "@polkadot/types": "11.3.1", + "@polkadot/util": "^12.6.2", + "rxjs": "^7.8.1", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/dkg-evm-module/node_modules/@polkadot/api-derive": { + "version": "11.3.1", + "resolved": "https://registry.npmjs.org/@polkadot/api-derive/-/api-derive-11.3.1.tgz", + "integrity": "sha512-9dopzrh4cRuft1nANmBvMY/hEhFDu0VICMTOGxQLOl8NMfcOFPTLAN0JhSBUoicGZhV+c4vpv01NBx/7/IL1HA==", + "dependencies": { + "@polkadot/api": "11.3.1", + "@polkadot/api-augment": "11.3.1", + "@polkadot/api-base": "11.3.1", + "@polkadot/rpc-core": "11.3.1", + "@polkadot/types": "11.3.1", + "@polkadot/types-codec": "11.3.1", + "@polkadot/util": "^12.6.2", + "@polkadot/util-crypto": "^12.6.2", + "rxjs": "^7.8.1", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/dkg-evm-module/node_modules/@polkadot/keyring": { + "version": "12.6.2", + "resolved": "https://registry.npmjs.org/@polkadot/keyring/-/keyring-12.6.2.tgz", + "integrity": "sha512-O3Q7GVmRYm8q7HuB3S0+Yf/q/EB2egKRRU3fv9b3B7V+A52tKzA+vIwEmNVaD1g5FKW9oB97rmpggs0zaKFqHw==", + "dependencies": { + "@polkadot/util": "12.6.2", + "@polkadot/util-crypto": "12.6.2", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "@polkadot/util": "12.6.2", + "@polkadot/util-crypto": "12.6.2" } }, + "node_modules/dkg-evm-module/node_modules/@polkadot/networks": { + "version": "12.6.2", + "resolved": "https://registry.npmjs.org/@polkadot/networks/-/networks-12.6.2.tgz", + "integrity": "sha512-1oWtZm1IvPWqvMrldVH6NI2gBoCndl5GEwx7lAuQWGr7eNL+6Bdc5K3Z9T0MzFvDGoi2/CBqjX9dRKo39pDC/w==", + "dependencies": { + "@polkadot/util": "12.6.2", + "@substrate/ss58-registry": "^1.44.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/dkg-evm-module/node_modules/@polkadot/rpc-augment": { + "version": "11.3.1", + "resolved": "https://registry.npmjs.org/@polkadot/rpc-augment/-/rpc-augment-11.3.1.tgz", + "integrity": "sha512-2PaDcKNju4QYQpxwVkWbRU3M0t340nMX9cMo+8awgvgL1LliV/fUDZueMKLuSS910JJMTPQ7y2pK4eQgMt08gQ==", + "dependencies": { + "@polkadot/rpc-core": "11.3.1", + "@polkadot/types": "11.3.1", + "@polkadot/types-codec": "11.3.1", + "@polkadot/util": "^12.6.2", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/dkg-evm-module/node_modules/@polkadot/rpc-core": { + "version": "11.3.1", + "resolved": "https://registry.npmjs.org/@polkadot/rpc-core/-/rpc-core-11.3.1.tgz", + "integrity": "sha512-KKNepsDd/mpmXcA6v/h14eFFPEzLGd7nrvx2UUXUxoZ0Fq2MH1hplP3s93k1oduNY/vOXJR2K9S4dKManA6GVQ==", + "dependencies": { + "@polkadot/rpc-augment": "11.3.1", + "@polkadot/rpc-provider": "11.3.1", + "@polkadot/types": "11.3.1", + "@polkadot/util": "^12.6.2", + "rxjs": "^7.8.1", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/dkg-evm-module/node_modules/@polkadot/rpc-provider": { + "version": "11.3.1", + "resolved": "https://registry.npmjs.org/@polkadot/rpc-provider/-/rpc-provider-11.3.1.tgz", + "integrity": "sha512-pqERChoHo45hd3WAgW8UuzarRF+G/o/eXEbl0PXLubiayw4X4qCmIzmtntUcKYgxGNcYGZaG87ZU8OjN97m6UA==", + "dependencies": { + "@polkadot/keyring": "^12.6.2", + "@polkadot/types": "11.3.1", + "@polkadot/types-support": "11.3.1", + "@polkadot/util": "^12.6.2", + "@polkadot/util-crypto": "^12.6.2", + "@polkadot/x-fetch": "^12.6.2", + "@polkadot/x-global": "^12.6.2", + "@polkadot/x-ws": "^12.6.2", + "eventemitter3": "^5.0.1", + "mock-socket": "^9.3.1", + "nock": "^13.5.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18" + }, + "optionalDependencies": { + "@substrate/connect": "0.8.10" + } + }, + "node_modules/dkg-evm-module/node_modules/@polkadot/types": { + "version": "11.3.1", + "resolved": "https://registry.npmjs.org/@polkadot/types/-/types-11.3.1.tgz", + "integrity": "sha512-5c7uRFXQTT11Awi6T0yFIdAfD6xGDAOz06Kp7M5S9OGNZY28wSPk5x6BYfNphWPaIBmHHewYJB5qmnrdYQAWKQ==", + "dependencies": { + "@polkadot/keyring": "^12.6.2", + "@polkadot/types-augment": "11.3.1", + "@polkadot/types-codec": "11.3.1", + "@polkadot/types-create": "11.3.1", + "@polkadot/util": "^12.6.2", + "@polkadot/util-crypto": "^12.6.2", + "rxjs": "^7.8.1", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/dkg-evm-module/node_modules/@polkadot/types-augment": { + "version": "11.3.1", + "resolved": "https://registry.npmjs.org/@polkadot/types-augment/-/types-augment-11.3.1.tgz", + "integrity": "sha512-eR3HVpvUmB3v7q2jTWVmVfAVfb1/kuNn7ij94Zqadg/fuUq0pKqIOKwkUj3OxRM3A/5BnW3MbgparjKD3r+fyw==", + "dependencies": { + "@polkadot/types": "11.3.1", + "@polkadot/types-codec": "11.3.1", + "@polkadot/util": "^12.6.2", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/dkg-evm-module/node_modules/@polkadot/types-codec": { + "version": "11.3.1", + "resolved": "https://registry.npmjs.org/@polkadot/types-codec/-/types-codec-11.3.1.tgz", + "integrity": "sha512-i7IiiuuL+Z/jFoKTA9xeh4wGQnhnNNjMT0+1ohvlOvnFsoKZKFQQOaDPPntGJVL1JDCV+KjkN2uQKZSeW8tguQ==", + "dependencies": { + "@polkadot/util": "^12.6.2", + "@polkadot/x-bigint": "^12.6.2", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/dkg-evm-module/node_modules/@polkadot/types-create": { + "version": "11.3.1", + "resolved": "https://registry.npmjs.org/@polkadot/types-create/-/types-create-11.3.1.tgz", + "integrity": "sha512-pBXtpz5FehcRJ6j5MzFUIUN8ZWM7z6HbqK1GxBmYbJVRElcGcOg7a/rL2pQVphU0Rx1E8bSO4thzGf4wUxSX7w==", + "dependencies": { + "@polkadot/types-codec": "11.3.1", + "@polkadot/util": "^12.6.2", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/dkg-evm-module/node_modules/@polkadot/types-known": { + "version": "11.3.1", + "resolved": "https://registry.npmjs.org/@polkadot/types-known/-/types-known-11.3.1.tgz", + "integrity": "sha512-3BIof7u6tn9bk3ZCIxA07iNoQ3uj4+vn3DTOjCKECozkRlt6V+kWRvqh16Hc0SHMg/QjcMb2fIu/WZhka1McUQ==", + "dependencies": { + "@polkadot/networks": "^12.6.2", + "@polkadot/types": "11.3.1", + "@polkadot/types-codec": "11.3.1", + "@polkadot/types-create": "11.3.1", + "@polkadot/util": "^12.6.2", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/dkg-evm-module/node_modules/@polkadot/types-support": { + "version": "11.3.1", + "resolved": "https://registry.npmjs.org/@polkadot/types-support/-/types-support-11.3.1.tgz", + "integrity": "sha512-jTFz1GKyF7nI29yIOq4v0NiWTOf5yX4HahJNeFD8TcxoLhF+6tH/XXqrUXJEfbaTlSrRWiW1LZYlb+snctqKHA==", + "dependencies": { + "@polkadot/util": "^12.6.2", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/dkg-evm-module/node_modules/@polkadot/util": { + "version": "12.6.2", + "resolved": "https://registry.npmjs.org/@polkadot/util/-/util-12.6.2.tgz", + "integrity": "sha512-l8TubR7CLEY47240uki0TQzFvtnxFIO7uI/0GoWzpYD/O62EIAMRsuY01N4DuwgKq2ZWD59WhzsLYmA5K6ksdw==", + "dependencies": { + "@polkadot/x-bigint": "12.6.2", + "@polkadot/x-global": "12.6.2", + "@polkadot/x-textdecoder": "12.6.2", + "@polkadot/x-textencoder": "12.6.2", + "@types/bn.js": "^5.1.5", + "bn.js": "^5.2.1", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/dkg-evm-module/node_modules/@polkadot/util-crypto": { + "version": "12.6.2", + "resolved": "https://registry.npmjs.org/@polkadot/util-crypto/-/util-crypto-12.6.2.tgz", + "integrity": "sha512-FEWI/dJ7wDMNN1WOzZAjQoIcCP/3vz3wvAp5QQm+lOrzOLj0iDmaIGIcBkz8HVm3ErfSe/uKP0KS4jgV/ib+Mg==", + "dependencies": { + "@noble/curves": "^1.3.0", + "@noble/hashes": "^1.3.3", + "@polkadot/networks": "12.6.2", + "@polkadot/util": "12.6.2", + "@polkadot/wasm-crypto": "^7.3.2", + "@polkadot/wasm-util": "^7.3.2", + "@polkadot/x-bigint": "12.6.2", + "@polkadot/x-randomvalues": "12.6.2", + "@scure/base": "^1.1.5", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "@polkadot/util": "12.6.2" + } + }, + "node_modules/dkg-evm-module/node_modules/@polkadot/wasm-bridge": { + "version": "7.3.2", + "resolved": "https://registry.npmjs.org/@polkadot/wasm-bridge/-/wasm-bridge-7.3.2.tgz", + "integrity": "sha512-AJEXChcf/nKXd5Q/YLEV5dXQMle3UNT7jcXYmIffZAo/KI394a+/24PaISyQjoNC0fkzS1Q8T5pnGGHmXiVz2g==", + "dependencies": { + "@polkadot/wasm-util": "7.3.2", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "@polkadot/util": "*", + "@polkadot/x-randomvalues": "*" + } + }, + "node_modules/dkg-evm-module/node_modules/@polkadot/wasm-crypto": { + "version": "7.3.2", + "resolved": "https://registry.npmjs.org/@polkadot/wasm-crypto/-/wasm-crypto-7.3.2.tgz", + "integrity": "sha512-+neIDLSJ6jjVXsjyZ5oLSv16oIpwp+PxFqTUaZdZDoA2EyFRQB8pP7+qLsMNk+WJuhuJ4qXil/7XiOnZYZ+wxw==", + "dependencies": { + "@polkadot/wasm-bridge": "7.3.2", + "@polkadot/wasm-crypto-asmjs": "7.3.2", + "@polkadot/wasm-crypto-init": "7.3.2", + "@polkadot/wasm-crypto-wasm": "7.3.2", + "@polkadot/wasm-util": "7.3.2", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "@polkadot/util": "*", + "@polkadot/x-randomvalues": "*" + } + }, + "node_modules/dkg-evm-module/node_modules/@polkadot/wasm-crypto-asmjs": { + "version": "7.3.2", + "resolved": "https://registry.npmjs.org/@polkadot/wasm-crypto-asmjs/-/wasm-crypto-asmjs-7.3.2.tgz", + "integrity": "sha512-QP5eiUqUFur/2UoF2KKKYJcesc71fXhQFLT3D4ZjG28Mfk2ZPI0QNRUfpcxVQmIUpV5USHg4geCBNuCYsMm20Q==", + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "@polkadot/util": "*" + } + }, + "node_modules/dkg-evm-module/node_modules/@polkadot/wasm-crypto-init": { + "version": "7.3.2", + "resolved": "https://registry.npmjs.org/@polkadot/wasm-crypto-init/-/wasm-crypto-init-7.3.2.tgz", + "integrity": "sha512-FPq73zGmvZtnuJaFV44brze3Lkrki3b4PebxCy9Fplw8nTmisKo9Xxtfew08r0njyYh+uiJRAxPCXadkC9sc8g==", + "dependencies": { + "@polkadot/wasm-bridge": "7.3.2", + "@polkadot/wasm-crypto-asmjs": "7.3.2", + "@polkadot/wasm-crypto-wasm": "7.3.2", + "@polkadot/wasm-util": "7.3.2", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "@polkadot/util": "*", + "@polkadot/x-randomvalues": "*" + } + }, + "node_modules/dkg-evm-module/node_modules/@polkadot/wasm-crypto-wasm": { + "version": "7.3.2", + "resolved": "https://registry.npmjs.org/@polkadot/wasm-crypto-wasm/-/wasm-crypto-wasm-7.3.2.tgz", + "integrity": "sha512-15wd0EMv9IXs5Abp1ZKpKKAVyZPhATIAHfKsyoWCEFDLSOA0/K0QGOxzrAlsrdUkiKZOq7uzSIgIDgW8okx2Mw==", + "dependencies": { + "@polkadot/wasm-util": "7.3.2", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "@polkadot/util": "*" + } + }, + "node_modules/dkg-evm-module/node_modules/@polkadot/wasm-util": { + "version": "7.3.2", + "resolved": "https://registry.npmjs.org/@polkadot/wasm-util/-/wasm-util-7.3.2.tgz", + "integrity": "sha512-bmD+Dxo1lTZyZNxbyPE380wd82QsX+43mgCm40boyKrRppXEyQmWT98v/Poc7chLuskYb6X8IQ6lvvK2bGR4Tg==", + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "@polkadot/util": "*" + } + }, + "node_modules/dkg-evm-module/node_modules/@polkadot/x-bigint": { + "version": "12.6.2", + "resolved": "https://registry.npmjs.org/@polkadot/x-bigint/-/x-bigint-12.6.2.tgz", + "integrity": "sha512-HSIk60uFPX4GOFZSnIF7VYJz7WZA7tpFJsne7SzxOooRwMTWEtw3fUpFy5cYYOeLh17/kHH1Y7SVcuxzVLc74Q==", + "dependencies": { + "@polkadot/x-global": "12.6.2", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/dkg-evm-module/node_modules/@polkadot/x-fetch": { + "version": "12.6.2", + "resolved": "https://registry.npmjs.org/@polkadot/x-fetch/-/x-fetch-12.6.2.tgz", + "integrity": "sha512-8wM/Z9JJPWN1pzSpU7XxTI1ldj/AfC8hKioBlUahZ8gUiJaOF7K9XEFCrCDLis/A1BoOu7Ne6WMx/vsJJIbDWw==", + "dependencies": { + "@polkadot/x-global": "12.6.2", + "node-fetch": "^3.3.2", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/dkg-evm-module/node_modules/@polkadot/x-global": { + "version": "12.6.2", + "resolved": "https://registry.npmjs.org/@polkadot/x-global/-/x-global-12.6.2.tgz", + "integrity": "sha512-a8d6m+PW98jmsYDtAWp88qS4dl8DyqUBsd0S+WgyfSMtpEXu6v9nXDgPZgwF5xdDvXhm+P0ZfVkVTnIGrScb5g==", + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/dkg-evm-module/node_modules/@polkadot/x-randomvalues": { + "version": "12.6.2", + "resolved": "https://registry.npmjs.org/@polkadot/x-randomvalues/-/x-randomvalues-12.6.2.tgz", + "integrity": "sha512-Vr8uG7rH2IcNJwtyf5ebdODMcr0XjoCpUbI91Zv6AlKVYOGKZlKLYJHIwpTaKKB+7KPWyQrk4Mlym/rS7v9feg==", + "dependencies": { + "@polkadot/x-global": "12.6.2", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "@polkadot/util": "12.6.2", + "@polkadot/wasm-util": "*" + } + }, + "node_modules/dkg-evm-module/node_modules/@polkadot/x-textdecoder": { + "version": "12.6.2", + "resolved": "https://registry.npmjs.org/@polkadot/x-textdecoder/-/x-textdecoder-12.6.2.tgz", + "integrity": "sha512-M1Bir7tYvNappfpFWXOJcnxUhBUFWkUFIdJSyH0zs5LmFtFdbKAeiDXxSp2Swp5ddOZdZgPac294/o2TnQKN1w==", + "dependencies": { + "@polkadot/x-global": "12.6.2", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/dkg-evm-module/node_modules/@polkadot/x-textencoder": { + "version": "12.6.2", + "resolved": "https://registry.npmjs.org/@polkadot/x-textencoder/-/x-textencoder-12.6.2.tgz", + "integrity": "sha512-4N+3UVCpI489tUJ6cv3uf0PjOHvgGp9Dl+SZRLgFGt9mvxnvpW/7+XBADRMtlG4xi5gaRK7bgl5bmY6OMDsNdw==", + "dependencies": { + "@polkadot/x-global": "12.6.2", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/dkg-evm-module/node_modules/@polkadot/x-ws": { + "version": "12.6.2", + "resolved": "https://registry.npmjs.org/@polkadot/x-ws/-/x-ws-12.6.2.tgz", + "integrity": "sha512-cGZWo7K5eRRQCRl2LrcyCYsrc3lRbTlixZh3AzgU8uX4wASVGRlNWi/Hf4TtHNe1ExCDmxabJzdIsABIfrr7xw==", + "dependencies": { + "@polkadot/x-global": "12.6.2", + "tslib": "^2.6.2", + "ws": "^8.15.1" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/dkg-evm-module/node_modules/@scure/base": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/@scure/base/-/base-1.1.7.tgz", + "integrity": "sha512-PPNYBslrLNNUQ/Yad37MHYsNQtK67EhWb6WtSvNLLPo7SdVZgkUjD6Dg+5On7zNwmskf8OX7I7Nx5oN+MIWE0g==", + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/dkg-evm-module/node_modules/@substrate/connect": { + "version": "0.8.10", + "resolved": "https://registry.npmjs.org/@substrate/connect/-/connect-0.8.10.tgz", + "integrity": "sha512-DIyQ13DDlXqVFnLV+S6/JDgiGowVRRrh18kahieJxhgvzcWicw5eLc6jpfQ0moVVLBYkO7rctB5Wreldwpva8w==", + "deprecated": "versions below 1.x are no longer maintained", + "optional": true, + "dependencies": { + "@substrate/connect-extension-protocol": "^2.0.0", + "@substrate/connect-known-chains": "^1.1.4", + "@substrate/light-client-extension-helpers": "^0.0.6", + "smoldot": "2.0.22" + } + }, + "node_modules/dkg-evm-module/node_modules/@substrate/connect-extension-protocol": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@substrate/connect-extension-protocol/-/connect-extension-protocol-2.0.0.tgz", + "integrity": "sha512-nKu8pDrE3LNCEgJjZe1iGXzaD6OSIDD4Xzz/yo4KO9mQ6LBvf49BVrt4qxBFGL6++NneLiWUZGoh+VSd4PyVIg==", + "optional": true + }, "node_modules/dkg.js": { "version": "6.3.0", "resolved": "https://registry.npmjs.org/dkg.js/-/dkg.js-6.3.0.tgz", @@ -15044,6 +15716,11 @@ "semver": "bin/semver.js" } }, + "node_modules/make-error": { + "version": "1.3.6", + "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", + "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==" + }, "node_modules/match-all": { "version": "1.2.6", "resolved": "https://registry.npmjs.org/match-all/-/match-all-1.2.6.tgz", @@ -18294,6 +18971,12 @@ "node": ">=10" } }, + "node_modules/scale-ts": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/scale-ts/-/scale-ts-1.6.0.tgz", + "integrity": "sha512-Ja5VCjNZR8TGKhUumy9clVVxcDpM+YFjAnkMuwQy68Hixio3VRRvWdE3g8T/yC+HXA0ZDQl2TGyUmtmbcVl40Q==", + "optional": true + }, "node_modules/scrypt-js": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/scrypt-js/-/scrypt-js-3.0.1.tgz", @@ -18772,6 +19455,15 @@ "node": ">=8.0.0" } }, + "node_modules/smoldot": { + "version": "2.0.22", + "resolved": "https://registry.npmjs.org/smoldot/-/smoldot-2.0.22.tgz", + "integrity": "sha512-B50vRgTY6v3baYH6uCgL15tfaag5tcS2o/P5q1OiXcKGv1axZDfz2dzzMuIkVpyMR2ug11F6EAtQlmYBQd292g==", + "optional": true, + "dependencies": { + "ws": "^8.8.1" + } + }, "node_modules/solc": { "version": "0.7.3", "resolved": "https://registry.npmjs.org/solc/-/solc-0.7.3.tgz", @@ -19742,6 +20434,59 @@ "utf8-byte-length": "^1.0.1" } }, + "node_modules/ts-node": { + "version": "10.9.2", + "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.9.2.tgz", + "integrity": "sha512-f0FFpIdcHgn8zcPSbf1dRevwt047YMnaiJM3u2w2RewrB+fob/zePZcrOyQoLMMO7aBIddLcQIEK5dYjkLnGrQ==", + "dependencies": { + "@cspotcode/source-map-support": "^0.8.0", + "@tsconfig/node10": "^1.0.7", + "@tsconfig/node12": "^1.0.7", + "@tsconfig/node14": "^1.0.0", + "@tsconfig/node16": "^1.0.2", + "acorn": "^8.4.1", + "acorn-walk": "^8.1.1", + "arg": "^4.1.0", + "create-require": "^1.1.0", + "diff": "^4.0.1", + "make-error": "^1.1.1", + "v8-compile-cache-lib": "^3.0.1", + "yn": "3.1.1" + }, + "bin": { + "ts-node": "dist/bin.js", + "ts-node-cwd": "dist/bin-cwd.js", + "ts-node-esm": "dist/bin-esm.js", + "ts-node-script": "dist/bin-script.js", + "ts-node-transpile-only": "dist/bin-transpile.js", + "ts-script": "dist/bin-script-deprecated.js" + }, + "peerDependencies": { + "@swc/core": ">=1.2.50", + "@swc/wasm": ">=1.2.50", + "@types/node": "*", + "typescript": ">=2.7" + }, + "peerDependenciesMeta": { + "@swc/core": { + "optional": true + }, + "@swc/wasm": { + "optional": true + } + } + }, + "node_modules/ts-node/node_modules/acorn-walk": { + "version": "8.3.3", + "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.3.3.tgz", + "integrity": "sha512-MxXdReSRhGO7VlFe1bRG/oI7/mdLV9B9JJT0N8vZOhF7gFRR5l3M8W9G8JxmKV+JC5mGqJ0QvqfSOLsCPa4nUw==", + "dependencies": { + "acorn": "^8.11.0" + }, + "engines": { + "node": ">=0.4.0" + } + }, "node_modules/tsconfig-paths": { "version": "3.15.0", "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.15.0.tgz", @@ -19951,6 +20696,18 @@ "is-typedarray": "^1.0.0" } }, + "node_modules/typescript": { + "version": "5.5.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.5.2.tgz", + "integrity": "sha512-NcRtPEOsPFFWjobJEtfihkLCZCXZt/os3zf8nTxjVH3RvTSxjrCamJpbExGvYOF+tFHc3pA65qpdwPbzjohhew==", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, "node_modules/uint8arrays": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/uint8arrays/-/uint8arrays-3.1.1.tgz", @@ -20236,6 +20993,11 @@ "uuid": "dist/bin/uuid" } }, + "node_modules/v8-compile-cache-lib": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz", + "integrity": "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==" + }, "node_modules/validate-iri": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/validate-iri/-/validate-iri-1.0.1.tgz", @@ -21099,7 +21861,6 @@ "version": "8.17.0", "resolved": "https://registry.npmjs.org/ws/-/ws-8.17.0.tgz", "integrity": "sha512-uJq6108EgZMAl20KagGkzCKfMEjxmKvZHG7Tlq0Z6nOky7YF7aq4mOx6xK8TJ/i1LeK4Qus7INktacctDgY8Ow==", - "optional": true, "engines": { "node": ">=10.0.0" }, @@ -21327,6 +22088,14 @@ "node": ">=12" } }, + "node_modules/yn": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz", + "integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==", + "engines": { + "node": ">=6" + } + }, "node_modules/yocto-queue": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", @@ -23871,6 +24640,25 @@ "sparqlalgebrajs": "^4.2.0" } }, + "@cspotcode/source-map-support": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz", + "integrity": "sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==", + "requires": { + "@jridgewell/trace-mapping": "0.3.9" + }, + "dependencies": { + "@jridgewell/trace-mapping": { + "version": "0.3.9", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz", + "integrity": "sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==", + "requires": { + "@jridgewell/resolve-uri": "^3.0.3", + "@jridgewell/sourcemap-codec": "^1.4.10" + } + } + } + }, "@cucumber/ci-environment": { "version": "9.1.0", "resolved": "https://registry.npmjs.org/@cucumber/ci-environment/-/ci-environment-9.1.0.tgz", @@ -24852,8 +25640,7 @@ "@jridgewell/resolve-uri": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", - "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", - "dev": true + "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==" }, "@jridgewell/set-array": { "version": "1.2.1", @@ -24864,8 +25651,7 @@ "@jridgewell/sourcemap-codec": { "version": "1.4.15", "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz", - "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==", - "dev": true + "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==" }, "@jridgewell/trace-mapping": { "version": "0.3.25", @@ -25170,6 +25956,72 @@ "resolved": "https://registry.npmjs.org/@openzeppelin/contracts/-/contracts-4.9.6.tgz", "integrity": "sha512-xSmezSupL+y9VkHZJGDoCBpmnB2ogM13ccaYDWqJTfS3dbuHkgjuwDFUmaFauBCboQMGB/S5UqUl2y54X99BmA==" }, + "@polkadot-api/json-rpc-provider": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/@polkadot-api/json-rpc-provider/-/json-rpc-provider-0.0.1.tgz", + "integrity": "sha512-/SMC/l7foRjpykLTUTacIH05H3mr9ip8b5xxfwXlVezXrNVLp3Cv0GX6uItkKd+ZjzVPf3PFrDF2B2/HLSNESA==", + "optional": true + }, + "@polkadot-api/json-rpc-provider-proxy": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/@polkadot-api/json-rpc-provider-proxy/-/json-rpc-provider-proxy-0.0.1.tgz", + "integrity": "sha512-gmVDUP8LpCH0BXewbzqXF2sdHddq1H1q+XrAW2of+KZj4woQkIGBRGTJHeBEVHe30EB+UejR1N2dT4PO/RvDdg==", + "optional": true + }, + "@polkadot-api/metadata-builders": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/@polkadot-api/metadata-builders/-/metadata-builders-0.0.1.tgz", + "integrity": "sha512-GCI78BHDzXAF/L2pZD6Aod/yl82adqQ7ftNmKg51ixRL02JpWUA+SpUKTJE5MY1p8kiJJIo09P2um24SiJHxNA==", + "optional": true, + "requires": { + "@polkadot-api/substrate-bindings": "0.0.1", + "@polkadot-api/utils": "0.0.1" + } + }, + "@polkadot-api/observable-client": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/@polkadot-api/observable-client/-/observable-client-0.1.0.tgz", + "integrity": "sha512-GBCGDRztKorTLna/unjl/9SWZcRmvV58o9jwU2Y038VuPXZcr01jcw/1O3x+yeAuwyGzbucI/mLTDa1QoEml3A==", + "optional": true, + "requires": { + "@polkadot-api/metadata-builders": "0.0.1", + "@polkadot-api/substrate-bindings": "0.0.1", + "@polkadot-api/substrate-client": "0.0.1", + "@polkadot-api/utils": "0.0.1" + } + }, + "@polkadot-api/substrate-bindings": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/@polkadot-api/substrate-bindings/-/substrate-bindings-0.0.1.tgz", + "integrity": "sha512-bAe7a5bOPnuFVmpv7y4BBMRpNTnMmE0jtTqRUw/+D8ZlEHNVEJQGr4wu3QQCl7k1GnSV1wfv3mzIbYjErEBocg==", + "optional": true, + "requires": { + "@noble/hashes": "^1.3.1", + "@polkadot-api/utils": "0.0.1", + "@scure/base": "^1.1.1", + "scale-ts": "^1.6.0" + }, + "dependencies": { + "@noble/hashes": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.4.0.tgz", + "integrity": "sha512-V1JJ1WTRUqHHrOSh597hURcMqVKVGL/ea3kv0gSnEdsEZ0/+VyPghM1lMNGc00z7CIQorSvbKpuJkxvuHbvdbg==", + "optional": true + } + } + }, + "@polkadot-api/substrate-client": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/@polkadot-api/substrate-client/-/substrate-client-0.0.1.tgz", + "integrity": "sha512-9Bg9SGc3AwE+wXONQoW8GC00N3v6lCZLW74HQzqB6ROdcm5VAHM4CB/xRzWSUF9CXL78ugiwtHx3wBcpx4H4Wg==", + "optional": true + }, + "@polkadot-api/utils": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/@polkadot-api/utils/-/utils-0.0.1.tgz", + "integrity": "sha512-3j+pRmlF9SgiYDabSdZsBSsN5XHbpXOAce1lWj56IEEaFZVjsiCaxDOA7C9nCcgfVXuvnbxqqEGQvnY+QfBAUw==", + "optional": true + }, "@polkadot/api": { "version": "9.14.2", "resolved": "https://registry.npmjs.org/@polkadot/api/-/api-9.14.2.tgz", @@ -26081,6 +26933,35 @@ "integrity": "sha512-161JhCC1csjH3GE5mPLEd7HbWtwNSPJBg3p1Ksz9SFlTzj/bgEwudiRN2y5i0MoLGCIJRYKyKGMxVnd29PzNjg==", "optional": true }, + "@substrate/connect-known-chains": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/@substrate/connect-known-chains/-/connect-known-chains-1.1.6.tgz", + "integrity": "sha512-JwtdGbnK3ZqrY1qp3Ifr/p648sp9hG0Q715h4nRghnqZJnMQIiLKaFkcLnvrAiYQD3zNTYDztHidy5Q/u0TcbQ==", + "optional": true + }, + "@substrate/light-client-extension-helpers": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/@substrate/light-client-extension-helpers/-/light-client-extension-helpers-0.0.6.tgz", + "integrity": "sha512-girltEuxQ1BvkJWmc8JJlk4ZxnlGXc/wkLcNguhY+UoDEMBK0LsdtfzQKIfrIehi4QdeSBlFEFBoI4RqPmsZzA==", + "optional": true, + "requires": { + "@polkadot-api/json-rpc-provider": "0.0.1", + "@polkadot-api/json-rpc-provider-proxy": "0.0.1", + "@polkadot-api/observable-client": "0.1.0", + "@polkadot-api/substrate-client": "0.0.1", + "@substrate/connect-extension-protocol": "^2.0.0", + "@substrate/connect-known-chains": "^1.1.4", + "rxjs": "^7.8.1" + }, + "dependencies": { + "@substrate/connect-extension-protocol": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@substrate/connect-extension-protocol/-/connect-extension-protocol-2.0.0.tgz", + "integrity": "sha512-nKu8pDrE3LNCEgJjZe1iGXzaD6OSIDD4Xzz/yo4KO9mQ6LBvf49BVrt4qxBFGL6++NneLiWUZGoh+VSd4PyVIg==", + "optional": true + } + } + }, "@substrate/smoldot-light": { "version": "0.7.9", "resolved": "https://registry.npmjs.org/@substrate/smoldot-light/-/smoldot-light-0.7.9.tgz", @@ -26117,6 +26998,26 @@ "integrity": "sha512-RbzJvlNzmRq5c3O09UipeuXno4tA1FE6ikOjxZK0tuxVv3412l64l5t1W5pj4+rJq9vpkm/kwiR07aZXnsKPxw==", "dev": true }, + "@tsconfig/node10": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.11.tgz", + "integrity": "sha512-DcRjDCujK/kCk/cUe8Xz8ZSpm8mS3mNNpta+jGCA6USEDfktlNvm1+IuZ9eTcDbNk41BHwpHHeW+N1lKCz4zOw==" + }, + "@tsconfig/node12": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/@tsconfig/node12/-/node12-1.0.11.tgz", + "integrity": "sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag==" + }, + "@tsconfig/node14": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@tsconfig/node14/-/node14-1.0.3.tgz", + "integrity": "sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow==" + }, + "@tsconfig/node16": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@tsconfig/node16/-/node16-1.0.4.tgz", + "integrity": "sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA==" + }, "@types/argparse": { "version": "1.0.38", "resolved": "https://registry.npmjs.org/@types/argparse/-/argparse-1.0.38.tgz", @@ -26579,6 +27480,11 @@ "integrity": "sha512-Xg+9RwCg/0p32teKdGMPTPnVXKD0w3DfHnFTficozsAgsvq2XenPJq/MYpzzQ/v8zrOyJn6Ds39VA4JIDwFfqw==", "dev": true }, + "arg": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", + "integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==" + }, "argparse": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", @@ -27839,6 +28745,11 @@ "sha.js": "^2.4.8" } }, + "create-require": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz", + "integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==" + }, "cross-fetch": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-4.0.0.tgz", @@ -28770,20 +29681,409 @@ "diff": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", - "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", - "dev": true + "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==" }, "dkg-evm-module": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/dkg-evm-module/-/dkg-evm-module-4.3.0.tgz", - "integrity": "sha512-1aZFPCiWu9zCAR9Y+Tg1EHKw9jd7HAiaHiV76BmpOSTd6f3hmsfpufNqvGLtqYmK4t3aEQwka9IsmysXP03JmA==", + "version": "4.3.3", + "resolved": "https://registry.npmjs.org/dkg-evm-module/-/dkg-evm-module-4.3.3.tgz", + "integrity": "sha512-94u6LGzq8LDSDt/IUxiFrmrMVvxu9B3N5NdcrfP9hIEgx4M0D3srsEj76L1rPrJ9MaBm8IW/i4M7rNpSK/FnBg==", "requires": { "@openzeppelin/contracts": "^4.9.3", + "@polkadot/api": "^11.0.3", + "@polkadot/keyring": "^12.6.2", + "@polkadot/util": "^12.6.2", + "@polkadot/util-crypto": "^12.6.2", "@prb/math": "^2.5.0", "dotenv": "^16.0.3", "hardhat": "^2.22.5", "hardhat-deploy": "^0.11.25", - "hardhat-deploy-ethers": "^0.3.0-beta.13" + "hardhat-deploy-ethers": "^0.3.0-beta.13", + "ts-node": "^10.9.2", + "typescript": "^5.4.5" + }, + "dependencies": { + "@noble/hashes": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.4.0.tgz", + "integrity": "sha512-V1JJ1WTRUqHHrOSh597hURcMqVKVGL/ea3kv0gSnEdsEZ0/+VyPghM1lMNGc00z7CIQorSvbKpuJkxvuHbvdbg==" + }, + "@polkadot/api": { + "version": "11.3.1", + "resolved": "https://registry.npmjs.org/@polkadot/api/-/api-11.3.1.tgz", + "integrity": "sha512-q4kFIIHTLvKxM24b0Eo8hJevsPMme+aITJGrDML9BgdZYTRN14+cu5nXiCsQvaEamdyYj+uCXWe2OV9X7pPxsA==", + "requires": { + "@polkadot/api-augment": "11.3.1", + "@polkadot/api-base": "11.3.1", + "@polkadot/api-derive": "11.3.1", + "@polkadot/keyring": "^12.6.2", + "@polkadot/rpc-augment": "11.3.1", + "@polkadot/rpc-core": "11.3.1", + "@polkadot/rpc-provider": "11.3.1", + "@polkadot/types": "11.3.1", + "@polkadot/types-augment": "11.3.1", + "@polkadot/types-codec": "11.3.1", + "@polkadot/types-create": "11.3.1", + "@polkadot/types-known": "11.3.1", + "@polkadot/util": "^12.6.2", + "@polkadot/util-crypto": "^12.6.2", + "eventemitter3": "^5.0.1", + "rxjs": "^7.8.1", + "tslib": "^2.6.2" + } + }, + "@polkadot/api-augment": { + "version": "11.3.1", + "resolved": "https://registry.npmjs.org/@polkadot/api-augment/-/api-augment-11.3.1.tgz", + "integrity": "sha512-Yj+6rb6h0WwY3yJ+UGhjGW+tyMRFUMsKQuGw+eFsXdjiNU9UoXsAqA2dG7Q1F+oeX/g+y2gLGBezNoCwbl6HfA==", + "requires": { + "@polkadot/api-base": "11.3.1", + "@polkadot/rpc-augment": "11.3.1", + "@polkadot/types": "11.3.1", + "@polkadot/types-augment": "11.3.1", + "@polkadot/types-codec": "11.3.1", + "@polkadot/util": "^12.6.2", + "tslib": "^2.6.2" + } + }, + "@polkadot/api-base": { + "version": "11.3.1", + "resolved": "https://registry.npmjs.org/@polkadot/api-base/-/api-base-11.3.1.tgz", + "integrity": "sha512-b8UkNL00NN7+3QaLCwL5cKg+7YchHoKCAhwKusWHNBZkkO6Oo2BWilu0dZkPJOyqV9P389Kbd9+oH+SKs9u2VQ==", + "requires": { + "@polkadot/rpc-core": "11.3.1", + "@polkadot/types": "11.3.1", + "@polkadot/util": "^12.6.2", + "rxjs": "^7.8.1", + "tslib": "^2.6.2" + } + }, + "@polkadot/api-derive": { + "version": "11.3.1", + "resolved": "https://registry.npmjs.org/@polkadot/api-derive/-/api-derive-11.3.1.tgz", + "integrity": "sha512-9dopzrh4cRuft1nANmBvMY/hEhFDu0VICMTOGxQLOl8NMfcOFPTLAN0JhSBUoicGZhV+c4vpv01NBx/7/IL1HA==", + "requires": { + "@polkadot/api": "11.3.1", + "@polkadot/api-augment": "11.3.1", + "@polkadot/api-base": "11.3.1", + "@polkadot/rpc-core": "11.3.1", + "@polkadot/types": "11.3.1", + "@polkadot/types-codec": "11.3.1", + "@polkadot/util": "^12.6.2", + "@polkadot/util-crypto": "^12.6.2", + "rxjs": "^7.8.1", + "tslib": "^2.6.2" + } + }, + "@polkadot/keyring": { + "version": "12.6.2", + "resolved": "https://registry.npmjs.org/@polkadot/keyring/-/keyring-12.6.2.tgz", + "integrity": "sha512-O3Q7GVmRYm8q7HuB3S0+Yf/q/EB2egKRRU3fv9b3B7V+A52tKzA+vIwEmNVaD1g5FKW9oB97rmpggs0zaKFqHw==", + "requires": { + "@polkadot/util": "12.6.2", + "@polkadot/util-crypto": "12.6.2", + "tslib": "^2.6.2" + } + }, + "@polkadot/networks": { + "version": "12.6.2", + "resolved": "https://registry.npmjs.org/@polkadot/networks/-/networks-12.6.2.tgz", + "integrity": "sha512-1oWtZm1IvPWqvMrldVH6NI2gBoCndl5GEwx7lAuQWGr7eNL+6Bdc5K3Z9T0MzFvDGoi2/CBqjX9dRKo39pDC/w==", + "requires": { + "@polkadot/util": "12.6.2", + "@substrate/ss58-registry": "^1.44.0", + "tslib": "^2.6.2" + } + }, + "@polkadot/rpc-augment": { + "version": "11.3.1", + "resolved": "https://registry.npmjs.org/@polkadot/rpc-augment/-/rpc-augment-11.3.1.tgz", + "integrity": "sha512-2PaDcKNju4QYQpxwVkWbRU3M0t340nMX9cMo+8awgvgL1LliV/fUDZueMKLuSS910JJMTPQ7y2pK4eQgMt08gQ==", + "requires": { + "@polkadot/rpc-core": "11.3.1", + "@polkadot/types": "11.3.1", + "@polkadot/types-codec": "11.3.1", + "@polkadot/util": "^12.6.2", + "tslib": "^2.6.2" + } + }, + "@polkadot/rpc-core": { + "version": "11.3.1", + "resolved": "https://registry.npmjs.org/@polkadot/rpc-core/-/rpc-core-11.3.1.tgz", + "integrity": "sha512-KKNepsDd/mpmXcA6v/h14eFFPEzLGd7nrvx2UUXUxoZ0Fq2MH1hplP3s93k1oduNY/vOXJR2K9S4dKManA6GVQ==", + "requires": { + "@polkadot/rpc-augment": "11.3.1", + "@polkadot/rpc-provider": "11.3.1", + "@polkadot/types": "11.3.1", + "@polkadot/util": "^12.6.2", + "rxjs": "^7.8.1", + "tslib": "^2.6.2" + } + }, + "@polkadot/rpc-provider": { + "version": "11.3.1", + "resolved": "https://registry.npmjs.org/@polkadot/rpc-provider/-/rpc-provider-11.3.1.tgz", + "integrity": "sha512-pqERChoHo45hd3WAgW8UuzarRF+G/o/eXEbl0PXLubiayw4X4qCmIzmtntUcKYgxGNcYGZaG87ZU8OjN97m6UA==", + "requires": { + "@polkadot/keyring": "^12.6.2", + "@polkadot/types": "11.3.1", + "@polkadot/types-support": "11.3.1", + "@polkadot/util": "^12.6.2", + "@polkadot/util-crypto": "^12.6.2", + "@polkadot/x-fetch": "^12.6.2", + "@polkadot/x-global": "^12.6.2", + "@polkadot/x-ws": "^12.6.2", + "@substrate/connect": "0.8.10", + "eventemitter3": "^5.0.1", + "mock-socket": "^9.3.1", + "nock": "^13.5.0", + "tslib": "^2.6.2" + } + }, + "@polkadot/types": { + "version": "11.3.1", + "resolved": "https://registry.npmjs.org/@polkadot/types/-/types-11.3.1.tgz", + "integrity": "sha512-5c7uRFXQTT11Awi6T0yFIdAfD6xGDAOz06Kp7M5S9OGNZY28wSPk5x6BYfNphWPaIBmHHewYJB5qmnrdYQAWKQ==", + "requires": { + "@polkadot/keyring": "^12.6.2", + "@polkadot/types-augment": "11.3.1", + "@polkadot/types-codec": "11.3.1", + "@polkadot/types-create": "11.3.1", + "@polkadot/util": "^12.6.2", + "@polkadot/util-crypto": "^12.6.2", + "rxjs": "^7.8.1", + "tslib": "^2.6.2" + } + }, + "@polkadot/types-augment": { + "version": "11.3.1", + "resolved": "https://registry.npmjs.org/@polkadot/types-augment/-/types-augment-11.3.1.tgz", + "integrity": "sha512-eR3HVpvUmB3v7q2jTWVmVfAVfb1/kuNn7ij94Zqadg/fuUq0pKqIOKwkUj3OxRM3A/5BnW3MbgparjKD3r+fyw==", + "requires": { + "@polkadot/types": "11.3.1", + "@polkadot/types-codec": "11.3.1", + "@polkadot/util": "^12.6.2", + "tslib": "^2.6.2" + } + }, + "@polkadot/types-codec": { + "version": "11.3.1", + "resolved": "https://registry.npmjs.org/@polkadot/types-codec/-/types-codec-11.3.1.tgz", + "integrity": "sha512-i7IiiuuL+Z/jFoKTA9xeh4wGQnhnNNjMT0+1ohvlOvnFsoKZKFQQOaDPPntGJVL1JDCV+KjkN2uQKZSeW8tguQ==", + "requires": { + "@polkadot/util": "^12.6.2", + "@polkadot/x-bigint": "^12.6.2", + "tslib": "^2.6.2" + } + }, + "@polkadot/types-create": { + "version": "11.3.1", + "resolved": "https://registry.npmjs.org/@polkadot/types-create/-/types-create-11.3.1.tgz", + "integrity": "sha512-pBXtpz5FehcRJ6j5MzFUIUN8ZWM7z6HbqK1GxBmYbJVRElcGcOg7a/rL2pQVphU0Rx1E8bSO4thzGf4wUxSX7w==", + "requires": { + "@polkadot/types-codec": "11.3.1", + "@polkadot/util": "^12.6.2", + "tslib": "^2.6.2" + } + }, + "@polkadot/types-known": { + "version": "11.3.1", + "resolved": "https://registry.npmjs.org/@polkadot/types-known/-/types-known-11.3.1.tgz", + "integrity": "sha512-3BIof7u6tn9bk3ZCIxA07iNoQ3uj4+vn3DTOjCKECozkRlt6V+kWRvqh16Hc0SHMg/QjcMb2fIu/WZhka1McUQ==", + "requires": { + "@polkadot/networks": "^12.6.2", + "@polkadot/types": "11.3.1", + "@polkadot/types-codec": "11.3.1", + "@polkadot/types-create": "11.3.1", + "@polkadot/util": "^12.6.2", + "tslib": "^2.6.2" + } + }, + "@polkadot/types-support": { + "version": "11.3.1", + "resolved": "https://registry.npmjs.org/@polkadot/types-support/-/types-support-11.3.1.tgz", + "integrity": "sha512-jTFz1GKyF7nI29yIOq4v0NiWTOf5yX4HahJNeFD8TcxoLhF+6tH/XXqrUXJEfbaTlSrRWiW1LZYlb+snctqKHA==", + "requires": { + "@polkadot/util": "^12.6.2", + "tslib": "^2.6.2" + } + }, + "@polkadot/util": { + "version": "12.6.2", + "resolved": "https://registry.npmjs.org/@polkadot/util/-/util-12.6.2.tgz", + "integrity": "sha512-l8TubR7CLEY47240uki0TQzFvtnxFIO7uI/0GoWzpYD/O62EIAMRsuY01N4DuwgKq2ZWD59WhzsLYmA5K6ksdw==", + "requires": { + "@polkadot/x-bigint": "12.6.2", + "@polkadot/x-global": "12.6.2", + "@polkadot/x-textdecoder": "12.6.2", + "@polkadot/x-textencoder": "12.6.2", + "@types/bn.js": "^5.1.5", + "bn.js": "^5.2.1", + "tslib": "^2.6.2" + } + }, + "@polkadot/util-crypto": { + "version": "12.6.2", + "resolved": "https://registry.npmjs.org/@polkadot/util-crypto/-/util-crypto-12.6.2.tgz", + "integrity": "sha512-FEWI/dJ7wDMNN1WOzZAjQoIcCP/3vz3wvAp5QQm+lOrzOLj0iDmaIGIcBkz8HVm3ErfSe/uKP0KS4jgV/ib+Mg==", + "requires": { + "@noble/curves": "^1.3.0", + "@noble/hashes": "^1.3.3", + "@polkadot/networks": "12.6.2", + "@polkadot/util": "12.6.2", + "@polkadot/wasm-crypto": "^7.3.2", + "@polkadot/wasm-util": "^7.3.2", + "@polkadot/x-bigint": "12.6.2", + "@polkadot/x-randomvalues": "12.6.2", + "@scure/base": "^1.1.5", + "tslib": "^2.6.2" + } + }, + "@polkadot/wasm-bridge": { + "version": "7.3.2", + "resolved": "https://registry.npmjs.org/@polkadot/wasm-bridge/-/wasm-bridge-7.3.2.tgz", + "integrity": "sha512-AJEXChcf/nKXd5Q/YLEV5dXQMle3UNT7jcXYmIffZAo/KI394a+/24PaISyQjoNC0fkzS1Q8T5pnGGHmXiVz2g==", + "requires": { + "@polkadot/wasm-util": "7.3.2", + "tslib": "^2.6.2" + } + }, + "@polkadot/wasm-crypto": { + "version": "7.3.2", + "resolved": "https://registry.npmjs.org/@polkadot/wasm-crypto/-/wasm-crypto-7.3.2.tgz", + "integrity": "sha512-+neIDLSJ6jjVXsjyZ5oLSv16oIpwp+PxFqTUaZdZDoA2EyFRQB8pP7+qLsMNk+WJuhuJ4qXil/7XiOnZYZ+wxw==", + "requires": { + "@polkadot/wasm-bridge": "7.3.2", + "@polkadot/wasm-crypto-asmjs": "7.3.2", + "@polkadot/wasm-crypto-init": "7.3.2", + "@polkadot/wasm-crypto-wasm": "7.3.2", + "@polkadot/wasm-util": "7.3.2", + "tslib": "^2.6.2" + } + }, + "@polkadot/wasm-crypto-asmjs": { + "version": "7.3.2", + "resolved": "https://registry.npmjs.org/@polkadot/wasm-crypto-asmjs/-/wasm-crypto-asmjs-7.3.2.tgz", + "integrity": "sha512-QP5eiUqUFur/2UoF2KKKYJcesc71fXhQFLT3D4ZjG28Mfk2ZPI0QNRUfpcxVQmIUpV5USHg4geCBNuCYsMm20Q==", + "requires": { + "tslib": "^2.6.2" + } + }, + "@polkadot/wasm-crypto-init": { + "version": "7.3.2", + "resolved": "https://registry.npmjs.org/@polkadot/wasm-crypto-init/-/wasm-crypto-init-7.3.2.tgz", + "integrity": "sha512-FPq73zGmvZtnuJaFV44brze3Lkrki3b4PebxCy9Fplw8nTmisKo9Xxtfew08r0njyYh+uiJRAxPCXadkC9sc8g==", + "requires": { + "@polkadot/wasm-bridge": "7.3.2", + "@polkadot/wasm-crypto-asmjs": "7.3.2", + "@polkadot/wasm-crypto-wasm": "7.3.2", + "@polkadot/wasm-util": "7.3.2", + "tslib": "^2.6.2" + } + }, + "@polkadot/wasm-crypto-wasm": { + "version": "7.3.2", + "resolved": "https://registry.npmjs.org/@polkadot/wasm-crypto-wasm/-/wasm-crypto-wasm-7.3.2.tgz", + "integrity": "sha512-15wd0EMv9IXs5Abp1ZKpKKAVyZPhATIAHfKsyoWCEFDLSOA0/K0QGOxzrAlsrdUkiKZOq7uzSIgIDgW8okx2Mw==", + "requires": { + "@polkadot/wasm-util": "7.3.2", + "tslib": "^2.6.2" + } + }, + "@polkadot/wasm-util": { + "version": "7.3.2", + "resolved": "https://registry.npmjs.org/@polkadot/wasm-util/-/wasm-util-7.3.2.tgz", + "integrity": "sha512-bmD+Dxo1lTZyZNxbyPE380wd82QsX+43mgCm40boyKrRppXEyQmWT98v/Poc7chLuskYb6X8IQ6lvvK2bGR4Tg==", + "requires": { + "tslib": "^2.6.2" + } + }, + "@polkadot/x-bigint": { + "version": "12.6.2", + "resolved": "https://registry.npmjs.org/@polkadot/x-bigint/-/x-bigint-12.6.2.tgz", + "integrity": "sha512-HSIk60uFPX4GOFZSnIF7VYJz7WZA7tpFJsne7SzxOooRwMTWEtw3fUpFy5cYYOeLh17/kHH1Y7SVcuxzVLc74Q==", + "requires": { + "@polkadot/x-global": "12.6.2", + "tslib": "^2.6.2" + } + }, + "@polkadot/x-fetch": { + "version": "12.6.2", + "resolved": "https://registry.npmjs.org/@polkadot/x-fetch/-/x-fetch-12.6.2.tgz", + "integrity": "sha512-8wM/Z9JJPWN1pzSpU7XxTI1ldj/AfC8hKioBlUahZ8gUiJaOF7K9XEFCrCDLis/A1BoOu7Ne6WMx/vsJJIbDWw==", + "requires": { + "@polkadot/x-global": "12.6.2", + "node-fetch": "^3.3.2", + "tslib": "^2.6.2" + } + }, + "@polkadot/x-global": { + "version": "12.6.2", + "resolved": "https://registry.npmjs.org/@polkadot/x-global/-/x-global-12.6.2.tgz", + "integrity": "sha512-a8d6m+PW98jmsYDtAWp88qS4dl8DyqUBsd0S+WgyfSMtpEXu6v9nXDgPZgwF5xdDvXhm+P0ZfVkVTnIGrScb5g==", + "requires": { + "tslib": "^2.6.2" + } + }, + "@polkadot/x-randomvalues": { + "version": "12.6.2", + "resolved": "https://registry.npmjs.org/@polkadot/x-randomvalues/-/x-randomvalues-12.6.2.tgz", + "integrity": "sha512-Vr8uG7rH2IcNJwtyf5ebdODMcr0XjoCpUbI91Zv6AlKVYOGKZlKLYJHIwpTaKKB+7KPWyQrk4Mlym/rS7v9feg==", + "requires": { + "@polkadot/x-global": "12.6.2", + "tslib": "^2.6.2" + } + }, + "@polkadot/x-textdecoder": { + "version": "12.6.2", + "resolved": "https://registry.npmjs.org/@polkadot/x-textdecoder/-/x-textdecoder-12.6.2.tgz", + "integrity": "sha512-M1Bir7tYvNappfpFWXOJcnxUhBUFWkUFIdJSyH0zs5LmFtFdbKAeiDXxSp2Swp5ddOZdZgPac294/o2TnQKN1w==", + "requires": { + "@polkadot/x-global": "12.6.2", + "tslib": "^2.6.2" + } + }, + "@polkadot/x-textencoder": { + "version": "12.6.2", + "resolved": "https://registry.npmjs.org/@polkadot/x-textencoder/-/x-textencoder-12.6.2.tgz", + "integrity": "sha512-4N+3UVCpI489tUJ6cv3uf0PjOHvgGp9Dl+SZRLgFGt9mvxnvpW/7+XBADRMtlG4xi5gaRK7bgl5bmY6OMDsNdw==", + "requires": { + "@polkadot/x-global": "12.6.2", + "tslib": "^2.6.2" + } + }, + "@polkadot/x-ws": { + "version": "12.6.2", + "resolved": "https://registry.npmjs.org/@polkadot/x-ws/-/x-ws-12.6.2.tgz", + "integrity": "sha512-cGZWo7K5eRRQCRl2LrcyCYsrc3lRbTlixZh3AzgU8uX4wASVGRlNWi/Hf4TtHNe1ExCDmxabJzdIsABIfrr7xw==", + "requires": { + "@polkadot/x-global": "12.6.2", + "tslib": "^2.6.2", + "ws": "^8.15.1" + } + }, + "@scure/base": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/@scure/base/-/base-1.1.7.tgz", + "integrity": "sha512-PPNYBslrLNNUQ/Yad37MHYsNQtK67EhWb6WtSvNLLPo7SdVZgkUjD6Dg+5On7zNwmskf8OX7I7Nx5oN+MIWE0g==" + }, + "@substrate/connect": { + "version": "0.8.10", + "resolved": "https://registry.npmjs.org/@substrate/connect/-/connect-0.8.10.tgz", + "integrity": "sha512-DIyQ13DDlXqVFnLV+S6/JDgiGowVRRrh18kahieJxhgvzcWicw5eLc6jpfQ0moVVLBYkO7rctB5Wreldwpva8w==", + "optional": true, + "requires": { + "@substrate/connect-extension-protocol": "^2.0.0", + "@substrate/connect-known-chains": "^1.1.4", + "@substrate/light-client-extension-helpers": "^0.0.6", + "smoldot": "2.0.22" + } + }, + "@substrate/connect-extension-protocol": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@substrate/connect-extension-protocol/-/connect-extension-protocol-2.0.0.tgz", + "integrity": "sha512-nKu8pDrE3LNCEgJjZe1iGXzaD6OSIDD4Xzz/yo4KO9mQ6LBvf49BVrt4qxBFGL6++NneLiWUZGoh+VSd4PyVIg==", + "optional": true + } } }, "dkg.js": { @@ -33423,6 +34723,11 @@ } } }, + "make-error": { + "version": "1.3.6", + "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", + "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==" + }, "match-all": { "version": "1.2.6", "resolved": "https://registry.npmjs.org/match-all/-/match-all-1.2.6.tgz", @@ -35949,6 +37254,12 @@ "xmlchars": "^2.2.0" } }, + "scale-ts": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/scale-ts/-/scale-ts-1.6.0.tgz", + "integrity": "sha512-Ja5VCjNZR8TGKhUumy9clVVxcDpM+YFjAnkMuwQy68Hixio3VRRvWdE3g8T/yC+HXA0ZDQl2TGyUmtmbcVl40Q==", + "optional": true + }, "scrypt-js": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/scrypt-js/-/scrypt-js-3.0.1.tgz", @@ -36295,6 +37606,15 @@ "integrity": "sha512-h+z7HKHYXj6wJU+AnS/+IH8Uh9fdcX1Lrhg1/VMdf9PwoBQXFcXiAdsy2tSK0P6gKwJLXp02r90ahUCqHk9rrw==", "dev": true }, + "smoldot": { + "version": "2.0.22", + "resolved": "https://registry.npmjs.org/smoldot/-/smoldot-2.0.22.tgz", + "integrity": "sha512-B50vRgTY6v3baYH6uCgL15tfaag5tcS2o/P5q1OiXcKGv1axZDfz2dzzMuIkVpyMR2ug11F6EAtQlmYBQd292g==", + "optional": true, + "requires": { + "ws": "^8.8.1" + } + }, "solc": { "version": "0.7.3", "resolved": "https://registry.npmjs.org/solc/-/solc-0.7.3.tgz", @@ -37065,6 +38385,36 @@ "utf8-byte-length": "^1.0.1" } }, + "ts-node": { + "version": "10.9.2", + "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.9.2.tgz", + "integrity": "sha512-f0FFpIdcHgn8zcPSbf1dRevwt047YMnaiJM3u2w2RewrB+fob/zePZcrOyQoLMMO7aBIddLcQIEK5dYjkLnGrQ==", + "requires": { + "@cspotcode/source-map-support": "^0.8.0", + "@tsconfig/node10": "^1.0.7", + "@tsconfig/node12": "^1.0.7", + "@tsconfig/node14": "^1.0.0", + "@tsconfig/node16": "^1.0.2", + "acorn": "^8.4.1", + "acorn-walk": "^8.1.1", + "arg": "^4.1.0", + "create-require": "^1.1.0", + "diff": "^4.0.1", + "make-error": "^1.1.1", + "v8-compile-cache-lib": "^3.0.1", + "yn": "3.1.1" + }, + "dependencies": { + "acorn-walk": { + "version": "8.3.3", + "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.3.3.tgz", + "integrity": "sha512-MxXdReSRhGO7VlFe1bRG/oI7/mdLV9B9JJT0N8vZOhF7gFRR5l3M8W9G8JxmKV+JC5mGqJ0QvqfSOLsCPa4nUw==", + "requires": { + "acorn": "^8.11.0" + } + } + } + }, "tsconfig-paths": { "version": "3.15.0", "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.15.0.tgz", @@ -37228,6 +38578,11 @@ "is-typedarray": "^1.0.0" } }, + "typescript": { + "version": "5.5.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.5.2.tgz", + "integrity": "sha512-NcRtPEOsPFFWjobJEtfihkLCZCXZt/os3zf8nTxjVH3RvTSxjrCamJpbExGvYOF+tFHc3pA65qpdwPbzjohhew==" + }, "uint8arrays": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/uint8arrays/-/uint8arrays-3.1.1.tgz", @@ -37462,6 +38817,11 @@ "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==" }, + "v8-compile-cache-lib": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz", + "integrity": "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==" + }, "validate-iri": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/validate-iri/-/validate-iri-1.0.1.tgz", @@ -38175,7 +39535,6 @@ "version": "8.17.0", "resolved": "https://registry.npmjs.org/ws/-/ws-8.17.0.tgz", "integrity": "sha512-uJq6108EgZMAl20KagGkzCKfMEjxmKvZHG7Tlq0Z6nOky7YF7aq4mOx6xK8TJ/i1LeK4Qus7INktacctDgY8Ow==", - "optional": true, "requires": {} }, "xhr": { @@ -38352,6 +39711,11 @@ } } }, + "yn": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz", + "integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==" + }, "yocto-queue": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", diff --git a/package.json b/package.json index 780e5ace1..bb88a9c32 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "origintrail_node", - "version": "6.4.0", + "version": "6.5.0", "description": "OTNode V6", "main": "index.js", "type": "module", @@ -50,7 +50,7 @@ "chai": "^4.3.6", "d3": "^7.8.5", "d3-node": "^3.0.0", - "dkg.js": "^6.1.2", + "dkg.js": "^6.3.0", "eslint": "^8.23.0", "eslint-config-airbnb": "^19.0.4", "eslint-config-prettier": "^8.5.0", @@ -80,7 +80,7 @@ "axios": "^1.6.0", "cors": "^2.8.5", "deep-extend": "^0.6.0", - "dkg-evm-module": "^4.3.0", + "dkg-evm-module": "^4.3.3", "dotenv": "^16.0.1", "ethers": "^5.7.2", "express": "^4.18.1", diff --git a/src/constants/constants.js b/src/constants/constants.js index 112a8a376..ea771a96f 100644 --- a/src/constants/constants.js +++ b/src/constants/constants.js @@ -724,6 +724,7 @@ export const BLOCK_TIME_MILLIS = { HARDHAT: 5_000, GNOSIS: 5_000, DEFAULT: 12_000, + BASE: 2_000, }; export const TRANSACTION_CONFIRMATIONS = 1; diff --git a/src/modules/blockchain/implementation/base/base-service.js b/src/modules/blockchain/implementation/base/base-service.js new file mode 100644 index 000000000..c6dd518cd --- /dev/null +++ b/src/modules/blockchain/implementation/base/base-service.js @@ -0,0 +1,25 @@ +import Web3Service from '../web3-service.js'; +import { BLOCK_TIME_MILLIS } from '../../../../constants/constants.js'; + +class BaseService extends Web3Service { + constructor(ctx) { + super(ctx); + + this.baseTokenTicker = 'ETH'; + this.tracTicker = 'TRAC'; + } + + getBlockTimeMillis() { + return BLOCK_TIME_MILLIS.BASE; + } + + async getGasPrice() { + return this.provider.getGasPrice(); + } + + async getAgreementScoreFunctionId() { + return 2; + } +} + +export default BaseService; diff --git a/tools/knowledge-assets-distribution-simulation/mocks/blockchain-module-manager-mock.js b/tools/knowledge-assets-distribution-simulation/mocks/blockchain-module-manager-mock.js index b16aa6f38..3f78ef96b 100644 --- a/tools/knowledge-assets-distribution-simulation/mocks/blockchain-module-manager-mock.js +++ b/tools/knowledge-assets-distribution-simulation/mocks/blockchain-module-manager-mock.js @@ -47,7 +47,8 @@ class BlockchainModuleManagerMock { getLinearSumParams(blockchain) { return { - distanceScaleFactor: '1000000000000000000', + distanceScaleFactor: ethers.utils.parseEther('1'), + stakeScaleFactor: ethers.utils.parseEther('1'), w1: 1, w2: 1, }; diff --git a/tools/knowledge-assets-distribution-simulation/simulation.js b/tools/knowledge-assets-distribution-simulation/simulation.js index 60b3cd959..1bab2dbfd 100644 --- a/tools/knowledge-assets-distribution-simulation/simulation.js +++ b/tools/knowledge-assets-distribution-simulation/simulation.js @@ -80,7 +80,7 @@ function generateRandomHashes(numberOfHashes) { async function generateRandomNodes( numberOfNodes, stakeMin = 50000, - stakeMax = 1000000, + stakeMax = 2000000, hashFunctionId = 1, ) { const nodes = []; @@ -429,7 +429,7 @@ async function runSimulation( `${mode}-${nodes.length}-${numberOfKAs}-${proximityScoreFunctionsPairId}-nodes-stake-distribution`, ); - const knowledgeAssets = await generateRandomHashes(numberOfKAs); + const knowledgeAssets = generateRandomHashes(numberOfKAs); const metrics = []; const replicas = {}; @@ -445,15 +445,13 @@ async function runSimulation( let IDEAL_MAX_DISTANCE_IN_NEIGHBORHOOD; if (proximityScoreFunctionsPairId === 2) { - IDEAL_MAX_DISTANCE_IN_NEIGHBORHOOD = HASH_RING_SIZE.div(nodesNumber).mul(20); - } else if (proximityScoreFunctionsPairId === 3) { IDEAL_MAX_DISTANCE_IN_NEIGHBORHOOD = HASH_RING_SIZE.div(nodesNumber).mul(10); } - const linearSumParams = await blockchainModuleManagerMock.getLinearSumParams(blockchain); + const linearSumParams = blockchainModuleManagerMock.getLinearSumParams(blockchain); const { distanceScaleFactor } = linearSumParams; - const minimumStake = await blockchainModuleManagerMock.getMinimumStake(blockchain); - const maximumStake = await blockchainModuleManagerMock.getMaximumStake(blockchain); + const minimumStake = blockchainModuleManagerMock.getMinimumStake(blockchain); + const maximumStake = blockchainModuleManagerMock.getMaximumStake(blockchain); for (const key of knowledgeAssets) { const nodesWithDistances = await Promise.all( @@ -492,6 +490,10 @@ async function runSimulation( node.distance, node.stake, maxDistance, + r2, + nodesNumber, + minimumStake, + maximumStake, ); let dividend = node.distance; @@ -554,6 +556,12 @@ const numberOfNodes = mode === 'generate' ? parseInt(args[1], 10) : undefined; const numberOfKAs = parseInt(args[2], 10); const proximityScoreFunctionsPairId = parseInt(args[3], 10); +logger.info(`mode: ${mode}`); +logger.info(`filePath: ${filePath}`); +logger.info(`numberOfNodes: ${numberOfNodes}`); +logger.info(`numberOfKAs: ${numberOfKAs}`); +logger.info(`proximityScoreFunctionsPairId: ${proximityScoreFunctionsPairId}`); + if ( (mode === 'load' && !filePath) || (mode === 'generate' && numberOfNodes === undefined) || From cad728ea63e1b251846dbb4d16792e8a2d3534de Mon Sep 17 00:00:00 2001 From: Mihajlo Pavlovic Date: Thu, 4 Jul 2024 12:46:12 +0200 Subject: [PATCH 2/3] OriginTrail Devnet Preelease v6.5.0 (#3230) * Update installer.sh (#3224) - Added base blockchain integration. Co-authored-by: Mihajlo Pavlovic * Base mainnet integration (#3229) * Add hub contract * Update set scripts * Remove hotfix * Update package-lock --------- Co-authored-by: Samuel Wamala <35219064+swamala@users.noreply.github.com> --- config/config.json | 2 +- installer/installer.sh | 346 +++++++++++++++++------------------------ package-lock.json | 4 +- package.json | 2 +- scripts/set-ask.js | 17 +- scripts/set-stake.js | 17 +- 6 files changed, 164 insertions(+), 224 deletions(-) diff --git a/config/config.json b/config/config.json index cbc91c4b3..6f687077a 100644 --- a/config/config.json +++ b/config/config.json @@ -817,7 +817,7 @@ "package": "./blockchain/implementation/base/base-service.js", "config": { - "hubContractAddress": "", + "hubContractAddress": "0xaBfcf2ad1718828E7D3ec20435b0d0b5EAfbDf2c", "operatorFee": 0 } } diff --git a/installer/installer.sh b/installer/installer.sh index 364dad676..77754cc11 100755 --- a/installer/installer.sh +++ b/installer/installer.sh @@ -283,7 +283,7 @@ install_node() { # Change directory to ot-node/current cd $OTNODE_DIR - # Request node env with strict input validation + # Request node environment with strict input validation while true; do read -p "Please select node environment: (Default: Mainnet) [T]estnet [M]ainnet [E]xit " choice case "$choice" in @@ -295,142 +295,79 @@ install_node() { done echo "NODE_ENV=$nodeEnv" >> $OTNODE_DIR/.env -# Blockchains prompt based on the selected environment -if [ "$nodeEnv" == "mainnet" ]; then - blockchain_prompt=("OriginTrail Parachain" "Gnosis" "Both") -elif [ "$nodeEnv" == "testnet" ]; then - blockchain_prompt=("OriginTrail Parachain" "Gnosis" "Both") -fi - - -# Ask user which blockchain to connect to with strict input validation -while true; do - read -p "Please select the blockchain you want to connect your node to: - 1. ${blockchain_prompt[0]} - 2. ${blockchain_prompt[1]} - 3. ${blockchain_prompt[2]} - Your choice: " blockchain_choice - - case "$blockchain_choice" in - [1]* ) blockchain="${blockchain_prompt[0]}"; break;; - [2]* ) blockchain="${blockchain_prompt[1]}"; break;; - [3]* ) blockchain="${blockchain_prompt[2]}"; break;; - [eE]* ) text_color $RED "Installer stopped by user"; exit;; - * ) text_color $RED "Invalid choice. Please enter a valid number."; continue;; - esac -done - - -# Function to validate Operator Fees input -validate_operator_fees() { - local blockchain=$1 - local operator_fee_variable="${blockchain}_OPERATOR_FEES" - - read -p "Enter Operator Fees (0% - 100%) for $blockchain: " OPERATOR_FEES - if (( OPERATOR_FEES >= 0 && OPERATOR_FEES <= 100 )); then - text_color $GREEN "Operator Fees for $blockchain: $OPERATOR_FEES" - eval "${operator_fee_variable}=$OPERATOR_FEES" + # Set blockchain options based on the selected environment + if [ "$nodeEnv" == "mainnet" ]; then + blockchain_options=("OriginTrail Parachain" "Gnosis" "Base") + otp_blockchain_id=2043 + gnosis_blockchain_id=100 + base_blockchain_id=8453 else - text_color $RED "Please enter Operator Fees in the range of 0% - 100%. Try again." - validate_operator_fees $blockchain + blockchain_options=("OriginTrail Parachain" "Gnosis" "Base-Sepolia") + otp_blockchain_id=20430 + gnosis_blockchain_id=10200 + base_blockchain_id=84532 fi -} - - -# Case statement to handle blockchain-specific configurations -case "$blockchain" in - "OriginTrail Parachain" | "Gnosis" ) - - - if [ "$blockchain" == "OriginTrail Parachain" ]; then - blockchain="OTP" - fi - - - # Input wallets for the selected blockchain - request_operational_wallet_keys $blockchain - EVM_OP_WALLET_KEYS_BLOCKCHAIN=$OP_WALLET_KEYS_JSON - - read -p "Enter your EVM management wallet address for $blockchain: " EVM_MANAGEMENT_WALLET - text_color $GREEN "EVM management wallet address for $blockchain: $EVM_MANAGEMENT_WALLET" - - read -p "Enter your profile shares token name for $blockchain: " SHARES_TOKEN_NAME - text_color $GREEN "Profile shares token name for $blockchain: $SHARES_TOKEN_NAME" - - read -p "Enter your profile shares token symbol for $blockchain: " SHARES_TOKEN_SYMBOL - text_color $GREEN "Profile shares token symbol for $blockchain: $SHARES_TOKEN_SYMBOL" - - # Prompt and validate Operator Fees for the first blockchain - validate_operator_fees $blockchain - eval "OPERATOR_FEE=\$${blockchain}_OPERATOR_FEES" - - if [ "$blockchain" == "Gnosis" ]; then - read -p "Enter your Gnosis RPC endpoint: " GNOSIS_RPC_ENDPOINT - text_color $GREEN "Gnosis RPC endpoint: $GNOSIS_RPC_ENDPOINT" - fi + # Ask user which blockchains to connect to + selected_blockchains=() + checkbox_states=() + for _ in "${blockchain_options[@]}"; do + checkbox_states+=("[ ]") + done - ;; - "Both" ) - if [ "$nodeEnv" == "mainnet" ]; then - blockchain1="OTP" - blockchain2="Gnosis" - elif [ "$nodeEnv" == "testnet" ]; then - blockchain1="OTP" - blockchain2="Gnosis" + while true; do + clear # Clear the screen for a cleaner display + echo "Please select the blockchains you want to connect your node to:" + for i in "${!blockchain_options[@]}"; do + echo " ${checkbox_states[$i]} $((i+1)). ${blockchain_options[$i]}" + done + echo " [ ] $((${#blockchain_options[@]}+1)). All Blockchains" + echo " Enter 'd' to finish selection" + + # Use read -n 1 to read a single character without requiring Enter + read -n 1 -p "Enter the number to toggle selection (1-$((${#blockchain_options[@]}+1))): " choice + echo # Add a newline after the selection + + if [[ "$choice" == "d" ]]; then + if [ ${#selected_blockchains[@]} -eq 0 ]; then + text_color $RED "You must select at least one blockchain. Please try again." + read -n 1 -p "Press any key to continue..." + continue + else + break + fi + elif [[ "$choice" =~ ^[1-${#blockchain_options[@]}]$ ]]; then + index=$((choice-1)) + if [[ "${checkbox_states[$index]}" == "[ ]" ]]; then + checkbox_states[$index]="[x]" + selected_blockchains+=("${blockchain_options[$index]}") + else + checkbox_states[$index]="[ ]" + selected_blockchains=(${selected_blockchains[@]/${blockchain_options[$index]}}) + fi + elif [[ "$choice" == "$((${#blockchain_options[@]}+1))" ]]; then + if [[ "${checkbox_states[-1]}" == "[ ]" ]]; then + for i in "${!checkbox_states[@]}"; do + checkbox_states[$i]="[x]" + done + selected_blockchains=("${blockchain_options[@]}") + else + for i in "${!checkbox_states[@]}"; do + checkbox_states[$i]="[ ]" + done + selected_blockchains=() + fi + else + text_color $RED "Invalid choice. Please enter a number between 1 and $((${#blockchain_options[@]}+1))." + read -n 1 -p "Press any key to continue..." fi + done - # Input wallets for the first blockchain - request_operational_wallet_keys $blockchain1 - EVM_OP_WALLET_KEYS_BLOCKCHAIN1=$OP_WALLET_KEYS_JSON - - read -p "Enter your EVM management wallet address for $blockchain1: " EVM_MANAGEMENT_WALLET - text_color $GREEN "EVM management wallet address for $blockchain1: $EVM_MANAGEMENT_WALLET" - - read -p "Enter your profile shares token name for $blockchain1: " SHARES_TOKEN_NAME - text_color $GREEN "Profile shares token name for $blockchain1: $SHARES_TOKEN_NAME" - - read -p "Enter your profile shares token symbol for $blockchain1: " SHARES_TOKEN_SYMBOL - text_color $GREEN "Profile shares token symbol for $blockchain1: $SHARES_TOKEN_SYMBOL" - - # Prompt and validate Operator Fees for the first blockchain - validate_operator_fees $blockchain1 - OPERATOR_FEES_1=$OTP_OPERATOR_FEES - - # Input wallets for the second blockchain - request_operational_wallet_keys $blockchain2 - EVM_OP_WALLET_KEYS_BLOCKCHAIN2=$OP_WALLET_KEYS_JSON - - read -p "Enter your EVM management wallet address for $blockchain2: " EVM_MANAGEMENT_WALLET_2 - text_color $GREEN "EVM management wallet address for $blockchain2: $EVM_MANAGEMENT_WALLET_2" - - read -p "Enter your profile shares token name for $blockchain2: " SHARES_TOKEN_NAME_2 - text_color $GREEN "Profile shares token name for $blockchain2: $SHARES_TOKEN_NAME_2" - - read -p "Enter your profile shares token symbol for $blockchain2: " SHARES_TOKEN_SYMBOL_2 - text_color $GREEN "Profile shares token symbol for $blockchain2: $SHARES_TOKEN_SYMBOL_2" - - # Prompt and validate Operator Fees for the second blockchain - validate_operator_fees $blockchain2 - OPERATOR_FEES_2=$Gnosis_OPERATOR_FEES - - - read -p "Enter your Gnosis RPC endpoint: " GNOSIS_RPC_ENDPOINT - text_color $GREEN "Gnosis RPC endpoint: $GNOSIS_RPC_ENDPOINT" - - ;; - * ) - text_color $RED "Invalid blockchain choice. Exiting installer." - exit;; -esac - - -perform_step npm ci --omit=dev --ignore-scripts "Executing npm install" - -CONFIG_DIR=$OTNODE_DIR/.. -perform_step touch $CONFIG_DIR/.origintrail_noderc "Configuring node config file" -perform_step $(jq --null-input --arg tripleStore "$tripleStore" '{"logLevel": "trace", "auth": {"ipWhitelist": ["::1", "127.0.0.1"]}}' > $CONFIG_DIR/.origintrail_noderc) "Adding loglevel and auth values to node config file" + text_color $GREEN "Final blockchain selection: ${selected_blockchains[*]}" + CONFIG_DIR=$OTNODE_DIR/.. + perform_step touch $CONFIG_DIR/.origintrail_noderc "Configuring node config file" + perform_step $(jq --null-input '{"logLevel": "trace", "auth": {"ipWhitelist": ["::1", "127.0.0.1"]}, "modules": {"blockchain": {"implementation": {}}}}' > $CONFIG_DIR/.origintrail_noderc) "Adding initial config to node config file" perform_step $(jq --arg tripleStore "$tripleStore" --arg tripleStoreUrl "$tripleStoreUrl" '.modules.tripleStore.implementation[$tripleStore] |= { @@ -463,88 +400,89 @@ perform_step $(jq --null-input --arg tripleStore "$tripleStore" '{"logLevel": "t } } } - } + .' $CONFIG_DIR/.origintrail_noderc > $CONFIG_DIR/origintrail_noderc_tmp) "Adding node wallets to node config file 1/2" + } + .' $CONFIG_DIR/.origintrail_noderc > $CONFIG_DIR/origintrail_noderc_tmp) "Adding triple store config to node config file" - perform_step mv $CONFIG_DIR/origintrail_noderc_tmp $CONFIG_DIR/.origintrail_noderc "Adding node wallets to node config file 2/2" + perform_step mv $CONFIG_DIR/origintrail_noderc_tmp $CONFIG_DIR/.origintrail_noderc "Finalizing initial node config file" -# Set blockchain IDs based on the environment -if [ "$nodeEnv" == "mainnet" ]; then - otp_blockchain_id=2043 - gnosis_blockchain_id=100 -else - otp_blockchain_id=20430 - gnosis_blockchain_id=10200 -fi + # Function to validate operator fees + validate_operator_fees() { + local blockchain=$1 + while true; do + read -p "Enter your operator fee for $blockchain (0-100): " OPERATOR_FEE + if [[ "$OPERATOR_FEE" =~ ^[0-9]+$ ]] && [ "$OPERATOR_FEE" -ge 0 ] && [ "$OPERATOR_FEE" -le 100 ]; then + text_color $GREEN "Operator fee for $blockchain: $OPERATOR_FEE" + break + else + text_color $RED "Invalid input. Please enter a number between 0 and 100." + fi + done + } -# Check if "Both" blockchains are selected -if [ "$blockchain" == "Both" ]; then - perform_step $(jq --arg otp_blockchain_id "$otp_blockchain_id" --argjson EVM_OP_WALLET_KEYS_BLOCKCHAIN1 "$EVM_OP_WALLET_KEYS_BLOCKCHAIN1" --argjson EVM_OP_WALLET_KEYS_BLOCKCHAIN2 "$EVM_OP_WALLET_KEYS_BLOCKCHAIN2" --arg EVM_MANAGEMENT_WALLET "$EVM_MANAGEMENT_WALLET" --arg SHARES_TOKEN_NAME "$SHARES_TOKEN_NAME" --arg SHARES_TOKEN_SYMBOL "$SHARES_TOKEN_SYMBOL" --argjson OPERATOR_FEES_1 "$OPERATOR_FEES_1" --argjson OPERATOR_FEES_2 "$OPERATOR_FEES_2" --arg gnosis_blockchain_id "$gnosis_blockchain_id" --arg EVM_OPERATIONAL_WALLET_2 "$EVM_OPERATIONAL_WALLET_2" --arg EVM_OPERATIONAL_PRIVATE_KEY_2 "$EVM_OPERATIONAL_PRIVATE_KEY_2" --arg EVM_MANAGEMENT_WALLET_2 "$EVM_MANAGEMENT_WALLET_2" --arg SHARES_TOKEN_NAME_2 "$SHARES_TOKEN_NAME_2" --arg SHARES_TOKEN_SYMBOL_2 "$SHARES_TOKEN_SYMBOL_2" --arg GNOSIS_RPC_ENDPOINT "$GNOSIS_RPC_ENDPOINT" ' - .modules.blockchain.implementation += { - "otp:'$otp_blockchain_id'": { - "enabled": true, - "config": { - "operationalWallets": $EVM_OP_WALLET_KEYS_BLOCKCHAIN1, - "evmManagementWalletPublicKey": $EVM_MANAGEMENT_WALLET, - "sharesTokenName": $SHARES_TOKEN_NAME, - "sharesTokenSymbol": $SHARES_TOKEN_SYMBOL, - "operatorFee": $OPERATOR_FEES_1 - } - }, - "gnosis:'$gnosis_blockchain_id'": { - "enabled": true, - "config": { - "operationalWallets": $EVM_OP_WALLET_KEYS_BLOCKCHAIN2, - "evmManagementWalletPublicKey": $EVM_MANAGEMENT_WALLET_2, - "sharesTokenName": $SHARES_TOKEN_NAME_2, - "sharesTokenSymbol": $SHARES_TOKEN_SYMBOL_2, - "operatorFee": $OPERATOR_FEES_2, - "rpcEndpoints": [$GNOSIS_RPC_ENDPOINT] - } - } - }' $CONFIG_DIR/.origintrail_noderc > $CONFIG_DIR/origintrail_noderc_tmp) "Adding node wallets to node config file 1/2 for Both" -else + # Function to configure a blockchain + configure_blockchain() { + local blockchain=$1 + local blockchain_id=$2 + + request_operational_wallet_keys $blockchain + local EVM_OP_WALLET_KEYS=$OP_WALLET_KEYS_JSON + + read -p "Enter your EVM management wallet address for $blockchain: " EVM_MANAGEMENT_WALLET + text_color $GREEN "EVM management wallet address for $blockchain: $EVM_MANAGEMENT_WALLET" + read -p "Enter your profile shares token name for $blockchain: " SHARES_TOKEN_NAME + text_color $GREEN "Profile shares token name for $blockchain: $SHARES_TOKEN_NAME" + + read -p "Enter your profile shares token symbol for $blockchain: " SHARES_TOKEN_SYMBOL + text_color $GREEN "Profile shares token symbol for $blockchain: $SHARES_TOKEN_SYMBOL" - # Single blockchain selected - if [ "$blockchain" = "OriginTrail Parachain" ] || [ "$blockchain" = "OTP" ]; then - blockchain="otp" - blockchain_id="$otp_blockchain_id" - elif [ "$blockchain" = "Gnosis" ]; then - blockchain="gnosis" - blockchain_id="$gnosis_blockchain_id" - fi - ADD_GNOSIS_RPC="false" - if [ "$blockchain" = "gnosis" ]; then - ADD_GNOSIS_RPC="true" - fi - - blockchain_arg="$blockchain:$blockchain_id" - - jq --arg blockchain_arg "$blockchain_arg" \ - --argjson EVM_OP_WALLET_KEYS_BLOCKCHAIN "$EVM_OP_WALLET_KEYS_BLOCKCHAIN" \ - --arg EVM_MANAGEMENT_WALLET "$EVM_MANAGEMENT_WALLET" \ - --arg SHARES_TOKEN_NAME "$SHARES_TOKEN_NAME" \ - --arg SHARES_TOKEN_SYMBOL "$SHARES_TOKEN_SYMBOL" \ - --argjson ADD_GNOSIS_RPC "$ADD_GNOSIS_RPC" \ - --argjson OPERATOR_FEE $OPERATOR_FEE \ - --arg GNOSIS_RPC_ENDPOINT "$GNOSIS_RPC_ENDPOINT" ' - (.modules.blockchain.implementation += { - ($blockchain_arg): { - "enabled": true, - "config": { - "operationalWallets": $EVM_OP_WALLET_KEYS_BLOCKCHAIN, - "evmManagementWalletPublicKey": $EVM_MANAGEMENT_WALLET, - "sharesTokenName": $SHARES_TOKEN_NAME, - "sharesTokenSymbol": $SHARES_TOKEN_SYMBOL, - "operatorFee": $OPERATOR_FEE + validate_operator_fees $blockchain + local RPC_ENDPOINT="" + if [ "$blockchain" == "gnosis" ] || [ "$blockchain" == "base" ]; then + read -p "Enter your $blockchain RPC endpoint: " RPC_ENDPOINT + text_color $GREEN "$blockchain RPC endpoint: $RPC_ENDPOINT" + fi + + local jq_filter=$(cat < "$CONFIG_DIR/origintrail_noderc_tmp" -fi +EOF + ) + + if [ -n "$RPC_ENDPOINT" ]; then + jq_filter+=" | .modules.blockchain.implementation[\"$blockchain:$blockchain_id\"].config.rpcEndpoints = [\"$RPC_ENDPOINT\"]" + fi + + jq "$jq_filter" $CONFIG_DIR/.origintrail_noderc > $CONFIG_DIR/origintrail_noderc_tmp + mv $CONFIG_DIR/origintrail_noderc_tmp $CONFIG_DIR/.origintrail_noderc + } + + # Configure selected blockchains + for blockchain in "${selected_blockchains[@]}"; do + case "$blockchain" in + "OriginTrail Parachain") + configure_blockchain "otp" $otp_blockchain_id + ;; + "Gnosis") + configure_blockchain "gnosis" $gnosis_blockchain_id + ;; + "Base" | "Base-Sepolia") + configure_blockchain "base" $base_blockchain_id + ;; + esac + done + + # Now execute npm install after configuring wallets + perform_step npm ci --omit=dev --ignore-scripts "Executing npm install" - perform_step mv $CONFIG_DIR/origintrail_noderc_tmp $CONFIG_DIR/.origintrail_noderc "Adding node wallets to node config file 2/2" perform_step cp $OTNODE_DIR/installer/data/otnode.service /lib/systemd/system/ "Copying otnode service file" systemctl daemon-reload diff --git a/package-lock.json b/package-lock.json index 52cecb7e7..135deab96 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "origintrail_node", - "version": "6.5.0+hotfix.1", + "version": "6.5.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "origintrail_node", - "version": "6.5.0+hotfix.1", + "version": "6.5.0", "license": "ISC", "dependencies": { "@comunica/query-sparql": "^2.4.3", diff --git a/package.json b/package.json index d285095ae..bb88a9c32 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "origintrail_node", - "version": "6.5.0+hotfix.1", + "version": "6.5.0", "description": "OTNode V6", "main": "index.js", "type": "module", diff --git a/scripts/set-ask.js b/scripts/set-ask.js index 756927e96..bb2b8734d 100644 --- a/scripts/set-ask.js +++ b/scripts/set-ask.js @@ -22,15 +22,16 @@ const devEnvironment = process.env.NODE_ENV === NODE_ENVIRONMENTS.TEST; async function getGasPrice(gasPriceOracleLink, hubContractAddress, provider) { - if (!gasPriceOracleLink) { - return devEnvironment ? undefined : 8; - } try { - if ( - hubContractAddress === '0x6C861Cb69300C34DfeF674F7C00E734e840C29C0' || - hubContractAddress === '0x144eDa5cbf8926327cb2cceef168A121F0E4A299' - ) { - return provider.getGasPrice(); + if (!gasPriceOracleLink) { + if ( + hubContractAddress === '0x6C861Cb69300C34DfeF674F7C00E734e840C29C0' || + hubContractAddress === '0x144eDa5cbf8926327cb2cceef168A121F0E4A299' || + hubContractAddress === '0xaBfcf2ad1718828E7D3ec20435b0d0b5EAfbDf2c' + ) { + return provider.getGasPrice(); + } + return devEnvironment ? undefined : 8; } let gasPrice; const response = await axios.get(gasPriceOracleLink); diff --git a/scripts/set-stake.js b/scripts/set-stake.js index 671c814ef..cfc4a235d 100644 --- a/scripts/set-stake.js +++ b/scripts/set-stake.js @@ -29,15 +29,16 @@ const devEnvironment = process.env.NODE_ENV === NODE_ENVIRONMENTS.TEST; async function getGasPrice(gasPriceOracleLink, hubContractAddress, provider) { - if (!gasPriceOracleLink) { - return devEnvironment ? undefined : 8; - } try { - if ( - hubContractAddress === '0x6C861Cb69300C34DfeF674F7C00E734e840C29C0' || - hubContractAddress === '0x144eDa5cbf8926327cb2cceef168A121F0E4A299' - ) { - return provider.getGasPrice(); + if (!gasPriceOracleLink) { + if ( + hubContractAddress === '0x6C861Cb69300C34DfeF674F7C00E734e840C29C0' || + hubContractAddress === '0x144eDa5cbf8926327cb2cceef168A121F0E4A299' || + hubContractAddress === '0xaBfcf2ad1718828E7D3ec20435b0d0b5EAfbDf2c' + ) { + return provider.getGasPrice(); + } + return devEnvironment ? undefined : 8; } let gasPrice; const response = await axios.get(gasPriceOracleLink); From cafd0dc80bf172bf473b529a900575cdfa9011da Mon Sep 17 00:00:00 2001 From: Mihajlo Pavlovic Date: Wed, 17 Jul 2024 16:56:35 +0200 Subject: [PATCH 3/3] OriginTrail Devnet Preelease v6.5.1 (#3242) * Update installer.sh (#3224) - Added base blockchain integration. Co-authored-by: Mihajlo Pavlovic * Base mainnet integration (#3229) * Add hub contract * Update set scripts * Remove hotfix * Update package-lock * Fixed removal of the AbortSignal event listener (#3227) * Increasing number of service agreements considered in command and command executor (#3241) * Increase number of service agreements for commits fetched from DB * Increase number of service agreements for commits fetched from DB * Increse limit and command queue pararelism * Add dynamic scaling factor when scheduling commits and proofs * Migration to remove duplicate service agreements (#3240) * Add findDuplicateServiceAgreement function * Expand query in findDuplicateServiceAgreement function * Add RemoveDuplicateServiceAgreementMigration * Fix migration queries * Migration tested and working * version bump * Add default connection pool to node (#3238) * Prune corrupted service agreement (#3237) * Add removeServiceAgreementsByBlockchainAndContract function * Change removeServiceAgreementsByBlockchainAndContract to remove all service agreements except ones with given contract * Add service agreement pruning migration * Fix epoch check scaling factor --------- Co-authored-by: Samuel Wamala <35219064+swamala@users.noreply.github.com> Co-authored-by: Uladzislau Hubar <71610423+u-hubar@users.noreply.github.com> --- config/config.json | 45 ++++++++++++-- ot-node.js | 13 ++++ package-lock.json | 4 +- package.json | 2 +- .../blockchain-epoch-check-command.js | 7 ++- src/constants/constants.js | 2 +- src/migration/migration-executor.js | 60 +++++++++++++++++++ ...e-duplicate-service-agreement-migration.js | 43 +++++++++++++ .../service-agreement-pruning-migration.js | 35 +++++++++++ .../network/implementation/libp2p-service.js | 19 +++--- .../service-agreement-repository.js | 37 +++++++++++- .../repository/repository-module-manager.js | 19 ++++++ 12 files changed, 264 insertions(+), 22 deletions(-) create mode 100644 src/migration/remove-duplicate-service-agreement-migration.js create mode 100644 src/migration/service-agreement-pruning-migration.js diff --git a/config/config.json b/config/config.json index 6f687077a..64d5fb3f0 100644 --- a/config/config.json +++ b/config/config.json @@ -77,7 +77,14 @@ "port": "3306", "host": "localhost", "dialect": "mysql", - "logging": false + "logging": false, + "pool": { + "max": 120, + "min": 0, + "acquire": 60000, + "idle": 10000, + "evict": 1000 + } } } } @@ -260,7 +267,14 @@ "port": "3306", "host": "localhost", "dialect": "mysql", - "logging": false + "logging": false, + "pool": { + "max": 120, + "min": 0, + "acquire": 60000, + "idle": 10000, + "evict": 1000 + } } } } @@ -413,7 +427,14 @@ "port": "3306", "host": "localhost", "dialect": "mysql", - "logging": false + "logging": false, + "pool": { + "max": 120, + "min": 0, + "acquire": 60000, + "idle": 10000, + "evict": 1000 + } } } } @@ -597,7 +618,14 @@ "port": "3306", "host": "localhost", "dialect": "mysql", - "logging": false + "logging": false, + "pool": { + "max": 120, + "min": 0, + "acquire": 60000, + "idle": 10000, + "evict": 1000 + } } } } @@ -781,7 +809,14 @@ "port": "3306", "host": "localhost", "dialect": "mysql", - "logging": false + "logging": false, + "pool": { + "max": 120, + "min": 0, + "acquire": 60000, + "idle": 10000, + "evict": 1000 + } } } } diff --git a/ot-node.js b/ot-node.js index 5614b42e3..4900e328d 100644 --- a/ot-node.js +++ b/ot-node.js @@ -89,6 +89,19 @@ class OTNode { this.logger, this.config, ); + + + MigrationExecutor.executeServiceAgreementPruningMigration( + this.container, + this.logger, + this.config, + ); + + MigrationExecutor.executeRemoveDuplicateServiceAgreementMigration( + this.container, + this.logger, + this.config, + ); } checkNodeVersion() { diff --git a/package-lock.json b/package-lock.json index 135deab96..bc8afa769 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "origintrail_node", - "version": "6.5.0", + "version": "6.5.1", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "origintrail_node", - "version": "6.5.0", + "version": "6.5.1", "license": "ISC", "dependencies": { "@comunica/query-sparql": "^2.4.3", diff --git a/package.json b/package.json index bb88a9c32..e7f54dafa 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "origintrail_node", - "version": "6.5.0", + "version": "6.5.1", "description": "OTNode V6", "main": "index.js", "type": "module", diff --git a/src/commands/protocols/common/epoch-check/blockchain-epoch-check-command.js b/src/commands/protocols/common/epoch-check/blockchain-epoch-check-command.js index baea3a9ec..7932f684c 100644 --- a/src/commands/protocols/common/epoch-check/blockchain-epoch-check-command.js +++ b/src/commands/protocols/common/epoch-check/blockchain-epoch-check-command.js @@ -51,10 +51,15 @@ class BlockchainEpochCheckCommand extends Command { command.period, ); + const numberOfBlockchains = this.blockchainModuleManager.getImplementationNames().length; + // We don't expect to have this many transactions in one epoch check window. // This is just to make sure we don't schedule too many commands and block the queue // TODO: find general solution for all commands scheduling blockchain transactions - totalTransactions = Math.min(totalTransactions, COMMAND_QUEUE_PARALLELISM * 0.3); + totalTransactions = Math.min( + totalTransactions, + Math.floor(COMMAND_QUEUE_PARALLELISM / numberOfBlockchains), + ); const transactionQueueLength = this.blockchainModuleManager.getTotalTransactionQueueLength(blockchain); diff --git a/src/constants/constants.js b/src/constants/constants.js index ea771a96f..e06bf467a 100644 --- a/src/constants/constants.js +++ b/src/constants/constants.js @@ -555,7 +555,7 @@ export const ARCHIVE_UPDATE_RESPONSES_FOLDER = 'update_responses'; * How many commands will run in parallel * @type {number} */ -export const COMMAND_QUEUE_PARALLELISM = 100; +export const COMMAND_QUEUE_PARALLELISM = 150; export const GET_LATEST_SERVICE_AGREEMENT_BATCH_SIZE = 50; diff --git a/src/migration/migration-executor.js b/src/migration/migration-executor.js index 0c84318a6..a3e2635ec 100644 --- a/src/migration/migration-executor.js +++ b/src/migration/migration-executor.js @@ -18,6 +18,8 @@ import MarkStakingEventsAsProcessedMigration from './mark-staking-events-as-proc import RemoveServiceAgreementsForChiadoMigration from './remove-service-agreements-for-chiado-migration.js'; import MultipleOpWalletsUserConfigurationMigration from './multiple-op-wallets-user-configuration-migration.js'; import GetOldServiceAgreementsMigration from './get-old-service-agreements-migration.js'; +import ServiceAgreementPruningMigration from './service-agreement-pruning-migration.js'; +import RemoveDuplicateServiceAgreementMigration from './remove-duplicate-service-agreement-migration.js'; class MigrationExecutor { static async executePullShardingTableMigration(container, logger, config) { @@ -442,6 +444,64 @@ class MigrationExecutor { } } + static async executeServiceAgreementPruningMigration(container, logger, config) { + if ( + process.env.NODE_ENV === NODE_ENVIRONMENTS.DEVELOPMENT || + process.env.NODE_ENV === NODE_ENVIRONMENTS.TEST + ) + return; + + const repositoryModuleManager = container.resolve('repositoryModuleManager'); + const blockchainModuleManager = container.resolve('blockchainModuleManager'); + const serviceAgreementService = container.resolve('serviceAgreementService'); + + const migration = new ServiceAgreementPruningMigration( + 'serviceAgreementPruningMigration', + logger, + config, + repositoryModuleManager, + blockchainModuleManager, + serviceAgreementService, + ); + if (!(await migration.migrationAlreadyExecuted())) { + try { + await migration.migrate(); + } catch (error) { + logger.error( + `Unable to execute service agreement pruning migration. Error: ${error.message}`, + ); + } + } + } + + static async executeRemoveDuplicateServiceAgreementMigration(container, logger, config) { + if ( + process.env.NODE_ENV === NODE_ENVIRONMENTS.DEVELOPMENT || + process.env.NODE_ENV === NODE_ENVIRONMENTS.TEST + ) + return; + + const repositoryModuleManager = container.resolve('repositoryModuleManager'); + const blockchainModuleManager = container.resolve('blockchainModuleManager'); + + const migration = new RemoveDuplicateServiceAgreementMigration( + 'removeDuplicateServiceAgreementMigration', + logger, + config, + repositoryModuleManager, + blockchainModuleManager, + ); + if (!(await migration.migrationAlreadyExecuted())) { + try { + await migration.migrate(); + } catch (error) { + logger.error( + `Unable to execute service agreement pruning migration. Error: ${error.message}`, + ); + } + } + } + static exitNode(code = 0) { process.exit(code); } diff --git a/src/migration/remove-duplicate-service-agreement-migration.js b/src/migration/remove-duplicate-service-agreement-migration.js new file mode 100644 index 000000000..8e646606c --- /dev/null +++ b/src/migration/remove-duplicate-service-agreement-migration.js @@ -0,0 +1,43 @@ +import BaseMigration from './base-migration.js'; + +class RemoveDuplicateServiceAgreementMigration extends BaseMigration { + constructor(migrationName, logger, config, repositoryModuleManager, blockchainModuleManager) { + super(migrationName, logger, config); + this.repositoryModuleManager = repositoryModuleManager; + this.blockchainModuleManager = blockchainModuleManager; + } + + async executeMigration() { + const blockchainIds = this.blockchainModuleManager.getImplementationNames(); + + for (const blockchainId of blockchainIds) { + const incorrectServiceAgreementId = []; + const duplicateTokenIdsRestult = + // eslint-disable-next-line no-await-in-loop + await this.repositoryModuleManager.findDuplicateServiceAgreements(blockchainId); + const duplicateTokenIds = duplicateTokenIdsRestult.map((t) => t.dataValues.token_id); + const findDuplicateServiceAgreements = + // eslint-disable-next-line no-await-in-loop + await this.repositoryModuleManager.findServiceAgreementsByTokenIds( + duplicateTokenIds, + blockchainId, + ); + for (const serviceAgreement of findDuplicateServiceAgreements) { + const blockchainAssertionId = + // eslint-disable-next-line no-await-in-loop + await this.blockchainModuleManager.getAssertionIdByIndex( + blockchainId, + serviceAgreement.assetStorageContractAddress, + serviceAgreement.tokenId, + serviceAgreement.stateIndex, + ); + if (serviceAgreement.assertionId !== blockchainAssertionId) { + incorrectServiceAgreementId.push(serviceAgreement.agreementId); + } + } + // eslint-disable-next-line no-await-in-loop + await this.repositoryModuleManager.removeServiceAgreements(incorrectServiceAgreementId); + } + } +} +export default RemoveDuplicateServiceAgreementMigration; diff --git a/src/migration/service-agreement-pruning-migration.js b/src/migration/service-agreement-pruning-migration.js new file mode 100644 index 000000000..2e7853c75 --- /dev/null +++ b/src/migration/service-agreement-pruning-migration.js @@ -0,0 +1,35 @@ +import BaseMigration from './base-migration.js'; + +class ServiceAgreementPruningMigration extends BaseMigration { + constructor( + migrationName, + logger, + config, + repositoryModuleManager, + blockchainModuleManager, + serviceAgreementService, + ) { + super(migrationName, logger, config); + this.repositoryModuleManager = repositoryModuleManager; + this.blockchainModuleManager = blockchainModuleManager; + this.serviceAgreementService = serviceAgreementService; + } + + async executeMigration() { + const blockchainIds = this.blockchainModuleManager.getImplementationNames(); + + // eslint-disable-next-line no-await-in-loop + for (const blockchainId of blockchainIds) { + const assetStorageContractAddresses = + // eslint-disable-next-line no-await-in-loop + await this.blockchainModuleManager.getAssetStorageContractAddresses(blockchainId); + + // eslint-disable-next-line no-await-in-loop + await this.repositoryModuleManager.removeServiceAgreementsByBlockchainAndContract( + blockchainId, + assetStorageContractAddresses[0], + ); + } + } +} +export default ServiceAgreementPruningMigration; diff --git a/src/modules/network/implementation/libp2p-service.js b/src/modules/network/implementation/libp2p-service.js index 6ea134353..19d1eeb9d 100644 --- a/src/modules/network/implementation/libp2p-service.js +++ b/src/modules/network/implementation/libp2p-service.js @@ -397,18 +397,17 @@ class Libp2pService { let readResponseStart; let readResponseEnd; let response; + const abortSignalEventListener = async () => { + stream.abort(); + response = null; + }; const timeoutController = new TimeoutController(timeout); try { readResponseStart = Date.now(); - timeoutController.signal.addEventListener( - 'abort', - async () => { - stream.abort(); - response = null; - }, - { once: true }, - ); + timeoutController.signal.addEventListener('abort', abortSignalEventListener, { + once: true, + }); response = await this._readMessageFromStream( stream, @@ -420,12 +419,12 @@ class Libp2pService { throw Error('Message timed out!'); } - timeoutController.signal.removeEventListener('abort'); + timeoutController.signal.removeEventListener('abort', abortSignalEventListener); timeoutController.clear(); readResponseEnd = Date.now(); } catch (error) { - timeoutController.signal.removeEventListener('abort'); + timeoutController.signal.removeEventListener('abort', abortSignalEventListener); timeoutController.clear(); readResponseEnd = Date.now(); diff --git a/src/modules/repository/implementation/sequelize/repositories/service-agreement-repository.js b/src/modules/repository/implementation/sequelize/repositories/service-agreement-repository.js index 062a6876e..6857a46a5 100644 --- a/src/modules/repository/implementation/sequelize/repositories/service-agreement-repository.js +++ b/src/modules/repository/implementation/sequelize/repositories/service-agreement-repository.js @@ -190,7 +190,7 @@ class ServiceAgreementRepository { ['scoreFunctionId', 'DESC'], [Sequelize.col('timeLeftInSubmitCommitWindow'), 'ASC'], ], - limit: 100, + limit: 500, raw: true, }); } @@ -249,7 +249,7 @@ class ServiceAgreementRepository { ['scoreFunctionId', 'DESC'], [Sequelize.col('timeLeftInSubmitProofWindow'), 'ASC'], ], - limit: 100, + limit: 500, raw: true, }); } @@ -286,6 +286,39 @@ class ServiceAgreementRepository { }, }); } + + + async removeServiceAgreementsByBlockchainAndContract(blockchainId, contract) { + await this.model.destroy({ + where: { + blockchainId, + assetStorageContractAddress: { + [Sequelize.Op.ne]: contract, + }, + }, + }); + } + + async findDuplicateServiceAgreements(blockchainId) { + return this.model.findAll({ + attributes: ['token_id', [Sequelize.fn('COUNT', Sequelize.col('*')), 'count']], + where: { + blockchain_id: `${blockchainId}`, + }, + group: ['token_id'], + having: Sequelize.literal('count > 1'), + }); + } + + async findServiceAgreementsByTokenIds(tokenIds, blockchainId) { + return this.model.findAll({ + where: { + tokenId: { [Sequelize.Op.in]: tokenIds }, + blockchainId, + }, + order: [['token_id']], + }); + } } export default ServiceAgreementRepository; diff --git a/src/modules/repository/repository-module-manager.js b/src/modules/repository/repository-module-manager.js index 30ad35a16..33f6ffb44 100644 --- a/src/modules/repository/repository-module-manager.js +++ b/src/modules/repository/repository-module-manager.js @@ -403,6 +403,14 @@ class RepositoryModuleManager extends BaseModuleManager { } } + async removeServiceAgreementsByBlockchainAndContract(blockchainId, contract) { + if (this.initialized) { + return this.getRepository( + 'service_agreement', + ).removeServiceAgreementsByBlockchainAndContract(blockchainId, contract); + } + } + async getEligibleAgreementsForSubmitCommit( timestampSeconds, blockchain, @@ -473,6 +481,17 @@ class RepositoryModuleManager extends BaseModuleManager { ); } + async findDuplicateServiceAgreements(blockchainId) { + return this.getRepository('service_agreement').findDuplicateServiceAgreements(blockchainId); + } + + async findServiceAgreementsByTokenIds(tokenIds, blockchainId) { + return this.getRepository('service_agreement').findServiceAgreementsByTokenIds( + tokenIds, + blockchainId, + ); + } + async createParanetRecord(name, description, paranetId, blockchainId) { this.getRepository('paranet').createParanetRecord( name,