diff --git a/README.md b/README.md index c4fd787499..97ea3aaf27 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ -___ +---
@@ -50,7 +50,7 @@ ___ -___ +---
@@ -60,6 +60,7 @@ ___ ### **What is the Decentralized Knowledge Graph?** +
@@ -69,17 +70,19 @@ ___
OriginTrail Decentralized Knowledge Graph (DKG), hosted on the OriginTrail Decentralized Network (ODN) as trusted knowledge infrastructure, is shared global Knowledge Graph of Knowledge Assets. Running on the basis of the permissionless multi-chain OriginTrail protocol, it combines blockchains and knowledge graph technology to enable trusted AI applications based on key W3C standards. +
### **The OriginTrail DKG Architecture** +
-The OriginTrail tech stack is a three layer structure, consisting of the multi-chain consensus layer (OriginTrail layer 1, running on multiple blockchains), the Decentralized Knowledge Graph layer (OriginTrail Layer 2, hosted on the ODN) and Trusted Knowledge applications in the application layer. +The OriginTrail tech stack is a three layer structure, consisting of the multi-chain consensus layer (OriginTrail layer 1, running on multiple blockchains), the Decentralized Knowledge Graph layer (OriginTrail Layer 2, hosted on the ODN) and Trusted Knowledge applications in the application layer.
DKG Architecture @@ -87,13 +90,15 @@ The OriginTrail tech stack is a three layer structure, consisting of the multi-c Further, the architecture differentiates between **the public, replicated knowledge graph** shared by all network nodes according to the protocol, and **private Knowledge graphs** hosted separately by each of the OriginTrail nodes. -**Anyone can run an OriginTrail node and become part of the ODN, contributing to the network capacity and hosting the OriginTrail DKG. The OriginTrail node is the ultimate data service for data and knowledge intensive Web3 applications and is used as the key backbone for trusted AI applications (see https://chatdkg.ai)** +**Anyone can run an OriginTrail node and become part of the ODN, contributing to the network capacity and hosting the OriginTrail DKG. The OriginTrail node is the ultimate data service for data and knowledge intensive Web3 applications and is used as the key backbone for trusted AI applications (see https://chatdkg.ai)** +
### **What is a Knowledge Asset?** +
@@ -105,14 +110,16 @@ Further, the architecture differentiates between **the public, replicated knowle **Knowledge Asset is the new, AI‑ready resource for the Internet** Knowledge Assets are verifiable containers of structured knowledge that live on the OriginTrail DKG and provide: -- **Discoverability - UAL is the new URL**. Uniform Asset Locators (UALs, based on the W3C Decentralized Identifiers) are a new Web3 knowledge identifier (extensions of the Uniform Resource Locators - URLs) which identify a specific piece of knowledge and make it easy to find and connect with other Knowledge Assets. -- **Ownership - NFTs enable ownership**. Each Knowledge Asset contains an NFT token that enables ownership, knowledge asset administration and market mechanisms. -- **Verifiability - On-chain information origin and verifiable trail**. The blockchain tech increases trust, security, transparency, and the traceability of information. + +- **Discoverability - UAL is the new URL**. Uniform Asset Locators (UALs, based on the W3C Decentralized Identifiers) are a new Web3 knowledge identifier (extensions of the Uniform Resource Locators - URLs) which identify a specific piece of knowledge and make it easy to find and connect with other Knowledge Assets. +- **Ownership - NFTs enable ownership**. Each Knowledge Asset contains an NFT token that enables ownership, knowledge asset administration and market mechanisms. +- **Verifiability - On-chain information origin and verifiable trail**. The blockchain tech increases trust, security, transparency, and the traceability of information. By their nature, Knowledge Assets are semantic resources (following the W3C Semantic Web set of standards), and through their symbolic representations inherently AI ready. See more at https://chatdkg.ai
**Discover Knowledge Assets with the DKG Explorer:** +
@@ -144,7 +151,6 @@ By their nature, Knowledge Assets are semantic resources (following the W3C Sema
-

(back to top)

@@ -152,16 +158,17 @@ By their nature, Knowledge Assets are semantic resources (following the W3C Sema ## 🚀 Getting Started -___ +--- ### Prerequisites
-- **NodeJS** >= 16.0.0 -- **npm** >= 8.0.0 +- **NodeJS** >= 16.0.0 +- **npm** >= 8.0.0 + +--- -___
### Local Network Setup @@ -169,19 +176,36 @@ ___
First, clone the repo: + ```bash git clone https://github.com/OriginTrail/ot-node.git cd ot-node ``` Install dependencies using `npm`: + ```bash npm install ``` +Create the .env file inside the "ot-node" directory: + +```bash +nano .env +``` + +and paste the following content inside (save and close): + +```bash +NODE_ENV=development +RPC_ENDPOINT_BC1=http://localhost:8545 +RPC_ENDPOINT_BC2=http://localhost:9545 +``` + Run the Triple Store. To use default Triple Store (`blazegraph`), download the exec file and run it with the following command in the separate process: + ```bash java -server -Xmx4g -jar blazegraph.jar ``` @@ -189,11 +213,13 @@ java -server -Xmx4g -jar blazegraph.jar Then, depending on the OS, use one of the scripts in order to run the local network with provided number of nodes (minimal amount of nodes should be 12): **MacOS** + ```bash bash ./tools/local-network-setup/setup-macos-environment.sh --nodes=12 ``` -___ +--- +
### DKG Node Setup @@ -202,7 +228,8 @@ ___ In order to run a DKG node on the **Testnet** or **Mainnet**, please read the official documentation: https://docs.origintrail.io/decentralized-knowledge-graph-layer-2/node-setup-instructions/setup-instructions-dockerless -___ +--- +
### Build on DKG @@ -217,13 +244,15 @@ From an architectural standpoint, the SDK libraries are application interfaces i The OriginTrail SDK libraries are being built in various languages by the team and the community, as listed below: -- dkg.js - JavaScript SDK implementation - - [Github repository](https://github.com/OriginTrail/dkg.js) - - [Documentation](https://docs.origintrail.io/decentralized-knowledge-graph-layer-2/dkg-sdk/dkg-v6-js-client) -- dkg.py - Python SDK implementation - - [Github repository](https://github.com/OriginTrail/dkg.py) - - [Documentation](https://docs.origintrail.io/decentralized-knowledge-graph-layer-2/dkg-sdk/dkg-v6-py-client) -___ + +- dkg.js - JavaScript SDK implementation + - [Github repository](https://github.com/OriginTrail/dkg.js) + - [Documentation](https://docs.origintrail.io/decentralized-knowledge-graph-layer-2/dkg-sdk/dkg-v6-js-client) +- dkg.py - Python SDK implementation + - [Github repository](https://github.com/OriginTrail/dkg.py) + - [Documentation](https://docs.origintrail.io/decentralized-knowledge-graph-layer-2/dkg-sdk/dkg-v6-py-client) + +---

(back to top)

@@ -282,4 +311,4 @@ Don't forget to give the project a star! Thanks again! -___ +--- diff --git a/config/config.json b/config/config.json index e16f1e509d..fed029d00b 100644 --- a/config/config.json +++ b/config/config.json @@ -112,12 +112,10 @@ "blockchain": { "enabled": true, "implementation": { - "hardhat": { + "hardhat1:31337": { "enabled": true, "package": "./blockchain/implementation/hardhat/hardhat-service.js", "config": { - "blockchainTitle": "hardhat", - "networkId": "ganache::testnet", "hubContractAddress": "0x5FbDB2315678afecb367f032d93F642f64180aa3", "rpcEndpoints": ["http://localhost:8545"], "evmManagementPublicKey": "0x1B420da5f7Be66567526E32bc68ab29F1A63765A", @@ -125,47 +123,15 @@ "initialAskAmount": 0.2 } }, - "otp": { - "enabled": false, - "package": "./blockchain/implementation/ot-parachain/ot-parachain-service.js", - "config": { - "networkId": "otp::testnet", - "hubContractAddress": "0x707233a55bD035C6Bc732196CA4dbffa63CbA169", - "rpcEndpoints": [ - "https://lofar-tm-rpc.origin-trail.network", - "https://lofar.origintrail.network/" - ], - "initialStakeAmount": 50000, - "initialAskAmount": 2 - } - }, - "polygon": { - "enabled": false, - "package": "./blockchain/implementation/polygon/polygon-service.js", + "hardhat2:31337": { + "enabled": true, + "package": "./blockchain/implementation/hardhat/hardhat-service.js", "config": { - "networkId": "polygon::testnet", - "hubContractAddress": "0xdaa16AC171CfE8Df6F79C06E7EEAb2249E2C9Ec8", - "gasPriceOracleLink": "https://gasstation-mumbai.matic.today/v2", - "rpcEndpoints": [ - "https://matic-mumbai.chainstacklabs.com", - "https://rpc-mumbai.matic.today", - "https://matic-testnet-archive-rpc.bwarelabs.com" - ], + "hubContractAddress": "0x5FbDB2315678afecb367f032d93F642f64180aa3", + "rpcEndpoints": ["http://localhost:9545"], "evmManagementPublicKey": "0x1B420da5f7Be66567526E32bc68ab29F1A63765A", "initialStakeAmount": 50000, - "initialAskAmount": 2 - } - }, - "rinkeby": { - "enabled": false, - "package": "./blockchain/implementation/polygon/eth-service.js", - "config": { - "networkId": "eth::rinkeby", - "hubContractAddress": "", - "gasPriceOracleLink": "", - "rpcEndpoints": [], - "initialStakeAmount": 50000, - "initialAskAmount": 2 + "initialAskAmount": 0.2 } } } @@ -289,17 +255,25 @@ "blockchain": { "enabled": true, "implementation": { - "hardhat": { + "hardhat1:31337": { "enabled": true, "package": "./blockchain/implementation/hardhat/hardhat-service.js", "config": { - "blockchainTitle": "ganache", - "networkId": "ganache::testnet", "hubContractAddress": "0x5FbDB2315678afecb367f032d93F642f64180aa3", "rpcEndpoints": ["http://localhost:8545"], "initialStakeAmount": 50000, "initialAskAmount": 0.2 } + }, + "hardhat2:31337": { + "enabled": true, + "package": "./blockchain/implementation/hardhat/hardhat-service.js", + "config": { + "hubContractAddress": "0x5FbDB2315678afecb367f032d93F642f64180aa3", + "rpcEndpoints": ["http://localhost:9545"], + "initialStakeAmount": 50000, + "initialAskAmount": 0.2 + } } } }, @@ -424,17 +398,26 @@ "blockchain": { "enabled": true, "implementation": { - "otp": { - "enabled": true, + "otp:20430": { + "enabled": false, "package": "./blockchain/implementation/ot-parachain/ot-parachain-service.js", "config": { - "networkId": "parachain::testnet", "hubContractAddress": "0xBbfF7Ea6b2Addc1f38A0798329e12C08f03750A6", "rpcEndpoints": [ "https://lofar-testnet.origin-trail.network", "https://lofar-testnet.origintrail.network" ] } + }, + "gnosis:10200": { + "enabled": false, + "package": "./blockchain/implementation/gnosis/gnosis-service.js", + + "config": { + "hubContractAddress": "0xC06210312C9217A0EdF67453618F5eB96668679A", + "gasPriceOracleLink": "https://blockscout.chiadochain.net/api/v1/gas-price-oracle", + "rpcEndpoints": ["https://rpc.chiadochain.net"] + } } } }, @@ -494,6 +477,170 @@ "publicOperations": [] } }, + "devnet": { + "modules": { + "autoUpdater": { + "enabled": true, + "implementation": { + "ot-auto-updater": { + "enabled": true, + "package": "./auto-updater/implementation/ot-auto-updater.js", + "config": { + "branch": "v6/release/testnet" + } + } + } + }, + "network": { + "enabled": true, + "implementation": { + "libp2p-service": { + "enabled": true, + "package": "./network/implementation/libp2p-service.js", + "config": { + "dht": { + "kBucketSize": 20 + }, + "connectionManager": { + "autoDial": true, + "autoDialInterval": 10e3, + "dialTimeout": 2e3 + }, + "peerRouting": { + "refreshManager": { + "enabled": true, + "interval": 6e5, + "bootDelay": 2e3 + } + }, + "port": 9000, + "bootstrap": [ + "/ip4/64.225.99.151/tcp/9000/p2p/QmawsTRqaLPyLQ5PfStpFcpQW4bvNQ59zV1by2G5aJHuVn", + "/ip4/18.157.122.121/tcp/9000/p2p/QmfDebvsKNwCggBBmEWB43cAZtTa2umMsnRvBnMV4sY5th" + ] + } + } + } + }, + "httpClient": { + "enabled": true, + "implementation": { + "express-http-client": { + "enabled": true, + "package": "./http-client/implementation/express-http-client.js", + "config": { + "useSsl": false, + "port": 8900, + "sslKeyPath": "/root/certs/privkey.pem", + "sslCertificatePath": "/root/certs/fullchain.pem", + "rateLimiter": { + "timeWindowSeconds": 60, + "maxRequests": 10 + } + } + } + } + }, + "repository": { + "enabled": true, + "implementation": { + "sequelize-repository": { + "enabled": true, + "package": "./repository/implementation/sequelize/sequelize-repository.js", + "config": { + "database": "operationaldb", + "user": "root", + "password": "password", + "port": "3306", + "host": "localhost", + "dialect": "mysql", + "logging": false + } + } + } + }, + "blockchain": { + "enabled": true, + "implementation": { + "otp:2160": { + "enabled": false, + "package": "./blockchain/implementation/ot-parachain/ot-parachain-service.js", + "config": { + "hubContractAddress": "0x833048F6e6BEa78E0AAdedeCd2Dc2231dda443FB", + "rpcEndpoints": [ + "https://lofar-tm-rpc.origin-trail.network", + "https://lofar.origintrail.network" + ] + } + }, + "gnosis:10200": { + "enabled": false, + "package": "./blockchain/implementation/gnosis/gnosis-service.js", + + "config": { + "hubContractAddress": "0xD2bA102A0b11944d00180eE8136208ccF87bC39A", + "gasPriceOracleLink": "https://blockscout.chiadochain.net/api/v1/gas-price-oracle", + "rpcEndpoints": ["https://rpc.chiadochain.net"] + } + } + } + }, + "validation": { + "enabled": true, + "implementation": { + "merkle-validation": { + "enabled": true, + "package": "./validation/implementation/merkle-validation.js", + "config": {} + } + } + }, + "tripleStore": { + "enabled": true, + "implementation": { + "ot-blazegraph": { + "enabled": false, + "package": "./triple-store/implementation/ot-blazegraph/ot-blazegraph.js", + "config": {} + }, + "ot-fuseki": { + "enabled": false, + "package": "./triple-store/implementation/ot-fuseki/ot-fuseki.js", + "config": {} + }, + "ot-graphdb": { + "enabled": false, + "package": "./triple-store/implementation/ot-graphdb/ot-graphdb.js", + "config": {} + } + } + }, + "telemetry": { + "enabled": true, + "implementation": { + "ot-telemetry": { + "enabled": true, + "package": "./telemetry/implementation/ot-telemetry.js", + "config": { + "sendTelemetryData": true, + "signalingServerUrl": "https://devnet-signaling.origin-trail.network/signal" + } + } + } + } + }, + "maximumAssertionSizeInKb": 2500, + "commandExecutorVerboseLoggingEnabled": false, + "appDataPath": "data", + "logLevel": "trace", + "auth": { + "ipBasedAuthEnabled": true, + "tokenBasedAuthEnabled": false, + "loggingEnabled": true, + "ipWhitelist": ["::1", "127.0.0.1"], + "publicOperations": [] + } + }, "mainnet": { "modules": { "autoUpdater": { @@ -578,13 +725,12 @@ }, "blockchain": { "enabled": true, - "defaultImplementation": "otp", + "defaultImplementation": "otp:2043", "implementation": { - "otp": { - "enabled": true, + "otp:2043": { + "enabled": false, "package": "./blockchain/implementation/ot-parachain/ot-parachain-service.js", "config": { - "networkId": "otp::mainnet", "hubContractAddress": "0x5fA7916c48Fe6D5F1738d12Ad234b78c90B4cAdA", "rpcEndpoints": [ "https://astrosat-parachain-rpc.origin-trail.network", @@ -592,6 +738,15 @@ "https://astrosat-2.origintrail.network/" ] } + }, + "gnosis:100": { + "enabled": false, + "package": "./blockchain/implementation/gnosis/gnosis-service.js", + "config": { + "hubContractAddress": "0xbEF14fc04F870c2dD65c13Df4faB6ba01A9c746b", + "gasPriceOracleLink": "https://api.gnosisscan.io/api?module=proxy&action=eth_gasPrice", + "rpcEndpoints": ["https://rpc.gnosischain.com/"] + } } } }, diff --git a/ot-node.js b/ot-node.js index 417e409f30..e2e59b0224 100644 --- a/ot-node.js +++ b/ot-node.js @@ -27,11 +27,8 @@ class OTNode { async start() { await this.checkForUpdate(); await this.removeUpdateFile(); - await MigrationExecutor.executeTripleStoreUserConfigurationMigration( - this.logger, - this.config, - ); - await MigrationExecutor.executeTelemetryModuleUserConfigurationMigration( + + await MigrationExecutor.executeUalExtensionUserConfigurationMigration( this.logger, this.config, ); @@ -51,57 +48,19 @@ class OTNode { this.initializeEventEmitter(); await this.initializeModules(); - await MigrationExecutor.executePullShardingTableMigration( - this.container, - this.logger, - this.config, - ); - await MigrationExecutor.executePrivateAssetsMetadataMigration( - this.container, - this.logger, - this.config, - ); - await MigrationExecutor.executeRemoveAgreementStartEndTimeMigration( - this.container, - this.logger, - this.config, - ); - await MigrationExecutor.executeMarkOldBlockchainEventsAsProcessedMigration( - this.container, - this.logger, - this.config, - ); - await MigrationExecutor.executeTripleStoreMetadataMigration( - this.container, - this.logger, - this.config, - ); - await MigrationExecutor.executeServiceAgreementsMetadataMigration( - this.container, - this.logger, - this.config, - ); - await MigrationExecutor.executeRemoveOldEpochCommandsMigration( - this.container, - this.logger, - this.config, - ); - await MigrationExecutor.executePendingStorageMigration(this.logger, this.config); - // MigrationExecutor.executeServiceAgreementsDataInspector( - // this.container, - // this.logger, - // this.config, - // ); - // await MigrationExecutor.executeServiceAgreementsInvalidDataMigration( - // this.container, - // this.logger, - // this.config, - // ); + await this.createProfiles(); await this.initializeCommandExecutor(); await this.initializeShardingTableService(); - await this.initializeBlockchainEventListenerService(); + + MigrationExecutor.executeUalExtensionTripleStoreMigration( + this.container, + this.logger, + this.config, + ).then(async () => { + await this.initializeBlockchainEventListenerService(); + }); await this.initializeRouters(); await this.startNetworkModule(); @@ -317,6 +276,7 @@ class OTNode { telemetryModuleManager.listenOnEvents((eventData) => { repositoryModuleManager.createEventRecord( eventData.operationId, + eventData.blockchainId, eventData.lastEvent, eventData.timestamp, eventData.value1, diff --git a/package-lock.json b/package-lock.json index 2186691d6a..96ed40c12e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "origintrail_node", - "version": "6.0.20", + "version": "6.1.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "origintrail_node", - "version": "6.0.20", + "version": "6.1.0", "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.0.7", + "dkg-evm-module": "^4.1.0", "dotenv": "^16.0.1", "ethers": "^5.7.2", "express": "^4.18.1", @@ -103,89 +103,17 @@ } }, "node_modules/@babel/code-frame": { - "version": "7.22.13", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.22.13.tgz", - "integrity": "sha512-XktuhWlJ5g+3TJXc5upd9Ks1HutSArik6jf2eAjYFyIOf4ej3RN+184cZbzDvbPnuTJIUhPKKJE3cIsYTiAT3w==", + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.18.6.tgz", + "integrity": "sha512-TDCmlK5eOvH+eH7cdAFlNXeVJqWIQ7gW9tY1GJIpUtFb6CmjVyq2VM3u71bOyR8CRihcCgMUYoDNyLXao3+70Q==", "dev": true, "dependencies": { - "@babel/highlight": "^7.22.13", - "chalk": "^2.4.2" + "@babel/highlight": "^7.18.6" }, "engines": { "node": ">=6.9.0" } }, - "node_modules/@babel/code-frame/node_modules/ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "dependencies": { - "color-convert": "^1.9.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/@babel/code-frame/node_modules/chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "dependencies": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/@babel/code-frame/node_modules/color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "dev": true, - "dependencies": { - "color-name": "1.1.3" - } - }, - "node_modules/@babel/code-frame/node_modules/color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", - "dev": true - }, - "node_modules/@babel/code-frame/node_modules/escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", - "dev": true, - "engines": { - "node": ">=0.8.0" - } - }, - "node_modules/@babel/code-frame/node_modules/has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/@babel/code-frame/node_modules/supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "dependencies": { - "has-flag": "^3.0.0" - }, - "engines": { - "node": ">=4" - } - }, "node_modules/@babel/compat-data": { "version": "7.21.0", "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.21.0.tgz", @@ -226,21 +154,21 @@ } }, "node_modules/@babel/core/node_modules/semver": { - "version": "6.3.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", - "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", "dev": true, "bin": { "semver": "bin/semver.js" } }, "node_modules/@babel/generator": { - "version": "7.23.3", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.23.3.tgz", - "integrity": "sha512-keeZWAV4LU3tW0qRi19HRpabC/ilM0HRBBzf9/k8FFiG4KVpiv0FIy4hHfLfFQZNhziCTPTmd59zoyv6DNISzg==", + "version": "7.21.3", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.21.3.tgz", + "integrity": "sha512-QS3iR1GYC/YGUnW7IdggFeN5c1poPUurnGttOV/bZgPGV+izC/D8HnD6DLwod0fsatNyVn1G3EVWMYIF0nHbeA==", "dev": true, "dependencies": { - "@babel/types": "^7.23.3", + "@babel/types": "^7.21.3", "@jridgewell/gen-mapping": "^0.3.2", "@jridgewell/trace-mapping": "^0.3.17", "jsesc": "^2.5.1" @@ -292,43 +220,43 @@ } }, "node_modules/@babel/helper-compilation-targets/node_modules/semver": { - "version": "6.3.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", - "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", "dev": true, "bin": { "semver": "bin/semver.js" } }, "node_modules/@babel/helper-environment-visitor": { - "version": "7.22.20", - "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.22.20.tgz", - "integrity": "sha512-zfedSIzFhat/gFhWfHtgWvlec0nqB9YEIVrpuwjruLlXfUSnA8cJB0miHKwqDnQ7d32aKo2xt88/xZptwxbfhA==", + "version": "7.18.9", + "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.18.9.tgz", + "integrity": "sha512-3r/aACDJ3fhQ/EVgFy0hpj8oHyHpQc+LPtJoY9SzTThAsStm4Ptegq92vqKoE3vD706ZVFWITnMnxucw+S9Ipg==", "dev": true, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-function-name": { - "version": "7.23.0", - "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.23.0.tgz", - "integrity": "sha512-OErEqsrxjZTJciZ4Oo+eoZqeW9UIiOcuYKRJA4ZAgV9myA+pOXhhmpfNCKjEH/auVfEYVFJ6y1Tc4r0eIApqiw==", + "version": "7.21.0", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.21.0.tgz", + "integrity": "sha512-HfK1aMRanKHpxemaY2gqBmL04iAPOPRj7DxtNbiDOrJK+gdwkiNRVpCpUJYbUT+aZyemKN8brqTOxzCaG6ExRg==", "dev": true, "dependencies": { - "@babel/template": "^7.22.15", - "@babel/types": "^7.23.0" + "@babel/template": "^7.20.7", + "@babel/types": "^7.21.0" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-hoist-variables": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.22.5.tgz", - "integrity": "sha512-wGjk9QZVzvknA6yKIUURb8zY3grXCcOZt+/7Wcy8O2uctxhplmUPkOdlgoNhmdVee2c92JXbf1xpMtVNbfoxRw==", + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.18.6.tgz", + "integrity": "sha512-UlJQPkFqFULIcyW5sbzgbkxn2FKRgwWiRexcuaR8RNJRy8+LLveqPjwZV/bwrLZCN0eUHD/x8D0heK1ozuoo6Q==", "dev": true, "dependencies": { - "@babel/types": "^7.22.5" + "@babel/types": "^7.18.6" }, "engines": { "node": ">=6.9.0" @@ -378,30 +306,30 @@ } }, "node_modules/@babel/helper-split-export-declaration": { - "version": "7.22.6", - "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.22.6.tgz", - "integrity": "sha512-AsUnxuLhRYsisFiaJwvp1QF+I3KjD5FOxut14q/GzovUe6orHLesW2C7d754kRm53h5gqrz6sFl6sxc4BVtE/g==", + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.18.6.tgz", + "integrity": "sha512-bde1etTx6ZyTmobl9LLMMQsaizFVZrquTEHOqKeQESMKo4PlObf+8+JA25ZsIpZhT/WEd39+vOdLXAFG/nELpA==", "dev": true, "dependencies": { - "@babel/types": "^7.22.5" + "@babel/types": "^7.18.6" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-string-parser": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.22.5.tgz", - "integrity": "sha512-mM4COjgZox8U+JcXQwPijIZLElkgEpO5rsERVDJTc2qfCDfERyob6k5WegS14SX18IIjv+XD+GrqNumY5JRCDw==", + "version": "7.19.4", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.19.4.tgz", + "integrity": "sha512-nHtDoQcuqFmwYNYPz3Rah5ph2p8PFeFCsZk9A/48dPc/rGocJ5J3hAAZ7pb76VWX3fZKu+uEr/FhH5jLx7umrw==", "dev": true, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-validator-identifier": { - "version": "7.22.20", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.20.tgz", - "integrity": "sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A==", + "version": "7.19.1", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.19.1.tgz", + "integrity": "sha512-awrNfaMtnHUr653GgGEs++LlAvW6w+DcPrOliSMXWCKo597CwL5Acf/wWdNkf/tfEQE3mjkeD1YOVZOUV/od1w==", "dev": true, "engines": { "node": ">=6.9.0" @@ -431,13 +359,13 @@ } }, "node_modules/@babel/highlight": { - "version": "7.22.20", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.22.20.tgz", - "integrity": "sha512-dkdMCN3py0+ksCgYmGG8jKeGA/8Tk+gJwSYYlFGxG5lmhfKNoAy004YpLxpS1W2J8m/EK2Ew+yOs9pVRwO89mg==", + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.18.6.tgz", + "integrity": "sha512-u7stbOuYjaPezCuLj29hNW1v64M2Md2qupEKP1fHc7WdOA3DgLh37suiSrZYY7haUB7iBeQZ9P1uiRF359do3g==", "dev": true, "dependencies": { - "@babel/helper-validator-identifier": "^7.22.20", - "chalk": "^2.4.2", + "@babel/helper-validator-identifier": "^7.18.6", + "chalk": "^2.0.0", "js-tokens": "^4.0.0" }, "engines": { @@ -516,9 +444,9 @@ } }, "node_modules/@babel/parser": { - "version": "7.23.3", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.23.3.tgz", - "integrity": "sha512-uVsWNvlVsIninV2prNz/3lHCb+5CJ+e+IUBfbjToAHODtfGYLfCFuY4AU7TskI+dAKk+njsPiBjq1gKTvZOBaw==", + "version": "7.21.3", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.21.3.tgz", + "integrity": "sha512-lobG0d7aOfQRXh8AyklEAgZGvA4FShxo6xQbUrrT/cNBPUdIDojlokwJsQyCC/eKia7ifqM0yP+2DRZ4WKw2RQ==", "dev": true, "bin": { "parser": "bin/babel-parser.js" @@ -539,33 +467,33 @@ } }, "node_modules/@babel/template": { - "version": "7.22.15", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.22.15.tgz", - "integrity": "sha512-QPErUVm4uyJa60rkI73qneDacvdvzxshT3kksGqlGWYdOTIUOwJ7RDUL8sGqslY1uXWSL6xMFKEXDS3ox2uF0w==", + "version": "7.20.7", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.20.7.tgz", + "integrity": "sha512-8SegXApWe6VoNw0r9JHpSteLKTpTiLZ4rMlGIm9JQ18KiCtyQiAMEazujAHrUS5flrcqYZa75ukev3P6QmUwUw==", "dev": true, "dependencies": { - "@babel/code-frame": "^7.22.13", - "@babel/parser": "^7.22.15", - "@babel/types": "^7.22.15" + "@babel/code-frame": "^7.18.6", + "@babel/parser": "^7.20.7", + "@babel/types": "^7.20.7" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/traverse": { - "version": "7.23.3", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.23.3.tgz", - "integrity": "sha512-+K0yF1/9yR0oHdE0StHuEj3uTPzwwbrLGfNOndVJVV2TqA5+j3oljJUb4nmB954FLGjNem976+B+eDuLIjesiQ==", - "dev": true, - "dependencies": { - "@babel/code-frame": "^7.22.13", - "@babel/generator": "^7.23.3", - "@babel/helper-environment-visitor": "^7.22.20", - "@babel/helper-function-name": "^7.23.0", - "@babel/helper-hoist-variables": "^7.22.5", - "@babel/helper-split-export-declaration": "^7.22.6", - "@babel/parser": "^7.23.3", - "@babel/types": "^7.23.3", + "version": "7.21.3", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.21.3.tgz", + "integrity": "sha512-XLyopNeaTancVitYZe2MlUEvgKb6YVVPXzofHgqHijCImG33b/uTurMS488ht/Hbsb2XK3U2BnSTxKVNGV3nGQ==", + "dev": true, + "dependencies": { + "@babel/code-frame": "^7.18.6", + "@babel/generator": "^7.21.3", + "@babel/helper-environment-visitor": "^7.18.9", + "@babel/helper-function-name": "^7.21.0", + "@babel/helper-hoist-variables": "^7.18.6", + "@babel/helper-split-export-declaration": "^7.18.6", + "@babel/parser": "^7.21.3", + "@babel/types": "^7.21.3", "debug": "^4.1.0", "globals": "^11.1.0" }, @@ -583,13 +511,13 @@ } }, "node_modules/@babel/types": { - "version": "7.23.3", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.23.3.tgz", - "integrity": "sha512-OZnvoH2l8PK5eUvEcUyCt/sXgr/h+UWpVuBbOljwcrAgUl6lpchoQ++PHGyQy1AtYnVA6CEq3y5xeEI10brpXw==", + "version": "7.21.3", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.21.3.tgz", + "integrity": "sha512-sBGdETxC+/M4o/zKC0sl6sjWv62WFR/uzxrJ6uYyMLZOUlPnwzw0tKgVHOXxaAd5l2g8pEDM5RZ495GPQI77kg==", "dev": true, "dependencies": { - "@babel/helper-string-parser": "^7.22.5", - "@babel/helper-validator-identifier": "^7.22.20", + "@babel/helper-string-parser": "^7.19.4", + "@babel/helper-validator-identifier": "^7.19.1", "to-fast-properties": "^2.0.0" }, "engines": { @@ -607,6 +535,29 @@ "buffer": "^6.0.3" } }, + "node_modules/@chainsafe/as-sha256": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/@chainsafe/as-sha256/-/as-sha256-0.3.1.tgz", + "integrity": "sha512-hldFFYuf49ed7DAakWVXSJODuq3pzJEguD8tQ7h+sGkM18vja+OFoJI9krnGmgzyuZC2ETX0NOIcCTy31v2Mtg==" + }, + "node_modules/@chainsafe/persistent-merkle-tree": { + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/@chainsafe/persistent-merkle-tree/-/persistent-merkle-tree-0.4.2.tgz", + "integrity": "sha512-lLO3ihKPngXLTus/L7WHKaw9PnNJWizlOF1H9NNzHP6Xvh82vzg9F2bzkXhYIFshMZ2gTCEz8tq6STe7r5NDfQ==", + "dependencies": { + "@chainsafe/as-sha256": "^0.3.1" + } + }, + "node_modules/@chainsafe/ssz": { + "version": "0.9.4", + "resolved": "https://registry.npmjs.org/@chainsafe/ssz/-/ssz-0.9.4.tgz", + "integrity": "sha512-77Qtg2N1ayqs4Bg/wvnWfg5Bta7iy7IRh8XqXh7oNMeP2HBbBwx8m6yTpA8p0EHItWPEBkgZd5S5/LSlp3GXuQ==", + "dependencies": { + "@chainsafe/as-sha256": "^0.3.1", + "@chainsafe/persistent-merkle-tree": "^0.4.2", + "case": "^1.6.3" + } + }, "node_modules/@colors/colors": { "version": "1.5.0", "resolved": "https://registry.npmjs.org/@colors/colors/-/colors-1.5.0.tgz", @@ -3024,94 +2975,23 @@ } }, "node_modules/@ethereumjs/common": { - "version": "2.6.5", - "resolved": "https://registry.npmjs.org/@ethereumjs/common/-/common-2.6.5.tgz", - "integrity": "sha512-lRyVQOeCDaIVtgfbowla32pzeDv2Obr8oR8Put5RdUBNRGr1VGPGQNGP6elWIpgK3YdpzqTOh4GyUGOureVeeA==", + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/@ethereumjs/common/-/common-2.5.0.tgz", + "integrity": "sha512-DEHjW6e38o+JmB/NO3GZBpW4lpaiBpkFgXF6jLcJ6gETBYpEyaA5nTimsWBUJR3Vmtm/didUEbNjajskugZORg==", "dev": true, "dependencies": { "crc-32": "^1.2.0", - "ethereumjs-util": "^7.1.5" - } - }, - "node_modules/@ethereumjs/rlp": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/@ethereumjs/rlp/-/rlp-4.0.1.tgz", - "integrity": "sha512-tqsQiBQDQdmPWE1xkkBq4rlSW5QZpLOUJ5RJh2/9fug+q9tnUhuZoVLk7s0scUIKTOzEtR72DFBXI4WiZcMpvw==", - "bin": { - "rlp": "bin/rlp" - }, - "engines": { - "node": ">=14" + "ethereumjs-util": "^7.1.1" } }, "node_modules/@ethereumjs/tx": { - "version": "3.5.2", - "resolved": "https://registry.npmjs.org/@ethereumjs/tx/-/tx-3.5.2.tgz", - "integrity": "sha512-gQDNJWKrSDGu2w7w0PzVXVBNMzb7wwdDOmOqczmhNjqFxFuIbhVJDwiGEnxFNC2/b8ifcZzY7MLcluizohRzNw==", + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/@ethereumjs/tx/-/tx-3.3.2.tgz", + "integrity": "sha512-6AaJhwg4ucmwTvw/1qLaZUX5miWrwZ4nLOUsKyb/HtzS3BMw/CasKhdi1ims9mBKeK9sOJCH4qGKOBGyJCeeog==", "dev": true, "dependencies": { - "@ethereumjs/common": "^2.6.4", - "ethereumjs-util": "^7.1.5" - } - }, - "node_modules/@ethereumjs/util": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/@ethereumjs/util/-/util-8.1.0.tgz", - "integrity": "sha512-zQ0IqbdX8FZ9aw11vP+dZkKDkS+kgIvQPHnSAXzP9pLu+Rfu3D3XEeLbicvoXJTYnhZiPmsZUxgdzXwNKxRPbA==", - "dependencies": { - "@ethereumjs/rlp": "^4.0.1", - "ethereum-cryptography": "^2.0.0", - "micro-ftch": "^0.3.1" - }, - "engines": { - "node": ">=14" - } - }, - "node_modules/@ethereumjs/util/node_modules/@noble/hashes": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.3.1.tgz", - "integrity": "sha512-EbqwksQwz9xDRGfDST86whPBgM65E0OH/pCgqW0GBVzO22bNE+NuIbeTb714+IfSjU3aRk47EUvXIb5bTsenKA==", - "engines": { - "node": ">= 16" - }, - "funding": { - "url": "https://paulmillr.com/funding/" - } - }, - "node_modules/@ethereumjs/util/node_modules/@scure/bip32": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/@scure/bip32/-/bip32-1.3.1.tgz", - "integrity": "sha512-osvveYtyzdEVbt3OfwwXFr4P2iVBL5u1Q3q4ONBfDY/UpOuXmOlbgwc1xECEboY8wIays8Yt6onaWMUdUbfl0A==", - "dependencies": { - "@noble/curves": "~1.1.0", - "@noble/hashes": "~1.3.1", - "@scure/base": "~1.1.0" - }, - "funding": { - "url": "https://paulmillr.com/funding/" - } - }, - "node_modules/@ethereumjs/util/node_modules/@scure/bip39": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/@scure/bip39/-/bip39-1.2.1.tgz", - "integrity": "sha512-Z3/Fsz1yr904dduJD0NpiyRHhRYHdcnyh73FZWiV+/qhWi83wNJ3NWolYqCEN+ZWsUz2TWwajJggcRE9r1zUYg==", - "dependencies": { - "@noble/hashes": "~1.3.0", - "@scure/base": "~1.1.0" - }, - "funding": { - "url": "https://paulmillr.com/funding/" - } - }, - "node_modules/@ethereumjs/util/node_modules/ethereum-cryptography": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ethereum-cryptography/-/ethereum-cryptography-2.1.2.tgz", - "integrity": "sha512-Z5Ba0T0ImZ8fqXrJbpHcbpAvIswRte2wGNR/KePnu8GbbvgJ47lMxT/ZZPG6i9Jaht4azPDop4HaM00J0J59ug==", - "dependencies": { - "@noble/curves": "1.1.0", - "@noble/hashes": "1.3.1", - "@scure/bip32": "1.3.1", - "@scure/bip39": "1.2.1" + "@ethereumjs/common": "^2.5.0", + "ethereumjs-util": "^7.1.2" } }, "node_modules/@ethersproject/abi": { @@ -3805,14 +3685,6 @@ "@ethersproject/strings": "^5.7.0" } }, - "node_modules/@fastify/busboy": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/@fastify/busboy/-/busboy-2.1.0.tgz", - "integrity": "sha512-+KpH+QxZU7O4675t3mnkQKcZZg56u+K/Ct2K+N2AZYNVK8kyeo/bI18tI8aPm3tvNNRyTWfj6s5tnGNlcbQRsA==", - "engines": { - "node": ">=14" - } - }, "node_modules/@humanwhocodes/config-array": { "version": "0.11.8", "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.8.tgz", @@ -4090,28 +3962,6 @@ } } }, - "node_modules/@noble/curves": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@noble/curves/-/curves-1.1.0.tgz", - "integrity": "sha512-091oBExgENk/kGj3AZmtBDMpxQPDtxQABR2B9lb1JbVTs6ytdzZNwvhxQ4MWasRNEzlbEH8jCWFCwhF/Obj5AA==", - "dependencies": { - "@noble/hashes": "1.3.1" - }, - "funding": { - "url": "https://paulmillr.com/funding/" - } - }, - "node_modules/@noble/curves/node_modules/@noble/hashes": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.3.1.tgz", - "integrity": "sha512-EbqwksQwz9xDRGfDST86whPBgM65E0OH/pCgqW0GBVzO22bNE+NuIbeTb714+IfSjU3aRk47EUvXIb5bTsenKA==", - "engines": { - "node": ">= 16" - }, - "funding": { - "url": "https://paulmillr.com/funding/" - } - }, "node_modules/@noble/hashes": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.2.0.tgz", @@ -4167,32 +4017,34 @@ } }, "node_modules/@nomicfoundation/ethereumjs-block": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-block/-/ethereumjs-block-4.2.2.tgz", - "integrity": "sha512-atjpt4gc6ZGZUPHBAQaUJsm1l/VCo7FmyQ780tMGO8QStjLdhz09dXynmhwVTy5YbRr0FOh/uX3QaEM0yIB2Zg==", - "dependencies": { - "@nomicfoundation/ethereumjs-common": "3.1.2", - "@nomicfoundation/ethereumjs-rlp": "4.0.3", - "@nomicfoundation/ethereumjs-trie": "5.0.5", - "@nomicfoundation/ethereumjs-tx": "4.1.2", - "@nomicfoundation/ethereumjs-util": "8.0.6", - "ethereum-cryptography": "0.1.3" + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-block/-/ethereumjs-block-5.0.2.tgz", + "integrity": "sha512-hSe6CuHI4SsSiWWjHDIzWhSiAVpzMUcDRpWYzN0T9l8/Rz7xNn3elwVOJ/tAyS0LqL6vitUD78Uk7lQDXZun7Q==", + "dependencies": { + "@nomicfoundation/ethereumjs-common": "4.0.2", + "@nomicfoundation/ethereumjs-rlp": "5.0.2", + "@nomicfoundation/ethereumjs-trie": "6.0.2", + "@nomicfoundation/ethereumjs-tx": "5.0.2", + "@nomicfoundation/ethereumjs-util": "9.0.2", + "ethereum-cryptography": "0.1.3", + "ethers": "^5.7.1" }, "engines": { "node": ">=14" } }, "node_modules/@nomicfoundation/ethereumjs-blockchain": { - "version": "6.2.2", - "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-blockchain/-/ethereumjs-blockchain-6.2.2.tgz", - "integrity": "sha512-6AIB2MoTEPZJLl6IRKcbd8mUmaBAQ/NMe3O7OsAOIiDjMNPPH5KaUQiLfbVlegT4wKIg/GOsFH7XlH2KDVoJNg==", - "dependencies": { - "@nomicfoundation/ethereumjs-block": "4.2.2", - "@nomicfoundation/ethereumjs-common": "3.1.2", - "@nomicfoundation/ethereumjs-ethash": "2.0.5", - "@nomicfoundation/ethereumjs-rlp": "4.0.3", - "@nomicfoundation/ethereumjs-trie": "5.0.5", - "@nomicfoundation/ethereumjs-util": "8.0.6", + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-blockchain/-/ethereumjs-blockchain-7.0.2.tgz", + "integrity": "sha512-8UUsSXJs+MFfIIAKdh3cG16iNmWzWC/91P40sazNvrqhhdR/RtGDlFk2iFTGbBAZPs2+klZVzhRX8m2wvuvz3w==", + "dependencies": { + "@nomicfoundation/ethereumjs-block": "5.0.2", + "@nomicfoundation/ethereumjs-common": "4.0.2", + "@nomicfoundation/ethereumjs-ethash": "3.0.2", + "@nomicfoundation/ethereumjs-rlp": "5.0.2", + "@nomicfoundation/ethereumjs-trie": "6.0.2", + "@nomicfoundation/ethereumjs-tx": "5.0.2", + "@nomicfoundation/ethereumjs-util": "9.0.2", "abstract-level": "^1.0.3", "debug": "^4.3.3", "ethereum-cryptography": "0.1.3", @@ -4213,22 +4065,22 @@ } }, "node_modules/@nomicfoundation/ethereumjs-common": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-common/-/ethereumjs-common-3.1.2.tgz", - "integrity": "sha512-JAEBpIua62dyObHM9KI2b4wHZcRQYYge9gxiygTWa3lNCr2zo+K0TbypDpgiNij5MCGNWP1eboNfNfx1a3vkvA==", + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-common/-/ethereumjs-common-4.0.2.tgz", + "integrity": "sha512-I2WGP3HMGsOoycSdOTSqIaES0ughQTueOsddJ36aYVpI3SN8YSusgRFLwzDJwRFVIYDKx/iJz0sQ5kBHVgdDwg==", "dependencies": { - "@nomicfoundation/ethereumjs-util": "8.0.6", + "@nomicfoundation/ethereumjs-util": "9.0.2", "crc-32": "^1.2.0" } }, "node_modules/@nomicfoundation/ethereumjs-ethash": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-ethash/-/ethereumjs-ethash-2.0.5.tgz", - "integrity": "sha512-xlLdcICGgAYyYmnI3r1t0R5fKGBJNDQSOQxXNjVO99JmxJIdXR5MgPo5CSJO1RpyzKOgzi3uIFn8agv564dZEQ==", + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-ethash/-/ethereumjs-ethash-3.0.2.tgz", + "integrity": "sha512-8PfoOQCcIcO9Pylq0Buijuq/O73tmMVURK0OqdjhwqcGHYC2PwhbajDh7GZ55ekB0Px197ajK3PQhpKoiI/UPg==", "dependencies": { - "@nomicfoundation/ethereumjs-block": "4.2.2", - "@nomicfoundation/ethereumjs-rlp": "4.0.3", - "@nomicfoundation/ethereumjs-util": "8.0.6", + "@nomicfoundation/ethereumjs-block": "5.0.2", + "@nomicfoundation/ethereumjs-rlp": "5.0.2", + "@nomicfoundation/ethereumjs-util": "9.0.2", "abstract-level": "^1.0.3", "bigint-crypto-utils": "^3.0.23", "ethereum-cryptography": "0.1.3" @@ -4238,14 +4090,14 @@ } }, "node_modules/@nomicfoundation/ethereumjs-evm": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-evm/-/ethereumjs-evm-1.3.2.tgz", - "integrity": "sha512-I00d4MwXuobyoqdPe/12dxUQxTYzX8OckSaWsMcWAfQhgVDvBx6ffPyP/w1aL0NW7MjyerySPcSVfDJAMHjilw==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-evm/-/ethereumjs-evm-2.0.2.tgz", + "integrity": "sha512-rBLcUaUfANJxyOx9HIdMX6uXGin6lANCulIm/pjMgRqfiCRMZie3WKYxTSd8ZE/d+qT+zTedBF4+VHTdTSePmQ==", "dependencies": { - "@nomicfoundation/ethereumjs-common": "3.1.2", - "@nomicfoundation/ethereumjs-util": "8.0.6", - "@types/async-eventemitter": "^0.2.1", - "async-eventemitter": "^0.2.4", + "@ethersproject/providers": "^5.7.1", + "@nomicfoundation/ethereumjs-common": "4.0.2", + "@nomicfoundation/ethereumjs-tx": "5.0.2", + "@nomicfoundation/ethereumjs-util": "9.0.2", "debug": "^4.3.3", "ethereum-cryptography": "0.1.3", "mcl-wasm": "^0.7.1", @@ -4256,9 +4108,9 @@ } }, "node_modules/@nomicfoundation/ethereumjs-rlp": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-rlp/-/ethereumjs-rlp-4.0.3.tgz", - "integrity": "sha512-DZMzB/lqPK78T6MluyXqtlRmOMcsZbTTbbEyAjo0ncaff2mqu/k8a79PBcyvpgAhWD/R59Fjq/x3ro5Lof0AtA==", + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-rlp/-/ethereumjs-rlp-5.0.2.tgz", + "integrity": "sha512-QwmemBc+MMsHJ1P1QvPl8R8p2aPvvVcKBbvHnQOKBpBztEo0omN0eaob6FeZS/e3y9NSe+mfu3nNFBHszqkjTA==", "bin": { "rlp": "bin/rlp" }, @@ -4267,26 +4119,26 @@ } }, "node_modules/@nomicfoundation/ethereumjs-statemanager": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-statemanager/-/ethereumjs-statemanager-1.0.5.tgz", - "integrity": "sha512-CAhzpzTR5toh/qOJIZUUOnWekUXuRqkkzaGAQrVcF457VhtCmr+ddZjjK50KNZ524c1XP8cISguEVNqJ6ij1sA==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-statemanager/-/ethereumjs-statemanager-2.0.2.tgz", + "integrity": "sha512-dlKy5dIXLuDubx8Z74sipciZnJTRSV/uHG48RSijhgm1V7eXYFC567xgKtsKiVZB1ViTP9iFL4B6Je0xD6X2OA==", "dependencies": { - "@nomicfoundation/ethereumjs-common": "3.1.2", - "@nomicfoundation/ethereumjs-rlp": "4.0.3", - "@nomicfoundation/ethereumjs-trie": "5.0.5", - "@nomicfoundation/ethereumjs-util": "8.0.6", + "@nomicfoundation/ethereumjs-common": "4.0.2", + "@nomicfoundation/ethereumjs-rlp": "5.0.2", "debug": "^4.3.3", "ethereum-cryptography": "0.1.3", - "functional-red-black-tree": "^1.0.1" + "ethers": "^5.7.1", + "js-sdsl": "^4.1.4" } }, "node_modules/@nomicfoundation/ethereumjs-trie": { - "version": "5.0.5", - "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-trie/-/ethereumjs-trie-5.0.5.tgz", - "integrity": "sha512-+8sNZrXkzvA1NH5F4kz5RSYl1I6iaRz7mAZRsyxOm0IVY4UaP43Ofvfp/TwOalFunurQrYB5pRO40+8FBcxFMA==", + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-trie/-/ethereumjs-trie-6.0.2.tgz", + "integrity": "sha512-yw8vg9hBeLYk4YNg5MrSJ5H55TLOv2FSWUTROtDtTMMmDGROsAu+0tBjiNGTnKRi400M6cEzoFfa89Fc5k8NTQ==", "dependencies": { - "@nomicfoundation/ethereumjs-rlp": "4.0.3", - "@nomicfoundation/ethereumjs-util": "8.0.6", + "@nomicfoundation/ethereumjs-rlp": "5.0.2", + "@nomicfoundation/ethereumjs-util": "9.0.2", + "@types/readable-stream": "^2.3.13", "ethereum-cryptography": "0.1.3", "readable-stream": "^3.6.0" }, @@ -4308,13 +4160,15 @@ } }, "node_modules/@nomicfoundation/ethereumjs-tx": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-tx/-/ethereumjs-tx-4.1.2.tgz", - "integrity": "sha512-emJBJZpmTdUa09cqxQqHaysbBI9Od353ZazeH7WgPb35miMgNY6mb7/3vBA98N5lUW/rgkiItjX0KZfIzihSoQ==", + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-tx/-/ethereumjs-tx-5.0.2.tgz", + "integrity": "sha512-T+l4/MmTp7VhJeNloMkM+lPU3YMUaXdcXgTGCf8+ZFvV9NYZTRLFekRwlG6/JMmVfIfbrW+dRRJ9A6H5Q/Z64g==", "dependencies": { - "@nomicfoundation/ethereumjs-common": "3.1.2", - "@nomicfoundation/ethereumjs-rlp": "4.0.3", - "@nomicfoundation/ethereumjs-util": "8.0.6", + "@chainsafe/ssz": "^0.9.2", + "@ethersproject/providers": "^5.7.2", + "@nomicfoundation/ethereumjs-common": "4.0.2", + "@nomicfoundation/ethereumjs-rlp": "5.0.2", + "@nomicfoundation/ethereumjs-util": "9.0.2", "ethereum-cryptography": "0.1.3" }, "engines": { @@ -4322,36 +4176,51 @@ } }, "node_modules/@nomicfoundation/ethereumjs-util": { - "version": "8.0.6", - "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-util/-/ethereumjs-util-8.0.6.tgz", - "integrity": "sha512-jOQfF44laa7xRfbfLXojdlcpkvxeHrE2Xu7tSeITsWFgoII163MzjOwFEzSNozHYieFysyoEMhCdP+NY5ikstw==", + "version": "9.0.2", + "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-util/-/ethereumjs-util-9.0.2.tgz", + "integrity": "sha512-4Wu9D3LykbSBWZo8nJCnzVIYGvGCuyiYLIJa9XXNVt1q1jUzHdB+sJvx95VGCpPkCT+IbLecW6yfzy3E1bQrwQ==", "dependencies": { - "@nomicfoundation/ethereumjs-rlp": "4.0.3", + "@chainsafe/ssz": "^0.10.0", + "@nomicfoundation/ethereumjs-rlp": "5.0.2", "ethereum-cryptography": "0.1.3" }, "engines": { "node": ">=14" } }, + "node_modules/@nomicfoundation/ethereumjs-util/node_modules/@chainsafe/persistent-merkle-tree": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/@chainsafe/persistent-merkle-tree/-/persistent-merkle-tree-0.5.0.tgz", + "integrity": "sha512-l0V1b5clxA3iwQLXP40zYjyZYospQLZXzBVIhhr9kDg/1qHZfzzHw0jj4VPBijfYCArZDlPkRi1wZaV2POKeuw==", + "dependencies": { + "@chainsafe/as-sha256": "^0.3.1" + } + }, + "node_modules/@nomicfoundation/ethereumjs-util/node_modules/@chainsafe/ssz": { + "version": "0.10.2", + "resolved": "https://registry.npmjs.org/@chainsafe/ssz/-/ssz-0.10.2.tgz", + "integrity": "sha512-/NL3Lh8K+0q7A3LsiFq09YXS9fPE+ead2rr7vM2QK8PLzrNsw3uqrif9bpRX5UxgeRjM+vYi+boCM3+GM4ovXg==", + "dependencies": { + "@chainsafe/as-sha256": "^0.3.1", + "@chainsafe/persistent-merkle-tree": "^0.5.0" + } + }, "node_modules/@nomicfoundation/ethereumjs-vm": { - "version": "6.4.2", - "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-vm/-/ethereumjs-vm-6.4.2.tgz", - "integrity": "sha512-PRTyxZMP6kx+OdAzBhuH1LD2Yw+hrSpaytftvaK//thDy2OI07S0nrTdbrdk7b8ZVPAc9H9oTwFBl3/wJ3w15g==", - "dependencies": { - "@nomicfoundation/ethereumjs-block": "4.2.2", - "@nomicfoundation/ethereumjs-blockchain": "6.2.2", - "@nomicfoundation/ethereumjs-common": "3.1.2", - "@nomicfoundation/ethereumjs-evm": "1.3.2", - "@nomicfoundation/ethereumjs-rlp": "4.0.3", - "@nomicfoundation/ethereumjs-statemanager": "1.0.5", - "@nomicfoundation/ethereumjs-trie": "5.0.5", - "@nomicfoundation/ethereumjs-tx": "4.1.2", - "@nomicfoundation/ethereumjs-util": "8.0.6", - "@types/async-eventemitter": "^0.2.1", - "async-eventemitter": "^0.2.4", + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-vm/-/ethereumjs-vm-7.0.2.tgz", + "integrity": "sha512-Bj3KZT64j54Tcwr7Qm/0jkeZXJMfdcAtRBedou+Hx0dPOSIgqaIr0vvLwP65TpHbak2DmAq+KJbW2KNtIoFwvA==", + "dependencies": { + "@nomicfoundation/ethereumjs-block": "5.0.2", + "@nomicfoundation/ethereumjs-blockchain": "7.0.2", + "@nomicfoundation/ethereumjs-common": "4.0.2", + "@nomicfoundation/ethereumjs-evm": "2.0.2", + "@nomicfoundation/ethereumjs-rlp": "5.0.2", + "@nomicfoundation/ethereumjs-statemanager": "2.0.2", + "@nomicfoundation/ethereumjs-trie": "6.0.2", + "@nomicfoundation/ethereumjs-tx": "5.0.2", + "@nomicfoundation/ethereumjs-util": "9.0.2", "debug": "^4.3.3", "ethereum-cryptography": "0.1.3", - "functional-red-black-tree": "^1.0.1", "mcl-wasm": "^0.7.1", "rustbn.js": "~0.2.0" }, @@ -5552,11 +5421,6 @@ "resolved": "https://registry.npmjs.org/@types/argparse/-/argparse-1.0.38.tgz", "integrity": "sha512-ebDJ9b0e702Yr7pWgB0jzm+CX4Srzz8RcXtLJDJB+BSccqMa36uyH/zUsSYao5+BD1ytv3k3rPYCq4mAE1hsXA==" }, - "node_modules/@types/async-eventemitter": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/@types/async-eventemitter/-/async-eventemitter-0.2.1.tgz", - "integrity": "sha512-M2P4Ng26QbAeITiH7w1d7OxtldgfAe0wobpyJzVK/XOb0cUGKU2R4pfAhqcJBXAe2ife5ZOhSv4wk7p+ffURtg==" - }, "node_modules/@types/bn.js": { "version": "5.1.1", "resolved": "https://registry.npmjs.org/@types/bn.js/-/bn.js-5.1.1.tgz", @@ -5586,9 +5450,9 @@ } }, "node_modules/@types/http-cache-semantics": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/@types/http-cache-semantics/-/http-cache-semantics-4.0.4.tgz", - "integrity": "sha512-1m0bIFVc7eJWyve9S0RnuRgcQqF/Xd5QsUZAZeQFr1Q3/p9JWoQQEqmVy+DPTNpGXwhgIetAoYF8JSc33q29QA==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@types/http-cache-semantics/-/http-cache-semantics-4.0.1.tgz", + "integrity": "sha512-SZs7ekbP8CN0txVG2xVRH6EgKmEm31BOxA07vkFaETzZz1xh+cbt8BcI0slpymvwhx5dlFnQG2rTlPVQn+iRPQ==", "dev": true }, "node_modules/@types/http-link-header": { @@ -5701,9 +5565,9 @@ "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" }, "node_modules/@types/responselike": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/@types/responselike/-/responselike-1.0.3.tgz", - "integrity": "sha512-H/+L+UkTV33uf49PH5pCAUBVPNj2nDBXTN+qS1dOwyyg24l3CcicicCA7ca+HMvJBZcFgl5r8e+RR6elsb4Lyw==", + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@types/responselike/-/responselike-1.0.0.tgz", + "integrity": "sha512-85Y2BjiufFzaMIlvJDvTTB8Fxl2xfLo4HgmHzVBz08w4wDePCTjYw66PdrolO0kzli3yam/YCgRufyo1DdQVTA==", "dev": true, "dependencies": { "@types/node": "*" @@ -6197,15 +6061,30 @@ } }, "node_modules/assertion-tools": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/assertion-tools/-/assertion-tools-2.1.0.tgz", - "integrity": "sha512-HCI/K2G9x/PlTpj0XuB2K3gR09C5VSXfqOfhzeqONC1x3WHRlUOIZmSSodaA5uLamUE45x8pnHjJxSyqxOI7tA==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/assertion-tools/-/assertion-tools-2.0.2.tgz", + "integrity": "sha512-wntV3+hNWfd0vAs1vaBsSBEaa7W7Qs3Wbu9Sh0WeZEr+RZ55ImjFICh1Bfi1ArGTXYgjd/zQa5YSSOFvs18UGQ==", "dependencies": { "ethers": "^5.7.2", "jsonld": "^8.1.0", "merkletreejs": "^0.3.2" } }, + "node_modules/assertion-tools/node_modules/merkletreejs": { + "version": "0.3.9", + "resolved": "https://registry.npmjs.org/merkletreejs/-/merkletreejs-0.3.9.tgz", + "integrity": "sha512-NjlATjJr4NEn9s8v/VEHhgwRWaE1eA/Une07d9SEqKzULJi1Wsh0Y3svwJdP2bYLMmgSBHzOrNydMWM1NN9VeQ==", + "dependencies": { + "bignumber.js": "^9.0.1", + "buffer-reverse": "^1.0.1", + "crypto-js": "^3.1.9-1", + "treeify": "^1.1.0", + "web3-utils": "^1.3.4" + }, + "engines": { + "node": ">= 7.6.0" + } + }, "node_modules/ast-types-flow": { "version": "0.0.7", "resolved": "https://registry.npmjs.org/ast-types-flow/-/ast-types-flow-0.0.7.tgz", @@ -6227,22 +6106,6 @@ "resolved": "https://registry.npmjs.org/async/-/async-3.2.4.tgz", "integrity": "sha512-iAB+JbDEGXhyIUavoDl9WP/Jj106Kz9DEn1DPgYw5ruDn0e3Wgi3sKFm55sASdGBNOQB8F59d9qQ7deqrHA8wQ==" }, - "node_modules/async-eventemitter": { - "version": "0.2.4", - "resolved": "https://registry.npmjs.org/async-eventemitter/-/async-eventemitter-0.2.4.tgz", - "integrity": "sha512-pd20BwL7Yt1zwDFy+8MX8F1+WCT8aQeKj0kQnTrH9WaeRETlRamVhD0JtRPmrV4GfOJ2F9CvdQkZeZhnh2TuHw==", - "dependencies": { - "async": "^2.4.0" - } - }, - "node_modules/async-eventemitter/node_modules/async": { - "version": "2.6.4", - "resolved": "https://registry.npmjs.org/async/-/async-2.6.4.tgz", - "integrity": "sha512-mzo5dfJYwAn29PeiJ0zvwTo04zj8HDJj0Mn8TD7sno7q12prdbnasKJHhkm2c1LgrhlJ0teaea8860oxi51mGA==", - "dependencies": { - "lodash": "^4.17.14" - } - }, "node_modules/async-limiter": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/async-limiter/-/async-limiter-1.0.1.tgz", @@ -6333,9 +6196,9 @@ } }, "node_modules/axios": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/axios/-/axios-1.6.0.tgz", - "integrity": "sha512-EZ1DYihju9pwVB+jg67ogm+Tmqc6JmhamRN6I4Zt8DfZu5lbcQGw3ozH9lFejSJgs/ibaef3A9PMXPLeefFGJg==", + "version": "1.6.2", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.6.2.tgz", + "integrity": "sha512-7i24Ri4pmDRfJTR7LDBhsOTtcm+9kjX5WiY1X3wIisx6G9So3pfMkEiU7emUBe46oceVImccTEM3k6C5dbVW8A==", "dependencies": { "follow-redirects": "^1.15.0", "form-data": "^4.0.0", @@ -6434,22 +6297,11 @@ } }, "node_modules/bigint-crypto-utils": { - "version": "3.1.8", - "resolved": "https://registry.npmjs.org/bigint-crypto-utils/-/bigint-crypto-utils-3.1.8.tgz", - "integrity": "sha512-+VMV9Laq8pXLBKKKK49nOoq9bfR3j7NNQAtbA617a4nw9bVLo8rsqkKMBgM2AJWlNX9fEIyYaYX+d0laqYV4tw==", - "dependencies": { - "bigint-mod-arith": "^3.1.0" - }, - "engines": { - "node": ">=10.4.0" - } - }, - "node_modules/bigint-mod-arith": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/bigint-mod-arith/-/bigint-mod-arith-3.1.2.tgz", - "integrity": "sha512-nx8J8bBeiRR+NlsROFH9jHswW5HO8mgfOSqW0AmjicMMvaONDa8AO+5ViKDUUNytBPWiwfvZP4/Bj4Y3lUfvgQ==", + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/bigint-crypto-utils/-/bigint-crypto-utils-3.3.0.tgz", + "integrity": "sha512-jOTSb+drvEDxEq6OuUybOAv/xxoh3cuYRUIPyu8sSHQNKM303UQ2R1DAo45o1AkcIXw6fzbaFI1+xGGdaXs2lg==", "engines": { - "node": ">=10.4.0" + "node": ">=14.0.0" } }, "node_modules/bignumber.js": { @@ -6768,9 +6620,9 @@ } }, "node_modules/cacheable-request": { - "version": "7.0.4", - "resolved": "https://registry.npmjs.org/cacheable-request/-/cacheable-request-7.0.4.tgz", - "integrity": "sha512-v+p6ongsrp0yTGbJXjgxPow2+DL93DASP4kXCDKb8/bwRtt9OEF3whggkkDkGNzgcWy2XaF4a8nZglC7uElscg==", + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/cacheable-request/-/cacheable-request-7.0.2.tgz", + "integrity": "sha512-pouW8/FmiPQbuGpkXQ9BAPv/Mo5xDGANgSNXzTzJ8DrKGuXOssM4wIQRjfanNRh3Yu5cfYPvcorqbhg2KIJtew==", "dev": true, "dependencies": { "clone-response": "^1.0.2", @@ -6894,6 +6746,14 @@ "upper-case-first": "^2.0.2" } }, + "node_modules/case": { + "version": "1.6.3", + "resolved": "https://registry.npmjs.org/case/-/case-1.6.3.tgz", + "integrity": "sha512-mzDSXIPaFwVDvZAHqZ9VlbyF4yyXRuX6IvB06WvPYkqJVO24kX1PPhv9bfpKNFZyxYFmmgo03HUiD8iklmJYRQ==", + "engines": { + "node": ">= 0.8.0" + } + }, "node_modules/caseless": { "version": "0.12.0", "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", @@ -7100,15 +6960,15 @@ "dev": true }, "node_modules/classic-level": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/classic-level/-/classic-level-1.2.0.tgz", - "integrity": "sha512-qw5B31ANxSluWz9xBzklRWTUAJ1SXIdaVKTVS7HcTGKOAmExx65Wo5BUICW+YGORe2FOUaDghoI9ZDxj82QcFg==", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/classic-level/-/classic-level-1.3.0.tgz", + "integrity": "sha512-iwFAJQYtqRTRM0F6L8h4JCt00ZSGdOyqh7yVrhhjrOpFhmBjNlRUey64MCiyo6UmQHMJ+No3c81nujPv+n9yrg==", "hasInstallScript": true, "dependencies": { "abstract-level": "^1.0.2", "catering": "^2.1.0", "module-error": "^1.0.1", - "napi-macros": "~2.0.0", + "napi-macros": "^2.2.2", "node-gyp-build": "^4.3.0" }, "engines": { @@ -7538,9 +7398,9 @@ } }, "node_modules/crypto-js": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/crypto-js/-/crypto-js-4.2.0.tgz", - "integrity": "sha512-KALDyEYgpY+Rlob/iriUtjV6d5Eq+Y191A5g4UqLAi8CyGP9N1+FdVbkc1SxKc2r4YAYqG8JzO2KGL+AizD70Q==" + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/crypto-js/-/crypto-js-3.3.0.tgz", + "integrity": "sha512-DIT51nX0dCfKltpRiXV+/TVZq+Qq2NgF4644+K7Ttnla7zEzqc+kjJyiB96BHNyUTBxyjzRcZYpUdZa+QAqi6Q==" }, "node_modules/d": { "version": "1.0.1", @@ -7804,18 +7664,18 @@ } }, "node_modules/dkg-evm-module": { - "version": "4.0.7", - "resolved": "https://registry.npmjs.org/dkg-evm-module/-/dkg-evm-module-4.0.7.tgz", - "integrity": "sha512-ZjrGEvdLpirmIHkuA3L/bEo7IkbJwHi6F33U7GMYEwvr/9hsgNnV3O5iiegb5UpISu8SgN0eKOS9hlr7ty5WzQ==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/dkg-evm-module/-/dkg-evm-module-4.1.0.tgz", + "integrity": "sha512-80l9dIjUchBk5SOx6+hdo/I1+r1hUpxHmz3fwQuLISvof4aLSVZ2oqvkEdMPtkvBOjgT3F7uKnHSu6SanBa40A==", "dependencies": { - "@openzeppelin/contracts": "^4.7.3", + "@openzeppelin/contracts": "^4.9.3", "@polkadot/api": "^10.1.4", "@polkadot/keyring": "^11.1.1", "@polkadot/util": "^11.1.1", "@polkadot/util-crypto": "^11.1.1", "@prb/math": "^2.5.0", "dotenv": "^16.0.3", - "hardhat": "^2.13.0", + "hardhat": "^2.19.1", "hardhat-deploy": "^0.11.25", "hardhat-deploy-ethers": "^0.3.0-beta.13", "ts-node": "^10.9.1", @@ -8323,12 +8183,12 @@ "optional": true }, "node_modules/dkg.js": { - "version": "6.0.15", - "resolved": "https://registry.npmjs.org/dkg.js/-/dkg.js-6.0.15.tgz", - "integrity": "sha512-XRg/RLleOoksistmGO3wNcJVfc67cYrvUzsJvjLxrWXAtPoRVWcRMYGklIdswCGepu+SfIz+UM/uOgC+/MAfuQ==", + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/dkg.js/-/dkg.js-6.0.2.tgz", + "integrity": "sha512-F1+XGbOTQh//n5fOLpPJCZLNMlTl9Q//A5dAAdBxhA/cXjDWnMJOX2w98Fd2b2/Q4ZsWGuLnwdILqO8GmhG9bw==", "dev": true, "dependencies": { - "assertion-tools": "^2.1.0", + "assertion-tools": "^2.0.2", "axios": "^0.27.2", "dkg-evm-module": "^4.0.4", "ethers": "^6.1.0", @@ -9037,9 +8897,9 @@ } }, "node_modules/eslint-config-airbnb-base/node_modules/semver": { - "version": "6.3.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", - "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", "dev": true, "bin": { "semver": "bin/semver.js" @@ -9172,9 +9032,9 @@ } }, "node_modules/eslint-plugin-import/node_modules/semver": { - "version": "6.3.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", - "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", "dev": true, "peer": true, "bin": { @@ -9213,9 +9073,9 @@ } }, "node_modules/eslint-plugin-jsx-a11y/node_modules/semver": { - "version": "6.3.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", - "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", "dev": true, "peer": true, "bin": { @@ -9297,9 +9157,9 @@ } }, "node_modules/eslint-plugin-react/node_modules/semver": { - "version": "6.3.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", - "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", "dev": true, "peer": true, "bin": { @@ -9524,7 +9384,6 @@ "version": "7.1.5", "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-7.1.5.tgz", "integrity": "sha512-SDl5kKrQAudFBUe5OJM9Ac6WmMyYmXX/6sTmLZ3ffG2eY6ZIGBes3pEDxNN6V72WyOw4CPD5RomKdsa8DAAwLg==", - "dev": true, "dependencies": { "@types/bn.js": "^5.1.0", "bn.js": "^5.1.2", @@ -10385,9 +10244,9 @@ } }, "node_modules/get-func-name": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.2.tgz", - "integrity": "sha512-8vXOvuE167CtIc3OyItco7N/dpRtBbYOsPsXCz7X/PMnlGjYjSGuZJgM1Y7mmew7BKf9BqvLX2tnOVy1BBUsxQ==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.0.tgz", + "integrity": "sha512-Hm0ixYtaSZ/V7C8FJrtZIuBBI+iSgL+1Aq82zSu8VQNB4S3Gk8e7Qs3VwBDJAhmRZcFqkl3tQu36g/Foh5I5ig==", "dev": true, "engines": { "node": "*" @@ -10760,27 +10619,26 @@ } }, "node_modules/hardhat": { - "version": "2.13.0", - "resolved": "https://registry.npmjs.org/hardhat/-/hardhat-2.13.0.tgz", - "integrity": "sha512-ZlzBOLML1QGlm6JWyVAG8lVTEAoOaVm1in/RU2zoGAnYEoD1Rp4T+ZMvrLNhHaaeS9hfjJ1gJUBfiDr4cx+htQ==", + "version": "2.19.1", + "resolved": "https://registry.npmjs.org/hardhat/-/hardhat-2.19.1.tgz", + "integrity": "sha512-bsWa63g1GB78ZyMN08WLhFElLPA+J+pShuKD1BFO2+88g3l+BL3R07vj9deIi9dMbssxgE714Gof1dBEDGqnCw==", "dependencies": { "@ethersproject/abi": "^5.1.2", "@metamask/eth-sig-util": "^4.0.0", - "@nomicfoundation/ethereumjs-block": "^4.0.0", - "@nomicfoundation/ethereumjs-blockchain": "^6.0.0", - "@nomicfoundation/ethereumjs-common": "^3.0.0", - "@nomicfoundation/ethereumjs-evm": "^1.0.0", - "@nomicfoundation/ethereumjs-rlp": "^4.0.0", - "@nomicfoundation/ethereumjs-statemanager": "^1.0.0", - "@nomicfoundation/ethereumjs-trie": "^5.0.0", - "@nomicfoundation/ethereumjs-tx": "^4.0.0", - "@nomicfoundation/ethereumjs-util": "^8.0.0", - "@nomicfoundation/ethereumjs-vm": "^6.0.0", + "@nomicfoundation/ethereumjs-block": "5.0.2", + "@nomicfoundation/ethereumjs-blockchain": "7.0.2", + "@nomicfoundation/ethereumjs-common": "4.0.2", + "@nomicfoundation/ethereumjs-evm": "2.0.2", + "@nomicfoundation/ethereumjs-rlp": "5.0.2", + "@nomicfoundation/ethereumjs-statemanager": "2.0.2", + "@nomicfoundation/ethereumjs-trie": "6.0.2", + "@nomicfoundation/ethereumjs-tx": "5.0.2", + "@nomicfoundation/ethereumjs-util": "9.0.2", + "@nomicfoundation/ethereumjs-vm": "7.0.2", "@nomicfoundation/solidity-analyzer": "^0.1.0", "@sentry/node": "^5.18.1", "@types/bn.js": "^5.1.0", "@types/lru-cache": "^5.1.0", - "abort-controller": "^3.0.0", "adm-zip": "^0.4.16", "aggregate-error": "^3.0.0", "ansi-escapes": "^4.3.0", @@ -10803,7 +10661,6 @@ "mnemonist": "^0.38.0", "mocha": "^10.0.0", "p-map": "^4.0.0", - "qs": "^6.7.0", "raw-body": "^2.4.1", "resolve": "1.17.0", "semver": "^6.3.0", @@ -10818,9 +10675,6 @@ "bin": { "hardhat": "internal/cli/bootstrap.js" }, - "engines": { - "node": ">=14.0.0" - }, "peerDependencies": { "ts-node": "*", "typescript": "*" @@ -10835,34 +10689,23 @@ } }, "node_modules/hardhat-deploy": { - "version": "0.11.43", - "resolved": "https://registry.npmjs.org/hardhat-deploy/-/hardhat-deploy-0.11.43.tgz", - "integrity": "sha512-D760CjDtinwjOCpKOvdyRtIJYLQIYXmhfgkFe+AkxlYM9bPZ/T4tZ/xIB2tR89ZT+z0hF1YuZFBXIL3/G/9T5g==", + "version": "0.11.25", + "resolved": "https://registry.npmjs.org/hardhat-deploy/-/hardhat-deploy-0.11.25.tgz", + "integrity": "sha512-ppSgrVE9A13YgTmf2PQGoyIs9o/jgJOMORrUP/rblU5K8mQ2YHWlPvkzZmP4h+SBW+tNmlnvSrf5K5DmMmExhw==", "dependencies": { - "@ethersproject/abi": "^5.7.0", - "@ethersproject/abstract-signer": "^5.7.0", - "@ethersproject/address": "^5.7.0", - "@ethersproject/bignumber": "^5.7.0", - "@ethersproject/bytes": "^5.7.0", - "@ethersproject/constants": "^5.7.0", - "@ethersproject/contracts": "^5.7.0", - "@ethersproject/providers": "^5.7.2", - "@ethersproject/solidity": "^5.7.0", - "@ethersproject/transactions": "^5.7.0", - "@ethersproject/wallet": "^5.7.0", "@types/qs": "^6.9.7", "axios": "^0.21.1", "chalk": "^4.1.2", "chokidar": "^3.5.2", "debug": "^4.3.2", "enquirer": "^2.3.6", - "ethers": "^5.7.0", + "ethers": "^5.5.3", "form-data": "^4.0.0", "fs-extra": "^10.0.0", "match-all": "^1.2.6", "murmur-128": "^0.2.1", "qs": "^6.9.4", - "zksync-web3": "^0.14.3" + "zksync-web3": "^0.8.1" } }, "node_modules/hardhat-deploy-ethers": { @@ -11077,9 +10920,9 @@ } }, "node_modules/hardhat/node_modules/semver": { - "version": "6.3.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", - "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", "bin": { "semver": "bin/semver.js" } @@ -11435,9 +11278,9 @@ } }, "node_modules/http2-wrapper": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/http2-wrapper/-/http2-wrapper-2.2.1.tgz", - "integrity": "sha512-V5nVw1PAOgfI3Lmeaj2Exmeg7fenjhRUgz1lPSezy1CuhPYbgQtbQj4jZfEAEMlaL+vupsvhjqCyjzob0yxsmQ==", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/http2-wrapper/-/http2-wrapper-2.2.0.tgz", + "integrity": "sha512-kZB0wxMo0sh1PehyjJUWRFEd99KC5TLjZ2cULC4f9iqJBAmKQQXEICjxl5iPJRwP40dpeHFqqhm7tYCvODpqpQ==", "dev": true, "dependencies": { "quick-lru": "^5.1.1", @@ -12267,9 +12110,9 @@ } }, "node_modules/istanbul-lib-instrument/node_modules/semver": { - "version": "6.3.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", - "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", "dev": true, "bin": { "semver": "bin/semver.js" @@ -12844,9 +12687,9 @@ "integrity": "sha512-zwhgOhhniaL7oxMgUMKKw5219PWWABMO+dgMnzJOQ2/5L3XJtTJGhW2PEXlxXj9zaccdReZJZ83+4NPhVfNVDg==" }, "node_modules/keyv": { - "version": "4.5.4", - "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", - "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==", + "version": "4.5.2", + "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.2.tgz", + "integrity": "sha512-5MHbFaKn8cNSmVW7BYnijeAVlE4cYA/SVkifVgrh7yotnfhKmjuXpDKjrABLnT0SfHWV21P8ow07OGfRrNDg8g==", "dev": true, "dependencies": { "json-buffer": "3.0.1" @@ -13420,9 +13263,9 @@ } }, "node_modules/lint-staged/node_modules/yaml": { - "version": "2.3.4", - "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.3.4.tgz", - "integrity": "sha512-8aAvwVUSHpfEqTQ4w/KMlf3HcRdt50E5ODIQJBw1fQ5RL34xabzxtUlzTXVqc4rkZsPbvrXKWnABCD7kWSmocA==", + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.2.1.tgz", + "integrity": "sha512-e0WHiYql7+9wr4cWMx3TVQrNwejKaEe7/rHNmQmqRjazfOP5W8PB6Jpebb5o6fIapbz9o9+2ipcaTM2ZwDI6lw==", "dev": true, "engines": { "node": ">= 14" @@ -13726,9 +13569,9 @@ } }, "node_modules/make-dir/node_modules/semver": { - "version": "6.3.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", - "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", "dev": true, "bin": { "semver": "bin/semver.js" @@ -13842,21 +13685,6 @@ "node": ">= 8" } }, - "node_modules/merkletreejs": { - "version": "0.3.11", - "resolved": "https://registry.npmjs.org/merkletreejs/-/merkletreejs-0.3.11.tgz", - "integrity": "sha512-LJKTl4iVNTndhL+3Uz/tfkjD0klIWsHlUzgtuNnNrsf7bAlXR30m+xYB7lHr5Z/l6e/yAIsr26Dabx6Buo4VGQ==", - "dependencies": { - "bignumber.js": "^9.0.1", - "buffer-reverse": "^1.0.1", - "crypto-js": "^4.2.0", - "treeify": "^1.1.0", - "web3-utils": "^1.3.4" - }, - "engines": { - "node": ">= 7.6.0" - } - }, "node_modules/methods": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", @@ -13865,11 +13693,6 @@ "node": ">= 0.6" } }, - "node_modules/micro-ftch": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/micro-ftch/-/micro-ftch-0.3.1.tgz", - "integrity": "sha512-/0LLxhzP0tfiR5hcQebtudP56gUurs2CLkGarnCiB/OqEyUFQ6U3paQi/tgLv0hBJYt2rnr9MNpxz4fiiugstg==" - }, "node_modules/microdata-rdf-streaming-parser": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/microdata-rdf-streaming-parser/-/microdata-rdf-streaming-parser-2.0.1.tgz", @@ -14496,9 +14319,9 @@ } }, "node_modules/napi-macros": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/napi-macros/-/napi-macros-2.0.0.tgz", - "integrity": "sha512-A0xLykHtARfueITVDernsAWdtIMbOJgKgcluwENp3AlsKN/PloyO10HtmoqnFAQAcxPkgZN7wdfPfEd0zNGxbg==" + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/napi-macros/-/napi-macros-2.2.2.tgz", + "integrity": "sha512-hmEVtAGYzVQpCKdbQea4skABsdXW4RUh5t5mJ2zzqowJS2OyXZTU1KhDVFhx+NlWZ4ap9mqR9TcDO3LTTttd+g==" }, "node_modules/native-abort-controller": { "version": "1.0.4", @@ -17292,9 +17115,9 @@ } }, "node_modules/solc/node_modules/semver": { - "version": "5.7.2", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", - "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", "bin": { "semver": "bin/semver" } @@ -17490,9 +17313,9 @@ } }, "node_modules/sshpk": { - "version": "1.18.0", - "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.18.0.tgz", - "integrity": "sha512-2p2KJZTSqQ/I3+HX42EpYOa2l3f8Erv8MWKsy2I9uf4wA7yFIkXRffYdsx86y6z4vHtV8u7g+pPlr8/4ouAxsQ==", + "version": "1.17.0", + "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.17.0.tgz", + "integrity": "sha512-/9HIEs1ZXGhSPE8X6Ccm7Nam1z8KcoCqPdI7ecm1N33EzAetWahvQWVqLZtaZQ+IDKX4IyA2o0gBzqIMkAagHQ==", "dev": true, "dependencies": { "asn1": "~0.2.3", @@ -18488,14 +18311,14 @@ } }, "node_modules/undici": { - "version": "5.27.2", - "resolved": "https://registry.npmjs.org/undici/-/undici-5.27.2.tgz", - "integrity": "sha512-iS857PdOEy/y3wlM3yRp+6SNQQ6xU0mmZcwRSriqk+et/cwWAtwmIGf6WkoDN2EK/AMdCO/dfXzIwi+rFMrjjQ==", + "version": "5.21.0", + "resolved": "https://registry.npmjs.org/undici/-/undici-5.21.0.tgz", + "integrity": "sha512-HOjK8l6a57b2ZGXOcUsI5NLfoTrfmbOl90ixJDl0AEFG4wgHNDQxtZy15/ZQp7HhjkpaGlp/eneMgtsu1dIlUA==", "dependencies": { - "@fastify/busboy": "^2.0.0" + "busboy": "^1.6.0" }, "engines": { - "node": ">=14.0" + "node": ">=12.18" } }, "node_modules/universalify": { @@ -18756,28 +18579,28 @@ "integrity": "sha512-LCHW+fE2UBJ2vjhqJujqmoxh1ytEDEr0dPO3CabMdMDJPKmsaxzS90V1Ar6LtNE5VHLqxR4YMEj1i4lzMAccIA==" }, "node_modules/web3": { - "version": "1.10.3", - "resolved": "https://registry.npmjs.org/web3/-/web3-1.10.3.tgz", - "integrity": "sha512-DgUdOOqC/gTqW+VQl1EdPxrVRPB66xVNtuZ5KD4adVBtko87hkgM8BTZ0lZ8IbUfnQk6DyjcDujMiH3oszllAw==", + "version": "1.8.2", + "resolved": "https://registry.npmjs.org/web3/-/web3-1.8.2.tgz", + "integrity": "sha512-92h0GdEHW9wqDICQQKyG4foZBYi0OQkyg4CRml2F7XBl/NG+fu9o6J19kzfFXzSBoA4DnJXbyRgj/RHZv5LRiw==", "dev": true, "hasInstallScript": true, "dependencies": { - "web3-bzz": "1.10.3", - "web3-core": "1.10.3", - "web3-eth": "1.10.3", - "web3-eth-personal": "1.10.3", - "web3-net": "1.10.3", - "web3-shh": "1.10.3", - "web3-utils": "1.10.3" + "web3-bzz": "1.8.2", + "web3-core": "1.8.2", + "web3-eth": "1.8.2", + "web3-eth-personal": "1.8.2", + "web3-net": "1.8.2", + "web3-shh": "1.8.2", + "web3-utils": "1.8.2" }, "engines": { "node": ">=8.0.0" } }, "node_modules/web3-bzz": { - "version": "1.10.3", - "resolved": "https://registry.npmjs.org/web3-bzz/-/web3-bzz-1.10.3.tgz", - "integrity": "sha512-XDIRsTwekdBXtFytMpHBuun4cK4x0ZMIDXSoo1UVYp+oMyZj07c7gf7tNQY5qZ/sN+CJIas4ilhN25VJcjSijQ==", + "version": "1.8.2", + "resolved": "https://registry.npmjs.org/web3-bzz/-/web3-bzz-1.8.2.tgz", + "integrity": "sha512-1EEnxjPnFnvNWw3XeeKuTR8PBxYd0+XWzvaLK7OJC/Go9O8llLGxrxICbKV+8cgIE0sDRBxiYx02X+6OhoAQ9w==", "dev": true, "hasInstallScript": true, "dependencies": { @@ -18796,56 +18619,56 @@ "dev": true }, "node_modules/web3-core": { - "version": "1.10.3", - "resolved": "https://registry.npmjs.org/web3-core/-/web3-core-1.10.3.tgz", - "integrity": "sha512-Vbk0/vUNZxJlz3RFjAhNNt7qTpX8yE3dn3uFxfX5OHbuon5u65YEOd3civ/aQNW745N0vGUlHFNxxmn+sG9DIw==", + "version": "1.8.2", + "resolved": "https://registry.npmjs.org/web3-core/-/web3-core-1.8.2.tgz", + "integrity": "sha512-DJTVEAYcNqxkqruJE+Rxp3CIv0y5AZMwPHQmOkz/cz+MM75SIzMTc0AUdXzGyTS8xMF8h3YWMQGgGEy8SBf1PQ==", "dev": true, "dependencies": { - "@types/bn.js": "^5.1.1", + "@types/bn.js": "^5.1.0", "@types/node": "^12.12.6", "bignumber.js": "^9.0.0", - "web3-core-helpers": "1.10.3", - "web3-core-method": "1.10.3", - "web3-core-requestmanager": "1.10.3", - "web3-utils": "1.10.3" + "web3-core-helpers": "1.8.2", + "web3-core-method": "1.8.2", + "web3-core-requestmanager": "1.8.2", + "web3-utils": "1.8.2" }, "engines": { "node": ">=8.0.0" } }, "node_modules/web3-core-helpers": { - "version": "1.10.3", - "resolved": "https://registry.npmjs.org/web3-core-helpers/-/web3-core-helpers-1.10.3.tgz", - "integrity": "sha512-Yv7dQC3B9ipOc5sWm3VAz1ys70Izfzb8n9rSiQYIPjpqtJM+3V4EeK6ghzNR6CO2es0+Yu9CtCkw0h8gQhrTxA==", + "version": "1.8.2", + "resolved": "https://registry.npmjs.org/web3-core-helpers/-/web3-core-helpers-1.8.2.tgz", + "integrity": "sha512-6B1eLlq9JFrfealZBomd1fmlq1o4A09vrCVQSa51ANoib/jllT3atZrRDr0zt1rfI7TSZTZBXdN/aTdeN99DWw==", "dev": true, "dependencies": { - "web3-eth-iban": "1.10.3", - "web3-utils": "1.10.3" + "web3-eth-iban": "1.8.2", + "web3-utils": "1.8.2" }, "engines": { "node": ">=8.0.0" } }, "node_modules/web3-core-method": { - "version": "1.10.3", - "resolved": "https://registry.npmjs.org/web3-core-method/-/web3-core-method-1.10.3.tgz", - "integrity": "sha512-VZ/Dmml4NBmb0ep5PTSg9oqKoBtG0/YoMPei/bq/tUdlhB2dMB79sbeJPwx592uaV0Vpk7VltrrrBv5hTM1y4Q==", + "version": "1.8.2", + "resolved": "https://registry.npmjs.org/web3-core-method/-/web3-core-method-1.8.2.tgz", + "integrity": "sha512-1qnr5mw5wVyULzLOrk4B+ryO3gfGjGd/fx8NR+J2xCGLf1e6OSjxT9vbfuQ3fErk/NjSTWWreieYWLMhaogcRA==", "dev": true, "dependencies": { "@ethersproject/transactions": "^5.6.2", - "web3-core-helpers": "1.10.3", - "web3-core-promievent": "1.10.3", - "web3-core-subscriptions": "1.10.3", - "web3-utils": "1.10.3" + "web3-core-helpers": "1.8.2", + "web3-core-promievent": "1.8.2", + "web3-core-subscriptions": "1.8.2", + "web3-utils": "1.8.2" }, "engines": { "node": ">=8.0.0" } }, "node_modules/web3-core-promievent": { - "version": "1.10.3", - "resolved": "https://registry.npmjs.org/web3-core-promievent/-/web3-core-promievent-1.10.3.tgz", - "integrity": "sha512-HgjY+TkuLm5uTwUtaAfkTgRx/NzMxvVradCi02gy17NxDVdg/p6svBHcp037vcNpkuGeFznFJgULP+s2hdVgUQ==", + "version": "1.8.2", + "resolved": "https://registry.npmjs.org/web3-core-promievent/-/web3-core-promievent-1.8.2.tgz", + "integrity": "sha512-nvkJWDVgoOSsolJldN33tKW6bKKRJX3MCPDYMwP5SUFOA/mCzDEoI88N0JFofDTXkh1k7gOqp1pvwi9heuaxGg==", "dev": true, "dependencies": { "eventemitter3": "4.0.4" @@ -18861,29 +18684,29 @@ "dev": true }, "node_modules/web3-core-requestmanager": { - "version": "1.10.3", - "resolved": "https://registry.npmjs.org/web3-core-requestmanager/-/web3-core-requestmanager-1.10.3.tgz", - "integrity": "sha512-VT9sKJfgM2yBOIxOXeXiDuFMP4pxzF6FT+y8KTLqhDFHkbG3XRe42Vm97mB/IvLQCJOmokEjl3ps8yP1kbggyw==", + "version": "1.8.2", + "resolved": "https://registry.npmjs.org/web3-core-requestmanager/-/web3-core-requestmanager-1.8.2.tgz", + "integrity": "sha512-p1d090RYs5Mu7DK1yyc3GCBVZB/03rBtFhYFoS2EruGzOWs/5Q0grgtpwS/DScdRAm8wB8mYEBhY/RKJWF6B2g==", "dev": true, "dependencies": { "util": "^0.12.5", - "web3-core-helpers": "1.10.3", - "web3-providers-http": "1.10.3", - "web3-providers-ipc": "1.10.3", - "web3-providers-ws": "1.10.3" + "web3-core-helpers": "1.8.2", + "web3-providers-http": "1.8.2", + "web3-providers-ipc": "1.8.2", + "web3-providers-ws": "1.8.2" }, "engines": { "node": ">=8.0.0" } }, "node_modules/web3-core-subscriptions": { - "version": "1.10.3", - "resolved": "https://registry.npmjs.org/web3-core-subscriptions/-/web3-core-subscriptions-1.10.3.tgz", - "integrity": "sha512-KW0Mc8sgn70WadZu7RjQ4H5sNDJ5Lx8JMI3BWos+f2rW0foegOCyWhRu33W1s6ntXnqeBUw5rRCXZRlA3z+HNA==", + "version": "1.8.2", + "resolved": "https://registry.npmjs.org/web3-core-subscriptions/-/web3-core-subscriptions-1.8.2.tgz", + "integrity": "sha512-vXQogHDmAIQcKpXvGiMddBUeP9lnKgYF64+yQJhPNE5PnWr1sAibXuIPV7mIPihpFr/n/DORRj6Wh1pUv9zaTw==", "dev": true, "dependencies": { "eventemitter3": "4.0.4", - "web3-core-helpers": "1.10.3" + "web3-core-helpers": "1.8.2" }, "engines": { "node": ">=8.0.0" @@ -18902,57 +18725,57 @@ "dev": true }, "node_modules/web3-eth": { - "version": "1.10.3", - "resolved": "https://registry.npmjs.org/web3-eth/-/web3-eth-1.10.3.tgz", - "integrity": "sha512-Uk1U2qGiif2mIG8iKu23/EQJ2ksB1BQXy3wF3RvFuyxt8Ft9OEpmGlO7wOtAyJdoKzD5vcul19bJpPcWSAYZhA==", + "version": "1.8.2", + "resolved": "https://registry.npmjs.org/web3-eth/-/web3-eth-1.8.2.tgz", + "integrity": "sha512-JoTiWWc4F4TInpbvDUGb0WgDYJsFhuIjJlinc5ByjWD88Gvh+GKLsRjjFdbqe5YtwIGT4NymwoC5LQd1K6u/QQ==", "dev": true, "dependencies": { - "web3-core": "1.10.3", - "web3-core-helpers": "1.10.3", - "web3-core-method": "1.10.3", - "web3-core-subscriptions": "1.10.3", - "web3-eth-abi": "1.10.3", - "web3-eth-accounts": "1.10.3", - "web3-eth-contract": "1.10.3", - "web3-eth-ens": "1.10.3", - "web3-eth-iban": "1.10.3", - "web3-eth-personal": "1.10.3", - "web3-net": "1.10.3", - "web3-utils": "1.10.3" + "web3-core": "1.8.2", + "web3-core-helpers": "1.8.2", + "web3-core-method": "1.8.2", + "web3-core-subscriptions": "1.8.2", + "web3-eth-abi": "1.8.2", + "web3-eth-accounts": "1.8.2", + "web3-eth-contract": "1.8.2", + "web3-eth-ens": "1.8.2", + "web3-eth-iban": "1.8.2", + "web3-eth-personal": "1.8.2", + "web3-net": "1.8.2", + "web3-utils": "1.8.2" }, "engines": { "node": ">=8.0.0" } }, "node_modules/web3-eth-abi": { - "version": "1.10.3", - "resolved": "https://registry.npmjs.org/web3-eth-abi/-/web3-eth-abi-1.10.3.tgz", - "integrity": "sha512-O8EvV67uhq0OiCMekqYsDtb6FzfYzMXT7VMHowF8HV6qLZXCGTdB/NH4nJrEh2mFtEwVdS6AmLFJAQd2kVyoMQ==", + "version": "1.8.2", + "resolved": "https://registry.npmjs.org/web3-eth-abi/-/web3-eth-abi-1.8.2.tgz", + "integrity": "sha512-Om9g3kaRNjqiNPAgKwGT16y+ZwtBzRe4ZJFGjLiSs6v5I7TPNF+rRMWuKnR6jq0azQZDj6rblvKFMA49/k48Og==", "dev": true, "dependencies": { "@ethersproject/abi": "^5.6.3", - "web3-utils": "1.10.3" + "web3-utils": "1.8.2" }, "engines": { "node": ">=8.0.0" } }, "node_modules/web3-eth-accounts": { - "version": "1.10.3", - "resolved": "https://registry.npmjs.org/web3-eth-accounts/-/web3-eth-accounts-1.10.3.tgz", - "integrity": "sha512-8MipGgwusDVgn7NwKOmpeo3gxzzd+SmwcWeBdpXknuyDiZSQy9tXe+E9LeFGrmys/8mLLYP79n3jSbiTyv+6pQ==", + "version": "1.8.2", + "resolved": "https://registry.npmjs.org/web3-eth-accounts/-/web3-eth-accounts-1.8.2.tgz", + "integrity": "sha512-c367Ij63VCz9YdyjiHHWLFtN85l6QghgwMQH2B1eM/p9Y5lTlTX7t/Eg/8+f1yoIStXbk2w/PYM2lk+IkbqdLA==", "dev": true, "dependencies": { - "@ethereumjs/common": "2.6.5", - "@ethereumjs/tx": "3.5.2", - "@ethereumjs/util": "^8.1.0", + "@ethereumjs/common": "2.5.0", + "@ethereumjs/tx": "3.3.2", "eth-lib": "0.2.8", + "ethereumjs-util": "^7.1.5", "scrypt-js": "^3.0.1", "uuid": "^9.0.0", - "web3-core": "1.10.3", - "web3-core-helpers": "1.10.3", - "web3-core-method": "1.10.3", - "web3-utils": "1.10.3" + "web3-core": "1.8.2", + "web3-core-helpers": "1.8.2", + "web3-core-method": "1.8.2", + "web3-utils": "1.8.2" }, "engines": { "node": ">=8.0.0" @@ -18976,81 +18799,77 @@ } }, "node_modules/web3-eth-accounts/node_modules/uuid": { - "version": "9.0.1", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.1.tgz", - "integrity": "sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==", + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.0.tgz", + "integrity": "sha512-MXcSTerfPa4uqyzStbRoTgt5XIe3x5+42+q1sDuy3R5MDk66URdLMOZe5aPX/SQd+kuYAh0FdP/pO28IkQyTeg==", "dev": true, - "funding": [ - "https://github.com/sponsors/broofa", - "https://github.com/sponsors/ctavan" - ], "bin": { "uuid": "dist/bin/uuid" } }, "node_modules/web3-eth-contract": { - "version": "1.10.3", - "resolved": "https://registry.npmjs.org/web3-eth-contract/-/web3-eth-contract-1.10.3.tgz", - "integrity": "sha512-Y2CW61dCCyY4IoUMD4JsEQWrILX4FJWDWC/Txx/pr3K/+fGsBGvS9kWQN5EsVXOp4g7HoFOfVh9Lf7BmVVSRmg==", + "version": "1.8.2", + "resolved": "https://registry.npmjs.org/web3-eth-contract/-/web3-eth-contract-1.8.2.tgz", + "integrity": "sha512-ID5A25tHTSBNwOPjiXSVzxruz006ULRIDbzWTYIFTp7NJ7vXu/kynKK2ag/ObuTqBpMbobP8nXcA9b5EDkIdQA==", "dev": true, "dependencies": { - "@types/bn.js": "^5.1.1", - "web3-core": "1.10.3", - "web3-core-helpers": "1.10.3", - "web3-core-method": "1.10.3", - "web3-core-promievent": "1.10.3", - "web3-core-subscriptions": "1.10.3", - "web3-eth-abi": "1.10.3", - "web3-utils": "1.10.3" + "@types/bn.js": "^5.1.0", + "web3-core": "1.8.2", + "web3-core-helpers": "1.8.2", + "web3-core-method": "1.8.2", + "web3-core-promievent": "1.8.2", + "web3-core-subscriptions": "1.8.2", + "web3-eth-abi": "1.8.2", + "web3-utils": "1.8.2" }, "engines": { "node": ">=8.0.0" } }, "node_modules/web3-eth-ens": { - "version": "1.10.3", - "resolved": "https://registry.npmjs.org/web3-eth-ens/-/web3-eth-ens-1.10.3.tgz", - "integrity": "sha512-hR+odRDXGqKemw1GFniKBEXpjYwLgttTES+bc7BfTeoUyUZXbyDHe5ifC+h+vpzxh4oS0TnfcIoarK0Z9tFSiQ==", + "version": "1.8.2", + "resolved": "https://registry.npmjs.org/web3-eth-ens/-/web3-eth-ens-1.8.2.tgz", + "integrity": "sha512-PWph7C/CnqdWuu1+SH4U4zdrK4t2HNt0I4XzPYFdv9ugE8EuojselioPQXsVGvjql+Nt3jDLvQvggPqlMbvwRw==", "dev": true, "dependencies": { "content-hash": "^2.5.2", "eth-ens-namehash": "2.0.8", - "web3-core": "1.10.3", - "web3-core-helpers": "1.10.3", - "web3-core-promievent": "1.10.3", - "web3-eth-abi": "1.10.3", - "web3-eth-contract": "1.10.3", - "web3-utils": "1.10.3" + "web3-core": "1.8.2", + "web3-core-helpers": "1.8.2", + "web3-core-promievent": "1.8.2", + "web3-eth-abi": "1.8.2", + "web3-eth-contract": "1.8.2", + "web3-utils": "1.8.2" }, "engines": { "node": ">=8.0.0" } }, "node_modules/web3-eth-iban": { - "version": "1.10.3", - "resolved": "https://registry.npmjs.org/web3-eth-iban/-/web3-eth-iban-1.10.3.tgz", - "integrity": "sha512-ZCfOjYKAjaX2TGI8uif5ah+J3BYFuo+47JOIV1RIz2l7kD9VfnxvRH5UiQDRyMALQC7KFd2hUqIEtHklapNyKA==", + "version": "1.8.2", + "resolved": "https://registry.npmjs.org/web3-eth-iban/-/web3-eth-iban-1.8.2.tgz", + "integrity": "sha512-h3vNblDWkWMuYx93Q27TAJz6lhzpP93EiC3+45D6xoz983p6si773vntoQ+H+5aZhwglBtoiBzdh7PSSOnP/xQ==", "dev": true, "dependencies": { "bn.js": "^5.2.1", - "web3-utils": "1.10.3" + "web3-utils": "1.8.2" }, "engines": { "node": ">=8.0.0" } }, "node_modules/web3-eth-personal": { - "version": "1.10.3", - "resolved": "https://registry.npmjs.org/web3-eth-personal/-/web3-eth-personal-1.10.3.tgz", - "integrity": "sha512-avrQ6yWdADIvuNQcFZXmGLCEzulQa76hUOuVywN7O3cklB4nFc/Gp3yTvD3bOAaE7DhjLQfhUTCzXL7WMxVTsw==", + "version": "1.8.2", + "resolved": "https://registry.npmjs.org/web3-eth-personal/-/web3-eth-personal-1.8.2.tgz", + "integrity": "sha512-Vg4HfwCr7doiUF/RC+Jz0wT4+cYaXcOWMAW2AHIjHX6Z7Xwa8nrURIeQgeEE62qcEHAzajyAdB1u6bJyTfuCXw==", "dev": true, "dependencies": { "@types/node": "^12.12.6", - "web3-core": "1.10.3", - "web3-core-helpers": "1.10.3", - "web3-core-method": "1.10.3", - "web3-net": "1.10.3", - "web3-utils": "1.10.3" + "web3-core": "1.8.2", + "web3-core-helpers": "1.8.2", + "web3-core-method": "1.8.2", + "web3-net": "1.8.2", + "web3-utils": "1.8.2" }, "engines": { "node": ">=8.0.0" @@ -19063,84 +18882,55 @@ "dev": true }, "node_modules/web3-net": { - "version": "1.10.3", - "resolved": "https://registry.npmjs.org/web3-net/-/web3-net-1.10.3.tgz", - "integrity": "sha512-IoSr33235qVoI1vtKssPUigJU9Fc/Ph0T9CgRi15sx+itysmvtlmXMNoyd6Xrgm9LuM4CIhxz7yDzH93B79IFg==", + "version": "1.8.2", + "resolved": "https://registry.npmjs.org/web3-net/-/web3-net-1.8.2.tgz", + "integrity": "sha512-1itkDMGmbgb83Dg9nporFes9/fxsU7smJ3oRXlFkg4ZHn8YJyP1MSQFPJWWwSc+GrcCFt4O5IrUTvEkHqE3xag==", "dev": true, "dependencies": { - "web3-core": "1.10.3", - "web3-core-method": "1.10.3", - "web3-utils": "1.10.3" + "web3-core": "1.8.2", + "web3-core-method": "1.8.2", + "web3-utils": "1.8.2" }, "engines": { "node": ">=8.0.0" } }, "node_modules/web3-providers-http": { - "version": "1.10.3", - "resolved": "https://registry.npmjs.org/web3-providers-http/-/web3-providers-http-1.10.3.tgz", - "integrity": "sha512-6dAgsHR3MxJ0Qyu3QLFlQEelTapVfWNTu5F45FYh8t7Y03T1/o+YAkVxsbY5AdmD+y5bXG/XPJ4q8tjL6MgZHw==", + "version": "1.8.2", + "resolved": "https://registry.npmjs.org/web3-providers-http/-/web3-providers-http-1.8.2.tgz", + "integrity": "sha512-2xY94IIEQd16+b+vIBF4IC1p7GVaz9q4EUFscvMUjtEq4ru4Atdzjs9GP+jmcoo49p70II0UV3bqQcz0TQfVyQ==", "dev": true, "dependencies": { - "abortcontroller-polyfill": "^1.7.5", - "cross-fetch": "^4.0.0", + "abortcontroller-polyfill": "^1.7.3", + "cross-fetch": "^3.1.4", "es6-promise": "^4.2.8", - "web3-core-helpers": "1.10.3" + "web3-core-helpers": "1.8.2" }, "engines": { "node": ">=8.0.0" } }, - "node_modules/web3-providers-http/node_modules/cross-fetch": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-4.0.0.tgz", - "integrity": "sha512-e4a5N8lVvuLgAWgnCrLr2PP0YyDOTHa9H/Rj54dirp61qXnNq46m82bRhNqIA5VccJtWBvPTFRV3TtvHUKPB1g==", - "dev": true, - "dependencies": { - "node-fetch": "^2.6.12" - } - }, - "node_modules/web3-providers-http/node_modules/node-fetch": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz", - "integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==", - "dev": true, - "dependencies": { - "whatwg-url": "^5.0.0" - }, - "engines": { - "node": "4.x || >=6.0.0" - }, - "peerDependencies": { - "encoding": "^0.1.0" - }, - "peerDependenciesMeta": { - "encoding": { - "optional": true - } - } - }, "node_modules/web3-providers-ipc": { - "version": "1.10.3", - "resolved": "https://registry.npmjs.org/web3-providers-ipc/-/web3-providers-ipc-1.10.3.tgz", - "integrity": "sha512-vP5WIGT8FLnGRfswTxNs9rMfS1vCbMezj/zHbBe/zB9GauBRTYVrUo2H/hVrhLg8Ut7AbsKZ+tCJ4mAwpKi2hA==", + "version": "1.8.2", + "resolved": "https://registry.npmjs.org/web3-providers-ipc/-/web3-providers-ipc-1.8.2.tgz", + "integrity": "sha512-p6fqKVGFg+WiXGHWnB1hu43PbvPkDHTz4RgoEzbXugv5rtv5zfYLqm8Ba6lrJOS5ks9kGKR21a0y3NzE3u7V4w==", "dev": true, "dependencies": { "oboe": "2.1.5", - "web3-core-helpers": "1.10.3" + "web3-core-helpers": "1.8.2" }, "engines": { "node": ">=8.0.0" } }, "node_modules/web3-providers-ws": { - "version": "1.10.3", - "resolved": "https://registry.npmjs.org/web3-providers-ws/-/web3-providers-ws-1.10.3.tgz", - "integrity": "sha512-/filBXRl48INxsh6AuCcsy4v5ndnTZ/p6bl67kmO9aK1wffv7CT++DrtclDtVMeDGCgB3van+hEf9xTAVXur7Q==", + "version": "1.8.2", + "resolved": "https://registry.npmjs.org/web3-providers-ws/-/web3-providers-ws-1.8.2.tgz", + "integrity": "sha512-3s/4K+wHgbiN+Zrp9YjMq2eqAF6QGABw7wFftPdx+m5hWImV27/MoIx57c6HffNRqZXmCHnfWWFCNHHsi7wXnA==", "dev": true, "dependencies": { "eventemitter3": "4.0.4", - "web3-core-helpers": "1.10.3", + "web3-core-helpers": "1.8.2", "websocket": "^1.0.32" }, "engines": { @@ -19154,30 +18944,29 @@ "dev": true }, "node_modules/web3-shh": { - "version": "1.10.3", - "resolved": "https://registry.npmjs.org/web3-shh/-/web3-shh-1.10.3.tgz", - "integrity": "sha512-cAZ60CPvs9azdwMSQ/PSUdyV4PEtaW5edAZhu3rCXf6XxQRliBboic+AvwUvB6j3eswY50VGa5FygfVmJ1JVng==", + "version": "1.8.2", + "resolved": "https://registry.npmjs.org/web3-shh/-/web3-shh-1.8.2.tgz", + "integrity": "sha512-uZ+3MAoNcaJsXXNCDnizKJ5viBNeHOFYsCbFhV755Uu52FswzTOw6DtE7yK9nYXMtIhiSgi7nwl1RYzP8pystw==", "dev": true, "hasInstallScript": true, "dependencies": { - "web3-core": "1.10.3", - "web3-core-method": "1.10.3", - "web3-core-subscriptions": "1.10.3", - "web3-net": "1.10.3" + "web3-core": "1.8.2", + "web3-core-method": "1.8.2", + "web3-core-subscriptions": "1.8.2", + "web3-net": "1.8.2" }, "engines": { "node": ">=8.0.0" } }, "node_modules/web3-utils": { - "version": "1.10.3", - "resolved": "https://registry.npmjs.org/web3-utils/-/web3-utils-1.10.3.tgz", - "integrity": "sha512-OqcUrEE16fDBbGoQtZXWdavsPzbGIDc5v3VrRTZ0XrIpefC/viZ1ZU9bGEemazyS0catk/3rkOOxpzTfY+XsyQ==", + "version": "1.8.2", + "resolved": "https://registry.npmjs.org/web3-utils/-/web3-utils-1.8.2.tgz", + "integrity": "sha512-v7j6xhfLQfY7xQDrUP0BKbaNrmZ2/+egbqP9q3KYmOiPpnvAfol+32slgL0WX/5n8VPvKCK5EZ1HGrAVICSToA==", "dependencies": { - "@ethereumjs/util": "^8.1.0", "bn.js": "^5.2.1", "ethereum-bloom-filters": "^1.0.6", - "ethereum-cryptography": "^2.1.2", + "ethereumjs-util": "^7.1.0", "ethjs-unit": "0.1.6", "number-to-bn": "1.7.0", "randombytes": "^2.1.0", @@ -19187,53 +18976,6 @@ "node": ">=8.0.0" } }, - "node_modules/web3-utils/node_modules/@noble/hashes": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.3.1.tgz", - "integrity": "sha512-EbqwksQwz9xDRGfDST86whPBgM65E0OH/pCgqW0GBVzO22bNE+NuIbeTb714+IfSjU3aRk47EUvXIb5bTsenKA==", - "engines": { - "node": ">= 16" - }, - "funding": { - "url": "https://paulmillr.com/funding/" - } - }, - "node_modules/web3-utils/node_modules/@scure/bip32": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/@scure/bip32/-/bip32-1.3.1.tgz", - "integrity": "sha512-osvveYtyzdEVbt3OfwwXFr4P2iVBL5u1Q3q4ONBfDY/UpOuXmOlbgwc1xECEboY8wIays8Yt6onaWMUdUbfl0A==", - "dependencies": { - "@noble/curves": "~1.1.0", - "@noble/hashes": "~1.3.1", - "@scure/base": "~1.1.0" - }, - "funding": { - "url": "https://paulmillr.com/funding/" - } - }, - "node_modules/web3-utils/node_modules/@scure/bip39": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/@scure/bip39/-/bip39-1.2.1.tgz", - "integrity": "sha512-Z3/Fsz1yr904dduJD0NpiyRHhRYHdcnyh73FZWiV+/qhWi83wNJ3NWolYqCEN+ZWsUz2TWwajJggcRE9r1zUYg==", - "dependencies": { - "@noble/hashes": "~1.3.0", - "@scure/base": "~1.1.0" - }, - "funding": { - "url": "https://paulmillr.com/funding/" - } - }, - "node_modules/web3-utils/node_modules/ethereum-cryptography": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ethereum-cryptography/-/ethereum-cryptography-2.1.2.tgz", - "integrity": "sha512-Z5Ba0T0ImZ8fqXrJbpHcbpAvIswRte2wGNR/KePnu8GbbvgJ47lMxT/ZZPG6i9Jaht4azPDop4HaM00J0J59ug==", - "dependencies": { - "@noble/curves": "1.1.0", - "@noble/hashes": "1.3.1", - "@scure/bip32": "1.3.1", - "@scure/bip39": "1.2.1" - } - }, "node_modules/webidl-conversions": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", @@ -19711,11 +19453,11 @@ } }, "node_modules/zksync-web3": { - "version": "0.14.4", - "resolved": "https://registry.npmjs.org/zksync-web3/-/zksync-web3-0.14.4.tgz", - "integrity": "sha512-kYehMD/S6Uhe1g434UnaMN+sBr9nQm23Ywn0EUP5BfQCsbjcr3ORuS68PosZw8xUTu3pac7G6YMSnNHk+fwzvg==", + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/zksync-web3/-/zksync-web3-0.8.1.tgz", + "integrity": "sha512-1A4aHPQ3MyuGjpv5X/8pVEN+MdZqMjfVmiweQSRjOlklXYu65wT9BGEOtCmMs5d3gIvLp4ssfTeuR5OCKOD2kw==", "peerDependencies": { - "ethers": "^5.7.0" + "ethers": "~5.7.0" } } }, @@ -19737,71 +19479,12 @@ } }, "@babel/code-frame": { - "version": "7.22.13", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.22.13.tgz", - "integrity": "sha512-XktuhWlJ5g+3TJXc5upd9Ks1HutSArik6jf2eAjYFyIOf4ej3RN+184cZbzDvbPnuTJIUhPKKJE3cIsYTiAT3w==", + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.18.6.tgz", + "integrity": "sha512-TDCmlK5eOvH+eH7cdAFlNXeVJqWIQ7gW9tY1GJIpUtFb6CmjVyq2VM3u71bOyR8CRihcCgMUYoDNyLXao3+70Q==", "dev": true, "requires": { - "@babel/highlight": "^7.22.13", - "chalk": "^2.4.2" - }, - "dependencies": { - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "requires": { - "color-convert": "^1.9.0" - } - }, - "chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - } - }, - "color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "dev": true, - "requires": { - "color-name": "1.1.3" - } - }, - "color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", - "dev": true - }, - "escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", - "dev": true - }, - "has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", - "dev": true - }, - "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "requires": { - "has-flag": "^3.0.0" - } - } + "@babel/highlight": "^7.18.6" } }, "@babel/compat-data": { @@ -19834,20 +19517,20 @@ }, "dependencies": { "semver": { - "version": "6.3.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", - "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", "dev": true } } }, "@babel/generator": { - "version": "7.23.3", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.23.3.tgz", - "integrity": "sha512-keeZWAV4LU3tW0qRi19HRpabC/ilM0HRBBzf9/k8FFiG4KVpiv0FIy4hHfLfFQZNhziCTPTmd59zoyv6DNISzg==", + "version": "7.21.3", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.21.3.tgz", + "integrity": "sha512-QS3iR1GYC/YGUnW7IdggFeN5c1poPUurnGttOV/bZgPGV+izC/D8HnD6DLwod0fsatNyVn1G3EVWMYIF0nHbeA==", "dev": true, "requires": { - "@babel/types": "^7.23.3", + "@babel/types": "^7.21.3", "@jridgewell/gen-mapping": "^0.3.2", "@jridgewell/trace-mapping": "^0.3.17", "jsesc": "^2.5.1" @@ -19889,36 +19572,36 @@ } }, "semver": { - "version": "6.3.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", - "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", "dev": true } } }, "@babel/helper-environment-visitor": { - "version": "7.22.20", - "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.22.20.tgz", - "integrity": "sha512-zfedSIzFhat/gFhWfHtgWvlec0nqB9YEIVrpuwjruLlXfUSnA8cJB0miHKwqDnQ7d32aKo2xt88/xZptwxbfhA==", + "version": "7.18.9", + "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.18.9.tgz", + "integrity": "sha512-3r/aACDJ3fhQ/EVgFy0hpj8oHyHpQc+LPtJoY9SzTThAsStm4Ptegq92vqKoE3vD706ZVFWITnMnxucw+S9Ipg==", "dev": true }, "@babel/helper-function-name": { - "version": "7.23.0", - "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.23.0.tgz", - "integrity": "sha512-OErEqsrxjZTJciZ4Oo+eoZqeW9UIiOcuYKRJA4ZAgV9myA+pOXhhmpfNCKjEH/auVfEYVFJ6y1Tc4r0eIApqiw==", + "version": "7.21.0", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.21.0.tgz", + "integrity": "sha512-HfK1aMRanKHpxemaY2gqBmL04iAPOPRj7DxtNbiDOrJK+gdwkiNRVpCpUJYbUT+aZyemKN8brqTOxzCaG6ExRg==", "dev": true, "requires": { - "@babel/template": "^7.22.15", - "@babel/types": "^7.23.0" + "@babel/template": "^7.20.7", + "@babel/types": "^7.21.0" } }, "@babel/helper-hoist-variables": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.22.5.tgz", - "integrity": "sha512-wGjk9QZVzvknA6yKIUURb8zY3grXCcOZt+/7Wcy8O2uctxhplmUPkOdlgoNhmdVee2c92JXbf1xpMtVNbfoxRw==", + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.18.6.tgz", + "integrity": "sha512-UlJQPkFqFULIcyW5sbzgbkxn2FKRgwWiRexcuaR8RNJRy8+LLveqPjwZV/bwrLZCN0eUHD/x8D0heK1ozuoo6Q==", "dev": true, "requires": { - "@babel/types": "^7.22.5" + "@babel/types": "^7.18.6" } }, "@babel/helper-module-imports": { @@ -19956,24 +19639,24 @@ } }, "@babel/helper-split-export-declaration": { - "version": "7.22.6", - "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.22.6.tgz", - "integrity": "sha512-AsUnxuLhRYsisFiaJwvp1QF+I3KjD5FOxut14q/GzovUe6orHLesW2C7d754kRm53h5gqrz6sFl6sxc4BVtE/g==", + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.18.6.tgz", + "integrity": "sha512-bde1etTx6ZyTmobl9LLMMQsaizFVZrquTEHOqKeQESMKo4PlObf+8+JA25ZsIpZhT/WEd39+vOdLXAFG/nELpA==", "dev": true, "requires": { - "@babel/types": "^7.22.5" + "@babel/types": "^7.18.6" } }, "@babel/helper-string-parser": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.22.5.tgz", - "integrity": "sha512-mM4COjgZox8U+JcXQwPijIZLElkgEpO5rsERVDJTc2qfCDfERyob6k5WegS14SX18IIjv+XD+GrqNumY5JRCDw==", + "version": "7.19.4", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.19.4.tgz", + "integrity": "sha512-nHtDoQcuqFmwYNYPz3Rah5ph2p8PFeFCsZk9A/48dPc/rGocJ5J3hAAZ7pb76VWX3fZKu+uEr/FhH5jLx7umrw==", "dev": true }, "@babel/helper-validator-identifier": { - "version": "7.22.20", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.20.tgz", - "integrity": "sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A==", + "version": "7.19.1", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.19.1.tgz", + "integrity": "sha512-awrNfaMtnHUr653GgGEs++LlAvW6w+DcPrOliSMXWCKo597CwL5Acf/wWdNkf/tfEQE3mjkeD1YOVZOUV/od1w==", "dev": true }, "@babel/helper-validator-option": { @@ -19994,13 +19677,13 @@ } }, "@babel/highlight": { - "version": "7.22.20", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.22.20.tgz", - "integrity": "sha512-dkdMCN3py0+ksCgYmGG8jKeGA/8Tk+gJwSYYlFGxG5lmhfKNoAy004YpLxpS1W2J8m/EK2Ew+yOs9pVRwO89mg==", + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.18.6.tgz", + "integrity": "sha512-u7stbOuYjaPezCuLj29hNW1v64M2Md2qupEKP1fHc7WdOA3DgLh37suiSrZYY7haUB7iBeQZ9P1uiRF359do3g==", "dev": true, "requires": { - "@babel/helper-validator-identifier": "^7.22.20", - "chalk": "^2.4.2", + "@babel/helper-validator-identifier": "^7.18.6", + "chalk": "^2.0.0", "js-tokens": "^4.0.0" }, "dependencies": { @@ -20063,9 +19746,9 @@ } }, "@babel/parser": { - "version": "7.23.3", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.23.3.tgz", - "integrity": "sha512-uVsWNvlVsIninV2prNz/3lHCb+5CJ+e+IUBfbjToAHODtfGYLfCFuY4AU7TskI+dAKk+njsPiBjq1gKTvZOBaw==", + "version": "7.21.3", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.21.3.tgz", + "integrity": "sha512-lobG0d7aOfQRXh8AyklEAgZGvA4FShxo6xQbUrrT/cNBPUdIDojlokwJsQyCC/eKia7ifqM0yP+2DRZ4WKw2RQ==", "dev": true }, "@babel/runtime": { @@ -20077,30 +19760,30 @@ } }, "@babel/template": { - "version": "7.22.15", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.22.15.tgz", - "integrity": "sha512-QPErUVm4uyJa60rkI73qneDacvdvzxshT3kksGqlGWYdOTIUOwJ7RDUL8sGqslY1uXWSL6xMFKEXDS3ox2uF0w==", + "version": "7.20.7", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.20.7.tgz", + "integrity": "sha512-8SegXApWe6VoNw0r9JHpSteLKTpTiLZ4rMlGIm9JQ18KiCtyQiAMEazujAHrUS5flrcqYZa75ukev3P6QmUwUw==", "dev": true, "requires": { - "@babel/code-frame": "^7.22.13", - "@babel/parser": "^7.22.15", - "@babel/types": "^7.22.15" + "@babel/code-frame": "^7.18.6", + "@babel/parser": "^7.20.7", + "@babel/types": "^7.20.7" } }, "@babel/traverse": { - "version": "7.23.3", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.23.3.tgz", - "integrity": "sha512-+K0yF1/9yR0oHdE0StHuEj3uTPzwwbrLGfNOndVJVV2TqA5+j3oljJUb4nmB954FLGjNem976+B+eDuLIjesiQ==", - "dev": true, - "requires": { - "@babel/code-frame": "^7.22.13", - "@babel/generator": "^7.23.3", - "@babel/helper-environment-visitor": "^7.22.20", - "@babel/helper-function-name": "^7.23.0", - "@babel/helper-hoist-variables": "^7.22.5", - "@babel/helper-split-export-declaration": "^7.22.6", - "@babel/parser": "^7.23.3", - "@babel/types": "^7.23.3", + "version": "7.21.3", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.21.3.tgz", + "integrity": "sha512-XLyopNeaTancVitYZe2MlUEvgKb6YVVPXzofHgqHijCImG33b/uTurMS488ht/Hbsb2XK3U2BnSTxKVNGV3nGQ==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.18.6", + "@babel/generator": "^7.21.3", + "@babel/helper-environment-visitor": "^7.18.9", + "@babel/helper-function-name": "^7.21.0", + "@babel/helper-hoist-variables": "^7.18.6", + "@babel/helper-split-export-declaration": "^7.18.6", + "@babel/parser": "^7.21.3", + "@babel/types": "^7.21.3", "debug": "^4.1.0", "globals": "^11.1.0" }, @@ -20114,13 +19797,13 @@ } }, "@babel/types": { - "version": "7.23.3", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.23.3.tgz", - "integrity": "sha512-OZnvoH2l8PK5eUvEcUyCt/sXgr/h+UWpVuBbOljwcrAgUl6lpchoQ++PHGyQy1AtYnVA6CEq3y5xeEI10brpXw==", + "version": "7.21.3", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.21.3.tgz", + "integrity": "sha512-sBGdETxC+/M4o/zKC0sl6sjWv62WFR/uzxrJ6uYyMLZOUlPnwzw0tKgVHOXxaAd5l2g8pEDM5RZ495GPQI77kg==", "dev": true, "requires": { - "@babel/helper-string-parser": "^7.22.5", - "@babel/helper-validator-identifier": "^7.22.20", + "@babel/helper-string-parser": "^7.19.4", + "@babel/helper-validator-identifier": "^7.19.1", "to-fast-properties": "^2.0.0" } }, @@ -20132,6 +19815,29 @@ "buffer": "^6.0.3" } }, + "@chainsafe/as-sha256": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/@chainsafe/as-sha256/-/as-sha256-0.3.1.tgz", + "integrity": "sha512-hldFFYuf49ed7DAakWVXSJODuq3pzJEguD8tQ7h+sGkM18vja+OFoJI9krnGmgzyuZC2ETX0NOIcCTy31v2Mtg==" + }, + "@chainsafe/persistent-merkle-tree": { + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/@chainsafe/persistent-merkle-tree/-/persistent-merkle-tree-0.4.2.tgz", + "integrity": "sha512-lLO3ihKPngXLTus/L7WHKaw9PnNJWizlOF1H9NNzHP6Xvh82vzg9F2bzkXhYIFshMZ2gTCEz8tq6STe7r5NDfQ==", + "requires": { + "@chainsafe/as-sha256": "^0.3.1" + } + }, + "@chainsafe/ssz": { + "version": "0.9.4", + "resolved": "https://registry.npmjs.org/@chainsafe/ssz/-/ssz-0.9.4.tgz", + "integrity": "sha512-77Qtg2N1ayqs4Bg/wvnWfg5Bta7iy7IRh8XqXh7oNMeP2HBbBwx8m6yTpA8p0EHItWPEBkgZd5S5/LSlp3GXuQ==", + "requires": { + "@chainsafe/as-sha256": "^0.3.1", + "@chainsafe/persistent-merkle-tree": "^0.4.2", + "case": "^1.6.3" + } + }, "@colors/colors": { "version": "1.5.0", "resolved": "https://registry.npmjs.org/@colors/colors/-/colors-1.5.0.tgz", @@ -22468,75 +22174,23 @@ "integrity": "sha512-lxJ9R5ygVm8ZWgYdUweoq5ownDlJ4upvoWmO4eLxBYHdMo+vZ/Rx0EN6MbKWDJOSUGrqJy2Gt+Dyv/VKml0fjg==" }, "@ethereumjs/common": { - "version": "2.6.5", - "resolved": "https://registry.npmjs.org/@ethereumjs/common/-/common-2.6.5.tgz", - "integrity": "sha512-lRyVQOeCDaIVtgfbowla32pzeDv2Obr8oR8Put5RdUBNRGr1VGPGQNGP6elWIpgK3YdpzqTOh4GyUGOureVeeA==", + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/@ethereumjs/common/-/common-2.5.0.tgz", + "integrity": "sha512-DEHjW6e38o+JmB/NO3GZBpW4lpaiBpkFgXF6jLcJ6gETBYpEyaA5nTimsWBUJR3Vmtm/didUEbNjajskugZORg==", "dev": true, "requires": { "crc-32": "^1.2.0", - "ethereumjs-util": "^7.1.5" + "ethereumjs-util": "^7.1.1" } }, - "@ethereumjs/rlp": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/@ethereumjs/rlp/-/rlp-4.0.1.tgz", - "integrity": "sha512-tqsQiBQDQdmPWE1xkkBq4rlSW5QZpLOUJ5RJh2/9fug+q9tnUhuZoVLk7s0scUIKTOzEtR72DFBXI4WiZcMpvw==" - }, "@ethereumjs/tx": { - "version": "3.5.2", - "resolved": "https://registry.npmjs.org/@ethereumjs/tx/-/tx-3.5.2.tgz", - "integrity": "sha512-gQDNJWKrSDGu2w7w0PzVXVBNMzb7wwdDOmOqczmhNjqFxFuIbhVJDwiGEnxFNC2/b8ifcZzY7MLcluizohRzNw==", + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/@ethereumjs/tx/-/tx-3.3.2.tgz", + "integrity": "sha512-6AaJhwg4ucmwTvw/1qLaZUX5miWrwZ4nLOUsKyb/HtzS3BMw/CasKhdi1ims9mBKeK9sOJCH4qGKOBGyJCeeog==", "dev": true, "requires": { - "@ethereumjs/common": "^2.6.4", - "ethereumjs-util": "^7.1.5" - } - }, - "@ethereumjs/util": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/@ethereumjs/util/-/util-8.1.0.tgz", - "integrity": "sha512-zQ0IqbdX8FZ9aw11vP+dZkKDkS+kgIvQPHnSAXzP9pLu+Rfu3D3XEeLbicvoXJTYnhZiPmsZUxgdzXwNKxRPbA==", - "requires": { - "@ethereumjs/rlp": "^4.0.1", - "ethereum-cryptography": "^2.0.0", - "micro-ftch": "^0.3.1" - }, - "dependencies": { - "@noble/hashes": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.3.1.tgz", - "integrity": "sha512-EbqwksQwz9xDRGfDST86whPBgM65E0OH/pCgqW0GBVzO22bNE+NuIbeTb714+IfSjU3aRk47EUvXIb5bTsenKA==" - }, - "@scure/bip32": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/@scure/bip32/-/bip32-1.3.1.tgz", - "integrity": "sha512-osvveYtyzdEVbt3OfwwXFr4P2iVBL5u1Q3q4ONBfDY/UpOuXmOlbgwc1xECEboY8wIays8Yt6onaWMUdUbfl0A==", - "requires": { - "@noble/curves": "~1.1.0", - "@noble/hashes": "~1.3.1", - "@scure/base": "~1.1.0" - } - }, - "@scure/bip39": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/@scure/bip39/-/bip39-1.2.1.tgz", - "integrity": "sha512-Z3/Fsz1yr904dduJD0NpiyRHhRYHdcnyh73FZWiV+/qhWi83wNJ3NWolYqCEN+ZWsUz2TWwajJggcRE9r1zUYg==", - "requires": { - "@noble/hashes": "~1.3.0", - "@scure/base": "~1.1.0" - } - }, - "ethereum-cryptography": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ethereum-cryptography/-/ethereum-cryptography-2.1.2.tgz", - "integrity": "sha512-Z5Ba0T0ImZ8fqXrJbpHcbpAvIswRte2wGNR/KePnu8GbbvgJ47lMxT/ZZPG6i9Jaht4azPDop4HaM00J0J59ug==", - "requires": { - "@noble/curves": "1.1.0", - "@noble/hashes": "1.3.1", - "@scure/bip32": "1.3.1", - "@scure/bip39": "1.2.1" - } - } + "@ethereumjs/common": "^2.5.0", + "ethereumjs-util": "^7.1.2" } }, "@ethersproject/abi": { @@ -22918,11 +22572,6 @@ "@ethersproject/strings": "^5.7.0" } }, - "@fastify/busboy": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/@fastify/busboy/-/busboy-2.1.0.tgz", - "integrity": "sha512-+KpH+QxZU7O4675t3mnkQKcZZg56u+K/Ct2K+N2AZYNVK8kyeo/bI18tI8aPm3tvNNRyTWfj6s5tnGNlcbQRsA==" - }, "@humanwhocodes/config-array": { "version": "0.11.8", "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.8.tgz", @@ -23141,21 +22790,6 @@ } } }, - "@noble/curves": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@noble/curves/-/curves-1.1.0.tgz", - "integrity": "sha512-091oBExgENk/kGj3AZmtBDMpxQPDtxQABR2B9lb1JbVTs6ytdzZNwvhxQ4MWasRNEzlbEH8jCWFCwhF/Obj5AA==", - "requires": { - "@noble/hashes": "1.3.1" - }, - "dependencies": { - "@noble/hashes": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.3.1.tgz", - "integrity": "sha512-EbqwksQwz9xDRGfDST86whPBgM65E0OH/pCgqW0GBVzO22bNE+NuIbeTb714+IfSjU3aRk47EUvXIb5bTsenKA==" - } - } - }, "@noble/hashes": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.2.0.tgz", @@ -23190,29 +22824,31 @@ } }, "@nomicfoundation/ethereumjs-block": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-block/-/ethereumjs-block-4.2.2.tgz", - "integrity": "sha512-atjpt4gc6ZGZUPHBAQaUJsm1l/VCo7FmyQ780tMGO8QStjLdhz09dXynmhwVTy5YbRr0FOh/uX3QaEM0yIB2Zg==", - "requires": { - "@nomicfoundation/ethereumjs-common": "3.1.2", - "@nomicfoundation/ethereumjs-rlp": "4.0.3", - "@nomicfoundation/ethereumjs-trie": "5.0.5", - "@nomicfoundation/ethereumjs-tx": "4.1.2", - "@nomicfoundation/ethereumjs-util": "8.0.6", - "ethereum-cryptography": "0.1.3" + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-block/-/ethereumjs-block-5.0.2.tgz", + "integrity": "sha512-hSe6CuHI4SsSiWWjHDIzWhSiAVpzMUcDRpWYzN0T9l8/Rz7xNn3elwVOJ/tAyS0LqL6vitUD78Uk7lQDXZun7Q==", + "requires": { + "@nomicfoundation/ethereumjs-common": "4.0.2", + "@nomicfoundation/ethereumjs-rlp": "5.0.2", + "@nomicfoundation/ethereumjs-trie": "6.0.2", + "@nomicfoundation/ethereumjs-tx": "5.0.2", + "@nomicfoundation/ethereumjs-util": "9.0.2", + "ethereum-cryptography": "0.1.3", + "ethers": "^5.7.1" } }, "@nomicfoundation/ethereumjs-blockchain": { - "version": "6.2.2", - "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-blockchain/-/ethereumjs-blockchain-6.2.2.tgz", - "integrity": "sha512-6AIB2MoTEPZJLl6IRKcbd8mUmaBAQ/NMe3O7OsAOIiDjMNPPH5KaUQiLfbVlegT4wKIg/GOsFH7XlH2KDVoJNg==", - "requires": { - "@nomicfoundation/ethereumjs-block": "4.2.2", - "@nomicfoundation/ethereumjs-common": "3.1.2", - "@nomicfoundation/ethereumjs-ethash": "2.0.5", - "@nomicfoundation/ethereumjs-rlp": "4.0.3", - "@nomicfoundation/ethereumjs-trie": "5.0.5", - "@nomicfoundation/ethereumjs-util": "8.0.6", + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-blockchain/-/ethereumjs-blockchain-7.0.2.tgz", + "integrity": "sha512-8UUsSXJs+MFfIIAKdh3cG16iNmWzWC/91P40sazNvrqhhdR/RtGDlFk2iFTGbBAZPs2+klZVzhRX8m2wvuvz3w==", + "requires": { + "@nomicfoundation/ethereumjs-block": "5.0.2", + "@nomicfoundation/ethereumjs-common": "4.0.2", + "@nomicfoundation/ethereumjs-ethash": "3.0.2", + "@nomicfoundation/ethereumjs-rlp": "5.0.2", + "@nomicfoundation/ethereumjs-trie": "6.0.2", + "@nomicfoundation/ethereumjs-tx": "5.0.2", + "@nomicfoundation/ethereumjs-util": "9.0.2", "abstract-level": "^1.0.3", "debug": "^4.3.3", "ethereum-cryptography": "0.1.3", @@ -23232,36 +22868,36 @@ } }, "@nomicfoundation/ethereumjs-common": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-common/-/ethereumjs-common-3.1.2.tgz", - "integrity": "sha512-JAEBpIua62dyObHM9KI2b4wHZcRQYYge9gxiygTWa3lNCr2zo+K0TbypDpgiNij5MCGNWP1eboNfNfx1a3vkvA==", + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-common/-/ethereumjs-common-4.0.2.tgz", + "integrity": "sha512-I2WGP3HMGsOoycSdOTSqIaES0ughQTueOsddJ36aYVpI3SN8YSusgRFLwzDJwRFVIYDKx/iJz0sQ5kBHVgdDwg==", "requires": { - "@nomicfoundation/ethereumjs-util": "8.0.6", + "@nomicfoundation/ethereumjs-util": "9.0.2", "crc-32": "^1.2.0" } }, "@nomicfoundation/ethereumjs-ethash": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-ethash/-/ethereumjs-ethash-2.0.5.tgz", - "integrity": "sha512-xlLdcICGgAYyYmnI3r1t0R5fKGBJNDQSOQxXNjVO99JmxJIdXR5MgPo5CSJO1RpyzKOgzi3uIFn8agv564dZEQ==", + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-ethash/-/ethereumjs-ethash-3.0.2.tgz", + "integrity": "sha512-8PfoOQCcIcO9Pylq0Buijuq/O73tmMVURK0OqdjhwqcGHYC2PwhbajDh7GZ55ekB0Px197ajK3PQhpKoiI/UPg==", "requires": { - "@nomicfoundation/ethereumjs-block": "4.2.2", - "@nomicfoundation/ethereumjs-rlp": "4.0.3", - "@nomicfoundation/ethereumjs-util": "8.0.6", + "@nomicfoundation/ethereumjs-block": "5.0.2", + "@nomicfoundation/ethereumjs-rlp": "5.0.2", + "@nomicfoundation/ethereumjs-util": "9.0.2", "abstract-level": "^1.0.3", "bigint-crypto-utils": "^3.0.23", "ethereum-cryptography": "0.1.3" } }, "@nomicfoundation/ethereumjs-evm": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-evm/-/ethereumjs-evm-1.3.2.tgz", - "integrity": "sha512-I00d4MwXuobyoqdPe/12dxUQxTYzX8OckSaWsMcWAfQhgVDvBx6ffPyP/w1aL0NW7MjyerySPcSVfDJAMHjilw==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-evm/-/ethereumjs-evm-2.0.2.tgz", + "integrity": "sha512-rBLcUaUfANJxyOx9HIdMX6uXGin6lANCulIm/pjMgRqfiCRMZie3WKYxTSd8ZE/d+qT+zTedBF4+VHTdTSePmQ==", "requires": { - "@nomicfoundation/ethereumjs-common": "3.1.2", - "@nomicfoundation/ethereumjs-util": "8.0.6", - "@types/async-eventemitter": "^0.2.1", - "async-eventemitter": "^0.2.4", + "@ethersproject/providers": "^5.7.1", + "@nomicfoundation/ethereumjs-common": "4.0.2", + "@nomicfoundation/ethereumjs-tx": "5.0.2", + "@nomicfoundation/ethereumjs-util": "9.0.2", "debug": "^4.3.3", "ethereum-cryptography": "0.1.3", "mcl-wasm": "^0.7.1", @@ -23269,31 +22905,31 @@ } }, "@nomicfoundation/ethereumjs-rlp": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-rlp/-/ethereumjs-rlp-4.0.3.tgz", - "integrity": "sha512-DZMzB/lqPK78T6MluyXqtlRmOMcsZbTTbbEyAjo0ncaff2mqu/k8a79PBcyvpgAhWD/R59Fjq/x3ro5Lof0AtA==" + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-rlp/-/ethereumjs-rlp-5.0.2.tgz", + "integrity": "sha512-QwmemBc+MMsHJ1P1QvPl8R8p2aPvvVcKBbvHnQOKBpBztEo0omN0eaob6FeZS/e3y9NSe+mfu3nNFBHszqkjTA==" }, "@nomicfoundation/ethereumjs-statemanager": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-statemanager/-/ethereumjs-statemanager-1.0.5.tgz", - "integrity": "sha512-CAhzpzTR5toh/qOJIZUUOnWekUXuRqkkzaGAQrVcF457VhtCmr+ddZjjK50KNZ524c1XP8cISguEVNqJ6ij1sA==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-statemanager/-/ethereumjs-statemanager-2.0.2.tgz", + "integrity": "sha512-dlKy5dIXLuDubx8Z74sipciZnJTRSV/uHG48RSijhgm1V7eXYFC567xgKtsKiVZB1ViTP9iFL4B6Je0xD6X2OA==", "requires": { - "@nomicfoundation/ethereumjs-common": "3.1.2", - "@nomicfoundation/ethereumjs-rlp": "4.0.3", - "@nomicfoundation/ethereumjs-trie": "5.0.5", - "@nomicfoundation/ethereumjs-util": "8.0.6", + "@nomicfoundation/ethereumjs-common": "4.0.2", + "@nomicfoundation/ethereumjs-rlp": "5.0.2", "debug": "^4.3.3", "ethereum-cryptography": "0.1.3", - "functional-red-black-tree": "^1.0.1" + "ethers": "^5.7.1", + "js-sdsl": "^4.1.4" } }, "@nomicfoundation/ethereumjs-trie": { - "version": "5.0.5", - "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-trie/-/ethereumjs-trie-5.0.5.tgz", - "integrity": "sha512-+8sNZrXkzvA1NH5F4kz5RSYl1I6iaRz7mAZRsyxOm0IVY4UaP43Ofvfp/TwOalFunurQrYB5pRO40+8FBcxFMA==", + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-trie/-/ethereumjs-trie-6.0.2.tgz", + "integrity": "sha512-yw8vg9hBeLYk4YNg5MrSJ5H55TLOv2FSWUTROtDtTMMmDGROsAu+0tBjiNGTnKRi400M6cEzoFfa89Fc5k8NTQ==", "requires": { - "@nomicfoundation/ethereumjs-rlp": "4.0.3", - "@nomicfoundation/ethereumjs-util": "8.0.6", + "@nomicfoundation/ethereumjs-rlp": "5.0.2", + "@nomicfoundation/ethereumjs-util": "9.0.2", + "@types/readable-stream": "^2.3.13", "ethereum-cryptography": "0.1.3", "readable-stream": "^3.6.0" }, @@ -23311,44 +22947,63 @@ } }, "@nomicfoundation/ethereumjs-tx": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-tx/-/ethereumjs-tx-4.1.2.tgz", - "integrity": "sha512-emJBJZpmTdUa09cqxQqHaysbBI9Od353ZazeH7WgPb35miMgNY6mb7/3vBA98N5lUW/rgkiItjX0KZfIzihSoQ==", + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-tx/-/ethereumjs-tx-5.0.2.tgz", + "integrity": "sha512-T+l4/MmTp7VhJeNloMkM+lPU3YMUaXdcXgTGCf8+ZFvV9NYZTRLFekRwlG6/JMmVfIfbrW+dRRJ9A6H5Q/Z64g==", "requires": { - "@nomicfoundation/ethereumjs-common": "3.1.2", - "@nomicfoundation/ethereumjs-rlp": "4.0.3", - "@nomicfoundation/ethereumjs-util": "8.0.6", + "@chainsafe/ssz": "^0.9.2", + "@ethersproject/providers": "^5.7.2", + "@nomicfoundation/ethereumjs-common": "4.0.2", + "@nomicfoundation/ethereumjs-rlp": "5.0.2", + "@nomicfoundation/ethereumjs-util": "9.0.2", "ethereum-cryptography": "0.1.3" } }, "@nomicfoundation/ethereumjs-util": { - "version": "8.0.6", - "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-util/-/ethereumjs-util-8.0.6.tgz", - "integrity": "sha512-jOQfF44laa7xRfbfLXojdlcpkvxeHrE2Xu7tSeITsWFgoII163MzjOwFEzSNozHYieFysyoEMhCdP+NY5ikstw==", + "version": "9.0.2", + "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-util/-/ethereumjs-util-9.0.2.tgz", + "integrity": "sha512-4Wu9D3LykbSBWZo8nJCnzVIYGvGCuyiYLIJa9XXNVt1q1jUzHdB+sJvx95VGCpPkCT+IbLecW6yfzy3E1bQrwQ==", "requires": { - "@nomicfoundation/ethereumjs-rlp": "4.0.3", + "@chainsafe/ssz": "^0.10.0", + "@nomicfoundation/ethereumjs-rlp": "5.0.2", "ethereum-cryptography": "0.1.3" + }, + "dependencies": { + "@chainsafe/persistent-merkle-tree": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/@chainsafe/persistent-merkle-tree/-/persistent-merkle-tree-0.5.0.tgz", + "integrity": "sha512-l0V1b5clxA3iwQLXP40zYjyZYospQLZXzBVIhhr9kDg/1qHZfzzHw0jj4VPBijfYCArZDlPkRi1wZaV2POKeuw==", + "requires": { + "@chainsafe/as-sha256": "^0.3.1" + } + }, + "@chainsafe/ssz": { + "version": "0.10.2", + "resolved": "https://registry.npmjs.org/@chainsafe/ssz/-/ssz-0.10.2.tgz", + "integrity": "sha512-/NL3Lh8K+0q7A3LsiFq09YXS9fPE+ead2rr7vM2QK8PLzrNsw3uqrif9bpRX5UxgeRjM+vYi+boCM3+GM4ovXg==", + "requires": { + "@chainsafe/as-sha256": "^0.3.1", + "@chainsafe/persistent-merkle-tree": "^0.5.0" + } + } } }, "@nomicfoundation/ethereumjs-vm": { - "version": "6.4.2", - "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-vm/-/ethereumjs-vm-6.4.2.tgz", - "integrity": "sha512-PRTyxZMP6kx+OdAzBhuH1LD2Yw+hrSpaytftvaK//thDy2OI07S0nrTdbrdk7b8ZVPAc9H9oTwFBl3/wJ3w15g==", - "requires": { - "@nomicfoundation/ethereumjs-block": "4.2.2", - "@nomicfoundation/ethereumjs-blockchain": "6.2.2", - "@nomicfoundation/ethereumjs-common": "3.1.2", - "@nomicfoundation/ethereumjs-evm": "1.3.2", - "@nomicfoundation/ethereumjs-rlp": "4.0.3", - "@nomicfoundation/ethereumjs-statemanager": "1.0.5", - "@nomicfoundation/ethereumjs-trie": "5.0.5", - "@nomicfoundation/ethereumjs-tx": "4.1.2", - "@nomicfoundation/ethereumjs-util": "8.0.6", - "@types/async-eventemitter": "^0.2.1", - "async-eventemitter": "^0.2.4", + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-vm/-/ethereumjs-vm-7.0.2.tgz", + "integrity": "sha512-Bj3KZT64j54Tcwr7Qm/0jkeZXJMfdcAtRBedou+Hx0dPOSIgqaIr0vvLwP65TpHbak2DmAq+KJbW2KNtIoFwvA==", + "requires": { + "@nomicfoundation/ethereumjs-block": "5.0.2", + "@nomicfoundation/ethereumjs-blockchain": "7.0.2", + "@nomicfoundation/ethereumjs-common": "4.0.2", + "@nomicfoundation/ethereumjs-evm": "2.0.2", + "@nomicfoundation/ethereumjs-rlp": "5.0.2", + "@nomicfoundation/ethereumjs-statemanager": "2.0.2", + "@nomicfoundation/ethereumjs-trie": "6.0.2", + "@nomicfoundation/ethereumjs-tx": "5.0.2", + "@nomicfoundation/ethereumjs-util": "9.0.2", "debug": "^4.3.3", "ethereum-cryptography": "0.1.3", - "functional-red-black-tree": "^1.0.1", "mcl-wasm": "^0.7.1", "rustbn.js": "~0.2.0" } @@ -24292,11 +23947,6 @@ "resolved": "https://registry.npmjs.org/@types/argparse/-/argparse-1.0.38.tgz", "integrity": "sha512-ebDJ9b0e702Yr7pWgB0jzm+CX4Srzz8RcXtLJDJB+BSccqMa36uyH/zUsSYao5+BD1ytv3k3rPYCq4mAE1hsXA==" }, - "@types/async-eventemitter": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/@types/async-eventemitter/-/async-eventemitter-0.2.1.tgz", - "integrity": "sha512-M2P4Ng26QbAeITiH7w1d7OxtldgfAe0wobpyJzVK/XOb0cUGKU2R4pfAhqcJBXAe2ife5ZOhSv4wk7p+ffURtg==" - }, "@types/bn.js": { "version": "5.1.1", "resolved": "https://registry.npmjs.org/@types/bn.js/-/bn.js-5.1.1.tgz", @@ -24326,9 +23976,9 @@ } }, "@types/http-cache-semantics": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/@types/http-cache-semantics/-/http-cache-semantics-4.0.4.tgz", - "integrity": "sha512-1m0bIFVc7eJWyve9S0RnuRgcQqF/Xd5QsUZAZeQFr1Q3/p9JWoQQEqmVy+DPTNpGXwhgIetAoYF8JSc33q29QA==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@types/http-cache-semantics/-/http-cache-semantics-4.0.1.tgz", + "integrity": "sha512-SZs7ekbP8CN0txVG2xVRH6EgKmEm31BOxA07vkFaETzZz1xh+cbt8BcI0slpymvwhx5dlFnQG2rTlPVQn+iRPQ==", "dev": true }, "@types/http-link-header": { @@ -24442,9 +24092,9 @@ } }, "@types/responselike": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/@types/responselike/-/responselike-1.0.3.tgz", - "integrity": "sha512-H/+L+UkTV33uf49PH5pCAUBVPNj2nDBXTN+qS1dOwyyg24l3CcicicCA7ca+HMvJBZcFgl5r8e+RR6elsb4Lyw==", + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@types/responselike/-/responselike-1.0.0.tgz", + "integrity": "sha512-85Y2BjiufFzaMIlvJDvTTB8Fxl2xfLo4HgmHzVBz08w4wDePCTjYw66PdrolO0kzli3yam/YCgRufyo1DdQVTA==", "dev": true, "requires": { "@types/node": "*" @@ -24849,13 +24499,27 @@ } }, "assertion-tools": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/assertion-tools/-/assertion-tools-2.1.0.tgz", - "integrity": "sha512-HCI/K2G9x/PlTpj0XuB2K3gR09C5VSXfqOfhzeqONC1x3WHRlUOIZmSSodaA5uLamUE45x8pnHjJxSyqxOI7tA==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/assertion-tools/-/assertion-tools-2.0.2.tgz", + "integrity": "sha512-wntV3+hNWfd0vAs1vaBsSBEaa7W7Qs3Wbu9Sh0WeZEr+RZ55ImjFICh1Bfi1ArGTXYgjd/zQa5YSSOFvs18UGQ==", "requires": { "ethers": "^5.7.2", "jsonld": "^8.1.0", "merkletreejs": "^0.3.2" + }, + "dependencies": { + "merkletreejs": { + "version": "0.3.9", + "resolved": "https://registry.npmjs.org/merkletreejs/-/merkletreejs-0.3.9.tgz", + "integrity": "sha512-NjlATjJr4NEn9s8v/VEHhgwRWaE1eA/Une07d9SEqKzULJi1Wsh0Y3svwJdP2bYLMmgSBHzOrNydMWM1NN9VeQ==", + "requires": { + "bignumber.js": "^9.0.1", + "buffer-reverse": "^1.0.1", + "crypto-js": "^3.1.9-1", + "treeify": "^1.1.0", + "web3-utils": "^1.3.4" + } + } } }, "ast-types-flow": { @@ -24876,24 +24540,6 @@ "resolved": "https://registry.npmjs.org/async/-/async-3.2.4.tgz", "integrity": "sha512-iAB+JbDEGXhyIUavoDl9WP/Jj106Kz9DEn1DPgYw5ruDn0e3Wgi3sKFm55sASdGBNOQB8F59d9qQ7deqrHA8wQ==" }, - "async-eventemitter": { - "version": "0.2.4", - "resolved": "https://registry.npmjs.org/async-eventemitter/-/async-eventemitter-0.2.4.tgz", - "integrity": "sha512-pd20BwL7Yt1zwDFy+8MX8F1+WCT8aQeKj0kQnTrH9WaeRETlRamVhD0JtRPmrV4GfOJ2F9CvdQkZeZhnh2TuHw==", - "requires": { - "async": "^2.4.0" - }, - "dependencies": { - "async": { - "version": "2.6.4", - "resolved": "https://registry.npmjs.org/async/-/async-2.6.4.tgz", - "integrity": "sha512-mzo5dfJYwAn29PeiJ0zvwTo04zj8HDJj0Mn8TD7sno7q12prdbnasKJHhkm2c1LgrhlJ0teaea8860oxi51mGA==", - "requires": { - "lodash": "^4.17.14" - } - } - } - }, "async-limiter": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/async-limiter/-/async-limiter-1.0.1.tgz", @@ -24966,9 +24612,9 @@ "peer": true }, "axios": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/axios/-/axios-1.6.0.tgz", - "integrity": "sha512-EZ1DYihju9pwVB+jg67ogm+Tmqc6JmhamRN6I4Zt8DfZu5lbcQGw3ozH9lFejSJgs/ibaef3A9PMXPLeefFGJg==", + "version": "1.6.2", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.6.2.tgz", + "integrity": "sha512-7i24Ri4pmDRfJTR7LDBhsOTtcm+9kjX5WiY1X3wIisx6G9So3pfMkEiU7emUBe46oceVImccTEM3k6C5dbVW8A==", "requires": { "follow-redirects": "^1.15.0", "form-data": "^4.0.0", @@ -25048,17 +24694,9 @@ "integrity": "sha512-GPEid2Y9QU1Exl1rpO9B2IPJGHPSupF5GnVIP0blYvNOMer2bTvSWs1jGOUg04hTmu67nmLsQ9TBo1puaotBHg==" }, "bigint-crypto-utils": { - "version": "3.1.8", - "resolved": "https://registry.npmjs.org/bigint-crypto-utils/-/bigint-crypto-utils-3.1.8.tgz", - "integrity": "sha512-+VMV9Laq8pXLBKKKK49nOoq9bfR3j7NNQAtbA617a4nw9bVLo8rsqkKMBgM2AJWlNX9fEIyYaYX+d0laqYV4tw==", - "requires": { - "bigint-mod-arith": "^3.1.0" - } - }, - "bigint-mod-arith": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/bigint-mod-arith/-/bigint-mod-arith-3.1.2.tgz", - "integrity": "sha512-nx8J8bBeiRR+NlsROFH9jHswW5HO8mgfOSqW0AmjicMMvaONDa8AO+5ViKDUUNytBPWiwfvZP4/Bj4Y3lUfvgQ==" + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/bigint-crypto-utils/-/bigint-crypto-utils-3.3.0.tgz", + "integrity": "sha512-jOTSb+drvEDxEq6OuUybOAv/xxoh3cuYRUIPyu8sSHQNKM303UQ2R1DAo45o1AkcIXw6fzbaFI1+xGGdaXs2lg==" }, "bignumber.js": { "version": "9.1.1", @@ -25312,9 +24950,9 @@ "dev": true }, "cacheable-request": { - "version": "7.0.4", - "resolved": "https://registry.npmjs.org/cacheable-request/-/cacheable-request-7.0.4.tgz", - "integrity": "sha512-v+p6ongsrp0yTGbJXjgxPow2+DL93DASP4kXCDKb8/bwRtt9OEF3whggkkDkGNzgcWy2XaF4a8nZglC7uElscg==", + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/cacheable-request/-/cacheable-request-7.0.2.tgz", + "integrity": "sha512-pouW8/FmiPQbuGpkXQ9BAPv/Mo5xDGANgSNXzTzJ8DrKGuXOssM4wIQRjfanNRh3Yu5cfYPvcorqbhg2KIJtew==", "dev": true, "requires": { "clone-response": "^1.0.2", @@ -25406,6 +25044,11 @@ "upper-case-first": "^2.0.2" } }, + "case": { + "version": "1.6.3", + "resolved": "https://registry.npmjs.org/case/-/case-1.6.3.tgz", + "integrity": "sha512-mzDSXIPaFwVDvZAHqZ9VlbyF4yyXRuX6IvB06WvPYkqJVO24kX1PPhv9bfpKNFZyxYFmmgo03HUiD8iklmJYRQ==" + }, "caseless": { "version": "0.12.0", "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", @@ -25563,14 +25206,14 @@ "dev": true }, "classic-level": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/classic-level/-/classic-level-1.2.0.tgz", - "integrity": "sha512-qw5B31ANxSluWz9xBzklRWTUAJ1SXIdaVKTVS7HcTGKOAmExx65Wo5BUICW+YGORe2FOUaDghoI9ZDxj82QcFg==", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/classic-level/-/classic-level-1.3.0.tgz", + "integrity": "sha512-iwFAJQYtqRTRM0F6L8h4JCt00ZSGdOyqh7yVrhhjrOpFhmBjNlRUey64MCiyo6UmQHMJ+No3c81nujPv+n9yrg==", "requires": { "abstract-level": "^1.0.2", "catering": "^2.1.0", "module-error": "^1.0.1", - "napi-macros": "~2.0.0", + "napi-macros": "^2.2.2", "node-gyp-build": "^4.3.0" } }, @@ -25907,9 +25550,9 @@ } }, "crypto-js": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/crypto-js/-/crypto-js-4.2.0.tgz", - "integrity": "sha512-KALDyEYgpY+Rlob/iriUtjV6d5Eq+Y191A5g4UqLAi8CyGP9N1+FdVbkc1SxKc2r4YAYqG8JzO2KGL+AizD70Q==" + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/crypto-js/-/crypto-js-3.3.0.tgz", + "integrity": "sha512-DIT51nX0dCfKltpRiXV+/TVZq+Qq2NgF4644+K7Ttnla7zEzqc+kjJyiB96BHNyUTBxyjzRcZYpUdZa+QAqi6Q==" }, "d": { "version": "1.0.1", @@ -26099,18 +25742,18 @@ "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==" }, "dkg-evm-module": { - "version": "4.0.7", - "resolved": "https://registry.npmjs.org/dkg-evm-module/-/dkg-evm-module-4.0.7.tgz", - "integrity": "sha512-ZjrGEvdLpirmIHkuA3L/bEo7IkbJwHi6F33U7GMYEwvr/9hsgNnV3O5iiegb5UpISu8SgN0eKOS9hlr7ty5WzQ==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/dkg-evm-module/-/dkg-evm-module-4.1.0.tgz", + "integrity": "sha512-80l9dIjUchBk5SOx6+hdo/I1+r1hUpxHmz3fwQuLISvof4aLSVZ2oqvkEdMPtkvBOjgT3F7uKnHSu6SanBa40A==", "requires": { - "@openzeppelin/contracts": "^4.7.3", + "@openzeppelin/contracts": "^4.9.3", "@polkadot/api": "^10.1.4", "@polkadot/keyring": "^11.1.1", "@polkadot/util": "^11.1.1", "@polkadot/util-crypto": "^11.1.1", "@prb/math": "^2.5.0", "dotenv": "^16.0.3", - "hardhat": "^2.13.0", + "hardhat": "^2.19.1", "hardhat-deploy": "^0.11.25", "hardhat-deploy-ethers": "^0.3.0-beta.13", "ts-node": "^10.9.1", @@ -26496,12 +26139,12 @@ } }, "dkg.js": { - "version": "6.0.15", - "resolved": "https://registry.npmjs.org/dkg.js/-/dkg.js-6.0.15.tgz", - "integrity": "sha512-XRg/RLleOoksistmGO3wNcJVfc67cYrvUzsJvjLxrWXAtPoRVWcRMYGklIdswCGepu+SfIz+UM/uOgC+/MAfuQ==", + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/dkg.js/-/dkg.js-6.0.2.tgz", + "integrity": "sha512-F1+XGbOTQh//n5fOLpPJCZLNMlTl9Q//A5dAAdBxhA/cXjDWnMJOX2w98Fd2b2/Q4ZsWGuLnwdILqO8GmhG9bw==", "dev": true, "requires": { - "assertion-tools": "^2.1.0", + "assertion-tools": "^2.0.2", "axios": "^0.27.2", "dkg-evm-module": "^4.0.4", "ethers": "^6.1.0", @@ -27073,9 +26716,9 @@ }, "dependencies": { "semver": { - "version": "6.3.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", - "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", "dev": true } } @@ -27184,9 +26827,9 @@ } }, "semver": { - "version": "6.3.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", - "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", "dev": true, "peer": true } @@ -27218,9 +26861,9 @@ }, "dependencies": { "semver": { - "version": "6.3.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", - "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", "dev": true, "peer": true } @@ -27273,9 +26916,9 @@ } }, "semver": { - "version": "6.3.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", - "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", "dev": true, "peer": true } @@ -27479,7 +27122,6 @@ "version": "7.1.5", "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-7.1.5.tgz", "integrity": "sha512-SDl5kKrQAudFBUe5OJM9Ac6WmMyYmXX/6sTmLZ3ffG2eY6ZIGBes3pEDxNN6V72WyOw4CPD5RomKdsa8DAAwLg==", - "dev": true, "requires": { "@types/bn.js": "^5.1.0", "bn.js": "^5.1.2", @@ -28146,9 +27788,9 @@ "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==" }, "get-func-name": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.2.tgz", - "integrity": "sha512-8vXOvuE167CtIc3OyItco7N/dpRtBbYOsPsXCz7X/PMnlGjYjSGuZJgM1Y7mmew7BKf9BqvLX2tnOVy1BBUsxQ==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.0.tgz", + "integrity": "sha512-Hm0ixYtaSZ/V7C8FJrtZIuBBI+iSgL+1Aq82zSu8VQNB4S3Gk8e7Qs3VwBDJAhmRZcFqkl3tQu36g/Foh5I5ig==", "dev": true }, "get-intrinsic": { @@ -28445,27 +28087,26 @@ } }, "hardhat": { - "version": "2.13.0", - "resolved": "https://registry.npmjs.org/hardhat/-/hardhat-2.13.0.tgz", - "integrity": "sha512-ZlzBOLML1QGlm6JWyVAG8lVTEAoOaVm1in/RU2zoGAnYEoD1Rp4T+ZMvrLNhHaaeS9hfjJ1gJUBfiDr4cx+htQ==", + "version": "2.19.1", + "resolved": "https://registry.npmjs.org/hardhat/-/hardhat-2.19.1.tgz", + "integrity": "sha512-bsWa63g1GB78ZyMN08WLhFElLPA+J+pShuKD1BFO2+88g3l+BL3R07vj9deIi9dMbssxgE714Gof1dBEDGqnCw==", "requires": { "@ethersproject/abi": "^5.1.2", "@metamask/eth-sig-util": "^4.0.0", - "@nomicfoundation/ethereumjs-block": "^4.0.0", - "@nomicfoundation/ethereumjs-blockchain": "^6.0.0", - "@nomicfoundation/ethereumjs-common": "^3.0.0", - "@nomicfoundation/ethereumjs-evm": "^1.0.0", - "@nomicfoundation/ethereumjs-rlp": "^4.0.0", - "@nomicfoundation/ethereumjs-statemanager": "^1.0.0", - "@nomicfoundation/ethereumjs-trie": "^5.0.0", - "@nomicfoundation/ethereumjs-tx": "^4.0.0", - "@nomicfoundation/ethereumjs-util": "^8.0.0", - "@nomicfoundation/ethereumjs-vm": "^6.0.0", + "@nomicfoundation/ethereumjs-block": "5.0.2", + "@nomicfoundation/ethereumjs-blockchain": "7.0.2", + "@nomicfoundation/ethereumjs-common": "4.0.2", + "@nomicfoundation/ethereumjs-evm": "2.0.2", + "@nomicfoundation/ethereumjs-rlp": "5.0.2", + "@nomicfoundation/ethereumjs-statemanager": "2.0.2", + "@nomicfoundation/ethereumjs-trie": "6.0.2", + "@nomicfoundation/ethereumjs-tx": "5.0.2", + "@nomicfoundation/ethereumjs-util": "9.0.2", + "@nomicfoundation/ethereumjs-vm": "7.0.2", "@nomicfoundation/solidity-analyzer": "^0.1.0", "@sentry/node": "^5.18.1", "@types/bn.js": "^5.1.0", "@types/lru-cache": "^5.1.0", - "abort-controller": "^3.0.0", "adm-zip": "^0.4.16", "aggregate-error": "^3.0.0", "ansi-escapes": "^4.3.0", @@ -28488,7 +28129,6 @@ "mnemonist": "^0.38.0", "mocha": "^10.0.0", "p-map": "^4.0.0", - "qs": "^6.7.0", "raw-body": "^2.4.1", "resolve": "1.17.0", "semver": "^6.3.0", @@ -28641,9 +28281,9 @@ } }, "semver": { - "version": "6.3.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", - "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==" + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==" }, "supports-color": { "version": "5.5.0", @@ -28667,34 +28307,23 @@ } }, "hardhat-deploy": { - "version": "0.11.43", - "resolved": "https://registry.npmjs.org/hardhat-deploy/-/hardhat-deploy-0.11.43.tgz", - "integrity": "sha512-D760CjDtinwjOCpKOvdyRtIJYLQIYXmhfgkFe+AkxlYM9bPZ/T4tZ/xIB2tR89ZT+z0hF1YuZFBXIL3/G/9T5g==", + "version": "0.11.25", + "resolved": "https://registry.npmjs.org/hardhat-deploy/-/hardhat-deploy-0.11.25.tgz", + "integrity": "sha512-ppSgrVE9A13YgTmf2PQGoyIs9o/jgJOMORrUP/rblU5K8mQ2YHWlPvkzZmP4h+SBW+tNmlnvSrf5K5DmMmExhw==", "requires": { - "@ethersproject/abi": "^5.7.0", - "@ethersproject/abstract-signer": "^5.7.0", - "@ethersproject/address": "^5.7.0", - "@ethersproject/bignumber": "^5.7.0", - "@ethersproject/bytes": "^5.7.0", - "@ethersproject/constants": "^5.7.0", - "@ethersproject/contracts": "^5.7.0", - "@ethersproject/providers": "^5.7.2", - "@ethersproject/solidity": "^5.7.0", - "@ethersproject/transactions": "^5.7.0", - "@ethersproject/wallet": "^5.7.0", "@types/qs": "^6.9.7", "axios": "^0.21.1", "chalk": "^4.1.2", "chokidar": "^3.5.2", "debug": "^4.3.2", "enquirer": "^2.3.6", - "ethers": "^5.7.0", + "ethers": "^5.5.3", "form-data": "^4.0.0", "fs-extra": "^10.0.0", "match-all": "^1.2.6", "murmur-128": "^0.2.1", "qs": "^6.9.4", - "zksync-web3": "^0.14.3" + "zksync-web3": "^0.8.1" }, "dependencies": { "axios": { @@ -28961,9 +28590,9 @@ } }, "http2-wrapper": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/http2-wrapper/-/http2-wrapper-2.2.1.tgz", - "integrity": "sha512-V5nVw1PAOgfI3Lmeaj2Exmeg7fenjhRUgz1lPSezy1CuhPYbgQtbQj4jZfEAEMlaL+vupsvhjqCyjzob0yxsmQ==", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/http2-wrapper/-/http2-wrapper-2.2.0.tgz", + "integrity": "sha512-kZB0wxMo0sh1PehyjJUWRFEd99KC5TLjZ2cULC4f9iqJBAmKQQXEICjxl5iPJRwP40dpeHFqqhm7tYCvODpqpQ==", "dev": true, "requires": { "quick-lru": "^5.1.1", @@ -29536,9 +29165,9 @@ }, "dependencies": { "semver": { - "version": "6.3.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", - "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", "dev": true } } @@ -30038,9 +29667,9 @@ "integrity": "sha512-zwhgOhhniaL7oxMgUMKKw5219PWWABMO+dgMnzJOQ2/5L3XJtTJGhW2PEXlxXj9zaccdReZJZ83+4NPhVfNVDg==" }, "keyv": { - "version": "4.5.4", - "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", - "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==", + "version": "4.5.2", + "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.2.tgz", + "integrity": "sha512-5MHbFaKn8cNSmVW7BYnijeAVlE4cYA/SVkifVgrh7yotnfhKmjuXpDKjrABLnT0SfHWV21P8ow07OGfRrNDg8g==", "dev": true, "requires": { "json-buffer": "3.0.1" @@ -30497,9 +30126,9 @@ "dev": true }, "yaml": { - "version": "2.3.4", - "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.3.4.tgz", - "integrity": "sha512-8aAvwVUSHpfEqTQ4w/KMlf3HcRdt50E5ODIQJBw1fQ5RL34xabzxtUlzTXVqc4rkZsPbvrXKWnABCD7kWSmocA==", + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.2.1.tgz", + "integrity": "sha512-e0WHiYql7+9wr4cWMx3TVQrNwejKaEe7/rHNmQmqRjazfOP5W8PB6Jpebb5o6fIapbz9o9+2ipcaTM2ZwDI6lw==", "dev": true } } @@ -30732,9 +30361,9 @@ }, "dependencies": { "semver": { - "version": "6.3.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", - "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", "dev": true } } @@ -30823,28 +30452,11 @@ "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==" }, - "merkletreejs": { - "version": "0.3.11", - "resolved": "https://registry.npmjs.org/merkletreejs/-/merkletreejs-0.3.11.tgz", - "integrity": "sha512-LJKTl4iVNTndhL+3Uz/tfkjD0klIWsHlUzgtuNnNrsf7bAlXR30m+xYB7lHr5Z/l6e/yAIsr26Dabx6Buo4VGQ==", - "requires": { - "bignumber.js": "^9.0.1", - "buffer-reverse": "^1.0.1", - "crypto-js": "^4.2.0", - "treeify": "^1.1.0", - "web3-utils": "^1.3.4" - } - }, "methods": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", "integrity": "sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==" }, - "micro-ftch": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/micro-ftch/-/micro-ftch-0.3.1.tgz", - "integrity": "sha512-/0LLxhzP0tfiR5hcQebtudP56gUurs2CLkGarnCiB/OqEyUFQ6U3paQi/tgLv0hBJYt2rnr9MNpxz4fiiugstg==" - }, "microdata-rdf-streaming-parser": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/microdata-rdf-streaming-parser/-/microdata-rdf-streaming-parser-2.0.1.tgz", @@ -31345,9 +30957,9 @@ "integrity": "sha512-MqBkQh/OHTS2egovRtLk45wEyNXwF+cokD+1YPf9u5VfJiRdAiRwB2froX5Co9Rh20xs4siNPm8naNotSD6RBw==" }, "napi-macros": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/napi-macros/-/napi-macros-2.0.0.tgz", - "integrity": "sha512-A0xLykHtARfueITVDernsAWdtIMbOJgKgcluwENp3AlsKN/PloyO10HtmoqnFAQAcxPkgZN7wdfPfEd0zNGxbg==" + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/napi-macros/-/napi-macros-2.2.2.tgz", + "integrity": "sha512-hmEVtAGYzVQpCKdbQea4skABsdXW4RUh5t5mJ2zzqowJS2OyXZTU1KhDVFhx+NlWZ4ap9mqR9TcDO3LTTttd+g==" }, "native-abort-controller": { "version": "1.0.4", @@ -33503,9 +33115,9 @@ } }, "semver": { - "version": "5.7.2", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", - "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==" + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==" }, "tmp": { "version": "0.0.33", @@ -33672,9 +33284,9 @@ "integrity": "sha512-qC9iz2FlN7DQl3+wjwn3802RTyjCx7sDvfQEXchwa6CWOx07/WVfh91gBmQ9fahw8snwGEWU3xGzOt4tFyHLxg==" }, "sshpk": { - "version": "1.18.0", - "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.18.0.tgz", - "integrity": "sha512-2p2KJZTSqQ/I3+HX42EpYOa2l3f8Erv8MWKsy2I9uf4wA7yFIkXRffYdsx86y6z4vHtV8u7g+pPlr8/4ouAxsQ==", + "version": "1.17.0", + "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.17.0.tgz", + "integrity": "sha512-/9HIEs1ZXGhSPE8X6Ccm7Nam1z8KcoCqPdI7ecm1N33EzAetWahvQWVqLZtaZQ+IDKX4IyA2o0gBzqIMkAagHQ==", "dev": true, "requires": { "asn1": "~0.2.3", @@ -34439,11 +34051,11 @@ } }, "undici": { - "version": "5.27.2", - "resolved": "https://registry.npmjs.org/undici/-/undici-5.27.2.tgz", - "integrity": "sha512-iS857PdOEy/y3wlM3yRp+6SNQQ6xU0mmZcwRSriqk+et/cwWAtwmIGf6WkoDN2EK/AMdCO/dfXzIwi+rFMrjjQ==", + "version": "5.21.0", + "resolved": "https://registry.npmjs.org/undici/-/undici-5.21.0.tgz", + "integrity": "sha512-HOjK8l6a57b2ZGXOcUsI5NLfoTrfmbOl90ixJDl0AEFG4wgHNDQxtZy15/ZQp7HhjkpaGlp/eneMgtsu1dIlUA==", "requires": { - "@fastify/busboy": "^2.0.0" + "busboy": "^1.6.0" } }, "universalify": { @@ -34658,24 +34270,24 @@ "integrity": "sha512-LCHW+fE2UBJ2vjhqJujqmoxh1ytEDEr0dPO3CabMdMDJPKmsaxzS90V1Ar6LtNE5VHLqxR4YMEj1i4lzMAccIA==" }, "web3": { - "version": "1.10.3", - "resolved": "https://registry.npmjs.org/web3/-/web3-1.10.3.tgz", - "integrity": "sha512-DgUdOOqC/gTqW+VQl1EdPxrVRPB66xVNtuZ5KD4adVBtko87hkgM8BTZ0lZ8IbUfnQk6DyjcDujMiH3oszllAw==", + "version": "1.8.2", + "resolved": "https://registry.npmjs.org/web3/-/web3-1.8.2.tgz", + "integrity": "sha512-92h0GdEHW9wqDICQQKyG4foZBYi0OQkyg4CRml2F7XBl/NG+fu9o6J19kzfFXzSBoA4DnJXbyRgj/RHZv5LRiw==", "dev": true, "requires": { - "web3-bzz": "1.10.3", - "web3-core": "1.10.3", - "web3-eth": "1.10.3", - "web3-eth-personal": "1.10.3", - "web3-net": "1.10.3", - "web3-shh": "1.10.3", - "web3-utils": "1.10.3" + "web3-bzz": "1.8.2", + "web3-core": "1.8.2", + "web3-eth": "1.8.2", + "web3-eth-personal": "1.8.2", + "web3-net": "1.8.2", + "web3-shh": "1.8.2", + "web3-utils": "1.8.2" } }, "web3-bzz": { - "version": "1.10.3", - "resolved": "https://registry.npmjs.org/web3-bzz/-/web3-bzz-1.10.3.tgz", - "integrity": "sha512-XDIRsTwekdBXtFytMpHBuun4cK4x0ZMIDXSoo1UVYp+oMyZj07c7gf7tNQY5qZ/sN+CJIas4ilhN25VJcjSijQ==", + "version": "1.8.2", + "resolved": "https://registry.npmjs.org/web3-bzz/-/web3-bzz-1.8.2.tgz", + "integrity": "sha512-1EEnxjPnFnvNWw3XeeKuTR8PBxYd0+XWzvaLK7OJC/Go9O8llLGxrxICbKV+8cgIE0sDRBxiYx02X+6OhoAQ9w==", "dev": true, "requires": { "@types/node": "^12.12.6", @@ -34692,18 +34304,18 @@ } }, "web3-core": { - "version": "1.10.3", - "resolved": "https://registry.npmjs.org/web3-core/-/web3-core-1.10.3.tgz", - "integrity": "sha512-Vbk0/vUNZxJlz3RFjAhNNt7qTpX8yE3dn3uFxfX5OHbuon5u65YEOd3civ/aQNW745N0vGUlHFNxxmn+sG9DIw==", + "version": "1.8.2", + "resolved": "https://registry.npmjs.org/web3-core/-/web3-core-1.8.2.tgz", + "integrity": "sha512-DJTVEAYcNqxkqruJE+Rxp3CIv0y5AZMwPHQmOkz/cz+MM75SIzMTc0AUdXzGyTS8xMF8h3YWMQGgGEy8SBf1PQ==", "dev": true, "requires": { - "@types/bn.js": "^5.1.1", + "@types/bn.js": "^5.1.0", "@types/node": "^12.12.6", "bignumber.js": "^9.0.0", - "web3-core-helpers": "1.10.3", - "web3-core-method": "1.10.3", - "web3-core-requestmanager": "1.10.3", - "web3-utils": "1.10.3" + "web3-core-helpers": "1.8.2", + "web3-core-method": "1.8.2", + "web3-core-requestmanager": "1.8.2", + "web3-utils": "1.8.2" }, "dependencies": { "@types/node": { @@ -34715,32 +34327,32 @@ } }, "web3-core-helpers": { - "version": "1.10.3", - "resolved": "https://registry.npmjs.org/web3-core-helpers/-/web3-core-helpers-1.10.3.tgz", - "integrity": "sha512-Yv7dQC3B9ipOc5sWm3VAz1ys70Izfzb8n9rSiQYIPjpqtJM+3V4EeK6ghzNR6CO2es0+Yu9CtCkw0h8gQhrTxA==", + "version": "1.8.2", + "resolved": "https://registry.npmjs.org/web3-core-helpers/-/web3-core-helpers-1.8.2.tgz", + "integrity": "sha512-6B1eLlq9JFrfealZBomd1fmlq1o4A09vrCVQSa51ANoib/jllT3atZrRDr0zt1rfI7TSZTZBXdN/aTdeN99DWw==", "dev": true, "requires": { - "web3-eth-iban": "1.10.3", - "web3-utils": "1.10.3" + "web3-eth-iban": "1.8.2", + "web3-utils": "1.8.2" } }, "web3-core-method": { - "version": "1.10.3", - "resolved": "https://registry.npmjs.org/web3-core-method/-/web3-core-method-1.10.3.tgz", - "integrity": "sha512-VZ/Dmml4NBmb0ep5PTSg9oqKoBtG0/YoMPei/bq/tUdlhB2dMB79sbeJPwx592uaV0Vpk7VltrrrBv5hTM1y4Q==", + "version": "1.8.2", + "resolved": "https://registry.npmjs.org/web3-core-method/-/web3-core-method-1.8.2.tgz", + "integrity": "sha512-1qnr5mw5wVyULzLOrk4B+ryO3gfGjGd/fx8NR+J2xCGLf1e6OSjxT9vbfuQ3fErk/NjSTWWreieYWLMhaogcRA==", "dev": true, "requires": { "@ethersproject/transactions": "^5.6.2", - "web3-core-helpers": "1.10.3", - "web3-core-promievent": "1.10.3", - "web3-core-subscriptions": "1.10.3", - "web3-utils": "1.10.3" + "web3-core-helpers": "1.8.2", + "web3-core-promievent": "1.8.2", + "web3-core-subscriptions": "1.8.2", + "web3-utils": "1.8.2" } }, "web3-core-promievent": { - "version": "1.10.3", - "resolved": "https://registry.npmjs.org/web3-core-promievent/-/web3-core-promievent-1.10.3.tgz", - "integrity": "sha512-HgjY+TkuLm5uTwUtaAfkTgRx/NzMxvVradCi02gy17NxDVdg/p6svBHcp037vcNpkuGeFznFJgULP+s2hdVgUQ==", + "version": "1.8.2", + "resolved": "https://registry.npmjs.org/web3-core-promievent/-/web3-core-promievent-1.8.2.tgz", + "integrity": "sha512-nvkJWDVgoOSsolJldN33tKW6bKKRJX3MCPDYMwP5SUFOA/mCzDEoI88N0JFofDTXkh1k7gOqp1pvwi9heuaxGg==", "dev": true, "requires": { "eventemitter3": "4.0.4" @@ -34755,26 +34367,26 @@ } }, "web3-core-requestmanager": { - "version": "1.10.3", - "resolved": "https://registry.npmjs.org/web3-core-requestmanager/-/web3-core-requestmanager-1.10.3.tgz", - "integrity": "sha512-VT9sKJfgM2yBOIxOXeXiDuFMP4pxzF6FT+y8KTLqhDFHkbG3XRe42Vm97mB/IvLQCJOmokEjl3ps8yP1kbggyw==", + "version": "1.8.2", + "resolved": "https://registry.npmjs.org/web3-core-requestmanager/-/web3-core-requestmanager-1.8.2.tgz", + "integrity": "sha512-p1d090RYs5Mu7DK1yyc3GCBVZB/03rBtFhYFoS2EruGzOWs/5Q0grgtpwS/DScdRAm8wB8mYEBhY/RKJWF6B2g==", "dev": true, "requires": { "util": "^0.12.5", - "web3-core-helpers": "1.10.3", - "web3-providers-http": "1.10.3", - "web3-providers-ipc": "1.10.3", - "web3-providers-ws": "1.10.3" + "web3-core-helpers": "1.8.2", + "web3-providers-http": "1.8.2", + "web3-providers-ipc": "1.8.2", + "web3-providers-ws": "1.8.2" } }, "web3-core-subscriptions": { - "version": "1.10.3", - "resolved": "https://registry.npmjs.org/web3-core-subscriptions/-/web3-core-subscriptions-1.10.3.tgz", - "integrity": "sha512-KW0Mc8sgn70WadZu7RjQ4H5sNDJ5Lx8JMI3BWos+f2rW0foegOCyWhRu33W1s6ntXnqeBUw5rRCXZRlA3z+HNA==", + "version": "1.8.2", + "resolved": "https://registry.npmjs.org/web3-core-subscriptions/-/web3-core-subscriptions-1.8.2.tgz", + "integrity": "sha512-vXQogHDmAIQcKpXvGiMddBUeP9lnKgYF64+yQJhPNE5PnWr1sAibXuIPV7mIPihpFr/n/DORRj6Wh1pUv9zaTw==", "dev": true, "requires": { "eventemitter3": "4.0.4", - "web3-core-helpers": "1.10.3" + "web3-core-helpers": "1.8.2" }, "dependencies": { "eventemitter3": { @@ -34786,51 +34398,51 @@ } }, "web3-eth": { - "version": "1.10.3", - "resolved": "https://registry.npmjs.org/web3-eth/-/web3-eth-1.10.3.tgz", - "integrity": "sha512-Uk1U2qGiif2mIG8iKu23/EQJ2ksB1BQXy3wF3RvFuyxt8Ft9OEpmGlO7wOtAyJdoKzD5vcul19bJpPcWSAYZhA==", + "version": "1.8.2", + "resolved": "https://registry.npmjs.org/web3-eth/-/web3-eth-1.8.2.tgz", + "integrity": "sha512-JoTiWWc4F4TInpbvDUGb0WgDYJsFhuIjJlinc5ByjWD88Gvh+GKLsRjjFdbqe5YtwIGT4NymwoC5LQd1K6u/QQ==", "dev": true, "requires": { - "web3-core": "1.10.3", - "web3-core-helpers": "1.10.3", - "web3-core-method": "1.10.3", - "web3-core-subscriptions": "1.10.3", - "web3-eth-abi": "1.10.3", - "web3-eth-accounts": "1.10.3", - "web3-eth-contract": "1.10.3", - "web3-eth-ens": "1.10.3", - "web3-eth-iban": "1.10.3", - "web3-eth-personal": "1.10.3", - "web3-net": "1.10.3", - "web3-utils": "1.10.3" + "web3-core": "1.8.2", + "web3-core-helpers": "1.8.2", + "web3-core-method": "1.8.2", + "web3-core-subscriptions": "1.8.2", + "web3-eth-abi": "1.8.2", + "web3-eth-accounts": "1.8.2", + "web3-eth-contract": "1.8.2", + "web3-eth-ens": "1.8.2", + "web3-eth-iban": "1.8.2", + "web3-eth-personal": "1.8.2", + "web3-net": "1.8.2", + "web3-utils": "1.8.2" } }, "web3-eth-abi": { - "version": "1.10.3", - "resolved": "https://registry.npmjs.org/web3-eth-abi/-/web3-eth-abi-1.10.3.tgz", - "integrity": "sha512-O8EvV67uhq0OiCMekqYsDtb6FzfYzMXT7VMHowF8HV6qLZXCGTdB/NH4nJrEh2mFtEwVdS6AmLFJAQd2kVyoMQ==", + "version": "1.8.2", + "resolved": "https://registry.npmjs.org/web3-eth-abi/-/web3-eth-abi-1.8.2.tgz", + "integrity": "sha512-Om9g3kaRNjqiNPAgKwGT16y+ZwtBzRe4ZJFGjLiSs6v5I7TPNF+rRMWuKnR6jq0azQZDj6rblvKFMA49/k48Og==", "dev": true, "requires": { "@ethersproject/abi": "^5.6.3", - "web3-utils": "1.10.3" + "web3-utils": "1.8.2" } }, "web3-eth-accounts": { - "version": "1.10.3", - "resolved": "https://registry.npmjs.org/web3-eth-accounts/-/web3-eth-accounts-1.10.3.tgz", - "integrity": "sha512-8MipGgwusDVgn7NwKOmpeo3gxzzd+SmwcWeBdpXknuyDiZSQy9tXe+E9LeFGrmys/8mLLYP79n3jSbiTyv+6pQ==", + "version": "1.8.2", + "resolved": "https://registry.npmjs.org/web3-eth-accounts/-/web3-eth-accounts-1.8.2.tgz", + "integrity": "sha512-c367Ij63VCz9YdyjiHHWLFtN85l6QghgwMQH2B1eM/p9Y5lTlTX7t/Eg/8+f1yoIStXbk2w/PYM2lk+IkbqdLA==", "dev": true, "requires": { - "@ethereumjs/common": "2.6.5", - "@ethereumjs/tx": "3.5.2", - "@ethereumjs/util": "^8.1.0", + "@ethereumjs/common": "2.5.0", + "@ethereumjs/tx": "3.3.2", "eth-lib": "0.2.8", + "ethereumjs-util": "^7.1.5", "scrypt-js": "^3.0.1", "uuid": "^9.0.0", - "web3-core": "1.10.3", - "web3-core-helpers": "1.10.3", - "web3-core-method": "1.10.3", - "web3-utils": "1.10.3" + "web3-core": "1.8.2", + "web3-core-helpers": "1.8.2", + "web3-core-method": "1.8.2", + "web3-utils": "1.8.2" }, "dependencies": { "bn.js": { @@ -34851,67 +34463,67 @@ } }, "uuid": { - "version": "9.0.1", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.1.tgz", - "integrity": "sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==", + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.0.tgz", + "integrity": "sha512-MXcSTerfPa4uqyzStbRoTgt5XIe3x5+42+q1sDuy3R5MDk66URdLMOZe5aPX/SQd+kuYAh0FdP/pO28IkQyTeg==", "dev": true } } }, "web3-eth-contract": { - "version": "1.10.3", - "resolved": "https://registry.npmjs.org/web3-eth-contract/-/web3-eth-contract-1.10.3.tgz", - "integrity": "sha512-Y2CW61dCCyY4IoUMD4JsEQWrILX4FJWDWC/Txx/pr3K/+fGsBGvS9kWQN5EsVXOp4g7HoFOfVh9Lf7BmVVSRmg==", + "version": "1.8.2", + "resolved": "https://registry.npmjs.org/web3-eth-contract/-/web3-eth-contract-1.8.2.tgz", + "integrity": "sha512-ID5A25tHTSBNwOPjiXSVzxruz006ULRIDbzWTYIFTp7NJ7vXu/kynKK2ag/ObuTqBpMbobP8nXcA9b5EDkIdQA==", "dev": true, "requires": { - "@types/bn.js": "^5.1.1", - "web3-core": "1.10.3", - "web3-core-helpers": "1.10.3", - "web3-core-method": "1.10.3", - "web3-core-promievent": "1.10.3", - "web3-core-subscriptions": "1.10.3", - "web3-eth-abi": "1.10.3", - "web3-utils": "1.10.3" + "@types/bn.js": "^5.1.0", + "web3-core": "1.8.2", + "web3-core-helpers": "1.8.2", + "web3-core-method": "1.8.2", + "web3-core-promievent": "1.8.2", + "web3-core-subscriptions": "1.8.2", + "web3-eth-abi": "1.8.2", + "web3-utils": "1.8.2" } }, "web3-eth-ens": { - "version": "1.10.3", - "resolved": "https://registry.npmjs.org/web3-eth-ens/-/web3-eth-ens-1.10.3.tgz", - "integrity": "sha512-hR+odRDXGqKemw1GFniKBEXpjYwLgttTES+bc7BfTeoUyUZXbyDHe5ifC+h+vpzxh4oS0TnfcIoarK0Z9tFSiQ==", + "version": "1.8.2", + "resolved": "https://registry.npmjs.org/web3-eth-ens/-/web3-eth-ens-1.8.2.tgz", + "integrity": "sha512-PWph7C/CnqdWuu1+SH4U4zdrK4t2HNt0I4XzPYFdv9ugE8EuojselioPQXsVGvjql+Nt3jDLvQvggPqlMbvwRw==", "dev": true, "requires": { "content-hash": "^2.5.2", "eth-ens-namehash": "2.0.8", - "web3-core": "1.10.3", - "web3-core-helpers": "1.10.3", - "web3-core-promievent": "1.10.3", - "web3-eth-abi": "1.10.3", - "web3-eth-contract": "1.10.3", - "web3-utils": "1.10.3" + "web3-core": "1.8.2", + "web3-core-helpers": "1.8.2", + "web3-core-promievent": "1.8.2", + "web3-eth-abi": "1.8.2", + "web3-eth-contract": "1.8.2", + "web3-utils": "1.8.2" } }, "web3-eth-iban": { - "version": "1.10.3", - "resolved": "https://registry.npmjs.org/web3-eth-iban/-/web3-eth-iban-1.10.3.tgz", - "integrity": "sha512-ZCfOjYKAjaX2TGI8uif5ah+J3BYFuo+47JOIV1RIz2l7kD9VfnxvRH5UiQDRyMALQC7KFd2hUqIEtHklapNyKA==", + "version": "1.8.2", + "resolved": "https://registry.npmjs.org/web3-eth-iban/-/web3-eth-iban-1.8.2.tgz", + "integrity": "sha512-h3vNblDWkWMuYx93Q27TAJz6lhzpP93EiC3+45D6xoz983p6si773vntoQ+H+5aZhwglBtoiBzdh7PSSOnP/xQ==", "dev": true, "requires": { "bn.js": "^5.2.1", - "web3-utils": "1.10.3" + "web3-utils": "1.8.2" } }, "web3-eth-personal": { - "version": "1.10.3", - "resolved": "https://registry.npmjs.org/web3-eth-personal/-/web3-eth-personal-1.10.3.tgz", - "integrity": "sha512-avrQ6yWdADIvuNQcFZXmGLCEzulQa76hUOuVywN7O3cklB4nFc/Gp3yTvD3bOAaE7DhjLQfhUTCzXL7WMxVTsw==", + "version": "1.8.2", + "resolved": "https://registry.npmjs.org/web3-eth-personal/-/web3-eth-personal-1.8.2.tgz", + "integrity": "sha512-Vg4HfwCr7doiUF/RC+Jz0wT4+cYaXcOWMAW2AHIjHX6Z7Xwa8nrURIeQgeEE62qcEHAzajyAdB1u6bJyTfuCXw==", "dev": true, "requires": { "@types/node": "^12.12.6", - "web3-core": "1.10.3", - "web3-core-helpers": "1.10.3", - "web3-core-method": "1.10.3", - "web3-net": "1.10.3", - "web3-utils": "1.10.3" + "web3-core": "1.8.2", + "web3-core-helpers": "1.8.2", + "web3-core-method": "1.8.2", + "web3-net": "1.8.2", + "web3-utils": "1.8.2" }, "dependencies": { "@types/node": { @@ -34923,66 +34535,46 @@ } }, "web3-net": { - "version": "1.10.3", - "resolved": "https://registry.npmjs.org/web3-net/-/web3-net-1.10.3.tgz", - "integrity": "sha512-IoSr33235qVoI1vtKssPUigJU9Fc/Ph0T9CgRi15sx+itysmvtlmXMNoyd6Xrgm9LuM4CIhxz7yDzH93B79IFg==", + "version": "1.8.2", + "resolved": "https://registry.npmjs.org/web3-net/-/web3-net-1.8.2.tgz", + "integrity": "sha512-1itkDMGmbgb83Dg9nporFes9/fxsU7smJ3oRXlFkg4ZHn8YJyP1MSQFPJWWwSc+GrcCFt4O5IrUTvEkHqE3xag==", "dev": true, "requires": { - "web3-core": "1.10.3", - "web3-core-method": "1.10.3", - "web3-utils": "1.10.3" + "web3-core": "1.8.2", + "web3-core-method": "1.8.2", + "web3-utils": "1.8.2" } }, "web3-providers-http": { - "version": "1.10.3", - "resolved": "https://registry.npmjs.org/web3-providers-http/-/web3-providers-http-1.10.3.tgz", - "integrity": "sha512-6dAgsHR3MxJ0Qyu3QLFlQEelTapVfWNTu5F45FYh8t7Y03T1/o+YAkVxsbY5AdmD+y5bXG/XPJ4q8tjL6MgZHw==", + "version": "1.8.2", + "resolved": "https://registry.npmjs.org/web3-providers-http/-/web3-providers-http-1.8.2.tgz", + "integrity": "sha512-2xY94IIEQd16+b+vIBF4IC1p7GVaz9q4EUFscvMUjtEq4ru4Atdzjs9GP+jmcoo49p70II0UV3bqQcz0TQfVyQ==", "dev": true, "requires": { - "abortcontroller-polyfill": "^1.7.5", - "cross-fetch": "^4.0.0", + "abortcontroller-polyfill": "^1.7.3", + "cross-fetch": "^3.1.4", "es6-promise": "^4.2.8", - "web3-core-helpers": "1.10.3" - }, - "dependencies": { - "cross-fetch": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-4.0.0.tgz", - "integrity": "sha512-e4a5N8lVvuLgAWgnCrLr2PP0YyDOTHa9H/Rj54dirp61qXnNq46m82bRhNqIA5VccJtWBvPTFRV3TtvHUKPB1g==", - "dev": true, - "requires": { - "node-fetch": "^2.6.12" - } - }, - "node-fetch": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz", - "integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==", - "dev": true, - "requires": { - "whatwg-url": "^5.0.0" - } - } + "web3-core-helpers": "1.8.2" } }, "web3-providers-ipc": { - "version": "1.10.3", - "resolved": "https://registry.npmjs.org/web3-providers-ipc/-/web3-providers-ipc-1.10.3.tgz", - "integrity": "sha512-vP5WIGT8FLnGRfswTxNs9rMfS1vCbMezj/zHbBe/zB9GauBRTYVrUo2H/hVrhLg8Ut7AbsKZ+tCJ4mAwpKi2hA==", + "version": "1.8.2", + "resolved": "https://registry.npmjs.org/web3-providers-ipc/-/web3-providers-ipc-1.8.2.tgz", + "integrity": "sha512-p6fqKVGFg+WiXGHWnB1hu43PbvPkDHTz4RgoEzbXugv5rtv5zfYLqm8Ba6lrJOS5ks9kGKR21a0y3NzE3u7V4w==", "dev": true, "requires": { "oboe": "2.1.5", - "web3-core-helpers": "1.10.3" + "web3-core-helpers": "1.8.2" } }, "web3-providers-ws": { - "version": "1.10.3", - "resolved": "https://registry.npmjs.org/web3-providers-ws/-/web3-providers-ws-1.10.3.tgz", - "integrity": "sha512-/filBXRl48INxsh6AuCcsy4v5ndnTZ/p6bl67kmO9aK1wffv7CT++DrtclDtVMeDGCgB3van+hEf9xTAVXur7Q==", + "version": "1.8.2", + "resolved": "https://registry.npmjs.org/web3-providers-ws/-/web3-providers-ws-1.8.2.tgz", + "integrity": "sha512-3s/4K+wHgbiN+Zrp9YjMq2eqAF6QGABw7wFftPdx+m5hWImV27/MoIx57c6HffNRqZXmCHnfWWFCNHHsi7wXnA==", "dev": true, "requires": { "eventemitter3": "4.0.4", - "web3-core-helpers": "1.10.3", + "web3-core-helpers": "1.8.2", "websocket": "^1.0.32" }, "dependencies": { @@ -34995,67 +34587,29 @@ } }, "web3-shh": { - "version": "1.10.3", - "resolved": "https://registry.npmjs.org/web3-shh/-/web3-shh-1.10.3.tgz", - "integrity": "sha512-cAZ60CPvs9azdwMSQ/PSUdyV4PEtaW5edAZhu3rCXf6XxQRliBboic+AvwUvB6j3eswY50VGa5FygfVmJ1JVng==", + "version": "1.8.2", + "resolved": "https://registry.npmjs.org/web3-shh/-/web3-shh-1.8.2.tgz", + "integrity": "sha512-uZ+3MAoNcaJsXXNCDnizKJ5viBNeHOFYsCbFhV755Uu52FswzTOw6DtE7yK9nYXMtIhiSgi7nwl1RYzP8pystw==", "dev": true, "requires": { - "web3-core": "1.10.3", - "web3-core-method": "1.10.3", - "web3-core-subscriptions": "1.10.3", - "web3-net": "1.10.3" + "web3-core": "1.8.2", + "web3-core-method": "1.8.2", + "web3-core-subscriptions": "1.8.2", + "web3-net": "1.8.2" } }, "web3-utils": { - "version": "1.10.3", - "resolved": "https://registry.npmjs.org/web3-utils/-/web3-utils-1.10.3.tgz", - "integrity": "sha512-OqcUrEE16fDBbGoQtZXWdavsPzbGIDc5v3VrRTZ0XrIpefC/viZ1ZU9bGEemazyS0catk/3rkOOxpzTfY+XsyQ==", + "version": "1.8.2", + "resolved": "https://registry.npmjs.org/web3-utils/-/web3-utils-1.8.2.tgz", + "integrity": "sha512-v7j6xhfLQfY7xQDrUP0BKbaNrmZ2/+egbqP9q3KYmOiPpnvAfol+32slgL0WX/5n8VPvKCK5EZ1HGrAVICSToA==", "requires": { - "@ethereumjs/util": "^8.1.0", "bn.js": "^5.2.1", "ethereum-bloom-filters": "^1.0.6", - "ethereum-cryptography": "^2.1.2", + "ethereumjs-util": "^7.1.0", "ethjs-unit": "0.1.6", "number-to-bn": "1.7.0", "randombytes": "^2.1.0", "utf8": "3.0.0" - }, - "dependencies": { - "@noble/hashes": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.3.1.tgz", - "integrity": "sha512-EbqwksQwz9xDRGfDST86whPBgM65E0OH/pCgqW0GBVzO22bNE+NuIbeTb714+IfSjU3aRk47EUvXIb5bTsenKA==" - }, - "@scure/bip32": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/@scure/bip32/-/bip32-1.3.1.tgz", - "integrity": "sha512-osvveYtyzdEVbt3OfwwXFr4P2iVBL5u1Q3q4ONBfDY/UpOuXmOlbgwc1xECEboY8wIays8Yt6onaWMUdUbfl0A==", - "requires": { - "@noble/curves": "~1.1.0", - "@noble/hashes": "~1.3.1", - "@scure/base": "~1.1.0" - } - }, - "@scure/bip39": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/@scure/bip39/-/bip39-1.2.1.tgz", - "integrity": "sha512-Z3/Fsz1yr904dduJD0NpiyRHhRYHdcnyh73FZWiV+/qhWi83wNJ3NWolYqCEN+ZWsUz2TWwajJggcRE9r1zUYg==", - "requires": { - "@noble/hashes": "~1.3.0", - "@scure/base": "~1.1.0" - } - }, - "ethereum-cryptography": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ethereum-cryptography/-/ethereum-cryptography-2.1.2.tgz", - "integrity": "sha512-Z5Ba0T0ImZ8fqXrJbpHcbpAvIswRte2wGNR/KePnu8GbbvgJ47lMxT/ZZPG6i9Jaht4azPDop4HaM00J0J59ug==", - "requires": { - "@noble/curves": "1.1.0", - "@noble/hashes": "1.3.1", - "@scure/bip32": "1.3.1", - "@scure/bip39": "1.2.1" - } - } } }, "webidl-conversions": { @@ -35430,9 +34984,9 @@ } }, "zksync-web3": { - "version": "0.14.4", - "resolved": "https://registry.npmjs.org/zksync-web3/-/zksync-web3-0.14.4.tgz", - "integrity": "sha512-kYehMD/S6Uhe1g434UnaMN+sBr9nQm23Ywn0EUP5BfQCsbjcr3ORuS68PosZw8xUTu3pac7G6YMSnNHk+fwzvg==", + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/zksync-web3/-/zksync-web3-0.8.1.tgz", + "integrity": "sha512-1A4aHPQ3MyuGjpv5X/8pVEN+MdZqMjfVmiweQSRjOlklXYu65wT9BGEOtCmMs5d3gIvLp4ssfTeuR5OCKOD2kw==", "requires": {} } } diff --git a/package.json b/package.json index 6fe84eebb7..04b8a57868 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "origintrail_node", - "version": "6.0.20", + "version": "6.1.0", "description": "OTNode V6", "main": "index.js", "type": "module", @@ -11,8 +11,10 @@ "prepare": "husky install", "lint-staged": "lint-staged", "create-account-mapping-signature": "node tools/ot-parachain-account-mapping/create-account-mapping-signature.js ", - "start:local_blockchain": "npm explore dkg-evm-module -- npm run dev", - "kill:local_blockchain": "npx kill-port 8545", + "start:local_blockchain": "npm explore dkg-evm-module -- npm run dev -- --port", + "start:local_blockchain:v1": "npm explore dkg-evm-module -- npm run dev:v1 -- --port", + "start:local_blockchain:v2": "npm explore dkg-evm-module -- npm run dev:v2 -- --port", + "kill:local_blockchain": "npx kill-port --port", "test:bdd": "cucumber-js --fail-fast --format progress --format-options '{\"colorsEnabled\": true}' test/bdd/ --import test/bdd/steps/ --exit", "test:unit": "nyc --all mocha --exit $(find test/unit -name '*.js')", "test:modules": "nyc --all mocha --exit $(find test/unit/modules -name '*.js')", @@ -75,7 +77,7 @@ "axios": "^1.6.0", "cors": "^2.8.5", "deep-extend": "^0.6.0", - "dkg-evm-module": "^4.0.7", + "dkg-evm-module": "^4.1.0", "dotenv": "^16.0.1", "ethers": "^5.7.2", "express": "^4.18.1", diff --git a/scripts/set-ask.js b/scripts/set-ask.js index 71bba163d8..2ce056f599 100644 --- a/scripts/set-ask.js +++ b/scripts/set-ask.js @@ -1,5 +1,6 @@ /* eslint-disable no-console */ import { ethers } from 'ethers'; +import axios from 'axios'; import { createRequire } from 'module'; import { NODE_ENVIRONMENTS, @@ -13,14 +14,39 @@ const Profile = require('dkg-evm-module/abi/Profile.json'); const IdentityStorage = require('dkg-evm-module/abi/IdentityStorage.json'); const Hub = require('dkg-evm-module/abi/Hub.json'); const argv = require('minimist')(process.argv.slice(1), { - string: ['ask', 'privateKey', 'hubContractAddress'], + string: ['ask', 'privateKey', 'hubContractAddress', 'gasPriceOracleLink'], }); const devEnvironment = process.env.NODE_ENV === NODE_ENVIRONMENTS.DEVELOPMENT || process.env.NODE_ENV === NODE_ENVIRONMENTS.TEST; -async function setAsk(rpcEndpoint, ask, walletPrivateKey, hubContractAddress) { +async function getGasPrice(gasPriceOracleLink) { + if (!gasPriceOracleLink) { + return devEnvironment ? undefined : 8; + } + try { + let gasPrice; + const response = await axios.get(gasPriceOracleLink); + if ( + gasPriceOracleLink === 'https://api.gnosisscan.io/api?module=proxy&action=eth_gasPrice' + ) { + gasPrice = Number(response.result, 10); + } else if ( + gasPriceOracleLink === 'https://blockscout.chiadochain.net/api/v1/gas-price-oracle' + ) { + gasPrice = Math.round(response.average * 1e9); + } else { + gasPrice = Math.round(response.result * 1e9); + } + this.logger.debug(`Gas price: ${gasPrice}`); + return gasPrice; + } catch (error) { + return undefined; + } +} + +async function setAsk(rpcEndpoint, ask, walletPrivateKey, hubContractAddress, gasPriceOracleLink) { const provider = new ethers.providers.JsonRpcProvider(rpcEndpoint); const wallet = new ethers.Wallet(walletPrivateKey, provider); @@ -36,8 +62,10 @@ async function setAsk(rpcEndpoint, ask, walletPrivateKey, hubContractAddress) { const askWei = ethers.utils.parseEther(ask); + const gasPrice = await getGasPrice(gasPriceOracleLink); + const tx = await profile.setAsk(identityId, askWei, { - gasPrice: devEnvironment ? undefined : 8, + gasPrice, gasLimit: 500_000, }); await provider.waitForTransaction( @@ -50,7 +78,13 @@ async function setAsk(rpcEndpoint, ask, walletPrivateKey, hubContractAddress) { const expectedArguments = ['rpcEndpoint', 'ask', 'privateKey', 'hubContractAddress']; if (validateArguments(argv, expectedArguments)) { - setAsk(argv.rpcEndpoint, argv.ask, argv.privateKey, argv.hubContractAddress) + setAsk( + argv.rpcEndpoint, + argv.ask, + argv.privateKey, + argv.hubContractAddress, + argv.gasPriceOracleLink, + ) .then(() => { console.log('Set ask completed'); process.exit(0); diff --git a/scripts/set-stake.js b/scripts/set-stake.js index 953b6f1e60..64938814e1 100644 --- a/scripts/set-stake.js +++ b/scripts/set-stake.js @@ -1,6 +1,7 @@ /* eslint-disable no-console */ import { ethers } from 'ethers'; import { createRequire } from 'module'; +import axios from 'axios'; import { NODE_ENVIRONMENTS, TRANSACTION_POLLING_TIMEOUT_MILLIS, @@ -19,6 +20,7 @@ const argv = require('minimist')(process.argv.slice(1), { 'operationalWalletPrivateKey', 'managementWalletPrivateKey', 'hubContractAddress', + 'gasPriceOracleLink', ], }); @@ -26,12 +28,38 @@ const devEnvironment = process.env.NODE_ENV === NODE_ENVIRONMENTS.DEVELOPMENT || process.env.NODE_ENV === NODE_ENVIRONMENTS.TEST; +async function getGasPrice(gasPriceOracleLink) { + if (!gasPriceOracleLink) { + return devEnvironment ? undefined : 8; + } + try { + let gasPrice; + const response = await axios.get(gasPriceOracleLink); + if ( + gasPriceOracleLink === 'https://api.gnosisscan.io/api?module=proxy&action=eth_gasPrice' + ) { + gasPrice = Number(response.result, 10); + } else if ( + gasPriceOracleLink === 'https://blockscout.chiadochain.net/api/v1/gas-price-oracle' + ) { + gasPrice = Math.round(response.average * 1e9); + } else { + gasPrice = Math.round(response.result * 1e9); + } + this.logger.debug(`Gas price: ${gasPrice}`); + return gasPrice; + } catch (error) { + return undefined; + } +} + async function setStake( rpcEndpoint, stake, operationalWalletPrivateKey, managementWalletPrivateKey, hubContractAddress, + gasPriceOracleLink, ) { const provider = new ethers.providers.JsonRpcProvider(rpcEndpoint); const operationalWallet = new ethers.Wallet(operationalWalletPrivateKey, provider); @@ -52,10 +80,13 @@ async function setStake( const stakeWei = ethers.utils.parseEther(stake); + const gasPrice = await getGasPrice(gasPriceOracleLink); + let tx = await tokenContract.increaseAllowance(stakingContractAddress, stakeWei, { - gasPrice: devEnvironment ? undefined : 8, + gasPrice, gasLimit: 500_000, }); + await provider.waitForTransaction( tx.hash, TRANSACTION_CONFIRMATIONS, @@ -63,7 +94,7 @@ async function setStake( ); // TODO: Add ABI instead of hard-coded function definition tx = await stakingContract['addStake(uint72,uint96)'](identityId, stakeWei, { - gasPrice: devEnvironment ? undefined : 1_000, + gasPrice: gasPrice ? gasPrice * 100 : undefined, gasLimit: 500_000, }); await provider.waitForTransaction( @@ -88,6 +119,7 @@ if (validateArguments(argv, expectedArguments)) { argv.operationalWalletPrivateKey, argv.managementWalletPrivateKey, argv.hubContractAddress, + argv.gasPriceOracleLink, ) .then(() => { console.log('Set stake completed'); diff --git a/src/commands/cleaners/cleaner-command.js b/src/commands/cleaners/cleaner-command.js index 38dc0685f2..3f78485ddb 100644 --- a/src/commands/cleaners/cleaner-command.js +++ b/src/commands/cleaners/cleaner-command.js @@ -66,8 +66,8 @@ class CleanerCommand extends Command { * @param command * @param error */ - async recover(command, error) { - this.logger.warn(`Failed to clean operational db data: error: ${error.message}`); + async recover(command) { + this.logger.warn(`Failed to clean operational db data: error: ${command.message}`); return Command.repeat(); } } diff --git a/src/commands/cleaners/operation-id-cleaner-command.js b/src/commands/cleaners/operation-id-cleaner-command.js index d1816e7d4c..0d41a8e9bb 100644 --- a/src/commands/cleaners/operation-id-cleaner-command.js +++ b/src/commands/cleaners/operation-id-cleaner-command.js @@ -54,8 +54,8 @@ class OperationIdCleanerCommand extends Command { * @param command * @param error */ - async recover(command, error) { - this.logger.warn(`Failed to clean operation ids table: error: ${error.message}`); + async recover(command) { + this.logger.warn(`Failed to clean operation ids table: error: ${command.message}`); return Command.repeat(); } diff --git a/src/commands/command-executor.js b/src/commands/command-executor.js index 776483f56e..5f2e36f057 100644 --- a/src/commands/command-executor.js +++ b/src/commands/command-executor.js @@ -293,6 +293,7 @@ class CommandExecutor { status: COMMAND_STATUS.PENDING, data: command.data, retries: command.retries - 1, + message: command.message, }); const period = command.period ?? 0; const delay = command.delay ?? 0; @@ -311,7 +312,7 @@ class CommandExecutor { * @return {Promise} * @private */ - async _handleError(command, handler, err) { + async _handleError(command, handler, error) { if (command.retries > 0) { await this._update(command, { retries: command.retries - 1, @@ -323,10 +324,10 @@ class CommandExecutor { try { await this._update(command, { status: COMMAND_STATUS.FAILED, - message: err.message, + message: error.message, }); - this.logger.warn(`Error in command: ${command.name}, error: ${err.message}`); - return await handler.recover(command, err); + this.logger.warn(`Error in command: ${command.name}, error: ${error.message}`); + return await handler.recover(command); } catch (e) { this.logger.warn(`Failed to recover command ${command.name} and ID ${command.id}`); } diff --git a/src/commands/command.js b/src/commands/command.js index 164c1f73e0..5e1f0735f9 100644 --- a/src/commands/command.js +++ b/src/commands/command.js @@ -23,9 +23,9 @@ class Command { * @param command * @param err */ - async recover(command, err) { - const { operationId } = command.data; - await this.handleError(operationId, err.message, this.errorType, true); + async recover(command) { + const { operationId, blockchain } = command.data; + await this.handleError(operationId, blockchain, command.message, this.errorType, true); return Command.empty(); } @@ -115,11 +115,12 @@ class Command { * @param markFailed - Update operation status to failed * @returns {*} */ - async handleError(operationId, errorMessage, errorName, markFailed) { + async handleError(operationId, blockchain, errorMessage, errorName, markFailed) { this.logger.error(`Command error (${errorName}): ${errorMessage}`); if (markFailed) { await this.operationIdService.updateOperationIdStatus( operationId, + blockchain, OPERATION_ID_STATUS.FAILED, errorMessage, errorName, diff --git a/src/commands/common/dial-peers-command.js b/src/commands/common/dial-peers-command.js index 41a728f342..61631e0a0d 100644 --- a/src/commands/common/dial-peers-command.js +++ b/src/commands/common/dial-peers-command.js @@ -37,8 +37,8 @@ class DialPeersCommand extends Command { * @param command * @param error */ - async recover(command, error) { - this.logger.warn(`Failed to dial peers: error: ${error.message}`); + async recover(command) { + this.logger.warn(`Failed to dial peers: error: ${command.message}`); return Command.repeat(); } diff --git a/src/commands/common/otnode-update-command.js b/src/commands/common/otnode-update-command.js index 46b391bd71..b5a34c26da 100644 --- a/src/commands/common/otnode-update-command.js +++ b/src/commands/common/otnode-update-command.js @@ -51,20 +51,20 @@ class OtnodeUpdateCommand extends Command { } else { this.logger.info('Your node is running on the latest version!'); } - } catch (e) { - await this.handleError(e); + } catch (error) { + await this.handleError(error.message); } return Command.repeat(); } - async recover(command, err) { - await this.handleError(err); + async recover(command) { + await this.handleError(command.message); return Command.repeat(); } - async handleError(error) { - this.logger.error(`Error in update command: ${error}. ${error.stack}`); + async handleError(errorMessage) { + this.logger.error(`Error in update command: ${errorMessage}`); } /** diff --git a/src/commands/common/send-telemetry-command.js b/src/commands/common/send-telemetry-command.js index ada1aab635..949e6fb532 100644 --- a/src/commands/common/send-telemetry-command.js +++ b/src/commands/common/send-telemetry-command.js @@ -30,15 +30,27 @@ class SendTelemetryCommand extends Command { try { const events = (await this.getUnpublishedEvents()) || []; + const blockchainsNodeInfo = []; + const implementations = this.blockchainModuleManager.getImplementationNames(); + for (const implementation of implementations) { + const blockchainInfo = { + blockchain_id: implementation, + // eslint-disable-next-line no-await-in-loop + identity_id: await this.blockchainModuleManager.getIdentityId(implementation), + operational_wallet: this.blockchainModuleManager.getPublicKey(implementation), + management_wallet: + this.blockchainModuleManager.getManagementKey(implementation), + }; + blockchainsNodeInfo.push(blockchainInfo); + } const nodeData = { version: pjson.version, identity: this.networkModuleManager.getPeerId().toB58String(), hostname: this.config.hostname, - operational_wallet: this.blockchainModuleManager.getPublicKey(), - management_wallet: this.blockchainModuleManager.getManagementKey(), triple_store: this.config.modules.tripleStore.defaultImplementation, auto_update_enabled: this.config.modules.autoUpdater.enabled, multiaddresses: this.networkModuleManager.getMultiaddrs(), + blockchains: blockchainsNodeInfo, }; const isDataSuccessfullySent = await this.telemetryModuleManager.sendTelemetryData( nodeData, @@ -47,20 +59,20 @@ class SendTelemetryCommand extends Command { if (isDataSuccessfullySent && events?.length > 0) { await this.removePublishedEvents(events); } - } catch (e) { - await this.handleError(e); + } catch (error) { + await this.handleError(error.message); } return Command.repeat(); } - async recover(command, err) { - await this.handleError(err); + async recover(command) { + await this.handleError(command.message); return Command.repeat(); } - async handleError(error) { - this.logger.error(`Error in send telemetry command: ${error}. ${error.stack}`); + async handleError(errorMessage) { + this.logger.error(`Error in send telemetry command: ${errorMessage}`); } /** diff --git a/src/commands/common/validate-asset-command.js b/src/commands/common/validate-asset-command.js index 317a45cdb6..ec25cd8c01 100644 --- a/src/commands/common/validate-asset-command.js +++ b/src/commands/common/validate-asset-command.js @@ -32,6 +32,7 @@ class ValidateAssetCommand extends Command { await this.operationIdService.updateOperationIdStatus( operationId, + blockchain, OPERATION_ID_STATUS.VALIDATE_ASSET_START, ); @@ -59,6 +60,7 @@ class ValidateAssetCommand extends Command { if (blockchainAssertionId !== cachedData.public.assertionId) { await this.handleError( operationId, + blockchain, `Invalid assertion id for asset ${ual}. Received value from blockchain: ${blockchainAssertionId}, received value from request: ${cachedData.public.assertionId}`, this.errorType, true, @@ -83,13 +85,20 @@ class ValidateAssetCommand extends Command { cachedData.private.assertionId, ); } catch (error) { - await this.handleError(operationId, error.message, this.errorType, true); + await this.handleError( + operationId, + blockchain, + error.message, + this.errorType, + true, + ); return Command.empty(); } } await this.operationIdService.updateOperationIdStatus( operationId, + blockchain, OPERATION_ID_STATUS.VALIDATE_ASSET_END, ); return this.continueSequence( @@ -103,6 +112,7 @@ class ValidateAssetCommand extends Command { const ual = this.ualService.deriveUAL(blockchain, contract, tokenId); await this.handleError( operationId, + blockchain, `Max retry count for command: ${command.name} reached! Unable to validate ual: ${ual}`, this.errorType, true, diff --git a/src/commands/local-store/local-store-command.js b/src/commands/local-store/local-store-command.js index 5bf84abc00..4a0aa82b31 100644 --- a/src/commands/local-store/local-store-command.js +++ b/src/commands/local-store/local-store-command.js @@ -34,6 +34,7 @@ class LocalStoreCommand extends Command { try { await this.operationIdService.updateOperationIdStatus( operationId, + blockchain, OPERATION_ID_STATUS.LOCAL_STORE.LOCAL_STORE_START, ); @@ -104,15 +105,17 @@ class LocalStoreCommand extends Command { await this.operationIdService.updateOperationIdStatus( operationId, + blockchain, OPERATION_ID_STATUS.LOCAL_STORE.LOCAL_STORE_END, ); await this.operationIdService.updateOperationIdStatus( operationId, + blockchain, OPERATION_ID_STATUS.COMPLETED, ); } catch (e) { - await this.handleError(operationId, e.message, this.errorType, true); + await this.handleError(operationId, blockchain, e.message, this.errorType, true); return Command.empty(); } diff --git a/src/commands/protocols/common/epoch-check-command.js b/src/commands/protocols/common/epoch-check-command.js index 330a700f09..d8da892f21 100644 --- a/src/commands/protocols/common/epoch-check-command.js +++ b/src/commands/protocols/common/epoch-check-command.js @@ -6,7 +6,9 @@ import { TRANSACTION_CONFIRMATIONS, OPERATION_ID_STATUS, ERROR_TYPE, + NODE_ENVIRONMENTS, } from '../../../constants/constants.js'; +import MigrationExecutor from '../../../migration/migration-executor.js'; class EpochCheckCommand extends Command { constructor(ctx) { @@ -17,18 +19,37 @@ class EpochCheckCommand extends Command { this.shardingTableService = ctx.shardingTableService; this.blockchainModuleManager = ctx.blockchainModuleManager; this.serviceAgreementService = ctx.serviceAgreementService; + this.fileService = ctx.fileService; this.errorType = ERROR_TYPE.COMMIT_PROOF.EPOCH_CHECK_ERROR; } async execute(command) { - const operationId = this.operationIdService.generateId(); - this.operationIdService.emitChangeEvent( - OPERATION_ID_STATUS.COMMIT_PROOF.EPOCH_CHECK_START, - operationId, + const migrationExecuted = await MigrationExecutor.migrationAlreadyExecuted( + 'ualExtensionTripleStoreMigration', + this.fileService, ); + if ( + process.env.NODE_ENV !== NODE_ENVIRONMENTS.DEVELOPMENT && + process.env.NODE_ENV !== NODE_ENVIRONMENTS.TEST && + !migrationExecuted + ) { + this.logger.info( + 'Epoch check command will be postponed until ual extension triple store migration is completed', + ); + return Command.repeat(); + } + this.logger.info('Starting epoch check command'); + const operationId = this.operationIdService.generateId(); + await Promise.all( this.blockchainModuleManager.getImplementationNames().map(async (blockchain) => { + this.operationIdService.emitChangeEvent( + OPERATION_ID_STATUS.COMMIT_PROOF.EPOCH_CHECK_START, + operationId, + blockchain, + ); + const commitWindowDurationPerc = await this.blockchainModuleManager.getCommitWindowDurationPerc(blockchain); const proofWindowDurationPerc = @@ -71,12 +92,13 @@ class EpochCheckCommand extends Command { r0, ), ]); - }), - ); - this.operationIdService.emitChangeEvent( - OPERATION_ID_STATUS.COMMIT_PROOF.EPOCH_CHECK_END, - operationId, + this.operationIdService.emitChangeEvent( + OPERATION_ID_STATUS.COMMIT_PROOF.EPOCH_CHECK_END, + operationId, + blockchain, + ); + }), ); return Command.repeat(); @@ -348,8 +370,8 @@ class EpochCheckCommand extends Command { * @param command * @param error */ - async recover(command, error) { - this.logger.warn(`Failed to execute ${command.name}; Error: ${error.message}`); + async recover(command) { + this.logger.warn(`Failed to execute ${command.name}. Error: ${command.message}`); return Command.repeat(); } diff --git a/src/commands/protocols/common/find-nodes-command.js b/src/commands/protocols/common/find-nodes-command.js index 400a0a6ef5..bf9e204301 100644 --- a/src/commands/protocols/common/find-nodes-command.js +++ b/src/commands/protocols/common/find-nodes-command.js @@ -46,8 +46,9 @@ class FindNodesCommand extends Command { ); if (closestNodes.length < minAckResponses) { - this.handleError( + await this.handleError( operationId, + blockchain, `Unable to find enough nodes for ${operationId}. Minimum number of nodes required: ${minAckResponses}`, this.errorType, true, @@ -68,6 +69,7 @@ class FindNodesCommand extends Command { async findNodes(blockchainId, keyword, operationId, hashFunctionId) { await this.operationIdService.updateOperationIdStatus( operationId, + blockchainId, OPERATION_ID_STATUS.FIND_NODES_START, ); const r2 = await this.blockchainModuleManager.getR2(blockchainId); @@ -87,6 +89,7 @@ class FindNodesCommand extends Command { await this.operationIdService.updateOperationIdStatus( operationId, + blockchainId, OPERATION_ID_STATUS.FIND_NODES_END, ); diff --git a/src/commands/protocols/common/handle-protocol-message-command.js b/src/commands/protocols/common/handle-protocol-message-command.js index 79400fda6e..92b7966697 100644 --- a/src/commands/protocols/common/handle-protocol-message-command.js +++ b/src/commands/protocols/common/handle-protocol-message-command.js @@ -225,9 +225,9 @@ class HandleProtocolMessageCommand extends Command { } async handleError(errorMessage, command) { - const { operationId, remotePeerId, keywordUuid, protocol } = command.data; + const { operationId, blockchain, remotePeerId, keywordUuid, protocol } = command.data; - await super.handleError(operationId, errorMessage, this.errorType, true); + await super.handleError(operationId, blockchain, errorMessage, this.errorType, true); await this.networkModuleManager.sendMessageResponse( protocol, remotePeerId, diff --git a/src/commands/protocols/common/protocol-init-command.js b/src/commands/protocols/common/protocol-init-command.js index 8f139828d2..6a76e0318b 100644 --- a/src/commands/protocols/common/protocol-init-command.js +++ b/src/commands/protocols/common/protocol-init-command.js @@ -3,8 +3,10 @@ import { NETWORK_MESSAGE_TYPES } from '../../../constants/constants.js'; class ProtocolInitCommand extends ProtocolMessageCommand { async prepareMessage(command) { - const { assertionId, blockchain, contract, tokenId, keyword, hashFunctionId } = - command.data; + const { assertionId, contract, tokenId, keyword, hashFunctionId } = command.data; + + // TODO: Backwards compatibility, send blockchain without chainId + const blockchain = command.data.blockchain.split(':')[0]; return { assertionId, blockchain, contract, tokenId, keyword, hashFunctionId }; } diff --git a/src/commands/protocols/common/protocol-message-command.js b/src/commands/protocols/common/protocol-message-command.js index 7e3c2a0424..b0ee5c48b9 100644 --- a/src/commands/protocols/common/protocol-message-command.js +++ b/src/commands/protocols/common/protocol-message-command.js @@ -78,12 +78,12 @@ class ProtocolMessageCommand extends Command { return Command.empty(); } - async recover(command, err) { + async recover(command) { const { node, operationId, keyword } = command.data; const keywordUuid = uuidv5(keyword, uuidv5.URL); this.networkModuleManager.removeCachedSession(operationId, keywordUuid, node.id); - await this.markResponseAsFailed(command, err.message); + await this.markResponseAsFailed(command, command.message); return Command.empty(); } diff --git a/src/commands/protocols/common/protocol-schedule-messages-command.js b/src/commands/protocols/common/protocol-schedule-messages-command.js index bc9d1af115..c29b66559d 100644 --- a/src/commands/protocols/common/protocol-schedule-messages-command.js +++ b/src/commands/protocols/common/protocol-schedule-messages-command.js @@ -26,7 +26,11 @@ class ProtocolScheduleMessagesCommand extends Command { const currentBatchLeftoverNodes = batchSize < leftoverNodes.length ? leftoverNodes.slice(batchSize) : []; - await this.operationIdService.updateOperationIdStatus(operationId, this.startEvent); + await this.operationIdService.updateOperationIdStatus( + operationId, + blockchain, + this.startEvent, + ); this.logger.debug( `Trying to ${this.operationService.getOperationName()} to batch of ${ diff --git a/src/commands/protocols/common/submit-commit-command.js b/src/commands/protocols/common/submit-commit-command.js index 1151062811..124e985231 100644 --- a/src/commands/protocols/common/submit-commit-command.js +++ b/src/commands/protocols/common/submit-commit-command.js @@ -42,11 +42,30 @@ class SubmitCommitCommand extends Command { this.operationIdService.emitChangeEvent( OPERATION_ID_STATUS.COMMIT_PROOF.SUBMIT_COMMIT_START, operationId, + blockchain, agreementId, epoch, ); } + const assertionIds = await this.blockchainModuleManager.getAssertionIds( + blockchain, + contract, + tokenId, + ); + + // If update for new state is already finalized (and node haven't processed the event yet), don't send commit for the older state + if (stateIndex < assertionIds.length - 1) { + this.logger.trace( + `Knowledge Asset was updated, not sending Commit for the Service Agreement with the ID: ${agreementId}, ` + + `Blockchain: ${blockchain}, Contract: ${contract}, Token ID: ${tokenId}, ` + + `Keyword: ${keyword}, Hash function ID: ${hashFunctionId}, Epoch: ${epoch}, ` + + `State Index: ${stateIndex}, Operation ID: ${operationId}`, + ); + + return Command.empty(); + } + // this can happen in case node has already submitted update commit const alreadySubmitted = await this.commitAlreadySubmitted( blockchain, @@ -62,13 +81,6 @@ class SubmitCommitCommand extends Command { `State Index: ${stateIndex}, Operation ID: ${operationId}`, ); - this.operationIdService.emitChangeEvent( - OPERATION_ID_STATUS.COMMIT_PROOF.SUBMIT_COMMIT_END, - operationId, - agreementId, - epoch, - ); - return Command.empty(); } @@ -120,7 +132,10 @@ class SubmitCommitCommand extends Command { newGasPrice = null; } - Object.assign(command.data, { gasPrice: newGasPrice }); + Object.assign(command, { + data: { ...command.data, gasPrice: newGasPrice }, + message: error.message, + }); return Command.retry(); } @@ -128,6 +143,14 @@ class SubmitCommitCommand extends Command { let msgBase; if (txSuccess) { msgBase = 'Successfully executed'; + + this.operationIdService.emitChangeEvent( + OPERATION_ID_STATUS.COMMIT_PROOF.SUBMIT_COMMIT_END, + operationId, + blockchain, + agreementId, + epoch, + ); } else { msgBase = 'Node has already submitted commit. Finishing'; } @@ -140,13 +163,6 @@ class SubmitCommitCommand extends Command { `Retry number: ${COMMAND_RETRIES.SUBMIT_COMMIT - command.retries + 1}`, ); - this.operationIdService.emitChangeEvent( - OPERATION_ID_STATUS.COMMIT_PROOF.SUBMIT_COMMIT_END, - operationId, - agreementId, - epoch, - ); - return Command.empty(); } @@ -169,7 +185,14 @@ class SubmitCommitCommand extends Command { } async retryFinished(command) { - this.recover(command, `Max retry count for command: ${command.name} reached!`); + const { blockchain, operationId } = command.data; + await this.handleError( + operationId, + blockchain, + `Max retries has been reached! Latest Error Message: ${command.message}`, + this.errorType, + true, + ); } /** diff --git a/src/commands/protocols/common/submit-proofs-command.js b/src/commands/protocols/common/submit-proofs-command.js index 832e8a6461..462d51fb27 100644 --- a/src/commands/protocols/common/submit-proofs-command.js +++ b/src/commands/protocols/common/submit-proofs-command.js @@ -48,6 +48,7 @@ class SubmitProofsCommand extends Command { this.operationIdService.emitChangeEvent( OPERATION_ID_STATUS.COMMIT_PROOF.CALCULATE_PROOFS_START, operationId, + blockchain, agreementId, epoch, ); @@ -70,7 +71,7 @@ class SubmitProofsCommand extends Command { const errorMessage = `Assertion with id: ${assertionId} not found in the triple store.`; this.logger.trace(errorMessage); - await this.handleError(operationId, errorMessage, this.errorType, true); + await this.handleError(operationId, blockchain, errorMessage, this.errorType, true); return Command.empty(); } @@ -84,6 +85,7 @@ class SubmitProofsCommand extends Command { this.operationIdService.emitChangeEvent( OPERATION_ID_STATUS.COMMIT_PROOF.CALCULATE_PROOFS_END, operationId, + blockchain, agreementId, epoch, ); @@ -91,10 +93,30 @@ class SubmitProofsCommand extends Command { this.operationIdService.emitChangeEvent( OPERATION_ID_STATUS.COMMIT_PROOF.SUBMIT_PROOFS_START, operationId, + blockchain, agreementId, epoch, ); } + + const assertionIds = await this.blockchainModuleManager.getAssertionIds( + blockchain, + contract, + tokenId, + ); + + // If update for new state is already finalized (and node haven't processed the event yet), don't send commit for the older state + if (stateIndex < assertionIds.length - 1) { + this.logger.trace( + `Knowledge Asset was updated, not sending Proof for the Service Agreement with the ID: ${agreementId}, ` + + `Blockchain: ${blockchain}, Contract: ${contract}, Token ID: ${tokenId}, ` + + `Keyword: ${keyword}, Hash function ID: ${hashFunctionId}, Epoch: ${epoch}, ` + + `State Index: ${stateIndex}, Operation ID: ${operationId}`, + ); + + return Command.empty(); + } + const alreadySubmitted = await this.proofAlreadySubmitted( blockchain, agreementId, @@ -109,13 +131,6 @@ class SubmitProofsCommand extends Command { `State Index: ${stateIndex}, Operation ID: ${operationId}`, ); - this.operationIdService.emitChangeEvent( - OPERATION_ID_STATUS.COMMIT_PROOF.SUBMIT_PROOFS_END, - operationId, - agreementId, - epoch, - ); - return Command.empty(); } @@ -169,7 +184,10 @@ class SubmitProofsCommand extends Command { newGasPrice = null; } - Object.assign(command.data, { gasPrice: newGasPrice }); + Object.assign(command, { + data: { ...command.data, gasPrice: newGasPrice }, + message: error.message, + }); return Command.retry(); } @@ -177,6 +195,14 @@ class SubmitProofsCommand extends Command { let msgBase; if (txSuccess) { msgBase = 'Successfully executed'; + + this.operationIdService.emitChangeEvent( + OPERATION_ID_STATUS.COMMIT_PROOF.SUBMIT_PROOFS_END, + operationId, + blockchain, + agreementId, + epoch, + ); } else { msgBase = 'Node has already sent proof. Finishing'; } @@ -189,13 +215,6 @@ class SubmitProofsCommand extends Command { `Retry number: ${COMMAND_RETRIES.SUBMIT_PROOFS - command.retries + 1}`, ); - this.operationIdService.emitChangeEvent( - OPERATION_ID_STATUS.COMMIT_PROOF.SUBMIT_PROOFS_END, - operationId, - agreementId, - epoch, - ); - return Command.empty(); } @@ -218,7 +237,14 @@ class SubmitProofsCommand extends Command { } async retryFinished(command) { - this.recover(command, `Max retry count for command: ${command.name} reached!`); + const { blockchain, operationId } = command.data; + await this.handleError( + operationId, + blockchain, + `Max retries has been reached! Latest Error Message: ${command.message}`, + this.errorType, + true, + ); } /** diff --git a/src/commands/protocols/get/receiver/v1.0.0/v1-0-0-handle-get-init-command.js b/src/commands/protocols/get/receiver/v1.0.0/v1-0-0-handle-get-init-command.js index 8dbef0a104..475a9c2b3c 100644 --- a/src/commands/protocols/get/receiver/v1.0.0/v1-0-0-handle-get-init-command.js +++ b/src/commands/protocols/get/receiver/v1.0.0/v1-0-0-handle-get-init-command.js @@ -23,6 +23,7 @@ class HandleGetInitCommand extends HandleProtocolMessageCommand { await this.operationIdService.updateOperationIdStatus( operationId, + blockchain, OPERATION_ID_STATUS.GET.ASSERTION_EXISTS_LOCAL_START, ); @@ -64,6 +65,7 @@ class HandleGetInitCommand extends HandleProtocolMessageCommand { await this.operationIdService.updateOperationIdStatus( operationId, + blockchain, OPERATION_ID_STATUS.GET.ASSERTION_EXISTS_LOCAL_END, ); diff --git a/src/commands/protocols/get/receiver/v1.0.0/v1-0-0-handle-get-request-command.js b/src/commands/protocols/get/receiver/v1.0.0/v1-0-0-handle-get-request-command.js index 576dbe8a5a..8bf5f5b3a6 100644 --- a/src/commands/protocols/get/receiver/v1.0.0/v1-0-0-handle-get-request-command.js +++ b/src/commands/protocols/get/receiver/v1.0.0/v1-0-0-handle-get-request-command.js @@ -23,6 +23,7 @@ class HandleGetRequestCommand extends HandleProtocolMessageCommand { const { operationId, blockchain, contract, tokenId, assertionId, state } = commandData; await this.operationIdService.updateOperationIdStatus( operationId, + blockchain, OPERATION_ID_STATUS.GET.GET_REMOTE_START, ); @@ -61,6 +62,7 @@ class HandleGetRequestCommand extends HandleProtocolMessageCommand { await this.operationIdService.updateOperationIdStatus( operationId, + blockchain, OPERATION_ID_STATUS.GET.GET_REMOTE_END, ); diff --git a/src/commands/protocols/get/sender/get-assertion-id-command.js b/src/commands/protocols/get/sender/get-assertion-id-command.js index cf40c8d681..b4773ce456 100644 --- a/src/commands/protocols/get/sender/get-assertion-id-command.js +++ b/src/commands/protocols/get/sender/get-assertion-id-command.js @@ -23,6 +23,7 @@ class GetAssertionIdCommand extends Command { if (state === ZERO_BYTES32) { await this.handleError( operationId, + blockchain, `The provided state: ${state}. State hash cannot be 0x0.`, this.errorType, ); @@ -47,6 +48,7 @@ class GetAssertionIdCommand extends Command { ) { await this.handleError( operationId, + blockchain, `The provided state: ${state} does not exist on the ${blockchain} blockchain, ``within contract: ${contract}, for the Knowledge Asset with tokenId: ${tokenId}.`, this.errorType, ); @@ -78,8 +80,13 @@ class GetAssertionIdCommand extends Command { return this.continueSequence({ ...command.data, state, assertionId }, command.sequence); } - async handleError(operationId, errorMessage, errorType) { - await this.operationService.markOperationAsFailed(operationId, errorMessage, errorType); + async handleError(operationId, blockchain, errorMessage, errorType) { + await this.operationService.markOperationAsFailed( + operationId, + blockchain, + errorMessage, + errorType, + ); } /** diff --git a/src/commands/protocols/get/sender/local-get-command.js b/src/commands/protocols/get/sender/local-get-command.js index 8d64f8186e..f510115010 100644 --- a/src/commands/protocols/get/sender/local-get-command.js +++ b/src/commands/protocols/get/sender/local-get-command.js @@ -28,6 +28,7 @@ class LocalGetCommand extends Command { const { operationId, blockchain, contract, tokenId, assertionId, state } = command.data; await this.operationIdService.updateOperationIdStatus( operationId, + blockchain, OPERATION_ID_STATUS.GET.GET_LOCAL_START, ); @@ -90,25 +91,36 @@ class LocalGetCommand extends Command { } if (response?.assertion?.length) { - await this.operationService.markOperationAsCompleted(operationId, response, [ - OPERATION_ID_STATUS.GET.GET_LOCAL_END, - OPERATION_ID_STATUS.GET.GET_END, - OPERATION_ID_STATUS.COMPLETED, - ]); + await this.operationService.markOperationAsCompleted( + operationId, + blockchain, + response, + [ + OPERATION_ID_STATUS.GET.GET_LOCAL_END, + OPERATION_ID_STATUS.GET.GET_END, + OPERATION_ID_STATUS.COMPLETED, + ], + ); return Command.empty(); } await this.operationIdService.updateOperationIdStatus( operationId, + blockchain, OPERATION_ID_STATUS.GET.GET_LOCAL_END, ); return this.continueSequence(command.data, command.sequence); } - async handleError(operationId, errorMessage, errorType) { - await this.operationService.markOperationAsFailed(operationId, errorMessage, errorType); + async handleError(operationId, blockchain, errorMessage, errorType) { + await this.operationService.markOperationAsFailed( + operationId, + blockchain, + errorMessage, + errorType, + ); } /** diff --git a/src/commands/protocols/get/sender/v1.0.0/v1-0-0-get-init-command.js b/src/commands/protocols/get/sender/v1.0.0/v1-0-0-get-init-command.js index ce55bf1ace..2c366cd952 100644 --- a/src/commands/protocols/get/sender/v1.0.0/v1-0-0-get-init-command.js +++ b/src/commands/protocols/get/sender/v1.0.0/v1-0-0-get-init-command.js @@ -10,7 +10,10 @@ class GetInitCommand extends ProtocolInitCommand { } async prepareMessage(command) { - const { blockchain, contract, tokenId, keyword, assertionId, state } = command.data; + const { contract, tokenId, keyword, assertionId, state } = command.data; + + // TODO: Backwards compatibility, send blockchain without chainId + const blockchain = command.data.blockchain.split(':')[0]; return { blockchain, diff --git a/src/commands/protocols/get/sender/v1.0.0/v1-0-0-get-request-command.js b/src/commands/protocols/get/sender/v1.0.0/v1-0-0-get-request-command.js index 7c6d6e1cfc..6780a99871 100644 --- a/src/commands/protocols/get/sender/v1.0.0/v1-0-0-get-request-command.js +++ b/src/commands/protocols/get/sender/v1.0.0/v1-0-0-get-request-command.js @@ -31,7 +31,10 @@ class GetRequestCommand extends ProtocolRequestCommand { } async prepareMessage(command) { - const { blockchain, contract, tokenId, assertionId, state, hashFunctionId } = command.data; + const { contract, tokenId, assertionId, state, hashFunctionId } = command.data; + + // TODO: Backwards compatibility, send blockchain without chainId + const blockchain = command.data.blockchain.split(':')[0]; return { blockchain, diff --git a/src/commands/protocols/publish/receiver/v1.0.0/v1-0-0-handle-store-init-command.js b/src/commands/protocols/publish/receiver/v1.0.0/v1-0-0-handle-store-init-command.js index 36cb8e407c..d9c529ffe8 100644 --- a/src/commands/protocols/publish/receiver/v1.0.0/v1-0-0-handle-store-init-command.js +++ b/src/commands/protocols/publish/receiver/v1.0.0/v1-0-0-handle-store-init-command.js @@ -16,6 +16,7 @@ class HandleStoreInitCommand extends HandleProtocolMessageCommand { await this.operationIdService.updateOperationIdStatus( operationId, + blockchain, OPERATION_ID_STATUS.VALIDATE_ASSET_REMOTE_START, ); @@ -31,6 +32,7 @@ class HandleStoreInitCommand extends HandleProtocolMessageCommand { this.operationIdService.updateOperationIdStatus( operationId, + blockchain, OPERATION_ID_STATUS.VALIDATE_ASSET_REMOTE_END, ); @@ -39,7 +41,7 @@ class HandleStoreInitCommand extends HandleProtocolMessageCommand { async retryFinished(command) { const { operationId } = command.data; - this.handleError( + await this.handleError( `Retry count for command: ${command.name} reached! Unable to validate data for operation id: ${operationId}`, command, ); diff --git a/src/commands/protocols/publish/receiver/v1.0.0/v1-0-0-handle-store-request-command.js b/src/commands/protocols/publish/receiver/v1.0.0/v1-0-0-handle-store-request-command.js index 5e82bd6178..c7e7210694 100644 --- a/src/commands/protocols/publish/receiver/v1.0.0/v1-0-0-handle-store-request-command.js +++ b/src/commands/protocols/publish/receiver/v1.0.0/v1-0-0-handle-store-request-command.js @@ -36,6 +36,7 @@ class HandleStoreRequestCommand extends HandleProtocolMessageCommand { await this.operationIdService.updateOperationIdStatus( operationId, + blockchain, OPERATION_ID_STATUS.PUBLISH.VALIDATING_PUBLISH_ASSERTION_REMOTE_START, ); const assertionIds = await this.blockchainModuleManager.getAssertionIds( @@ -49,11 +50,13 @@ class HandleStoreRequestCommand extends HandleProtocolMessageCommand { await this.operationIdService.updateOperationIdStatus( operationId, + blockchain, OPERATION_ID_STATUS.PUBLISH.VALIDATING_PUBLISH_ASSERTION_REMOTE_END, ); await this.operationIdService.updateOperationIdStatus( operationId, + blockchain, OPERATION_ID_STATUS.PUBLISH.PUBLISH_LOCAL_STORE_START, ); @@ -85,6 +88,7 @@ class HandleStoreRequestCommand extends HandleProtocolMessageCommand { await this.operationIdService.updateOperationIdStatus( operationId, + blockchain, OPERATION_ID_STATUS.PUBLISH.PUBLISH_LOCAL_STORE_END, ); diff --git a/src/commands/protocols/publish/sender/publish-schedule-messages-command.js b/src/commands/protocols/publish/sender/publish-schedule-messages-command.js index f5314aca85..4c4977a09e 100644 --- a/src/commands/protocols/publish/sender/publish-schedule-messages-command.js +++ b/src/commands/protocols/publish/sender/publish-schedule-messages-command.js @@ -102,6 +102,7 @@ class PublishScheduleMessagesCommand extends ProtocolScheduleMessagesCommand { if (validBids < minAckResponses) { await this.operationService.markOperationAsFailed( operationId, + blockchain, 'Unable to start publish, not enough nodes in neighbourhood satisfy the bid.', ERROR_TYPE.PUBLISH.PUBLISH_START_ERROR, ); diff --git a/src/commands/protocols/publish/sender/publish-validate-asset-command.js b/src/commands/protocols/publish/sender/publish-validate-asset-command.js index 4ff4edc453..764624a226 100644 --- a/src/commands/protocols/publish/sender/publish-validate-asset-command.js +++ b/src/commands/protocols/publish/sender/publish-validate-asset-command.js @@ -6,8 +6,13 @@ class PublishValidateAssetCommand extends ValidateAssetCommand { this.operationService = ctx.publishService; } - async handleError(operationId, errorMessage, errorType) { - await this.operationService.markOperationAsFailed(operationId, errorMessage, errorType); + async handleError(operationId, blockchain, errorMessage, errorType) { + await this.operationService.markOperationAsFailed( + operationId, + blockchain, + errorMessage, + errorType, + ); } /** diff --git a/src/commands/protocols/update/receiver/submit-update-commit-command.js b/src/commands/protocols/update/receiver/submit-update-commit-command.js index 7a6cbe098f..e253372f87 100644 --- a/src/commands/protocols/update/receiver/submit-update-commit-command.js +++ b/src/commands/protocols/update/receiver/submit-update-commit-command.js @@ -46,6 +46,7 @@ class SubmitUpdateCommitCommand extends Command { this.operationIdService.emitChangeEvent( OPERATION_ID_STATUS.COMMIT_PROOF.SUBMIT_UPDATE_COMMIT_START, operationId, + blockchain, agreementId, epoch, ); @@ -64,13 +65,6 @@ class SubmitUpdateCommitCommand extends Command { `Epoch: ${epoch}, Operation ID: ${operationId}`, ); - this.operationIdService.emitChangeEvent( - OPERATION_ID_STATUS.COMMIT_PROOF.SUBMIT_UPDATE_COMMIT_END, - operationId, - agreementId, - epoch, - ); - return Command.empty(); } @@ -119,7 +113,10 @@ class SubmitUpdateCommitCommand extends Command { newGasPrice = null; } - Object.assign(command.data, { gasPrice: newGasPrice }); + Object.assign(command, { + data: { ...command.data, gasPrice: newGasPrice }, + message: error.message, + }); return Command.retry(); } @@ -136,6 +133,7 @@ class SubmitUpdateCommitCommand extends Command { this.operationIdService.emitChangeEvent( OPERATION_ID_STATUS.COMMIT_PROOF.SUBMIT_UPDATE_COMMIT_END, operationId, + blockchain, agreementId, epoch, ); @@ -149,7 +147,14 @@ class SubmitUpdateCommitCommand extends Command { } async retryFinished(command) { - this.recover(command, `Max retry count for command: ${command.name} reached!`); + const { blockchain, operationId } = command.data; + await this.handleError( + operationId, + blockchain, + `Max retries has been reached! Latest Error Message: ${command.message}`, + this.errorType, + true, + ); } /** diff --git a/src/commands/protocols/update/receiver/v1.0.0/v1-0-0-handle-update-init-command.js b/src/commands/protocols/update/receiver/v1.0.0/v1-0-0-handle-update-init-command.js index 9882288b20..ca0c1720ab 100644 --- a/src/commands/protocols/update/receiver/v1.0.0/v1-0-0-handle-update-init-command.js +++ b/src/commands/protocols/update/receiver/v1.0.0/v1-0-0-handle-update-init-command.js @@ -18,6 +18,7 @@ class HandleUpdateInitCommand extends HandleProtocolMessageCommand { commandData; await this.operationIdService.updateOperationIdStatus( operationId, + blockchain, OPERATION_ID_STATUS.VALIDATE_ASSET_REMOTE_START, ); @@ -42,6 +43,7 @@ class HandleUpdateInitCommand extends HandleProtocolMessageCommand { await this.operationIdService.updateOperationIdStatus( operationId, + blockchain, OPERATION_ID_STATUS.VALIDATE_ASSET_REMOTE_END, ); return validationResult; @@ -61,7 +63,7 @@ class HandleUpdateInitCommand extends HandleProtocolMessageCommand { async retryFinished(command) { const { operationId } = command.data; - this.handleError( + await this.handleError( `Retry count for command: ${command.name} reached! Unable to validate data for operation id: ${operationId}`, command, ); diff --git a/src/commands/protocols/update/receiver/v1.0.0/v1-0-0-handle-update-request-command.js b/src/commands/protocols/update/receiver/v1.0.0/v1-0-0-handle-update-request-command.js index 0429b3c1f3..c02ae88649 100644 --- a/src/commands/protocols/update/receiver/v1.0.0/v1-0-0-handle-update-request-command.js +++ b/src/commands/protocols/update/receiver/v1.0.0/v1-0-0-handle-update-request-command.js @@ -39,6 +39,7 @@ class HandleUpdateRequestCommand extends HandleProtocolMessageCommand { await this.operationIdService.updateOperationIdStatus( operationId, + blockchain, OPERATION_ID_STATUS.UPDATE.VALIDATING_UPDATE_ASSERTION_REMOTE_START, ); @@ -112,6 +113,7 @@ class HandleUpdateRequestCommand extends HandleProtocolMessageCommand { await Promise.all(scheduleCommandsPromises); await this.operationIdService.updateOperationIdStatus( operationId, + blockchain, OPERATION_ID_STATUS.UPDATE.VALIDATING_UPDATE_ASSERTION_REMOTE_END, ); return { messageType: NETWORK_MESSAGE_TYPES.RESPONSES.ACK, messageData: {} }; diff --git a/src/commands/protocols/update/sender/update-validate-asset-command.js b/src/commands/protocols/update/sender/update-validate-asset-command.js index 581f3cf671..867a6729a7 100644 --- a/src/commands/protocols/update/sender/update-validate-asset-command.js +++ b/src/commands/protocols/update/sender/update-validate-asset-command.js @@ -6,8 +6,13 @@ class UpdateValidateAssetCommand extends ValidateAssetCommand { this.operationService = ctx.updateService; } - async handleError(operationId, errorMessage, errorType) { - await this.operationService.markOperationAsFailed(operationId, errorMessage, errorType); + async handleError(operationId, blockchain, errorMessage, errorType) { + await this.operationService.markOperationAsFailed( + operationId, + blockchain, + errorMessage, + errorType, + ); } /** diff --git a/src/commands/query/query-command.js b/src/commands/query/query-command.js index 68860027ec..d75acf8dc0 100644 --- a/src/commands/query/query-command.js +++ b/src/commands/query/query-command.js @@ -27,6 +27,7 @@ class QueryCommand extends Command { await this.operationIdService.updateOperationIdStatus( operationId, + null, OPERATION_ID_STATUS.QUERY.QUERY_START, ); try { @@ -47,6 +48,7 @@ class QueryCommand extends Command { await this.operationIdService.updateOperationIdStatus( operationId, + null, OPERATION_ID_STATUS.QUERY.QUERY_END, ); @@ -54,10 +56,11 @@ class QueryCommand extends Command { await this.operationIdService.updateOperationIdStatus( operationId, + null, OPERATION_ID_STATUS.COMPLETED, ); } catch (e) { - await this.handleError(operationId, e.message, this.errorType, true); + await this.handleError(operationId, null, e.message, this.errorType, true); } return Command.empty(); diff --git a/src/constants/constants.js b/src/constants/constants.js index 7f05315ec4..ea9f47e221 100644 --- a/src/constants/constants.js +++ b/src/constants/constants.js @@ -1,4 +1,4 @@ -import { BigNumber } from 'ethers'; +import { BigNumber, ethers } from 'ethers'; export const WS_RPC_PROVIDER_PRIORITY = 2; @@ -18,7 +18,9 @@ export const UINT256_UINT32_DIVISOR_BN = UINT256_MAX_BN.div(UINT32_MAX_BN); export const ZERO_PREFIX = '0x'; -export const ZERO_BYTES32 = `0x${'0'.repeat(64)}`; +export const ZERO_BYTES32 = ethers.constants.HashZero; + +export const ZERO_ADDRESS = ethers.constants.AddressZero; export const SCHEMA_CONTEXT = 'http://schema.org/'; @@ -566,6 +568,7 @@ export const CONTRACT_EVENTS = { export const NODE_ENVIRONMENTS = { DEVELOPMENT: 'development', TEST: 'test', + DEVNET: 'devnet', TESTNET: 'testnet', MAINNET: 'mainnet', }; @@ -578,6 +581,7 @@ export const CONTRACT_EVENT_FETCH_INTERVALS = { export const BLOCK_TIME_MILLIS = { OTP: 12_000, HARDHAT: 5_000, + GNOSIS: 5_000, DEFAULT: 12_000, }; diff --git a/src/controllers/http-api/http-api-router.js b/src/controllers/http-api/http-api-router.js index cadf110dfd..f141912e79 100644 --- a/src/controllers/http-api/http-api-router.js +++ b/src/controllers/http-api/http-api-router.js @@ -4,6 +4,7 @@ import { HTTP_API_ROUTES } from '../../constants/constants.js'; class HttpApiRouter { constructor(ctx) { this.httpClientModuleManager = ctx.httpClientModuleManager; + this.blockchainModuleManager = ctx.blockchainModuleManager; this.apiRoutes = HTTP_API_ROUTES; this.apiVersions = Object.keys(this.apiRoutes); @@ -36,7 +37,8 @@ class HttpApiRouter { } initializeBeforeMiddlewares() { - this.httpClientModuleManager.initializeBeforeMiddlewares(); + const blockchainImplementations = this.blockchainModuleManager.getImplementationNames(); + this.httpClientModuleManager.initializeBeforeMiddlewares(blockchainImplementations); } async initializeVersionedListeners() { diff --git a/src/controllers/http-api/v0/get-http-api-controller-v0.js b/src/controllers/http-api/v0/get-http-api-controller-v0.js index f743fb48a6..3114e49955 100644 --- a/src/controllers/http-api/v0/get-http-api-controller-v0.js +++ b/src/controllers/http-api/v0/get-http-api-controller-v0.js @@ -25,6 +25,7 @@ class GetController extends BaseController { await this.operationIdService.updateOperationIdStatus( operationId, + null, OPERATION_ID_STATUS.GET.GET_INIT_START, ); @@ -38,6 +39,9 @@ class GetController extends BaseController { OPERATION_STATUS.IN_PROGRESS, ); + let blockchain; + let contract; + let tokenId; try { const { id } = req.body; @@ -45,7 +49,7 @@ class GetController extends BaseController { throw Error('Requested id is not a UAL.'); } - const { blockchain, contract, tokenId } = this.ualService.resolveUAL(id); + ({ blockchain, contract, tokenId } = this.ualService.resolveUAL(id)); const isValidUal = await this.validationService.validateUal( blockchain, @@ -84,6 +88,7 @@ class GetController extends BaseController { await this.operationIdService.updateOperationIdStatus( operationId, + blockchain, OPERATION_ID_STATUS.GET.GET_INIT_END, ); } catch (error) { @@ -91,6 +96,7 @@ class GetController extends BaseController { await this.operationService.markOperationAsFailed( operationId, + blockchain, 'Unable to get data, Failed to process input data!', ERROR_TYPE.GET.GET_ROUTE_ERROR, ); diff --git a/src/controllers/http-api/v0/local-store-http-api-controller-v0.js b/src/controllers/http-api/v0/local-store-http-api-controller-v0.js index fb94771785..06b6e0385a 100644 --- a/src/controllers/http-api/v0/local-store-http-api-controller-v0.js +++ b/src/controllers/http-api/v0/local-store-http-api-controller-v0.js @@ -20,6 +20,7 @@ class LocalStoreController extends BaseController { await this.operationIdService.updateOperationIdStatus( operationId, + null, OPERATION_ID_STATUS.LOCAL_STORE.LOCAL_STORE_INIT_END, ); diff --git a/src/controllers/http-api/v0/publish-http-api-controller-v0.js b/src/controllers/http-api/v0/publish-http-api-controller-v0.js index 91cce81b6b..dd132f8eac 100644 --- a/src/controllers/http-api/v0/publish-http-api-controller-v0.js +++ b/src/controllers/http-api/v0/publish-http-api-controller-v0.js @@ -17,12 +17,20 @@ class PublishController extends BaseController { } async handleRequest(req, res) { + const { assertion, assertionId, blockchain, contract, tokenId } = req.body; + const hashFunctionId = req.body.hashFunctionId ?? CONTENT_ASSET_HASH_FUNCTION_ID; + + this.logger.info( + `Received asset with assertion id: ${assertionId}, blockchain: ${blockchain}, hub contract: ${contract}, token id: ${tokenId}`, + ); + const operationId = await this.operationIdService.generateOperationId( OPERATION_ID_STATUS.PUBLISH.PUBLISH_START, ); await this.operationIdService.updateOperationIdStatus( operationId, + blockchain, OPERATION_ID_STATUS.PUBLISH.PUBLISH_INIT_START, ); @@ -32,6 +40,7 @@ class PublishController extends BaseController { await this.operationIdService.updateOperationIdStatus( operationId, + blockchain, OPERATION_ID_STATUS.PUBLISH.PUBLISH_INIT_END, ); await this.repositoryModuleManager.createOperationRecord( @@ -41,13 +50,6 @@ class PublishController extends BaseController { ); try { - const { assertion, assertionId, blockchain, contract, tokenId } = req.body; - const hashFunctionId = req.body.hashFunctionId ?? CONTENT_ASSET_HASH_FUNCTION_ID; - - this.logger.info( - `Received asset with assertion id: ${assertionId}, blockchain: ${blockchain}, hub contract: ${contract}, token id: ${tokenId}`, - ); - await this.operationIdService.cacheOperationIdData(operationId, { public: { assertion, @@ -91,6 +93,7 @@ class PublishController extends BaseController { await this.operationService.markOperationAsFailed( operationId, + blockchain, 'Unable to publish data, Failed to process input data!', ERROR_TYPE.PUBLISH.PUBLISH_ROUTE_ERROR, ); diff --git a/src/controllers/http-api/v0/query-http-api-controller-v0.js b/src/controllers/http-api/v0/query-http-api-controller-v0.js index 0a66186e38..79e2455734 100644 --- a/src/controllers/http-api/v0/query-http-api-controller-v0.js +++ b/src/controllers/http-api/v0/query-http-api-controller-v0.js @@ -22,6 +22,7 @@ class QueryController extends BaseController { await this.operationIdService.updateOperationIdStatus( operationId, + null, OPERATION_ID_STATUS.QUERY.QUERY_INIT_END, ); diff --git a/src/controllers/http-api/v0/update-http-api-controller-v0.js b/src/controllers/http-api/v0/update-http-api-controller-v0.js index 17ecfffcb7..104677a889 100644 --- a/src/controllers/http-api/v0/update-http-api-controller-v0.js +++ b/src/controllers/http-api/v0/update-http-api-controller-v0.js @@ -17,12 +17,20 @@ class UpdateController extends BaseController { } async handleRequest(req, res) { + const { assertion, assertionId, blockchain, contract, tokenId } = req.body; + const hashFunctionId = req.body.hashFunctionId ?? CONTENT_ASSET_HASH_FUNCTION_ID; + + this.logger.info( + `Received asset with assertion id: ${assertionId}, blockchain: ${blockchain}, hub contract: ${contract}, token id: ${tokenId}`, + ); + const operationId = await this.operationIdService.generateOperationId( OPERATION_ID_STATUS.UPDATE.UPDATE_START, ); await this.operationIdService.updateOperationIdStatus( operationId, + blockchain, OPERATION_ID_STATUS.UPDATE.UPDATE_INIT_START, ); @@ -32,6 +40,7 @@ class UpdateController extends BaseController { await this.operationIdService.updateOperationIdStatus( operationId, + blockchain, OPERATION_ID_STATUS.UPDATE.UPDATE_INIT_END, ); @@ -42,13 +51,6 @@ class UpdateController extends BaseController { ); try { - const { assertion, assertionId, blockchain, contract, tokenId } = req.body; - const hashFunctionId = req.body.hashFunctionId ?? CONTENT_ASSET_HASH_FUNCTION_ID; - - this.logger.info( - `Received asset with assertion id: ${assertionId}, blockchain: ${blockchain}, hub contract: ${contract}, token id: ${tokenId}`, - ); - await this.operationIdService.cacheOperationIdData(operationId, { public: { assertion, @@ -85,6 +87,7 @@ class UpdateController extends BaseController { await this.operationService.markOperationAsFailed( operationId, + blockchain, 'Unable to update data, Failed to process input data!', ERROR_TYPE.UPDATE.UPDATE_ROUTE_ERROR, ); diff --git a/src/controllers/rpc/rpc-router.js b/src/controllers/rpc/rpc-router.js index 7773e29de2..18bfd4e9a1 100644 --- a/src/controllers/rpc/rpc-router.js +++ b/src/controllers/rpc/rpc-router.js @@ -1,6 +1,8 @@ class RpcRouter { constructor(ctx) { this.networkModuleManager = ctx.networkModuleManager; + this.blockchainModuleManager = ctx.blockchainModuleManager; + this.protocolService = ctx.protocolService; this.logger = ctx.logger; @@ -21,11 +23,26 @@ class RpcRouter { const operation = this.protocolService.toOperation(protocol); const handleRequest = `${version}HandleRequest`; const controller = `${operation}RpcController`; + const blockchainImplementations = this.blockchainModuleManager.getImplementationNames(); + + this.networkModuleManager.handleMessage(protocol, (message, remotePeerId) => { + const modifiedMessage = this.modifyMessage(message, blockchainImplementations); + this[controller][handleRequest](modifiedMessage, remotePeerId, protocol); + }); + } + } - this.networkModuleManager.handleMessage(protocol, (message, remotePeerId) => - this[controller][handleRequest](message, remotePeerId, protocol), - ); + modifyMessage(message, blockchainImplementations) { + const modifiedMessage = message; + if (modifiedMessage.data.blockchain?.split(':').length === 1) { + for (const implementation of blockchainImplementations) { + if (implementation.split(':')[0] === modifiedMessage.data.blockchain) { + modifiedMessage.data.blockchain = implementation; + break; + } + } } + return modifiedMessage; } } diff --git a/src/migration/migration-executor.js b/src/migration/migration-executor.js index 1c505c7216..c639c10b47 100644 --- a/src/migration/migration-executor.js +++ b/src/migration/migration-executor.js @@ -1,3 +1,4 @@ +import path from 'path'; import { NODE_ENVIRONMENTS } from '../constants/constants.js'; import PullBlockchainShardingTableMigration from './pull-sharding-table-migration.js'; import PrivateAssetsMetadataMigration from './private-assets-metadata-migration.js'; @@ -11,6 +12,8 @@ import PendingStorageMigration from './pending-storage-migration.js'; import MarkOldBlockchainEventsAsProcessedMigration from './mark-old-blockchain-events-as-processed-migration.js'; import ServiceAgreementsDataInspector from './service-agreements-data-inspector.js'; import ServiceAgreementsInvalidDataMigration from './service-agreements-invalid-data-migration.js'; +import UalExtensionUserConfigurationMigration from './ual-extension-user-configuration-migration.js'; +import UalExtensionTripleStoreMigration from './ual-extension-triple-store-migration.js'; class MigrationExecutor { static async executePullShardingTableMigration(container, logger, config) { @@ -25,7 +28,7 @@ class MigrationExecutor { const validationModuleManager = container.resolve('validationModuleManager'); const migration = new PullBlockchainShardingTableMigration( - 'pullShardingTableMigrationV612', + 'pullShardingTableMigrationV613', logger, config, repositoryModuleManager, @@ -289,9 +292,63 @@ class MigrationExecutor { } } + static async executeUalExtensionUserConfigurationMigration(logger, config) { + if ( + process.env.NODE_ENV === NODE_ENVIRONMENTS.DEVELOPMENT || + process.env.NODE_ENV === NODE_ENVIRONMENTS.TEST + ) + return; + + const migration = new UalExtensionUserConfigurationMigration( + 'ualExtensionUserConfigurationMigration', + logger, + config, + ); + if (!(await migration.migrationAlreadyExecuted())) { + await migration.migrate(); + logger.info('Node will now restart!'); + this.exitNode(1); + } + } + + static async executeUalExtensionTripleStoreMigration(container, logger, config) { + if ( + process.env.NODE_ENV === NODE_ENVIRONMENTS.DEVELOPMENT || + process.env.NODE_ENV === NODE_ENVIRONMENTS.TEST + ) + return; + + const tripleStoreService = container.resolve('tripleStoreService'); + + const migration = new UalExtensionTripleStoreMigration( + 'ualExtensionTripleStoreMigration', + logger, + config, + tripleStoreService, + ); + if (!(await migration.migrationAlreadyExecuted())) { + try { + await migration.migrate(); + } catch (error) { + logger.error( + `Unable to execute ual extension triple store migration. Error: ${error.message}`, + ); + this.exitNode(1); + } + } + } + static exitNode(code = 0) { process.exit(code); } + + static async migrationAlreadyExecuted(migrationName, fileService) { + const migrationFilePath = path.join(fileService.getMigrationFolderPath(), migrationName); + if (await fileService.pathExists(migrationFilePath)) { + return true; + } + return false; + } } export default MigrationExecutor; diff --git a/src/migration/network-private-key-migration.js b/src/migration/network-private-key-migration.js index c95fbe1f95..70a18b1e8e 100644 --- a/src/migration/network-private-key-migration.js +++ b/src/migration/network-private-key-migration.js @@ -10,7 +10,11 @@ class NetworkPrivateKeyMigration extends BaseMigration { if (networkPrivateKey) { let directoryPath; - if (process.env.NODE_ENV === 'testnet' || process.env.NODE_ENV === 'mainnet') { + if ( + process.env.NODE_ENV === 'testnet' || + process.env.NODE_ENV === 'mainnet' || + process.env.NODE_ENV === 'devnet' + ) { directoryPath = join( appRootPath.path, '..', diff --git a/src/migration/ual-extension-triple-store-migration.js b/src/migration/ual-extension-triple-store-migration.js new file mode 100644 index 0000000000..4709c6133b --- /dev/null +++ b/src/migration/ual-extension-triple-store-migration.js @@ -0,0 +1,95 @@ +/* eslint-disable no-await-in-loop */ +import BaseMigration from './base-migration.js'; +import { TRIPLE_STORE_REPOSITORIES } from '../constants/constants.js'; + +const CHAIN_IDS = { + development: 31337, + test: 31337, + devnet: 2160, + testnet: 20430, + mainnet: 2043, +}; +const chainId = CHAIN_IDS[process.env.NODE_ENV]; + +class UalExtensionTripleStoreMigration extends BaseMigration { + constructor(migrationName, logger, config, tripleStoreService) { + super(migrationName, logger, config); + this.tripleStoreService = tripleStoreService; + } + + async executeMigration() { + const oldBlockchainId = this.getOldBlockchainId(); + const newBlockchainId = `${oldBlockchainId}:${chainId}`; + + const chunkSize = 10000; + + for (const repository in TRIPLE_STORE_REPOSITORIES) { + const getUalListQuery = ` + PREFIX schema: + SELECT DISTINCT ?subject ?object + WHERE { + ?subject schema:assertion ?object . + }`; + + const ualList = await this.tripleStoreService.select( + TRIPLE_STORE_REPOSITORIES[repository], + getUalListQuery, + ); + + this.logger.info( + `Ual extension triple store migration: found ${ualList.length} distinct UALs in ${repository}`, + ); + const subjectsSet = new Set(ualList.map((item) => item.subject)); + const newTriples = []; + for (const { subject: ual, object: assertionId } of ualList) { + if (assertionId.startsWith('assertion:')) { + let newUal; + if (ual.includes(newBlockchainId)) { + newUal = ual.replace(newBlockchainId, oldBlockchainId); + } else { + newUal = ual.replace(oldBlockchainId, newBlockchainId); + } + if (!subjectsSet.has(newUal)) { + newTriples.push(`<${newUal}> schema:assertion <${assertionId}>`); + } + } + } + + while (newTriples.length) { + const triplesForInsert = newTriples.splice(0, chunkSize); + const insertQuery = ` + PREFIX schema: + INSERT DATA { + GRAPH { + ${triplesForInsert.join(' .\n')} + } + }`; + await this.tripleStoreService.queryVoid( + TRIPLE_STORE_REPOSITORIES[repository], + insertQuery, + ); + this.logger.info( + `Inserted ${triplesForInsert.length} triples, left for insert: ${newTriples.length} repository: ${repository}`, + ); + } + this.logger.info(`Finished processing of UALs in repository: ${repository}`); + } + } + + getOldBlockchainId() { + let oldBlockchainId; + if (this.config.modules.blockchain.implementation) { + for (const implementationName in this.config.modules.blockchain.implementation) { + if (this.config.modules.blockchain.implementation[implementationName].enabled) { + oldBlockchainId = implementationName; + } + } + } + if (!oldBlockchainId) { + throw Error('Unable to find old blockchain id in configuration'); + } + return oldBlockchainId.split(':')[0]; + } +} + +export default UalExtensionTripleStoreMigration; diff --git a/src/migration/ual-extension-user-configuration-migration.js b/src/migration/ual-extension-user-configuration-migration.js new file mode 100644 index 0000000000..5d0c74f570 --- /dev/null +++ b/src/migration/ual-extension-user-configuration-migration.js @@ -0,0 +1,71 @@ +import appRootPath from 'app-root-path'; +import path from 'path'; +import BaseMigration from './base-migration.js'; + +const CHAIN_IDS = { + development: 31337, + test: 31337, + devnet: 2160, + testnet: 20430, + mainnet: 2043, +}; +const chainId = CHAIN_IDS[process.env.NODE_ENV]; + +class UalExtensionUserConfigurationMigration extends BaseMigration { + constructor(migrationName, logger, config, repositoryModuleManager) { + super(migrationName, logger, config); + this.repositoryModuleManager = repositoryModuleManager; + } + + async executeMigration() { + const configurationFolderPath = path.join(appRootPath.path, '..'); + const configurationFilePath = path.join( + configurationFolderPath, + this.config.configFilename, + ); + + const userConfiguration = await this.fileService.readFile(configurationFilePath, true); + + const oldBlockchainId = this.getOldBlockchainId(userConfiguration); + + if (this.blockchainIdInNewFormat(oldBlockchainId)) { + this.logger.info( + 'Blockchain id in user configuration already updated to be in new format, migration will be skipped', + ); + return null; + } + + const newBlockchainId = `${oldBlockchainId}:${chainId}`; + userConfiguration.modules.blockchain.defaultImplementation = newBlockchainId; + userConfiguration.modules.blockchain.implementation[newBlockchainId] = + userConfiguration.modules.blockchain.implementation[oldBlockchainId]; + userConfiguration.modules.blockchain.implementation[newBlockchainId].enabled = true; + delete userConfiguration.modules.blockchain.implementation[oldBlockchainId]; + await this.fileService.writeContentsToFile( + configurationFolderPath, + this.config.configFilename, + JSON.stringify(userConfiguration, null, 4), + ); + } + + blockchainIdInNewFormat(blockchainId) { + return blockchainId.includes(':'); + } + + getOldBlockchainId(userConfiguration) { + let oldBlockchainId; + if (userConfiguration.modules.blockchain.implementation) { + for (const implementationName in userConfiguration.modules.blockchain.implementation) { + if (implementationName.includes('otp')) { + oldBlockchainId = implementationName; + } + } + } + if (!oldBlockchainId) { + throw Error('Unable to find old blockchain id in user configuration'); + } + return oldBlockchainId; + } +} + +export default UalExtensionUserConfigurationMigration; diff --git a/src/modules/blockchain/blockchain-module-manager.js b/src/modules/blockchain/blockchain-module-manager.js index bf94cc5e2d..d7b8b98c19 100644 --- a/src/modules/blockchain/blockchain-module-manager.js +++ b/src/modules/blockchain/blockchain-module-manager.js @@ -393,10 +393,8 @@ class BlockchainModuleManager extends BaseModuleManager { callImplementationFunction(blockchain, functionName, args = []) { if (blockchain) { - const split = blockchain.split(':'); - const [name] = split; - if (this.getImplementation(name)) { - return this.getImplementation(name).module[functionName](...args); + if (this.getImplementation(blockchain)) { + return this.getImplementation(blockchain).module[functionName](...args); } } else { return this.getImplementation().module[functionName](...args); diff --git a/src/modules/blockchain/implementation/gnosis/gnosis-service.js b/src/modules/blockchain/implementation/gnosis/gnosis-service.js new file mode 100644 index 0000000000..4c74dbb03b --- /dev/null +++ b/src/modules/blockchain/implementation/gnosis/gnosis-service.js @@ -0,0 +1,34 @@ +import axios from 'axios'; +import Web3Service from '../web3-service.js'; +import { BLOCK_TIME_MILLIS } from '../../../../constants/constants.js'; + +class GnosisService extends Web3Service { + constructor(ctx) { + super(ctx); + + this.baseTokenTicker = 'GNO'; + this.tracTicker = 'TRAC'; + } + + getBlockTimeMillis() { + return BLOCK_TIME_MILLIS.GNOSIS; + } + + async getGasPrice() { + try { + const response = await axios.get(this.config.gasPriceOracleLink); + let gasPrice; + if (this.config.name.split(':')[1] === '100') { + gasPrice = Number(response.result, 10); + } else if (this.config.name.split(':')[1] === '10200') { + gasPrice = Math.round(response.average * 1e9); + } + this.logger.debug(`Gas price on Gnosis: ${gasPrice}`); + return gasPrice; + } catch (error) { + return undefined; + } + } +} + +export default GnosisService; diff --git a/src/modules/blockchain/implementation/web3-service.js b/src/modules/blockchain/implementation/web3-service.js index dd0472aee6..4e41f9b2cd 100644 --- a/src/modules/blockchain/implementation/web3-service.js +++ b/src/modules/blockchain/implementation/web3-service.js @@ -114,9 +114,13 @@ class Web3Service { stallTimeout: RPC_PROVIDER_STALL_TIMEOUT, }); - this.logger.debug(`Connected to the blockchain RPC: ${rpcEndpoint}.`); + this.logger.debug( + `Connected to the blockchain RPC: ${this.maskRpcUrl(rpcEndpoint)}.`, + ); } catch (e) { - this.logger.warn(`Unable to connect to the blockchain RPC: ${rpcEndpoint}.`); + this.logger.warn( + `Unable to connect to the blockchain RPC: ${this.maskRpcUrl(rpcEndpoint)}.`, + ); } } @@ -214,7 +218,7 @@ class Web3Service { ); this.logger.debug( `${functionName}(${inputs}) ${method} has failed; Error: ${decodedErrorData}; ` + - `RPC: ${info.backend.provider.connection.url}.`, + `RPC: ${this.maskRpcUrl(info.backend.provider.connection.url)}.`, ); } else if (info.backend.result !== undefined) { let message = `${functionName}(${inputs}) ${method} has been successfully executed; `; @@ -234,7 +238,7 @@ class Web3Service { } } - message += `RPC: ${info.backend.provider.connection.url}.`; + message += `RPC: ${this.maskRpcUrl(info.backend.provider.connection.url)}.`; this.logger.debug(message); } @@ -242,6 +246,13 @@ class Web3Service { }); } + maskRpcUrl(url) { + if (url.includes('apiKey')) { + return url.split('apiKey')[0]; + } + return url; + } + initializeAssetStorageContract(assetStorageAddress) { this.assetStorageContracts[assetStorageAddress.toLowerCase()] = new ethers.Contract( assetStorageAddress, diff --git a/src/modules/http-client/http-client-module-manager.js b/src/modules/http-client/http-client-module-manager.js index aef322cf6d..adbbb364d2 100644 --- a/src/modules/http-client/http-client-module-manager.js +++ b/src/modules/http-client/http-client-module-manager.js @@ -52,9 +52,12 @@ class HttpClientModuleManager extends BaseModuleManager { } } - initializeBeforeMiddlewares() { + initializeBeforeMiddlewares(blockchainImpelemntations) { if (this.initialized) { - return this.getImplementation().module.initializeBeforeMiddlewares(this.authService); + return this.getImplementation().module.initializeBeforeMiddlewares( + this.authService, + blockchainImpelemntations, + ); } } diff --git a/src/modules/http-client/implementation/express-http-client.js b/src/modules/http-client/implementation/express-http-client.js index cd37b698c2..c6a75edc9a 100644 --- a/src/modules/http-client/implementation/express-http-client.js +++ b/src/modules/http-client/implementation/express-http-client.js @@ -7,6 +7,7 @@ import requestValidationMiddleware from './middleware/request-validation-middlew import rateLimiterMiddleware from './middleware/rate-limiter-middleware.js'; import authenticationMiddleware from './middleware/authentication-middleware.js'; import authorizationMiddleware from './middleware/authorization-middleware.js'; +import blockchainIdMiddleware from './middleware/blockchain-id-midleware.js'; import { BYTES_IN_MEGABYTE, MAX_FILE_SIZE } from '../../../constants/constants.js'; class ExpressHttpClient { @@ -66,11 +67,12 @@ class ExpressHttpClient { return middlewares; } - initializeBeforeMiddlewares(authService) { + initializeBeforeMiddlewares(authService, blockchainImplementations) { this._initializeCorsMiddleware(); this.app.use(authenticationMiddleware(authService)); this.app.use(authorizationMiddleware(authService)); this._initializeBaseMiddlewares(); + this.app.use(blockchainIdMiddleware(blockchainImplementations)); } initializeAfterMiddlewares() { diff --git a/src/modules/http-client/implementation/middleware/blockchain-id-midleware.js b/src/modules/http-client/implementation/middleware/blockchain-id-midleware.js new file mode 100644 index 0000000000..42d6759ef9 --- /dev/null +++ b/src/modules/http-client/implementation/middleware/blockchain-id-midleware.js @@ -0,0 +1,30 @@ +function addBlockchainId(blockchain, blockchainImplementations) { + let updatedBlockchain = blockchain; + + if (blockchain?.split(':').length === 1) { + for (const implementation of blockchainImplementations) { + if (implementation.split(':')[0] === blockchain) { + updatedBlockchain = implementation; + break; + } + } + } + + return updatedBlockchain; +} + +export default function blockchainIdMiddleware(blockchainImplementations) { + return (req, res, next) => { + if (req.method === 'GET') + req.query.blockchain = addBlockchainId(req.query.blockchain, blockchainImplementations); + else if (Array.isArray(req.body)) { + for (const element of req.body) { + element.blockchain = addBlockchainId(element.blockchain, blockchainImplementations); + } + } else { + req.body.blockchain = addBlockchainId(req.body.blockchain, blockchainImplementations); + } + + next(); + }; +} diff --git a/src/modules/network/implementation/libp2p-service.js b/src/modules/network/implementation/libp2p-service.js index da50372d0a..385d9be40e 100644 --- a/src/modules/network/implementation/libp2p-service.js +++ b/src/modules/network/implementation/libp2p-service.js @@ -123,7 +123,7 @@ class Libp2pService { getKeyPath() { let directoryPath; - if (process.env.NODE_ENV === 'testnet' || process.env.NODE_ENV === 'mainnet') { + if (!devEnvironment) { directoryPath = join( appRootPath.path, '..', diff --git a/src/modules/repository/implementation/sequelize/migrations/20231201140100-event-add-blockchain-id.js b/src/modules/repository/implementation/sequelize/migrations/20231201140100-event-add-blockchain-id.js new file mode 100644 index 0000000000..c785da1e05 --- /dev/null +++ b/src/modules/repository/implementation/sequelize/migrations/20231201140100-event-add-blockchain-id.js @@ -0,0 +1,9 @@ +export async function up({ context: { queryInterface, Sequelize } }) { + await queryInterface.addColumn('event', 'blockchain_id', { + type: Sequelize.STRING, + }); +} + +export async function down({ context: { queryInterface } }) { + await queryInterface.removeColumn('event', 'blockchain_id'); +} diff --git a/src/modules/repository/implementation/sequelize/migrations/20233010122500-update-blockchain-id.js b/src/modules/repository/implementation/sequelize/migrations/20233010122500-update-blockchain-id.js new file mode 100644 index 0000000000..4074736ed8 --- /dev/null +++ b/src/modules/repository/implementation/sequelize/migrations/20233010122500-update-blockchain-id.js @@ -0,0 +1,44 @@ +const CHAIN_IDS = { + development: 31337, + test: 31337, + devnet: 2160, + testnet: 20430, + mainnet: 2043, +}; +const chainId = CHAIN_IDS[process.env.NODE_ENV]; + +export async function up({ context: { queryInterface } }) { + await queryInterface.sequelize.query(` + update shard set blockchain_id='otp:${chainId}' + `); + + await queryInterface.sequelize.query(` + update service_agreement set blockchain_id='otp:${chainId}' + `); + + await queryInterface.sequelize.query(` + update blockchain_event set blockchain_id='otp:${chainId}' + `); + + await queryInterface.sequelize.query(` + update blockchain set blockchain_id='otp:${chainId}' + `); +} + +export async function down({ context: { queryInterface } }) { + await queryInterface.sequelize.query(` + update shard set blockchain_id='otp' + `); + + await queryInterface.sequelize.query(` + update service_agreement set blockchain_id='otp' + `); + + await queryInterface.sequelize.query(` + update blockchain_event set blockchain_id='otp' + `); + + await queryInterface.sequelize.query(` + update blockchain set blockchain_id='otp' + `); +} diff --git a/src/modules/repository/implementation/sequelize/migrations/20233011121700-remove-blockchain-info.js b/src/modules/repository/implementation/sequelize/migrations/20233011121700-remove-blockchain-info.js new file mode 100644 index 0000000000..f1128be5fd --- /dev/null +++ b/src/modules/repository/implementation/sequelize/migrations/20233011121700-remove-blockchain-info.js @@ -0,0 +1,10 @@ +const chiadoBlockchainId = 'gnosis:10200'; + +export async function up({ context: { queryInterface } }) { + await queryInterface.sequelize.query(` + delete from blockchain where blockchain_id='${chiadoBlockchainId}' + `); +} + +// eslint-disable-next-line no-empty-function +export async function down() {} diff --git a/src/modules/repository/implementation/sequelize/models/event.js b/src/modules/repository/implementation/sequelize/models/event.js index 77de650a78..d4f8b4db45 100644 --- a/src/modules/repository/implementation/sequelize/models/event.js +++ b/src/modules/repository/implementation/sequelize/models/event.js @@ -8,6 +8,7 @@ export default (sequelize, DataTypes) => { autoIncrement: true, }, operationId: DataTypes.UUID, + blockchainId: DataTypes.STRING, name: DataTypes.STRING, timestamp: DataTypes.STRING, value1: DataTypes.TEXT, diff --git a/src/modules/repository/implementation/sequelize/repositories/blockchain-event-repository.js b/src/modules/repository/implementation/sequelize/repositories/blockchain-event-repository.js index 151f221ddc..c03087cadb 100644 --- a/src/modules/repository/implementation/sequelize/repositories/blockchain-event-repository.js +++ b/src/modules/repository/implementation/sequelize/repositories/blockchain-event-repository.js @@ -23,9 +23,10 @@ class BlockchainEventRepository { return inserted.map((event) => event.dataValues); } - async getAllUnprocessedBlockchainEvents(eventNames) { + async getAllUnprocessedBlockchainEvents(eventNames, blockchainId) { return this.model.findAll({ where: { + blockchainId, processed: false, event: { [Sequelize.Op.in]: eventNames }, }, diff --git a/src/modules/repository/implementation/sequelize/repositories/event-repository.js b/src/modules/repository/implementation/sequelize/repositories/event-repository.js index ba2a618b6f..276f83ce52 100644 --- a/src/modules/repository/implementation/sequelize/repositories/event-repository.js +++ b/src/modules/repository/implementation/sequelize/repositories/event-repository.js @@ -11,9 +11,10 @@ class EventRepository { this.model = models.event; } - async createEventRecord(operationId, name, timestamp, value1, value2, value3) { + async createEventRecord(operationId, blockchainId, name, timestamp, value1, value2, value3) { return this.model.create({ operationId, + blockchainId, name, timestamp, value1, diff --git a/src/modules/repository/repository-module-manager.js b/src/modules/repository/repository-module-manager.js index 5cf4a83153..0a58b7570a 100644 --- a/src/modules/repository/repository-module-manager.js +++ b/src/modules/repository/repository-module-manager.js @@ -206,6 +206,7 @@ class RepositoryModuleManager extends BaseModuleManager { async createEventRecord( operationId, + blockchainId, name, timestamp, value1 = null, @@ -214,6 +215,7 @@ class RepositoryModuleManager extends BaseModuleManager { ) { return this.getRepository('event').createEventRecord( operationId, + blockchainId, name, timestamp, value1, @@ -250,8 +252,11 @@ class RepositoryModuleManager extends BaseModuleManager { return this.getRepository('blockchain_event').insertBlockchainEvents(events); } - async getAllUnprocessedBlockchainEvents(eventNames) { - return this.getRepository('blockchain_event').getAllUnprocessedBlockchainEvents(eventNames); + async getAllUnprocessedBlockchainEvents(eventNames, blockchainId) { + return this.getRepository('blockchain_event').getAllUnprocessedBlockchainEvents( + eventNames, + blockchainId, + ); } async markBlockchainEventsAsProcessed(events) { diff --git a/src/service/blockchain-event-listener-service.js b/src/service/blockchain-event-listener-service.js index 29d63ff71a..6e3f2a9d84 100644 --- a/src/service/blockchain-event-listener-service.js +++ b/src/service/blockchain-event-listener-service.js @@ -47,7 +47,7 @@ class BlockchainEventListenerService { process.env.NODE_ENV === NODE_ENVIRONMENTS.DEVELOPMENT || process.env.NODE_ENV === NODE_ENVIRONMENTS.TEST; - const currentBlock = await this.blockchainModuleManager.getBlockNumber(); + const currentBlock = await this.blockchainModuleManager.getBlockNumber(blockchainId); const syncContractEventsPromises = [ this.getContractEvents( blockchainId, @@ -93,7 +93,10 @@ class BlockchainEventListenerService { } const contractEvents = await Promise.all(syncContractEventsPromises); - await this.handleBlockchainEvents(contractEvents.flatMap((events) => events)); + await this.handleBlockchainEvents( + contractEvents.flatMap((events) => events), + blockchainId, + ); } listenOnBlockchainEvents(blockchainId) { @@ -162,18 +165,25 @@ class BlockchainEventListenerService { return events; } - async handleBlockchainEvents(events) { + async handleBlockchainEvents(events, blockchainId) { const eventsForProcessing = events.filter((event) => eventNames.includes(event.event)); if (eventsForProcessing?.length) { - this.logger.trace(`${eventsForProcessing.length} blockchain events caught.`); + this.logger.trace( + `${eventsForProcessing.length} blockchain events caught on blockchain ${blockchainId}.`, + ); await this.repositoryModuleManager.insertBlockchainEvents(eventsForProcessing); } const unprocessedEvents = - await this.repositoryModuleManager.getAllUnprocessedBlockchainEvents(eventNames); + await this.repositoryModuleManager.getAllUnprocessedBlockchainEvents( + eventNames, + blockchainId, + ); if (unprocessedEvents?.length) { - this.logger.trace(`Processing ${unprocessedEvents.length} blockchain events.`); + this.logger.trace( + `Processing ${unprocessedEvents.length} blockchain events on blockchain ${blockchainId}.`, + ); let groupedEvents = {}; let currentBlock = 0; for (const event of unprocessedEvents) { diff --git a/src/service/file-service.js b/src/service/file-service.js index 7d92ce8a84..bc5b60098a 100644 --- a/src/service/file-service.js +++ b/src/service/file-service.js @@ -104,7 +104,11 @@ class FileService { } getDataFolderPath() { - if (process.env.NODE_ENV === 'testnet' || process.env.NODE_ENV === 'mainnet') { + if ( + process.env.NODE_ENV === 'testnet' || + process.env.NODE_ENV === 'mainnet' || + process.env.NODE_ENV === 'devnet' + ) { return path.join(appRootPath.path, '..', this.config.appDataPath); } return path.join(appRootPath.path, this.config.appDataPath); diff --git a/src/service/get-service.js b/src/service/get-service.js index af8ef60b8c..97c26ecc0c 100644 --- a/src/service/get-service.js +++ b/src/service/get-service.js @@ -26,6 +26,7 @@ class GetService extends OperationService { async processResponse(command, responseStatus, responseData) { const { operationId, + blockchain, numberOfFoundNodes, leftoverNodes, keyword, @@ -64,6 +65,7 @@ class GetService extends OperationService { ) { await this.markOperationAsCompleted( operationId, + blockchain, { assertion: responseData.nquads }, this.completedStatuses, ); @@ -80,6 +82,7 @@ class GetService extends OperationService { ); await this.markOperationAsCompleted( operationId, + blockchain, { message: 'Unable to find assertion on the network!', }, diff --git a/src/service/operation-id-service.js b/src/service/operation-id-service.js index 3e714c2a75..8331c067ea 100644 --- a/src/service/operation-id-service.js +++ b/src/service/operation-id-service.js @@ -38,9 +38,11 @@ class OperationIdService { async updateOperationIdStatusWithValues( operationId, + blockchain, status, value1 = null, value2 = null, + value3 = null, timestamp = Date.now(), ) { const response = { @@ -48,12 +50,18 @@ class OperationIdService { timestamp, }; - this.emitChangeEvent(status, operationId, value1, value2, null, timestamp); + this.emitChangeEvent(status, operationId, blockchain, value1, value2, value3, timestamp); await this.repositoryModuleManager.updateOperationIdRecord(response, operationId); } - async updateOperationIdStatus(operationId, status, errorMessage = null, errorType = null) { + async updateOperationIdStatus( + operationId, + blockchain, + status, + errorMessage = null, + errorType = null, + ) { const response = { status, }; @@ -64,7 +72,7 @@ class OperationIdService { await this.removeOperationIdCache(operationId); } - this.emitChangeEvent(status, operationId, errorMessage, errorType); + this.emitChangeEvent(status, operationId, blockchain, errorMessage, errorType); await this.repositoryModuleManager.updateOperationIdRecord(response, operationId); } @@ -72,6 +80,7 @@ class OperationIdService { emitChangeEvent( status, operationId, + blockchainId = null, value1 = null, value2 = null, value3 = null, @@ -82,6 +91,7 @@ class OperationIdService { const eventData = { lastEvent: status, operationId, + blockchainId, timestamp, value1, value2, diff --git a/src/service/operation-service.js b/src/service/operation-service.js index 13f4d64285..c2897d7222 100644 --- a/src/service/operation-service.js +++ b/src/service/operation-service.js @@ -59,7 +59,7 @@ class OperationService { return keywordsStatuses; } - async markOperationAsCompleted(operationId, responseData, endStatuses) { + async markOperationAsCompleted(operationId, blockchain, responseData, endStatuses) { this.logger.info(`Finalizing ${this.operationName} for operationId: ${operationId}`); await this.repositoryModuleManager.updateOperationStatus( @@ -74,11 +74,11 @@ class OperationService { for (const status of endStatuses) { // eslint-disable-next-line no-await-in-loop - await this.operationIdService.updateOperationIdStatus(operationId, status); + await this.operationIdService.updateOperationIdStatus(operationId, blockchain, status); } } - async markOperationAsFailed(operationId, message, errorType) { + async markOperationAsFailed(operationId, blockchain, message, errorType) { this.logger.info(`${this.operationName} for operationId: ${operationId} failed.`); await this.repositoryModuleManager.updateOperationStatus( @@ -89,6 +89,7 @@ class OperationService { await this.operationIdService.updateOperationIdStatus( operationId, + blockchain, OPERATION_ID_STATUS.FAILED, message, errorType, diff --git a/src/service/publish-service.js b/src/service/publish-service.js index 12b16edbf2..197efc4fb5 100644 --- a/src/service/publish-service.js +++ b/src/service/publish-service.js @@ -27,6 +27,7 @@ class PublishService extends OperationService { async processResponse(command, responseStatus, responseData, errorMessage = null) { const { operationId, + blockchain, numberOfFoundNodes, leftoverNodes, keyword, @@ -71,7 +72,12 @@ class PublishService extends OperationService { } } if (allCompleted) { - await this.markOperationAsCompleted(operationId, null, this.completedStatuses); + await this.markOperationAsCompleted( + operationId, + blockchain, + null, + this.completedStatuses, + ); this.logResponsesSummary(completedNumber, failedNumber); this.logger.info( `${this.operationName} with operation id: ${operationId} with status: ${ @@ -86,6 +92,7 @@ class PublishService extends OperationService { if (leftoverNodes.length === 0) { await this.markOperationAsFailed( operationId, + blockchain, 'Not replicated to enough nodes!', this.errorType, ); diff --git a/src/service/triple-store-service.js b/src/service/triple-store-service.js index f1a9ab03bc..085acb8f19 100644 --- a/src/service/triple-store-service.js +++ b/src/service/triple-store-service.js @@ -1,6 +1,6 @@ import { formatAssertion } from 'assertion-tools'; -import { SCHEMA_CONTEXT } from '../constants/constants.js'; +import { SCHEMA_CONTEXT, TRIPLE_STORE_REPOSITORIES } from '../constants/constants.js'; class TripleStoreService { constructor(ctx) { @@ -47,12 +47,23 @@ class TripleStoreService { keyword, }); + const oldUalConnection = await formatAssertion({ + '@context': SCHEMA_CONTEXT, + '@id': this.ualService.getUalWithoutChainId(ual, blockchain), + assertion: { '@id': `assertion:${assertionId}` }, + }); + await Promise.all([ this.tripleStoreModuleManager.insertAssetAssertionMetadata( this.repositoryImplementations[repository], repository, currentAssetNquads.join('\n'), ), + this.tripleStoreModuleManager.insertAssetAssertionMetadata( + this.repositoryImplementations[repository], + repository, + oldUalConnection.join('\n'), + ), this.tripleStoreModuleManager.insertAssertion( this.repositoryImplementations[repository], repository, @@ -179,6 +190,11 @@ class TripleStoreService { repository, ual, ); + await this.tripleStoreModuleManager.deleteAssetMetadata( + this.repositoryImplementations[repository], + repository, + this.ualService.getUalWithoutChainId(ual, blockchain), + ); // Delete assertions that were linked only to this Knowledge Asset for (const linkedAssertionId of linkedAssertionIds) { @@ -212,8 +228,13 @@ class TripleStoreService { repository, assertionId, ); - - return this.dataService.parseBindings(bindings); + const count = this.dataService.parseBindings(bindings); + if (count > 1) { + // since 6.1.0 in asset metadata we are storing two triples connected to assertion id + // using 2 formats of ual - so we can expect that this query returns 2 triples per asset + return Math.round(count / 2); + } + return count; } async getAssertion(repository, assertionId) { @@ -374,6 +395,21 @@ class TripleStoreService { query, ); } + + async queryVoidAllRepositories(query) { + const queryPromises = []; + for (const repository in TRIPLE_STORE_REPOSITORIES) { + queryPromises.push( + this.tripleStoreModuleManager.queryVoid( + this.repositoryImplementations[repository], + TRIPLE_STORE_REPOSITORIES[repository], + query, + ), + ); + } + + return Promise.all(queryPromises); + } } export default TripleStoreService; diff --git a/src/service/ual-service.js b/src/service/ual-service.js index 4119e18f74..f3f2b35266 100644 --- a/src/service/ual-service.js +++ b/src/service/ual-service.js @@ -12,15 +12,25 @@ class UALService { // did:dkg:otp:2043/0x123231/5 isUAL(ual) { + if (!ual.startsWith('did:dkg:')) return false; const parts = ual.replace('did:', '').replace('dkg:', '').split('/'); if (parts.length === 3) { // eslint-disable-next-line no-restricted-globals - return this.isContract(parts[1]) && !isNaN(Number(parts[2])); + return this.isContract(parts[1]) && !Number.isNaN(Number(parts[2])); } if (parts.length === 2) { const parts2 = parts[0].split(':'); // eslint-disable-next-line no-restricted-globals - return parts2.length === 2 && this.isContract(parts2[1]) && !isNaN(Number(parts[1])); + if (parts2.length === 3) { + return ( + parts2.length === 2 && + this.isContract(parts2[2]) && + !Number.isNaN(Number(parts[1])) + ); + } + return ( + parts2.length === 2 && this.isContract(parts2[1]) && !Number.isNaN(Number(parts[1])) + ); } } @@ -31,15 +41,40 @@ class UALService { if (!this.isContract(contract)) { throw new Error(`Invalid contract format: ${contract}`); } - return { blockchain: parts[0], contract, tokenId: Number(parts[2]) }; + let blockchainName = parts[0]; + if (blockchainName.split(':').length === 1) { + for (const implementation of this.blockchainModuleManager.getImplementationNames()) { + if (implementation.split(':')[0] === blockchainName) { + blockchainName = implementation; + break; + } + } + } + return { blockchain: blockchainName, contract, tokenId: Number(parts[2]) }; } if (parts.length === 2) { const parts2 = parts[0].split(':'); - const contract = parts2[1]; - if (!this.isContract(contract)) { - throw new Error(`Invalid contract format: ${contract}`); + if (parts2.length === 3) { + const contract = parts2[2]; + if (!this.isContract(contract)) { + throw new Error(`Invalid contract format: ${contract}`); + } + return { blockchain: parts2[0] + parts2[1], contract, tokenId: Number(parts[1]) }; + } + if (parts2.length === 2) { + let blockchainWithId; + for (const implementation of this.blockchainModuleManager.getImplementationNames()) { + if (implementation.split(':')[0] === blockchainWithId) { + blockchainWithId = implementation; + break; + } + } + const contract = parts2[1]; + if (!this.isContract(contract)) { + throw new Error(`Invalid contract format: ${contract}`); + } + return { blockchain: blockchainWithId, contract, tokenId: Number(parts[1]) }; } - return { blockchain: parts2[0], contract, tokenId: Number(parts[1]) }; } throw new Error(`UAL doesn't have correct format: ${ual}`); @@ -65,6 +100,15 @@ class UALService { [contract, firstAssertionId], ); } + + getUalWithoutChainId(ual, blockchain) { + const blockchainParts = blockchain.split(':'); + + if (ual.includes(blockchain)) { + return ual.replace(blockchain, blockchainParts[0]); + } + return ual; + } } export default UALService; diff --git a/src/service/update-service.js b/src/service/update-service.js index 758e4de96d..496f71e74d 100644 --- a/src/service/update-service.js +++ b/src/service/update-service.js @@ -27,6 +27,7 @@ class UpdateService extends OperationService { async processResponse(command, responseStatus, responseData, errorMessage = null) { const { operationId, + blockchain, numberOfFoundNodes, leftoverNodes, keyword, @@ -71,7 +72,12 @@ class UpdateService extends OperationService { } } if (allCompleted) { - await this.markOperationAsCompleted(operationId, null, this.completedStatuses); + await this.markOperationAsCompleted( + operationId, + blockchain, + null, + this.completedStatuses, + ); this.logResponsesSummary(completedNumber, failedNumber); this.logger.info( `${this.operationName} with operation id: ${operationId} with status: ${ @@ -86,6 +92,7 @@ class UpdateService extends OperationService { if (leftoverNodes.length === 0) { await this.markOperationAsFailed( operationId, + blockchain, 'Not replicated to enough nodes!', this.errorType, ); diff --git a/src/service/validation-service.js b/src/service/validation-service.js index 0786db76d0..a841a4265d 100644 --- a/src/service/validation-service.js +++ b/src/service/validation-service.js @@ -1,5 +1,5 @@ import { assertionMetadata } from 'assertion-tools'; -import { BYTES_IN_KILOBYTE } from '../constants/constants.js'; +import { BYTES_IN_KILOBYTE, ZERO_ADDRESS } from '../constants/constants.js'; class ValidationService { constructor(ctx) { @@ -16,11 +16,14 @@ class ValidationService { let isValid = true; try { - await this.blockchainModuleManager.getKnowledgeAssetOwner( + const result = await this.blockchainModuleManager.getKnowledgeAssetOwner( blockchain, contract, tokenId, ); + if (!result || result === ZERO_ADDRESS) { + isValid = false; + } } catch (err) { isValid = false; } diff --git a/test/bdd/features/get-errors.feature b/test/bdd/features/get-errors.feature index 1ea6d7c22f..ba16564fab 100644 --- a/test/bdd/features/get-errors.feature +++ b/test/bdd/features/get-errors.feature @@ -1,6 +1,6 @@ Feature: Get errors test Background: Setup local blockchain, bootstraps and nodes - Given the blockchain is set up + Given the blockchains are set up And 1 bootstrap is running @get-errors @@ -8,7 +8,7 @@ Feature: Get errors test Given I setup 4 nodes And I wait for 5 seconds - When I call Get directly on the node 1 with nonExistentUAL + When I call Get directly on the node 1 with nonExistentUAL on blockchain hardhat1:31337 And I wait for latest resolve to finalize Then Latest Get operation finished with status: GetRouteError @@ -17,31 +17,35 @@ Feature: Get errors test Given I setup 4 nodes And I wait for 5 seconds - When I call Get directly on the node 1 with invalidUAL + When I call Get directly on the node 1 with invalidUAL on blockchain hardhat1:31337 And I wait for latest resolve to finalize Then Latest Get operation finished with status: GetRouteError @get-errors Scenario: Getting non-existent state Given I setup 4 nodes - And I set R0 to be 1 - And I set R1 to be 2 + And I set R0 to be 1 on blockchain hardhat1:31337 + And I set R1 to be 2 on blockchain hardhat1:31337 + And I set R0 to be 1 on blockchain hardhat2:31337 + And I set R1 to be 2 on blockchain hardhat2:31337 And I wait for 5 seconds - When I call Publish on the node 1 with validAssertion + When I call Publish on the node 1 with validAssertion on blockchain hardhat1:31337 And I wait for latest Publish to finalize - And I call Get directly on the node 1 with nonExistentState + And I call Get directly on the node 1 with nonExistentState on blockchain hardhat1:31337 Then It should fail with status code 400 @get-errors Scenario: Getting invalid state hash Given I setup 4 nodes - And I set R0 to be 1 - And I set R1 to be 2 + And I set R0 to be 1 on blockchain hardhat1:31337 + And I set R1 to be 2 on blockchain hardhat1:31337 + And I set R0 to be 1 on blockchain hardhat2:31337 + And I set R1 to be 2 on blockchain hardhat2:31337 And I wait for 5 seconds - When I call Publish on the node 1 with validAssertion + When I call Publish on the node 1 with validAssertion on blockchain hardhat1:31337 And I wait for latest Publish to finalize - And I call Get directly on the node 1 with invalidStateHash + And I call Get directly on the node 1 with invalidStateHash on blockchain hardhat1:31337 And I wait for latest resolve to finalize Then Latest Get operation finished with status: GetAssertionIdError diff --git a/test/bdd/features/get.feature b/test/bdd/features/get.feature index 88c3af8c01..f27035795b 100644 --- a/test/bdd/features/get.feature +++ b/test/bdd/features/get.feature @@ -1,78 +1,135 @@ Feature: Get asset states test Background: Setup local blockchain, bootstraps and nodes - Given the blockchain is set up + Given the blockchains are set up And 1 bootstrap is running @release - Scenario: Get first state of the updated knowledge asset - Given I set R0 to be 1 - And I set R1 to be 2 - And I set finalizationCommitsNumber to be 2 + Scenario: Get first state of the updated knowledge asset on both blockchains + Given I set R0 to be 1 on blockchain hardhat1:31337 + And I set R1 to be 2 on blockchain hardhat1:31337 + And I set finalizationCommitsNumber to be 2 on blockchain hardhat1:31337 + And I set R0 to be 1 on blockchain hardhat2:31337 + And I set R1 to be 2 on blockchain hardhat2:31337 + And I set finalizationCommitsNumber to be 2 on blockchain hardhat2:31337 And I setup 4 nodes And I wait for 5 seconds - When I call Publish on the node 4 with validPublish_1ForValidUpdate_1 + When I call Publish on the node 4 with validPublish_1ForValidUpdate_1 on blockchain hardhat1:31337 And I wait for latest Publish to finalize Then Latest Publish operation finished with status: COMPLETED - When I call Update on the node 4 for the latest published UAL with validUpdate_1 + When I call Publish on the node 4 with validPublish_1ForValidUpdate_1 on blockchain hardhat2:31337 + And I wait for latest Publish to finalize + Then Latest Publish operation finished with status: COMPLETED + + When I call Update on the node 4 for the latest published UAL with validUpdate_1 on blockchain hardhat1:31337 And I wait for latest Update to finalize Then Latest Update operation finished with status: COMPLETED - When I call Get directly on the node 4 with validGetFirstStateRequestBody + When I call Update on the node 4 for the latest published UAL with validUpdate_1 on blockchain hardhat2:31337 + And I wait for latest Update to finalize + Then Latest Update operation finished with status: COMPLETED + + When I call Get directly on the node 4 with validGetFirstStateRequestBody on blockchain hardhat1:31337 + And I wait for latest resolve to finalize + Then Latest Get operation finished with status: COMPLETED + + When I call Get directly on the node 4 with validGetFirstStateRequestBody on blockchain hardhat2:31337 And I wait for latest resolve to finalize Then Latest Get operation finished with status: COMPLETED @release - Scenario: Get latest state of the updated knowledge asset - Given I set R0 to be 1 - And I set R1 to be 2 - And I set finalizationCommitsNumber to be 2 + Scenario: Get latest state of the updated knowledge asset on both blockchains + Given I set R0 to be 1 on blockchain hardhat1:31337 + And I set R1 to be 2 on blockchain hardhat1:31337 + And I set finalizationCommitsNumber to be 2 on blockchain hardhat1:31337 + And I set R0 to be 1 on blockchain hardhat2:31337 + And I set R1 to be 2 on blockchain hardhat2:31337 + And I set finalizationCommitsNumber to be 2 on blockchain hardhat2:31337 And I setup 4 nodes And I wait for 5 seconds - When I call Publish on the node 4 with validPublish_1ForValidUpdate_1 + When I call Publish on the node 4 with validPublish_1ForValidUpdate_1 on blockchain hardhat1:31337 And I wait for latest Publish to finalize Then Latest Publish operation finished with status: COMPLETED - When I call Update on the node 4 for the latest published UAL with validUpdate_1 + When I call Publish on the node 4 with validPublish_1ForValidUpdate_1 on blockchain hardhat2:31337 + And I wait for latest Publish to finalize + Then Latest Publish operation finished with status: COMPLETED + + When I call Update on the node 4 for the latest published UAL with validUpdate_1 on blockchain hardhat1:31337 And I wait for latest Update to finalize Then Latest Update operation finished with status: COMPLETED - When I call Get directly on the node 4 with validGetUpdatedStateRequestBody + When I call Update on the node 4 for the latest published UAL with validUpdate_1 on blockchain hardhat2:31337 + And I wait for latest Update to finalize + Then Latest Update operation finished with status: COMPLETED + + When I call Get directly on the node 4 with validGetUpdatedStateRequestBody on blockchain hardhat1:31337 + And I wait for latest resolve to finalize + Then Latest Get operation finished with status: COMPLETED + + When I call Get directly on the node 4 with validGetUpdatedStateRequestBody on blockchain hardhat2:31337 And I wait for latest resolve to finalize Then Latest Get operation finished with status: COMPLETED @release - Scenario: Get all states of the knowledge asset that is updated 2 times - Given I set R0 to be 1 - And I set R1 to be 2 - And I set finalizationCommitsNumber to be 2 + Scenario: Get all states of the knowledge asset that is updated 2 times on both blockchains + Given I set R0 to be 1 on blockchain hardhat1:31337 + And I set R1 to be 2 on blockchain hardhat1:31337 + And I set finalizationCommitsNumber to be 2 on blockchain hardhat1:31337 + And I set R0 to be 1 on blockchain hardhat2:31337 + And I set R1 to be 2 on blockchain hardhat2:31337 + And I set finalizationCommitsNumber to be 2 on blockchain hardhat2:31337 And I setup 4 nodes And I wait for 5 seconds - When I call Publish on the node 4 with validPublish_1ForValidUpdate_1 + When I call Publish on the node 4 with validPublish_1ForValidUpdate_1 on blockchain hardhat1:31337 And I wait for latest Publish to finalize Then Latest Publish operation finished with status: COMPLETED - When I call Update on the node 4 for the latest published UAL with validUpdate_1 + When I call Publish on the node 4 with validPublish_1ForValidUpdate_1 on blockchain hardhat2:31337 + And I wait for latest Publish to finalize + Then Latest Publish operation finished with status: COMPLETED + + When I call Update on the node 4 for the latest published UAL with validUpdate_1 on blockchain hardhat1:31337 + And I wait for latest Update to finalize + Then Latest Update operation finished with status: COMPLETED + + When I call Update on the node 4 for the latest published UAL with validUpdate_1 on blockchain hardhat2:31337 And I wait for latest Update to finalize Then Latest Update operation finished with status: COMPLETED And I wait for 30 seconds - When I call Update on the node 4 for the latest published UAL with validUpdate_2 + When I call Update on the node 4 for the latest published UAL with validUpdate_2 on blockchain hardhat1:31337 + And I wait for latest Update to finalize + Then Latest Update operation finished with status: COMPLETED + + When I call Update on the node 4 for the latest published UAL with validUpdate_2 on blockchain hardhat2:31337 And I wait for latest Update to finalize Then Latest Update operation finished with status: COMPLETED - When I call Get directly on the node 4 with getFirstStateRequestBody + When I call Get directly on the node 4 with getFirstStateRequestBody on blockchain hardhat1:31337 + And I wait for latest resolve to finalize + Then Latest Get operation finished with status: COMPLETED + + When I call Get directly on the node 4 with getFirstStateRequestBody on blockchain hardhat2:31337 + And I wait for latest resolve to finalize + Then Latest Get operation finished with status: COMPLETED + + When I call Get directly on the node 4 with getSecondStateRequestBody on blockchain hardhat1:31337 + And I wait for latest resolve to finalize + Then Latest Get operation finished with status: COMPLETED + + When I call Get directly on the node 4 with getSecondStateRequestBody on blockchain hardhat2:31337 And I wait for latest resolve to finalize Then Latest Get operation finished with status: COMPLETED - When I call Get directly on the node 4 with getSecondStateRequestBody + When I call Get directly on the node 4 with getThirdStateRequestBody on blockchain hardhat1:31337 And I wait for latest resolve to finalize Then Latest Get operation finished with status: COMPLETED - When I call Get directly on the node 4 with getThirdStateRequestBody + When I call Get directly on the node 4 with getThirdStateRequestBody on blockchain hardhat2:31337 And I wait for latest resolve to finalize Then Latest Get operation finished with status: COMPLETED diff --git a/test/bdd/features/publish-errors.feature b/test/bdd/features/publish-errors.feature index 503f7040a3..a717855f6a 100644 --- a/test/bdd/features/publish-errors.feature +++ b/test/bdd/features/publish-errors.feature @@ -1,6 +1,6 @@ Feature: Publish errors test Background: Setup local blockchain, bootstraps and nodes - Given the blockchain is set up + Given the blockchains are set up And 1 bootstrap is running @publish-errors @@ -8,7 +8,7 @@ Feature: Publish errors test Given I setup 2 nodes And I wait for 5 seconds - When I call Publish on the node 1 with validAssertion + When I call Publish on the node 1 with validAssertion on blockchain hardhat1:31337 And I wait for latest Publish to finalize Then Latest Publish operation finished with status: PublishStartError diff --git a/test/bdd/features/publish.feature b/test/bdd/features/publish.feature index 3cdc2c54f4..6317726472 100644 --- a/test/bdd/features/publish.feature +++ b/test/bdd/features/publish.feature @@ -1,15 +1,21 @@ Feature: Release related tests Background: Setup local blockchain, bootstraps and nodes - Given the blockchain is set up + Given the blockchains are set up And 1 bootstrap is running @release - Scenario: Publishing a valid assertion - Given I set R0 to be 1 - And I set R1 to be 2 + Scenario: Publishing a valid assertion on both blockchains + Given I set R0 to be 1 on blockchain hardhat1:31337 + And I set R1 to be 2 on blockchain hardhat1:31337 + And I set R0 to be 1 on blockchain hardhat2:31337 + And I set R1 to be 2 on blockchain hardhat2:31337 And I setup 4 nodes And I wait for 5 seconds - When I call Publish on the node 4 with validAssertion + When I call Publish on the node 4 with validAssertion on blockchain hardhat1:31337 + And I wait for latest Publish to finalize + Then Latest Publish operation finished with status: COMPLETED + + When I call Publish on the node 4 with validAssertion on blockchain hardhat2:31337 And I wait for latest Publish to finalize Then Latest Publish operation finished with status: COMPLETED diff --git a/test/bdd/features/update-errors.feature b/test/bdd/features/update-errors.feature index c5e6c5659c..0fa082bc22 100644 --- a/test/bdd/features/update-errors.feature +++ b/test/bdd/features/update-errors.feature @@ -1,6 +1,6 @@ Feature: Update errors test Background: Setup local blockchain, bootstraps and nodes - Given the blockchain is set up + Given the blockchains are set up And 1 bootstrap is running @update-errors diff --git a/test/bdd/features/update.feature b/test/bdd/features/update.feature index fb1d42a81e..e0ce54dc91 100644 --- a/test/bdd/features/update.feature +++ b/test/bdd/features/update.feature @@ -1,20 +1,31 @@ Feature: Update asset test Background: Setup local blockchain, bootstraps and nodes - Given the blockchain is set up + Given the blockchains are set up And 1 bootstrap is running @release - Scenario: Update an existing knowledge asset - Given I set R0 to be 1 - And I set R1 to be 2 - And I set finalizationCommitsNumber to be 2 + Scenario: Update an existing knowledge asset on both blockchains + Given I set R0 to be 1 on blockchain hardhat1:31337 + And I set R1 to be 2 on blockchain hardhat1:31337 + And I set finalizationCommitsNumber to be 2 on blockchain hardhat1:31337 + And I set R0 to be 1 on blockchain hardhat2:31337 + And I set R1 to be 2 on blockchain hardhat2:31337 + And I set finalizationCommitsNumber to be 2 on blockchain hardhat2:31337 And I setup 4 nodes And I wait for 5 seconds - When I call Publish on the node 4 with validPublish_1ForValidUpdate_1 + When I call Publish on the node 4 with validPublish_1ForValidUpdate_1 on blockchain hardhat1:31337 And I wait for latest Publish to finalize Then Latest Publish operation finished with status: COMPLETED - When I call Update on the node 4 for the latest published UAL with validUpdate_1 + When I call Publish on the node 4 with validPublish_1ForValidUpdate_1 on blockchain hardhat2:31337 + And I wait for latest Publish to finalize + Then Latest Publish operation finished with status: COMPLETED + + When I call Update on the node 4 for the latest published UAL with validUpdate_1 on blockchain hardhat1:31337 + And I wait for latest Update to finalize + Then Latest Update operation finished with status: COMPLETED + + When I call Update on the node 4 for the latest published UAL with validUpdate_1 on blockchain hardhat2:31337 And I wait for latest Update to finalize Then Latest Update operation finished with status: COMPLETED diff --git a/test/bdd/steps/api/datasets/requests.json b/test/bdd/steps/api/datasets/requests.json index be7258046b..ac5eefe732 100644 --- a/test/bdd/steps/api/datasets/requests.json +++ b/test/bdd/steps/api/datasets/requests.json @@ -1,73 +1,73 @@ { - "validPublishRequestBody": { - "assertionId": "0xc311cca6412f8453067ac7a04831af411b2963734d107541763c1ef7c8e56f65", - "assertion": [ - "_:c14n0 \"Born: April 30, 1916, Petoskey, Michigan, United States\" .", - "_:c14n0 \"Claude Elwood Shannon was an American mathematician, electrical engineer, and cryptographer known as the father of information theory. \" .", - "_:c14n0 \"Died: February 24, 2001, Medford, Massachusetts, United States\" .", - "_:c14n0 \"Claude Shànnon\" .", - "_:c14n0 ." - ], - "blockchain": "hardhat", - "contract": "0xB0D4afd8879eD9F52b28595d31B441D079B2Ca07", - "tokenId": 0 - }, - "validGetFirstStateRequestBody": { - "id": "did:dkg:hardhat/0xB0D4afd8879eD9F52b28595d31B441D079B2Ca07/0", - "state": "0xe3a6733d7b999ca6f0d141afe3e38ac59223a4dfde7a5458932d2094ed4193cf" - }, - "validGetUpdatedStateRequestBody": { - "id": "did:dkg:hardhat/0xB0D4afd8879eD9F52b28595d31B441D079B2Ca07/0" - }, - "getFirstStateRequestBody": { - "id": "did:dkg:hardhat/0xB0D4afd8879eD9F52b28595d31B441D079B2Ca07/0", - "state": "0xe3a6733d7b999ca6f0d141afe3e38ac59223a4dfde7a5458932d2094ed4193cf" - }, - "getSecondStateRequestBody": { - "id": "did:dkg:hardhat/0xB0D4afd8879eD9F52b28595d31B441D079B2Ca07/0", - "state": "0x591503a1c8ba4667dd7afd203025c1bf594d817d8eec71274fe960d69fb8584f" - }, - "getThirdStateRequestBody": { - "id": "did:dkg:hardhat/0xB0D4afd8879eD9F52b28595d31B441D079B2Ca07/0", - "state": "0x759c285786b95622dad67a6be857a4eec3d9ba0caec991ed4297629ae6abbc0d" - }, - "blockchainNotDefinedRequestBody": { - "publishType": "asset", - "assertionId": "0xc311cca6412f8453067ac7a04831af411b2963734d107541763c1ef7c8e56f65", - "assertion": [ - "_:c14n0 \"Born: April 30, 1916, Petoskey, Michigan, United States\" .", - "_:c14n0 \"Claude Elwood Shannon was an American mathematician, electrical engineer, and cryptographer known as the father of information theory. \" .", - "_:c14n0 \"Died: February 24, 2001, Medford, Massachusetts, United States\" .", - "_:c14n0 \"Claude Shànnon\" .", - "_:c14n0 ." - ], - "blockchain": null, - "contract": "0xB0D4afd8879eD9F52b28595d31B441D079B2Ca07", - "tokenId": 0 - }, - "nonExistentUAL": { - "id": "did:dkg:hardhat/0xB0D4afd8879eD9F52b28595d31B441D079B2Ca07/1" - }, - "invalidUAL": { - "id": "did:dkg:hardhat/0xB0D4afd8879eD9F/52b28595d31B441D079B2Ca07/1" - }, - "nonExistentState": { - "id": "did:dkg:hardhat/0xB0D4afd8879eD9F52b28595d31B441D079B2Ca07/0", - "state": -1 - }, - "invalidStateHash": { - "id": "did:dkg:hardhat/0xB0D4afd8879eD9F52b28595d31B441D079B2Ca07/0", - "state": "0x591503a1c8ba4667dd7afd203025c1bf594d817d8eec71274fe960d69fb8584e" - }, - "validUpdateRequestBody": { - "assertionId": "0x591503a1c8ba4667dd7afd203025c1bf594d817d8eec71274fe960d69fb8584f", - "assertion": [ - " .", - " \"TL\" .", - " ." - ], - "blockchain": "hardhat", - "contract": "0xB0D4afd8879eD9F52b28595d31B441D079B2Ca07", - "tokenId": 0 - } + "validPublishRequestBody": { + "assertionId": "0xc311cca6412f8453067ac7a04831af411b2963734d107541763c1ef7c8e56f65", + "assertion": [ + "_:c14n0 \"Born: April 30, 1916, Petoskey, Michigan, United States\" .", + "_:c14n0 \"Claude Elwood Shannon was an American mathematician, electrical engineer, and cryptographer known as the father of information theory. \" .", + "_:c14n0 \"Died: February 24, 2001, Medford, Massachusetts, United States\" .", + "_:c14n0 \"Claude Shànnon\" .", + "_:c14n0 ." + ], + "blockchain": "hardhat1:31337", + "contract": "0xB0D4afd8879eD9F52b28595d31B441D079B2Ca07", + "tokenId": 0 + }, + "validGetFirstStateRequestBody": { + "id": "did:dkg:blockchain/0xB0D4afd8879eD9F52b28595d31B441D079B2Ca07/0", + "state": "0xe3a6733d7b999ca6f0d141afe3e38ac59223a4dfde7a5458932d2094ed4193cf" + }, + "validGetUpdatedStateRequestBody": { + "id": "did:dkg:blockchain/0xB0D4afd8879eD9F52b28595d31B441D079B2Ca07/0" + }, + "getFirstStateRequestBody": { + "id": "did:dkg:blockchain/0xB0D4afd8879eD9F52b28595d31B441D079B2Ca07/0", + "state": "0xe3a6733d7b999ca6f0d141afe3e38ac59223a4dfde7a5458932d2094ed4193cf" + }, + "getSecondStateRequestBody": { + "id": "did:dkg:blockchain/0xB0D4afd8879eD9F52b28595d31B441D079B2Ca07/0", + "state": "0x591503a1c8ba4667dd7afd203025c1bf594d817d8eec71274fe960d69fb8584f" + }, + "getThirdStateRequestBody": { + "id": "did:dkg:blockchain/0xB0D4afd8879eD9F52b28595d31B441D079B2Ca07/0", + "state": "0x759c285786b95622dad67a6be857a4eec3d9ba0caec991ed4297629ae6abbc0d" + }, + "blockchainNotDefinedRequestBody": { + "publishType": "asset", + "assertionId": "0xc311cca6412f8453067ac7a04831af411b2963734d107541763c1ef7c8e56f65", + "assertion": [ + "_:c14n0 \"Born: April 30, 1916, Petoskey, Michigan, United States\" .", + "_:c14n0 \"Claude Elwood Shannon was an American mathematician, electrical engineer, and cryptographer known as the father of information theory. \" .", + "_:c14n0 \"Died: February 24, 2001, Medford, Massachusetts, United States\" .", + "_:c14n0 \"Claude Shànnon\" .", + "_:c14n0 ." + ], + "blockchain": null, + "contract": "0xB0D4afd8879eD9F52b28595d31B441D079B2Ca07", + "tokenId": 0 + }, + "nonExistentUAL": { + "id": "did:dkg:hardhat1:31337/0xB0D4afd8879eD9F52b28595d31B441D079B2Ca07/1" + }, + "invalidUAL": { + "id": "did:dkg:hardhat1:31337/0xB0D4afd8879eD9F/52b28595d31B441D079B2Ca07/1" + }, + "nonExistentState": { + "id": "did:dkg:hardhat1:31337/0xB0D4afd8879eD9F52b28595d31B441D079B2Ca07/0", + "state": -1 + }, + "invalidStateHash": { + "id": "did:dkg:hardhat1:31337/0xB0D4afd8879eD9F52b28595d31B441D079B2Ca07/0", + "state": "0x591503a1c8ba4667dd7afd203025c1bf594d817d8eec71274fe960d69fb8584e" + }, + "validUpdateRequestBody": { + "assertionId": "0x591503a1c8ba4667dd7afd203025c1bf594d817d8eec71274fe960d69fb8584f", + "assertion": [ + " .", + " \"TL\" .", + " ." + ], + "blockchain": "hardhat1:31337", + "contract": "0xB0D4afd8879eD9F52b28595d31B441D079B2Ca07", + "tokenId": 0 + } } diff --git a/test/bdd/steps/api/get.mjs b/test/bdd/steps/api/get.mjs index 47ea8df7a1..7b49dfd543 100644 --- a/test/bdd/steps/api/get.mjs +++ b/test/bdd/steps/api/get.mjs @@ -28,18 +28,29 @@ When( ); When( - /^I call Get directly on the node (\d+) with ([^"]*)/, + /^I call Get directly on the node (\d+) with ([^"]*) on blockchain ([^"]*)/, { timeout: 30000 }, - async function getFromNode(node, requestName) { - this.logger.log(`I call get directly on the node ${node}`); + async function getFromNode(node, requestName, blockchain) { + this.logger.log(`I call get directly on the node ${node} on blockchain ${blockchain}`); + + expect( + !!this.state.localBlockchains[blockchain], + `Blockchain with name ${blockchain} not found`, + ).to.be.equal(true); + expect( !!requests[requestName], `Request body with name: ${requestName} not found!`, ).to.be.equal(true); - const requestBody = requests[requestName]; + + const requestBody = JSON.parse(JSON.stringify(requests[requestName])); + requestBody.id = requestBody.id.replace('blockchain', blockchain); try { - const result = await httpApiHelper.get(this.state.nodes[node - 1].nodeRpcUrl, requestBody); + const result = await httpApiHelper.get( + this.state.nodes[node - 1].nodeRpcUrl, + requestBody, + ); const { operationId } = result.data; this.state.latestGetData = { nodeId: node - 1, @@ -51,24 +62,15 @@ When( }, ); -Then( - /^It should fail with status code (\d+)/, - function checkLatestError(expectedStatusCode) { - const expectedStatusCodeInt = parseInt(expectedStatusCode, 10); - assert( - this.state.latestError, - 'No error occurred' - ); - assert( - this.state.latestError.statusCode, - 'No status code in error' - ); - assert( - this.state.latestError.statusCode === expectedStatusCodeInt, - `Expected request to fail with status code ${expectedStatusCodeInt}, but it failed with another code.` - ); - }, -); +Then(/^It should fail with status code (\d+)/, function checkLatestError(expectedStatusCode) { + const expectedStatusCodeInt = parseInt(expectedStatusCode, 10); + assert(this.state.latestError, 'No error occurred'); + assert(this.state.latestError.statusCode, 'No status code in error'); + assert( + this.state.latestError.statusCode === expectedStatusCodeInt, + `Expected request to fail with status code ${expectedStatusCodeInt}, but it failed with another code.`, + ); +}); When('I wait for latest Get to finalize', { timeout: 80000 }, async function getFinalize() { this.logger.log('I wait for latest get to finalize'); diff --git a/test/bdd/steps/api/publish.mjs b/test/bdd/steps/api/publish.mjs index 1b18aea9b7..18b6bf3bb3 100644 --- a/test/bdd/steps/api/publish.mjs +++ b/test/bdd/steps/api/publish.mjs @@ -10,18 +10,25 @@ const requests = JSON.parse(await readFile('test/bdd/steps/api/datasets/requests const httpApiHelper = new HttpApiHelper(); When( - /^I call Publish on the node (\d+) with ([^"]*)/, + /^I call Publish on the node (\d+) with ([^"]*) on blockchain ([^"]*)/, { timeout: 120000 }, - async function publish(node, assertionName) { - this.logger.log(`I call publish route on the node ${node}`); + async function publish(node, assertionName, blockchain) { + this.logger.log(`I call publish route on the node ${node} on blockchain ${blockchain}`); + + expect( + !!this.state.localBlockchains[blockchain], + `Blockchain with name ${blockchain} not found`, + ).to.be.equal(true); + expect( !!assertions[assertionName], `Assertion with name: ${assertionName} not found!`, ).to.be.equal(true); const assertion = assertions[assertionName]; + const options = this.state.nodes[node - 1].clientBlockchainOptions[blockchain]; const result = await this.state.nodes[node - 1].client - .publish(assertion) + .publish(assertion, options) .catch((error) => { assert.fail(`Error while trying to publish assertion. ${error}`); }); diff --git a/test/bdd/steps/api/update.mjs b/test/bdd/steps/api/update.mjs index ebf4c46513..4740083d75 100644 --- a/test/bdd/steps/api/update.mjs +++ b/test/bdd/steps/api/update.mjs @@ -10,10 +10,16 @@ const requests = JSON.parse(await readFile('test/bdd/steps/api/datasets/requests const httpApiHelper = new HttpApiHelper(); When( - /^I call Update on the node (\d+) for the latest published UAL with ([^"]*)/, + /^I call Update on the node (\d+) for the latest published UAL with ([^"]*) on blockchain ([^"]*)/, { timeout: 120000 }, - async function update(node, assertionName) { - this.logger.log(`I call update route on the node ${node}`); + async function update(node, assertionName, blockchain) { + this.logger.log(`I call update route on the node ${node} on blockchain ${blockchain}`); + + expect( + !!this.state.localBlockchains[blockchain], + `Blockchain with name ${blockchain} not found`, + ).to.be.equal(true); + expect( !!assertions[assertionName], `Assertion with name: ${assertionName} not found!`, @@ -21,8 +27,9 @@ When( const assertion = assertions[assertionName]; const { UAL } = this.state.latestPublishData; + const options = this.state.nodes[node - 1].clientBlockchainOptions[blockchain]; const result = await this.state.nodes[node - 1].client - .update(UAL, assertion) + .update(UAL, assertion, options) .catch((error) => { assert.fail(`Error while trying to update assertion. ${error}`); }); diff --git a/test/bdd/steps/blockchain.mjs b/test/bdd/steps/blockchain.mjs index 16cac4c171..5ed3b4c2c8 100644 --- a/test/bdd/steps/blockchain.mjs +++ b/test/bdd/steps/blockchain.mjs @@ -3,18 +3,28 @@ import { expect } from 'chai'; import fs from 'fs'; import LocalBlockchain from './lib/local-blockchain.mjs'; -Given(/^the blockchain is set up$/, { timeout: 240_000 }, function blockchainSetup(done) { - this.logger.log('Starting blockchain'); - expect(this.state.localBlockchain, "localBlockchain shouldn't be defined").to.be.equal(null); - const blockchainConsole = new console.Console( - fs.createWriteStream(`${this.state.scenarionLogDir}/blockchain.log`), - ); +Given(/^the blockchains are set up$/, { timeout: 240_000 }, function blockchainSetup(done) { + + const blockchains = [ + {name: 'hardhat1:31337', port: 8545}, + {name: 'hardhat2:31337', port: 9545} + ] + + const promises = []; + + blockchains.forEach((blockchain, index)=>{ + this.logger.log(`Starting local blockchain ${blockchain.name} on port: ${blockchain.port}`); + const blockchainConsole = new console.Console( + fs.createWriteStream(`${this.state.scenarionLogDir}/blockchain-${blockchain.name.replace(':', '-')}.log`), + ); + const localBlockchain = new LocalBlockchain(); + this.state.localBlockchains[blockchain.name] = localBlockchain; + + promises.push(localBlockchain.initialize(blockchain.port, blockchainConsole)); + }) + + Promise.all(promises).then(()=>{ + done(); + }).catch((error) => done(error)); - this.state.localBlockchain = new LocalBlockchain(); - this.state.localBlockchain - .initialize(blockchainConsole) - .then(() => { - done(); - }) - .catch((error) => done(error)); }); diff --git a/test/bdd/steps/common.mjs b/test/bdd/steps/common.mjs index 5a09f88575..7d8886d8eb 100644 --- a/test/bdd/steps/common.mjs +++ b/test/bdd/steps/common.mjs @@ -5,7 +5,7 @@ import { setTimeout as sleep } from 'timers/promises'; import DkgClientHelper from '../../utilities/dkg-client-helper.mjs'; import StepsUtils from '../../utilities/steps-utils.mjs'; -import FileService from "../../../src/service/file-service.js"; +import FileService from '../../../src/service/file-service.js'; const stepsUtils = new StepsUtils(); @@ -14,21 +14,29 @@ Given( { timeout: 30000 }, function nodeSetup(nodeCount, done) { this.logger.log(`I setup ${nodeCount} node${nodeCount !== 1 ? 's' : ''}`); - const wallets = this.state.localBlockchain.getWallets(); + const currentNumberOfNodes = Object.keys(this.state.nodes).length; let nodesStarted = 0; for (let i = 0; i < nodeCount; i += 1) { const nodeIndex = currentNumberOfNodes + i; - const wallet = wallets[nodeIndex + 1]; - const managementWallet = wallets[nodeIndex + 1 + Math.floor(wallets.length / 2)]; + const blockchains = []; + Object.keys(this.state.localBlockchains).forEach((blockchainId) => { + const blockchain = this.state.localBlockchains[blockchainId]; + const wallets = blockchain.getWallets(); + blockchains.push({ + blockchainId, + operationalWallet: wallets[nodeIndex], + managementWallet: wallets[nodeIndex + Math.floor(wallets.length / 2)], + port: blockchain.port + }) + }); const rpcPort = 8901 + nodeIndex; const networkPort = 9001 + nodeIndex; const nodeName = `origintrail-test-${nodeIndex}`; const sharesTokenName = `origintrail-test-${nodeIndex}`; const sharesTokenSymbol = `OT-T-${nodeIndex}`; const nodeConfiguration = stepsUtils.createNodeConfiguration( - wallet, - managementWallet, + blockchains, nodeIndex, nodeName, rpcPort, @@ -54,21 +62,35 @@ Given( const client = new DkgClientHelper({ endpoint: 'http://localhost', port: rpcPort, - blockchain: { - name: 'hardhat', - publicKey: wallet.address, - privateKey: wallet.privateKey, - }, maxNumberOfRetries: 5, frequency: 2, contentType: 'all', }); + let clientBlockchainOptions = {}; + Object.keys(this.state.localBlockchains).forEach((blockchainId, index) => { + const blockchain = this.state.localBlockchains[blockchainId]; + const wallets = blockchain.getWallets(); + clientBlockchainOptions[blockchainId] = { + blockchain: { + name: blockchainId, + publicKey: wallets[index].address, + privateKey: wallets[index].privateKey, + rpc: `http://localhost:${blockchain.port}`, + hubContract: '0x5FbDB2315678afecb367f032d93F642f64180aa3', + }, + }; + }); + this.state.nodes[nodeIndex] = { client, forkedNode, configuration: nodeConfiguration, nodeRpcUrl: `http://localhost:${rpcPort}`, - fileService: new FileService({config: nodeConfiguration, logger: this.logger}), + fileService: new FileService({ + config: nodeConfiguration, + logger: this.logger, + }), + clientBlockchainOptions, }; } nodesStarted += 1; @@ -88,18 +110,25 @@ Given( expect(nodeCount).to.be.equal(1); // Currently not supported more. this.logger.log('Initializing bootstrap node'); const nodeIndex = Object.keys(this.state.nodes).length; - const wallets = this.state.localBlockchain.getWallets(); - const wallet = wallets[nodeIndex]; - const managementWallet = - this.state.localBlockchain.getWallets()[nodeIndex + Math.floor(wallets.length / 2)]; + + const blockchains = []; + Object.keys(this.state.localBlockchains).forEach((blockchainId) => { + const blockchain = this.state.localBlockchains[blockchainId]; + const wallets = blockchain.getWallets(); + blockchains.push({ + blockchainId, + operationalWallet: wallets[0], + managementWallet: wallets[Math.floor(wallets.length / 2)], + port: this.state.localBlockchains[blockchainId].port + }) + }); const rpcPort = 8900; const networkPort = 9000; const nodeName = 'origintrail-test-bootstrap'; const sharesTokenName = `${nodeName}-${nodeIndex}`; const sharesTokenSymbol = `OT-B-${nodeIndex}`; const nodeConfiguration = stepsUtils.createNodeConfiguration( - wallet, - managementWallet, + blockchains, nodeIndex, nodeName, rpcPort, @@ -132,91 +161,105 @@ Given( forkedNode, configuration: nodeConfiguration, nodeRpcUrl: `http://localhost:${rpcPort}`, - fileService: new FileService({config: nodeConfiguration, logger: this.logger}), + fileService: new FileService({ + config: nodeConfiguration, + logger: this.logger, + }), }); } done(); }); }, ); -// regex allows strings separated by dots -Given( - /^I setup node (\d+) with ([a-z][\w-]*(?:\.[\w-]+)*) set to ([^"]*)$/, - { timeout: 120000 }, - function setupPublishNode(nodeNum, propertyName, propertyValue, done) { - const nodeIndex = Object.keys(this.state.nodes).length; - const wallets = this.state.localBlockchain.getWallets(); - const wallet = wallets[nodeIndex + 1]; - const managementWallet = - this.state.localBlockchain.getWallets()[nodeIndex + 1 + Math.floor(wallets.length / 2)]; - const rpcPort = 8901 + nodeIndex; - const networkPort = 9001 + nodeIndex; - const nodeName = `origintrail-test-${nodeIndex}`; - const sharesTokenName = `origintrail-test-${nodeIndex}`; - const sharesTokenSymbol = `OT-T-${nodeIndex}`; - const nodeConfiguration = stepsUtils.createNodeConfiguration( - wallet, - managementWallet, - nodeIndex, - nodeName, - rpcPort, - networkPort, - sharesTokenName, - sharesTokenSymbol, - ); - const propertyNameSplit = propertyName.split('.'); - this.logger.log(`I setup node ${nodeNum} with ${propertyName} set to ${propertyValue}`); - expect( - Object.prototype.hasOwnProperty.call(nodeConfiguration, propertyNameSplit[0]), - `Property ${propertyName} doesn't exist`, - ).to.be.equal(true); - let propName = nodeConfiguration; - for (let i = 0; i < propertyNameSplit.length - 1; i += 1) { - propName = propName[propertyNameSplit[i]]; - } - if (propName[propertyNameSplit.slice(-1)] !== undefined) { - propName[propertyNameSplit.slice(-1)] = propertyValue === '\\0' ? '\0' : propertyValue; - } else { - assert.fail(`Property ${propertyName} doesn't exist`); - } - const forkedNode = stepsUtils.forkNode(nodeConfiguration); - - const logFileStream = fs.createWriteStream(`${this.state.scenarionLogDir}/${nodeName}.log`); - forkedNode.stdout.setEncoding('utf8'); - forkedNode.stdout.on('data', (data) => { - // Here is where the output goes - logFileStream.write(data); - }); - - // eslint-disable-next-line no-loop-func - forkedNode.on('message', (response) => { - if (response.error) { - assert.fail(`Error while initializing node${nodeIndex} : ${response.error}`); - } else { - const client = new DkgClientHelper({ - endpoint: 'http://localhost', - port: rpcPort, - blockchain: { - name: 'hardhat', - publicKey: wallet.address, - privateKey: wallet.privateKey, - }, - maxNumberOfRetries: 5, - frequency: 2, - contentType: 'all', - }); - this.state.nodes[nodeIndex] = { - client, - forkedNode, - configuration: nodeConfiguration, - nodeRpcUrl: `http://localhost:${rpcPort}`, - fileService: new FileService({config: nodeConfiguration, logger: this.logger}), - }; - } - done(); - }); - }, -); +// +// Given( +// /^I setup node (\d+) with ([a-z][\w-]*(?:\.[\w-]+)*) set to ([^"]*)$/, +// { timeout: 120000 }, +// function setupPublishNode(nodeNum, propertyName, propertyValue, done) { +// const nodeIndex = Object.keys(this.state.nodes).length; +// +// const blockchains = []; +// +// Object.keys(this.state.localBlockchains).forEach((blockchainId) => { +// const blockchain = this.state.localBlockchains[blockchainId]; +// const wallets = blockchain.getWallets(); +// blockchains.push({ +// blockchainId, +// operationalWallet: wallets[nodeIndex], +// managementWallet: wallets[nodeIndex + Math.floor(wallets[blockchainId].length / 2)], +// port: blockchain.port +// }) +// }); +// const rpcPort = 8901 + nodeIndex; +// const networkPort = 9001 + nodeIndex; +// const nodeName = `origintrail-test-${nodeIndex}`; +// const sharesTokenName = `origintrail-test-${nodeIndex}`; +// const sharesTokenSymbol = `OT-T-${nodeIndex}`; +// const nodeConfiguration = stepsUtils.createNodeConfiguration( +// blockchains, +// nodeIndex, +// nodeName, +// rpcPort, +// networkPort, +// sharesTokenName, +// sharesTokenSymbol, +// ); +// const propertyNameSplit = propertyName.split('.'); +// this.logger.log(`I setup node ${nodeNum} with ${propertyName} set to ${propertyValue}`); +// expect( +// Object.prototype.hasOwnProperty.call(nodeConfiguration, propertyNameSplit[0]), +// `Property ${propertyName} doesn't exist`, +// ).to.be.equal(true); +// let propName = nodeConfiguration; +// for (let i = 0; i < propertyNameSplit.length - 1; i += 1) { +// propName = propName[propertyNameSplit[i]]; +// } +// if (propName[propertyNameSplit.slice(-1)] !== undefined) { +// propName[propertyNameSplit.slice(-1)] = propertyValue === '\\0' ? '\0' : propertyValue; +// } else { +// assert.fail(`Property ${propertyName} doesn't exist`); +// } +// const forkedNode = stepsUtils.forkNode(nodeConfiguration); +// +// const logFileStream = fs.createWriteStream(`${this.state.scenarionLogDir}/${nodeName}.log`); +// forkedNode.stdout.setEncoding('utf8'); +// forkedNode.stdout.on('data', (data) => { +// // Here is where the output goes +// logFileStream.write(data); +// }); +// +// // eslint-disable-next-line no-loop-func +// forkedNode.on('message', (response) => { +// if (response.error) { +// assert.fail(`Error while initializing node${nodeIndex} : ${response.error}`); +// } else { +// const client = new DkgClientHelper({ +// endpoint: 'http://localhost', +// port: rpcPort, +// blockchain: { +// name: 'hardhat', +// publicKey: wallet.address, +// privateKey: wallet.privateKey, +// }, +// maxNumberOfRetries: 5, +// frequency: 2, +// contentType: 'all', +// }); +// this.state.nodes[nodeIndex] = { +// client, +// forkedNode, +// configuration: nodeConfiguration, +// nodeRpcUrl: `http://localhost:${rpcPort}`, +// fileService: new FileService({ +// config: nodeConfiguration, +// logger: this.logger, +// }), +// }; +// } +// done(); +// }); +// }, +// ); Then( /Latest (Get|Publish|Update) operation finished with status: ([COMPLETED|FAILED|PublishValidateAssertionError|PublishStartError|GetAssertionIdError|GetNetworkError|GetLocalError|PublishRouteError]+)$/, @@ -245,17 +288,42 @@ Given(/^I wait for (\d+) seconds$/, { timeout: 100000 }, async function waitFor( await sleep(seconds * 1000); }); -Given(/^I set R1 to be (\d+)$/, { timeout: 100000 }, async function waitFor(r1) { - this.logger.log(`I set R1 to be ${r1}`); - await this.state.localBlockchain.setR1(r1); -}); +Given( + /^I set R1 to be (\d+) on blockchain ([^"]*)$/, + { timeout: 100000 }, + async function waitFor(r1, blockchain) { + if (!this.state.localBlockchains[blockchain]) { + throw Error(`Unknown blockchain ${blockchain}`); + } + this.logger.log(`I set R1 to be ${r1} on blockchain ${blockchain}`); + await this.state.localBlockchains[blockchain].setR1(r1); + }, +); -Given(/^I set R0 to be (\d+)$/, { timeout: 100000 }, async function waitFor(r0) { - this.logger.log(`I set R0 to be ${r0}`); - await this.state.localBlockchain.setR0(r0); -}); +Given( + /^I set R0 to be (\d+) on blockchain ([^"]*)$/, + { timeout: 100000 }, + async function waitFor(r0, blockchain) { + if (!this.state.localBlockchains[blockchain]) { + throw Error(`Unknown blockchain ${blockchain}`); + } + this.logger.log(`I set R0 to be ${r0} on blockchain ${blockchain}`); + await this.state.localBlockchains[blockchain].setR0(r0); + }, +); -Given(/^I set finalizationCommitsNumber to be (\d+)$/, { timeout: 100000 }, async function waitFor(finalizationCommitsNumber) { - this.logger.log(`I set finalizationCommitsNumber to be ${finalizationCommitsNumber}`); - await this.state.localBlockchain.setFinalizationCommitsNumber(finalizationCommitsNumber); -}); +Given( + /^I set finalizationCommitsNumber to be (\d+) on blockchain ([^"]*)$/, + { timeout: 100000 }, + async function waitFor(finalizationCommitsNumber, blockchain) { + if (!this.state.localBlockchains[blockchain]) { + throw Error(`Unknown blockchain ${blockchain}`); + } + this.logger.log( + `I set finalizationCommitsNumber to be ${finalizationCommitsNumber} on blockchain ${blockchain}`, + ); + await this.state.localBlockchains[blockchain].setFinalizationCommitsNumber( + finalizationCommitsNumber, + ); + }, +); diff --git a/test/bdd/steps/hooks.mjs b/test/bdd/steps/hooks.mjs index c1d31646b4..b62f088bdd 100644 --- a/test/bdd/steps/hooks.mjs +++ b/test/bdd/steps/hooks.mjs @@ -2,9 +2,9 @@ import 'dotenv/config'; import { Before, BeforeAll, After, AfterAll } from '@cucumber/cucumber'; import slugify from 'slugify'; import fs from 'fs'; -import mysql from "mysql2"; +import mysql from 'mysql2'; import { NODE_ENVIRONMENTS } from '../../../src/constants/constants.js'; -import TripleStoreModuleManager from "../../../src/modules/triple-store/triple-store-module-manager.js"; +import TripleStoreModuleManager from '../../../src/modules/triple-store/triple-store-module-manager.js'; process.env.NODE_ENV = NODE_ENVIRONMENTS.TEST; @@ -16,6 +16,7 @@ Before(function beforeMethod(testCase, done) { // Initialize variables this.state = {}; this.state.localBlockchain = null; + this.state.localBlockchains = []; this.state.nodes = {}; this.state.bootstraps = []; let logDir = process.env.CUCUMBER_ARTIFACTS_DIR || '.'; @@ -32,22 +33,26 @@ After(function afterMethod(testCase, done) { const promises = []; for (const key in this.state.nodes) { this.state.nodes[key].forkedNode.kill(); - tripleStoreConfiguration.push({modules: {tripleStore: this.state.nodes[key].configuration.modules.tripleStore}}); + tripleStoreConfiguration.push({ + modules: { tripleStore: this.state.nodes[key].configuration.modules.tripleStore }, + }); databaseNames.push(this.state.nodes[key].configuration.operationalDatabase.databaseName); const dataFolderPath = this.state.nodes[key].fileService.getDataFolderPath(); promises.push(this.state.nodes[key].fileService.removeFolder(dataFolderPath)); } this.state.bootstraps.forEach((node) => { node.forkedNode.kill(); - tripleStoreConfiguration.push({modules: {tripleStore: node.configuration.modules.tripleStore}}); + tripleStoreConfiguration.push({ + modules: { tripleStore: node.configuration.modules.tripleStore }, + }); databaseNames.push(node.configuration.operationalDatabase.databaseName); const dataFolderPath = node.fileService.getDataFolderPath(); promises.push(node.fileService.removeFolder(dataFolderPath)); }); - if (this.state.localBlockchain) { - this.logger.info('Stopping local blockchain!'); - promises.push(this.state.localBlockchain.stop()); - this.state.localBlockchain = null; + for (const localBlockchain in this.state.localBlockchains) { + this.logger.info(`Stopping local blockchain ${localBlockchain}!`); + promises.push(this.state.localBlockchains[localBlockchain].stop()); + this.state.localBlockchains[localBlockchain] = null; } this.logger.log('After test hook, cleaning repositories'); @@ -63,18 +68,24 @@ After(function afterMethod(testCase, done) { promises.push(con); tripleStoreConfiguration.forEach((config) => { promises.push(async () => { - const tripleStoreModuleManager = new TripleStoreModuleManager({config, logger: this.logger}); + const tripleStoreModuleManager = new TripleStoreModuleManager({ + config, + logger: this.logger, + }); await tripleStoreModuleManager.initialize(); for (const implementationName of tripleStoreModuleManager.getImplementationNames()) { - const {tripleStoreConfig} = tripleStoreModuleManager.getImplementation(implementationName); + const { tripleStoreConfig } = + tripleStoreModuleManager.getImplementation(implementationName); Object.keys(tripleStoreConfig.repositories).map(async (repository) => { - this.logger.log('Removing triple store configuration:', JSON.stringify(tripleStoreConfig, null, 4)); - await tripleStoreModuleManager.deleteRepository(implementationName, repository); - } - ) + this.logger.log( + 'Removing triple store configuration:', + JSON.stringify(tripleStoreConfig, null, 4), + ); + await tripleStoreModuleManager.deleteRepository(implementationName, repository); + }); } - }) - }) + }); + }); Promise.all(promises) .then(() => { con.end(); diff --git a/test/bdd/steps/lib/local-blockchain.mjs b/test/bdd/steps/lib/local-blockchain.mjs index 777238c95d..19410f9504 100644 --- a/test/bdd/steps/lib/local-blockchain.mjs +++ b/test/bdd/steps/lib/local-blockchain.mjs @@ -50,13 +50,14 @@ const testParametersStorageParams = { let startBlockchainProcess; class LocalBlockchain { - async initialize(_console = console) { - startBlockchainProcess = exec('npm run start:local_blockchain'); + async initialize(port, _console = console, version = '') { + this.port = port; + startBlockchainProcess = exec(`npm run start:local_blockchain${version} -- ${port}`); startBlockchainProcess.stdout.on('data', (data) => { _console.log(data); }); - this.provider = new ethers.providers.JsonRpcProvider('http://localhost:8545'); + this.provider = new ethers.providers.JsonRpcProvider(`http://localhost:${port}`); const [privateKeysFile, publicKeysFile] = await Promise.all([ readFile('test/bdd/steps/api/datasets/privateKeys.json'), @@ -94,7 +95,7 @@ class LocalBlockchain { } async stop() { - const commandLog = await execSync('npm run kill:local_blockchain'); + const commandLog = await execSync(`npm run kill:local_blockchain -- ${this.port}`); console.log(`Killing hardhat process: ${commandLog.toString()}`); startBlockchainProcess.kill(); } @@ -138,7 +139,10 @@ class LocalBlockchain { async setFinalizationCommitsNumber(commitsNumber) { console.log(`Setting finalizationCommitsNumber in parameters storage to: ${commitsNumber}`); - const encodedData = this.ParametersStorageInterface.encodeFunctionData('setFinalizationCommitsNumber', [commitsNumber]); + const encodedData = this.ParametersStorageInterface.encodeFunctionData( + 'setFinalizationCommitsNumber', + [commitsNumber], + ); const parametersStorageAddress = await this.hubContract.getContractAddress( 'ParametersStorage', ); diff --git a/test/bdd/steps/lib/state.mjs b/test/bdd/steps/lib/state.mjs index 727635eeb3..a4a98ad675 100644 --- a/test/bdd/steps/lib/state.mjs +++ b/test/bdd/steps/lib/state.mjs @@ -7,6 +7,11 @@ const state = { // this is local blockchain object look at test/bdd/steps/lib/local-blockchain.js localBlockchain: {}, + // this is local blockchain object look at test/bdd/steps/lib/local-blockchain.js + localBlockchains: { + test1: {}, + test2: {} + }, // array of nodes nodes: { 0: { diff --git a/test/unit/mock/operation-id-service-mock.js b/test/unit/mock/operation-id-service-mock.js index 75adb55f42..7e7a728857 100644 --- a/test/unit/mock/operation-id-service-mock.js +++ b/test/unit/mock/operation-id-service-mock.js @@ -5,7 +5,13 @@ class OperationIdServiceMock { cacheOperationIdData(operationId, data) {} - async updateOperationIdStatus(operationId, status, errorMessage = null, errorType = null) { + async updateOperationIdStatus( + operationId, + blockchain, + status, + errorMessage = null, + errorType = null, + ) { await this.repositoryModuleManager.updateOperationIdRecord( { status, diff --git a/test/unit/service/get-service.test.js b/test/unit/service/get-service.test.js index d990d457e2..44c6324a3a 100644 --- a/test/unit/service/get-service.test.js +++ b/test/unit/service/get-service.test.js @@ -42,6 +42,7 @@ describe('Get service test', async () => { { data: { operationId: '5195d01a-b437-4aae-b388-a77b9fa715f1', + blockchain: 'hardhat', numberOfFoundNodes: 1, leftoverNodes: [], keyword: 'origintrail', @@ -77,6 +78,7 @@ describe('Get service test', async () => { { data: { operationId: '5195d01a-b437-4aae-b388-a77b9fa715f1', + blockchain: 'hardhat', numberOfFoundNodes: 1, leftoverNodes: [1, 2, 3, 4], keyword: 'origintrail', diff --git a/test/unit/service/publish-service.test.js b/test/unit/service/publish-service.test.js index fad7dc6adf..9fb976320c 100644 --- a/test/unit/service/publish-service.test.js +++ b/test/unit/service/publish-service.test.js @@ -45,6 +45,7 @@ describe('Publish service test', async () => { { data: { operationId: '5195d01a-b437-4aae-b388-a77b9fa715f1', + blockchain: 'hardhat', numberOfFoundNodes: 1, leftoverNodes: [], keyword: 'origintrail', @@ -74,6 +75,7 @@ describe('Publish service test', async () => { { data: { operationId: '5195d01a-b437-4aae-b388-a77b9fa715f1', + blockchain: 'hardhat', numberOfFoundNodes: 1, leftoverNodes: [], keyword: 'origintrail', @@ -100,6 +102,7 @@ describe('Publish service test', async () => { { data: { operationId: '5195d01a-b437-4aae-b388-a77b9fa715f1', + blockchain: 'hardhat', numberOfFoundNodes: 1, leftoverNodes: [], keyword: 'origintrail', @@ -126,6 +129,7 @@ describe('Publish service test', async () => { { data: { operationId: '5195d01a-b437-4aae-b388-a77b9fa715f1', + blockchain: 'hardhat', numberOfFoundNodes: 1, leftoverNodes: [1, 2, 3, 4], keyword: 'origintrail', diff --git a/test/unit/service/update-service.test.js b/test/unit/service/update-service.test.js index 46409a8566..40b8ad8336 100644 --- a/test/unit/service/update-service.test.js +++ b/test/unit/service/update-service.test.js @@ -46,6 +46,7 @@ describe('Update service test', async () => { { data: { operationId: '5195d01a-b437-4aae-b388-a77b9fa715f1', + blockchain: 'hardhat', numberOfFoundNodes: 1, leftoverNodes: [], keyword: 'origintrail', @@ -75,6 +76,7 @@ describe('Update service test', async () => { { data: { operationId: '5195d01a-b437-4aae-b388-a77b9fa715f1', + blockchain: 'hardhat', numberOfFoundNodes: 1, leftoverNodes: [], keyword: 'origintrail', @@ -101,6 +103,7 @@ describe('Update service test', async () => { { data: { operationId: '5195d01a-b437-4aae-b388-a77b9fa715f1', + blockchain: 'hardhat', numberOfFoundNodes: 1, leftoverNodes: [], keyword: 'origintrail', @@ -127,6 +130,7 @@ describe('Update service test', async () => { { data: { operationId: '5195d01a-b437-4aae-b388-a77b9fa715f1', + blockchain: 'hardhat', numberOfFoundNodes: 1, leftoverNodes: [1, 2, 3, 4], keyword: 'origintrail', diff --git a/test/utilities/dkg-client-helper.mjs b/test/utilities/dkg-client-helper.mjs index bc18895fcd..6b41114a0a 100644 --- a/test/utilities/dkg-client-helper.mjs +++ b/test/utilities/dkg-client-helper.mjs @@ -10,30 +10,36 @@ class DkgClientHelper { return this.client.node.info(); } - async publish(data) { - const options = { + async publish(data, userOptions = {}) { + const defaultOptions = { visibility: 'public', epochsNum: 5, hashFunctionId: CONTENT_ASSET_HASH_FUNCTION_ID, }; + const options = { ...defaultOptions, ...userOptions }; + return this.client.asset.create(data, options); } - async update(ual, assertion) { - const options = { + async update(ual, assertion, userOptions = {}) { + const defaultOptions = { hashFunctionId: CONTENT_ASSET_HASH_FUNCTION_ID, }; + const options = { ...defaultOptions, ...userOptions }; + return this.client.asset.update(ual, assertion, options); } - async get(ual, state) { - const options = { + async get(ual, state, userOptions = {}) { + const defaultOptions = { state, validate: true, }; + const options = { ...defaultOptions, ...userOptions }; + return this.client.asset.get(ual, options); } diff --git a/test/utilities/steps-utils.mjs b/test/utilities/steps-utils.mjs index e17a5eb646..36cfa244ce 100644 --- a/test/utilities/steps-utils.mjs +++ b/test/utilities/steps-utils.mjs @@ -8,9 +8,25 @@ class StepsUtils { return forkedNode; } + /** + * + * @param blockchains [{ + * blockchainId: 'blockchainId', + * port: '', + * operationalWallet: 'operationalWallet', + * managementWallet: 'managementWallet' + * }] + * @param nodeIndex + * @param nodeName + * @param rpcPort + * @param networkPort + * @param sharesTokenName + * @param sharesTokenSymbol + * @param bootstrap + * @returns {{operationalDatabase: {databaseName: (string|string)}, graphDatabase: {name}, auth: {ipBasedAuthEnabled: boolean}, appDataPath: (string|string), rpcPort, modules: {httpClient: {implementation: {"express-http-client": {config: {port}}}}, repository: {implementation: {"sequelize-repository": {config: {database: (string|string)}}}}, tripleStore: {implementation: {"ot-blazegraph": {config: {repositories: {publicHistory: {password: string, name: string, url: string, username: string}, publicCurrent: {password: string, name: string, url: string, username: string}, privateHistory: {password: string, name: string, url: string, username: string}, privateCurrent: {password: string, name: string, url: string, username: string}}}}}}, validation: {implementation: {"merkle-validation": {package: string, enabled: boolean}}, enabled: boolean}, network: {implementation: {"libp2p-service": {config: {privateKey: (string|undefined), port}}}}}}} + */ createNodeConfiguration( - wallet, - managementWallet, + blockchains, nodeIndex, nodeName, rpcPort, @@ -19,21 +35,10 @@ class StepsUtils { sharesTokenSymbol, bootstrap = false, ) { - return { + let config = { modules: { blockchain: { - implementation: { - hardhat: { - config: { - evmOperationalWalletPublicKey: wallet.address, - evmOperationalWalletPrivateKey: wallet.privateKey, - evmManagementWalletPublicKey: managementWallet.address, - evmManagementWalletPrivateKey: managementWallet.privateKey, - sharesTokenName, - sharesTokenSymbol, - }, - }, - }, + implementation: {} }, network: { implementation: { @@ -63,30 +68,30 @@ class StepsUtils { 'ot-blazegraph': { config: { repositories: { - "privateCurrent": { - "url": "http://localhost:9999", - "name": "private-current", - "username": "admin", - "password": "" + privateCurrent: { + url: 'http://localhost:9999', + name: 'private-current', + username: 'admin', + password: '', + }, + privateHistory: { + url: 'http://localhost:9999', + name: 'private-history', + username: 'admin', + password: '', }, - "privateHistory": { - "url": "http://localhost:9999", - "name": "private-history", - "username": "admin", - "password": "" + publicCurrent: { + url: 'http://localhost:9999', + name: 'public-current', + username: 'admin', + password: '', }, - "publicCurrent": { - "url": "http://localhost:9999", - "name": "public-current", - "username": "admin", - "password": "" + publicHistory: { + url: 'http://localhost:9999', + name: 'public-history', + username: 'admin', + password: '', }, - "publicHistory": { - "url": "http://localhost:9999", - "name": "public-history", - "username": "admin", - "password": "" - } }, }, }, @@ -125,6 +130,26 @@ class StepsUtils { name: nodeName, }, }; + + for (const blockchain of blockchains) { + config.modules.blockchain.implementation[blockchain.blockchainId] = { + enabled: true, + package: './blockchain/implementation/hardhat/hardhat-service.js', + config: { + hubContractAddress: '0x5FbDB2315678afecb367f032d93F642f64180aa3', + rpcEndpoints: [`http://localhost:${blockchain.port}`], + initialStakeAmount: 50000, + initialAskAmount: 0.2, + evmOperationalWalletPublicKey: blockchain.operationalWallet.address, + evmOperationalWalletPrivateKey: blockchain.operationalWallet.privateKey, + evmManagementWalletPublicKey: blockchain.managementWallet.address, + evmManagementWalletPrivateKey: blockchain.managementWallet.privateKey, + sharesTokenName, + sharesTokenSymbol, + }, + }; + } + return config; } } export default StepsUtils; diff --git a/tools/local-network-setup/.origintrail_noderc_template.json b/tools/local-network-setup/.origintrail_noderc_template.json index e1cbacf528..f63e39a681 100644 --- a/tools/local-network-setup/.origintrail_noderc_template.json +++ b/tools/local-network-setup/.origintrail_noderc_template.json @@ -135,9 +135,9 @@ } }, "blockchain": { - "defaultImplementation": "hardhat", "implementation": { - "hardhat": { + "hardhat1:31337": { + "enabled": true, "package": "./blockchain/implementation/hardhat/hardhat-service.js", "config": { "evmOperationalWalletPublicKey": "0xd6879C0A03aDD8cFc43825A42a3F3CF44DB7D2b9", @@ -145,35 +145,18 @@ "evmOperationalWalletPrivateKey": "0x02b39cac1532bef9dba3e36ec32d3de1e9a88f1dda597d3ac6e2130aed9adc4e" } }, - "otp": { + "hardhat2:31337": { + "package": "./blockchain/implementation/hardhat/hardhat-service.js", "config": { - "evmOperationalWalletPublicKey": "...", - "evmOperationalWalletPrivateKey": "...", + "evmOperationalWalletPublicKey": "0xd6879C0A03aDD8cFc43825A42a3F3CF44DB7D2b9", "rpcEndpoints": [], - "evmManagementWalletPublicKey": "..." - } - }, - "polygon": { - "config": { - "rpcEndpoints": [] - } - }, - "rinkeby": { - "package": "./blockchain/implementation/polygon/eth-service.js", - "config": { - "networkId": "eth::rinkeby", - "hubContractAddress": "", - "gasPriceOracleLink": "", - "rpcEndpoints": [] + "evmOperationalWalletPrivateKey": "0x02b39cac1532bef9dba3e36ec32d3de1e9a88f1dda597d3ac6e2130aed9adc4e" } } } } }, "auth": { - "ipWhitelist": [ - "::1", - "127.0.0.1" - ] + "ipWhitelist": ["::1", "127.0.0.1"] } } diff --git a/tools/local-network-setup/README.md b/tools/local-network-setup/README.md index 44ae3089f7..3280d62671 100644 --- a/tools/local-network-setup/README.md +++ b/tools/local-network-setup/README.md @@ -1,21 +1,16 @@ -DKG local network setup tool -======================== +# DKG local network setup tool -This tool will help you set up a local DKG v6 network running with the Ganache blockchain. It is useful for development and testing purposes and is used internally by the OriginTrail core developers. +This tool will help you set up a local DKG v6 network running with the Hardhat blockchain. It is useful for development and testing purposes and is used internally by the OriginTrail core developers.
- **Note: This tool is an internal tool used by the OriginTrail team and thus is developed for our workflow, meaning that it currently only supports MacOS**, but we encourage you to adapt it for your workflow as well. +# Prerequisites -Prerequisites -============= - -* An installed and running triplestore (graph database) - * We recommend testing with GraphDB. In order to download GraphDB, please visit their official [website](https://graphdb.ontotext.com/). Alternatively other triple stores can be used (Blazegraph, Apache Jena and other RDF native graph databases) -* An installed and running MySQL server -* You should have installed npm and Node.js (v16) or higher - +- An installed and running triplestore (graph database) + - We recommend testing with Blazegraph. In order to download Blazegraph, please visit their official [website](https://blazegraph.com/). Alternatively other triple stores can be used (GraphBD or and other RDF native graph databases) +- An installed and running MySQL server +- You should have installed npm and Node.js (v16) # Setup instructions @@ -23,55 +18,58 @@ In order to run the local network you fist need to clone the "ot-node" repositor
## 1. CLONE OT-NODE REPOSITORY & INSTALL DEPENDENCIES + After cloning the **ot-node** repository, please checkout to "v6/develop" branch and install dependencies by running: + ```bash git clone https://github.com/OriginTrail/ot-node.git && cd ot-node/ && npm install && cd .. ``` +
### 2.2 Create the .env file inside the "ot-node" directory: + ```bash nano .env ``` + and paste the following content inside (save and close): + ```bash NODE_ENV=development -RPC_ENDPOINT=http://localhost:8545 -PRIVATE_KEY=02b39cac1532bef9dba3e36ec32d3de1e9a88f1dda597d3ac6e2130aed9adc4e +RPC_ENDPOINT_BC1=http://localhost:8545 +RPC_ENDPOINT_BC2=http://localhost:9545 ``` -**Note:** The private key above is used ONLY for convenience and SHOULD be changed to a secure key when used in production. If you are connecting to rinkeby testnet network you need to provide valid RPC_ENDPOINT + +**Note:** The private key above is used ONLY for convenience and SHOULD be changed to a secure key when used in production.
## 3. START THE LOCAL NETWORK ## Specifying the number of nodes -You can specify to run anywhere between one and ten nodes with the `--nodes` parameter. -**Note:** All nodes assume MySQL username root and no password. To change the MySQL login information update the .dh_origintrail_noderc template file sequelize-repository config object with your username and password
+You can specify to run anywhere between one and twenty nodes with the `--nodes` parameter. + +**Note:** All nodes assume MySQL username root and no password. To change the MySQL login information update the .origintrail_noderc template file sequelize-repository config object with your username and password
The first node will be named `bootstrap`, while subsequent nodes will be named `dh1, dh2, ...`.
```bash bash ./tools/local-network-setup/setup-macos-environment.sh --nodes=6 ``` -**Note:** With the above command, we will start ganache instance, deploy contracts, deploy a 6 nodes network (1 bootstrap and 5 subsequent nodes)
+ +**Note:** With the above command, we will start two hardhat instances, deploy contracts, deploy a 6 nodes network (1 bootstrap and 5 subsequent nodes)
## Specifying the blockchain network + You can specify the blockchain network you want to connect to with `--network` parameter. Available networks: -- ganache - default network -- rinkeby - ETH testnet network -```bash -bash ./tools/local-network-setup/setup-macos-environment.sh --network=rinkeby -``` -**Note:** In order to run on rinkeby network you must provide Rinkeby ETH Testnet tokens to the wallets. Minimum of 3 Rinkeby ETH tokens is required for contract deployment. Wallet used for contracts deployment is the one you defined in .env file. Additionally, you need to send minimum of 1 Rinkeby ETH token to the wallets specified in file: ./tools/local-network-setup/keys.json. -
-Contribution -============ +- hardhat - default network -OriginTrail is an open source project. We happily invite you to join us in our mission of building decentralized knowledge graph - we're excited for your contributions! Join us in discord to meet the dev community +# Contribution +OriginTrail is an open source project. We happily invite you to join us in our mission of building decentralized knowledge graph - we're excited for your contributions! Join us in discord to meet the dev community ### Useful links @@ -84,4 +82,3 @@ OriginTrail is an open source project. We happily invite you to join us in our m [OriginTrail Telegram Group](https://t.me/origintrail) [OriginTrail Twitter](https://twitter.com/origin_trail) - diff --git a/tools/local-network-setup/generate-config-files.js b/tools/local-network-setup/generate-config-files.js index 74ccc1cf1d..cff6c9c5c8 100644 --- a/tools/local-network-setup/generate-config-files.js +++ b/tools/local-network-setup/generate-config-files.js @@ -99,10 +99,23 @@ function generateTripleStoreConfig(templateTripleStoreConfig, nodeIndex) { function generateBlockchainConfig(templateBlockchainConfig, nodeIndex) { const blockchainConfig = JSON.parse(JSON.stringify(templateBlockchainConfig)); - blockchainConfig.implementation[blockchain].config = { - ...blockchainConfig.implementation[blockchain].config, + blockchainConfig.implementation['hardhat1:31337'].config = { + ...blockchainConfig.implementation['hardhat1:31337'].config, hubContractAddress, - rpcEndpoints: [process.env.RPC_ENDPOINT], + rpcEndpoints: [process.env.RPC_ENDPOINT_BC1], + evmOperationalWalletPublicKey: publicKeys[nodeIndex], + evmOperationalWalletPrivateKey: privateKeys[nodeIndex], + evmManagementWalletPublicKey: publicKeys[publicKeys.length - 1 - nodeIndex], + evmManagementWalletPrivateKey: privateKeys[privateKeys.length - 1 - nodeIndex], + sharesTokenName: `LocalNode${nodeIndex}`, + sharesTokenSymbol: `LN${nodeIndex}`, + }; + + // TODO: Don't use string + blockchainConfig.implementation['hardhat2:31337'].config = { + ...blockchainConfig.implementation['hardhat2:31337'].config, + hubContractAddress, + rpcEndpoints: [process.env.RPC_ENDPOINT_BC2], evmOperationalWalletPublicKey: publicKeys[nodeIndex], evmOperationalWalletPrivateKey: privateKeys[nodeIndex], evmManagementWalletPublicKey: publicKeys[publicKeys.length - 1 - nodeIndex], diff --git a/tools/local-network-setup/run-local-blockchain.js b/tools/local-network-setup/run-local-blockchain.js index 40b9333f26..33e679aca5 100644 --- a/tools/local-network-setup/run-local-blockchain.js +++ b/tools/local-network-setup/run-local-blockchain.js @@ -1,5 +1,7 @@ import LocalBlockchain from '../../test/bdd/steps/lib/local-blockchain.mjs'; +const port = parseInt(process.argv[2], 10); +const version = process.argv.length > 3 ? process.argv[3] : ''; const localBlockchain = new LocalBlockchain(); -await localBlockchain.initialize(console); +await localBlockchain.initialize(port, console, version); diff --git a/tools/local-network-setup/setup-macos-environment.sh b/tools/local-network-setup/setup-macos-environment.sh index edf36af4a3..94e3d9b0f3 100755 --- a/tools/local-network-setup/setup-macos-environment.sh +++ b/tools/local-network-setup/setup-macos-environment.sh @@ -1,9 +1,9 @@ #!/bin/sh pathToOtNode=$(pwd) numberOfNodes=4 -network="hardhat" +network="hardhat1:31337" tripleStore="ot-blazegraph" -availableNetworks=("hardhat") +availableNetworks=("hardhat1:31337") export $(xargs < $pathToOtNode/.env) export ACCESS_KEY=$RPC_ENDPOINT # Check for script arguments @@ -43,15 +43,25 @@ while [ $# -gt 0 ]; do esac shift done -if [[ $network == hardhat ]] +if [[ $network == hardhat1:31337 ]] then echo ================================ - echo ====== Starting hardhat ====== + echo ====== Starting hardhat1 ====== echo ================================ osascript -e "tell app \"Terminal\" do script \"cd $pathToOtNode - node tools/local-network-setup/run-local-blockchain.js\" + node tools/local-network-setup/run-local-blockchain.js 8545 :v1\" + end tell" + echo Waiting for hardhat to start and contracts deployment + + echo ================================ + echo ====== Starting hardhat 2 ====== + echo ================================ + + osascript -e "tell app \"Terminal\" + do script \"cd $pathToOtNode + node tools/local-network-setup/run-local-blockchain.js 9545 :v2\" end tell" echo Waiting for hardhat to start and contracts deployment fi @@ -61,7 +71,7 @@ echo ====== Generating configs ====== echo ================================ node $pathToOtNode/tools/local-network-setup/generate-config-files.js $numberOfNodes $network $tripleStore $hubContractAddress - +sleep 5 echo ================================ echo ======== Starting nodes ======== echo ================================