From 7da2841772651a9f9d44703764da75473773ba0e Mon Sep 17 00:00:00 2001 From: djordjekovac Date: Tue, 14 Nov 2023 11:44:53 +0100 Subject: [PATCH 01/11] Added service agreements operational db migration (#2780) * Added service agreements operational db migration * Update migration * Resovled issue with failing bdd tests * PR comments resolved, disabled revert to older version on error --- index.js | 44 ++- ot-node.js | 298 +++--------------- .../http-api/v0/get-http-api-controller-v0.js | 4 +- src/migration/base-migration.js | 24 ++ src/migration/migration-executor.js | 268 ++++++++++++++++ ...ervice-agreements-op-database-migration.js | 137 ++++++++ .../blockchain/implementation/web3-service.js | 48 +-- .../service-agreement-repository.js | 34 +- .../repository/repository-module-manager.js | 20 ++ src/service/file-service.js | 3 +- 10 files changed, 571 insertions(+), 309 deletions(-) create mode 100644 src/migration/migration-executor.js create mode 100644 src/migration/service-agreements-op-database-migration.js diff --git a/index.js b/index.js index 7a6cda7eef..fdc26099db 100644 --- a/index.js +++ b/index.js @@ -1,10 +1,6 @@ /* eslint-disable no-console */ import 'dotenv/config'; import fs from 'fs-extra'; -import path from 'path'; -import appRootPath from 'app-root-path'; -import { execSync } from 'child_process'; -import semver from 'semver'; import OTNode from './ot-node.js'; import { NODE_ENVIRONMENTS } from './src/constants/constants.js'; @@ -30,26 +26,26 @@ process.env.NODE_ENV = await node.start(); } catch (e) { console.error(`Error occurred while start ot-node, error message: ${e}. ${e.stack}`); - console.error(`Trying to recover from older version`); - if (process.env.NODE_ENV !== NODE_ENVIRONMENTS.DEVELOPMENT) { - const rootPath = path.join(appRootPath.path, '..'); - const oldVersionsDirs = (await fs.promises.readdir(rootPath, { withFileTypes: true })) - .filter((dirent) => dirent.isDirectory()) - .map((dirent) => dirent.name) - .filter((name) => semver.valid(name) && !appRootPath.path.includes(name)); - - if (oldVersionsDirs.length === 0) { - console.error( - `Failed to start OT-Node, no backup code available. Error message: ${e.message}`, - ); - process.exit(1); - } - - const oldVersion = oldVersionsDirs.sort(semver.compare).pop(); - const oldversionPath = path.join(rootPath, oldVersion); - execSync(`ln -sfn ${oldversionPath} ${rootPath}/current`); - await fs.promises.rm(appRootPath.path, { force: true, recursive: true }); - } + // console.error(`Trying to recover from older version`); + // if (process.env.NODE_ENV !== NODE_ENVIRONMENTS.DEVELOPMENT) { + // const rootPath = path.join(appRootPath.path, '..'); + // const oldVersionsDirs = (await fs.promises.readdir(rootPath, { withFileTypes: true })) + // .filter((dirent) => dirent.isDirectory()) + // .map((dirent) => dirent.name) + // .filter((name) => semver.valid(name) && !appRootPath.path.includes(name)); + // + // if (oldVersionsDirs.length === 0) { + // console.error( + // `Failed to start OT-Node, no backup code available. Error message: ${e.message}`, + // ); + // process.exit(1); + // } + // + // const oldVersion = oldVersionsDirs.sort(semver.compare).pop(); + // const oldversionPath = path.join(rootPath, oldVersion); + // execSync(`ln -sfn ${oldversionPath} ${rootPath}/current`); + // await fs.promises.rm(appRootPath.path, { force: true, recursive: true }); + // } process.exit(1); } })(); diff --git a/ot-node.js b/ot-node.js index 716669d52d..deff16483c 100644 --- a/ot-node.js +++ b/ot-node.js @@ -5,20 +5,11 @@ import { createRequire } from 'module'; import { execSync } from 'child_process'; import DependencyInjection from './src/service/dependency-injection.js'; import Logger from './src/logger/logger.js'; -import { MIN_NODE_VERSION, NODE_ENVIRONMENTS } from './src/constants/constants.js'; +import { MIN_NODE_VERSION } from './src/constants/constants.js'; import FileService from './src/service/file-service.js'; import OtnodeUpdateCommand from './src/commands/common/otnode-update-command.js'; import OtAutoUpdater from './src/modules/auto-updater/implementation/ot-auto-updater.js'; -import PullBlockchainShardingTableMigration from './src/migration/pull-sharding-table-migration.js'; -import TripleStoreUserConfigurationMigration from './src/migration/triple-store-user-configuration-migration.js'; -import TelemetryModuleUserConfigurationMigration from './src/migration/telemetry-module-user-configuration-migration.js'; -import PrivateAssetsMetadataMigration from './src/migration/private-assets-metadata-migration.js'; -import ServiceAgreementsMetadataMigration from './src/migration/service-agreements-metadata-migration.js'; -import RemoveAgreementStartEndTimeMigration from './src/migration/remove-agreement-start-end-time-migration.js'; -import MarkOldBlockchainEventsAsProcessedMigration from './src/migration/mark-old-blockchain-events-as-processed-migration.js'; -import TripleStoreMetadataMigration from './src/migration/triple-store-metadata-migration.js'; -import RemoveOldEpochCommandsMigration from './src/migration/remove-old-epoch-commands-migration.js'; -import PendingStorageMigration from './src/migration/pending-storage-migration.js'; +import MigrationExecutor from './src/migration/migration-executor.js'; const require = createRequire(import.meta.url); const pjson = require('./package.json'); @@ -36,8 +27,14 @@ class OTNode { async start() { await this.checkForUpdate(); await this.removeUpdateFile(); - await this.executeTripleStoreUserConfigurationMigration(); - await this.executeTelemetryModuleUserConfigurationMigration(); + await MigrationExecutor.executeTripleStoreUserConfigurationMigration( + this.logger, + this.config, + ); + await MigrationExecutor.executeTelemetryModuleUserConfigurationMigration( + this.logger, + this.config, + ); this.logger.info(' ██████╗ ████████╗███╗ ██╗ ██████╗ ██████╗ ███████╗'); this.logger.info('██╔═══██╗╚══██╔══╝████╗ ██║██╔═══██╗██╔══██╗██╔════╝'); this.logger.info('██║ ██║ ██║ ██╔██╗ ██║██║ ██║██║ ██║█████╗'); @@ -54,15 +51,47 @@ class OTNode { this.initializeEventEmitter(); await this.initializeModules(); - await this.executePullShardingTableMigration(); - await this.executePrivateAssetsMetadataMigration(); - await this.executeRemoveAgreementStartEndTimeMigration(); - await this.executeMarkOldBlockchainEventsAsProcessedMigration(); - await this.executeTripleStoreMetadataMigration(); - await this.executeServiceAgreementsMetadataMigration(); - await this.executeRemoveOldEpochCommandsMigration(); - await this.executePendingStorageMigration(); - + 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); + await MigrationExecutor.executeServiceAgreementsOpDatabaseMigration( + this.container, + this.logger, + this.config, + ); await this.createProfiles(); await this.initializeCommandExecutor(); @@ -292,211 +321,6 @@ class OTNode { }); } - async executePrivateAssetsMetadataMigration() { - if ( - process.env.NODE_ENV === NODE_ENVIRONMENTS.DEVELOPMENT || - process.env.NODE_ENV === NODE_ENVIRONMENTS.TEST - ) - return; - const blockchainModuleManager = this.container.resolve('blockchainModuleManager'); - const tripleStoreService = this.container.resolve('tripleStoreService'); - const serviceAgreementService = this.container.resolve('serviceAgreementService'); - const ualService = this.container.resolve('ualService'); - const dataService = this.container.resolve('dataService'); - - const migration = new PrivateAssetsMetadataMigration( - 'privateAssetsMetadataMigration', - this.logger, - this.config, - tripleStoreService, - blockchainModuleManager, - serviceAgreementService, - ualService, - dataService, - ); - - if (!(await migration.migrationAlreadyExecuted())) { - await migration.migrate(); - this.logger.info('Node will now restart!'); - this.stop(1); - } - } - - async executeTelemetryModuleUserConfigurationMigration() { - if ( - process.env.NODE_ENV === NODE_ENVIRONMENTS.DEVELOPMENT || - process.env.NODE_ENV === NODE_ENVIRONMENTS.TEST - ) - return; - - const migration = new TelemetryModuleUserConfigurationMigration( - 'telemetryModuleUserConfigurationMigration', - this.logger, - this.config, - ); - if (!(await migration.migrationAlreadyExecuted())) { - await migration.migrate(); - this.logger.info('Node will now restart!'); - this.stop(1); - } - } - - async executeTripleStoreUserConfigurationMigration() { - if ( - process.env.NODE_ENV === NODE_ENVIRONMENTS.DEVELOPMENT || - process.env.NODE_ENV === NODE_ENVIRONMENTS.TEST - ) - return; - - const migration = new TripleStoreUserConfigurationMigration( - 'tripleStoreUserConfigurationMigration', - this.logger, - this.config, - ); - if (!(await migration.migrationAlreadyExecuted())) { - await migration.migrate(); - this.logger.info('Node will now restart!'); - this.stop(1); - } - } - - async executePullShardingTableMigration() { - if ( - process.env.NODE_ENV === NODE_ENVIRONMENTS.DEVELOPMENT || - process.env.NODE_ENV === NODE_ENVIRONMENTS.TEST - ) - return; - - const blockchainModuleManager = this.container.resolve('blockchainModuleManager'); - const repositoryModuleManager = this.container.resolve('repositoryModuleManager'); - const validationModuleManager = this.container.resolve('validationModuleManager'); - - const migration = new PullBlockchainShardingTableMigration( - 'pullShardingTableMigrationV612', - this.logger, - this.config, - repositoryModuleManager, - blockchainModuleManager, - validationModuleManager, - ); - if (!(await migration.migrationAlreadyExecuted())) { - await migration.migrate(); - } - } - - async executeServiceAgreementsMetadataMigration() { - if ( - process.env.NODE_ENV === NODE_ENVIRONMENTS.DEVELOPMENT || - process.env.NODE_ENV === NODE_ENVIRONMENTS.TEST - ) - return; - - const blockchainModuleManager = this.container.resolve('blockchainModuleManager'); - const repositoryModuleManager = this.container.resolve('repositoryModuleManager'); - const tripleStoreService = this.container.resolve('tripleStoreService'); - const serviceAgreementService = this.container.resolve('serviceAgreementService'); - const ualService = this.container.resolve('ualService'); - - const migration = new ServiceAgreementsMetadataMigration( - 'serviceAgreementsMetadataMigration', - this.logger, - this.config, - tripleStoreService, - blockchainModuleManager, - repositoryModuleManager, - serviceAgreementService, - ualService, - ); - if (!(await migration.migrationAlreadyExecuted())) { - await migration.migrate(); - } - } - - async executeRemoveAgreementStartEndTimeMigration() { - if ( - process.env.NODE_ENV === NODE_ENVIRONMENTS.DEVELOPMENT || - process.env.NODE_ENV === NODE_ENVIRONMENTS.TEST - ) - return; - - const tripleStoreService = this.container.resolve('tripleStoreService'); - - const migration = new RemoveAgreementStartEndTimeMigration( - 'removeAgreementStartEndTimeMigration', - this.logger, - this.config, - tripleStoreService, - ); - if (!(await migration.migrationAlreadyExecuted())) { - await migration.migrate(); - } - } - - async executeTripleStoreMetadataMigration() { - if ( - process.env.NODE_ENV === NODE_ENVIRONMENTS.DEVELOPMENT || - process.env.NODE_ENV === NODE_ENVIRONMENTS.TEST - ) - return; - const blockchainModuleManager = this.container.resolve('blockchainModuleManager'); - const tripleStoreService = this.container.resolve('tripleStoreService'); - const serviceAgreementService = this.container.resolve('serviceAgreementService'); - const ualService = this.container.resolve('ualService'); - const dataService = this.container.resolve('dataService'); - - const migration = new TripleStoreMetadataMigration( - 'tripleStoreMetadataMigration', - this.logger, - this.config, - tripleStoreService, - blockchainModuleManager, - serviceAgreementService, - ualService, - dataService, - ); - - if (!(await migration.migrationAlreadyExecuted())) { - await migration.migrate(); - } - } - - async executeRemoveOldEpochCommandsMigration() { - if ( - process.env.NODE_ENV === NODE_ENVIRONMENTS.DEVELOPMENT || - process.env.NODE_ENV === NODE_ENVIRONMENTS.TEST - ) - return; - - const repositoryModuleManager = this.container.resolve('repositoryModuleManager'); - - const migration = new RemoveOldEpochCommandsMigration( - 'removeOldEpochCommandsMigration', - this.logger, - this.config, - repositoryModuleManager, - ); - if (!(await migration.migrationAlreadyExecuted())) { - await migration.migrate(); - } - } - - async executePendingStorageMigration() { - if ( - process.env.NODE_ENV === NODE_ENVIRONMENTS.DEVELOPMENT || - process.env.NODE_ENV === NODE_ENVIRONMENTS.TEST - ) - return; - - const migration = new PendingStorageMigration( - 'pendingStorageMigration', - this.logger, - this.config, - ); - if (!(await migration.migrationAlreadyExecuted())) { - await migration.migrate(); - } - } - async initializeShardingTableService() { try { const shardingTableService = this.container.resolve('shardingTableService'); @@ -533,26 +357,6 @@ class OTNode { this.logger.info('Stopping node...'); process.exit(code); } - - async executeMarkOldBlockchainEventsAsProcessedMigration() { - if ( - process.env.NODE_ENV === NODE_ENVIRONMENTS.DEVELOPMENT || - process.env.NODE_ENV === NODE_ENVIRONMENTS.TEST - ) - return; - - const repositoryModuleManager = this.container.resolve('repositoryModuleManager'); - - const migration = new MarkOldBlockchainEventsAsProcessedMigration( - 'markOldBlockchainEventsAsProcessedMigration', - this.logger, - this.config, - repositoryModuleManager, - ); - if (!(await migration.migrationAlreadyExecuted())) { - await migration.migrate(); - } - } } export default OTNode; 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 b14dbc5e17..f743fb48a6 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 @@ -87,9 +87,7 @@ class GetController extends BaseController { OPERATION_ID_STATUS.GET.GET_INIT_END, ); } catch (error) { - this.logger.error( - `Error while initializing get data: ${error.message}. ${error.stack}`, - ); + this.logger.error(`Error while initializing get data: ${error.message}.`); await this.operationService.markOperationAsFailed( operationId, diff --git a/src/migration/base-migration.js b/src/migration/base-migration.js index 0b17fa6577..afa94b65b6 100644 --- a/src/migration/base-migration.js +++ b/src/migration/base-migration.js @@ -52,6 +52,30 @@ class BaseMigration { ); } + async getMigrationInfo() { + const migrationFolderPath = this.fileService.getMigrationFolderPath(); + const migrationInfoFileName = `${this.migrationName}_info`; + const migrationInfoPath = path.join(migrationFolderPath, migrationInfoFileName); + let migrationInfo = null; + if (await this.fileService.pathExists(migrationInfoPath)) { + migrationInfo = await this.fileService + .readFile(migrationInfoPath, true) + .catch(() => {}); + } + return migrationInfo; + } + + async saveMigrationInfo(migrationInfo) { + const migrationFolderPath = this.fileService.getMigrationFolderPath(); + const migrationInfoFileName = `${this.migrationName}_info`; + await this.fileService.writeContentsToFile( + migrationFolderPath, + migrationInfoFileName, + JSON.stringify(migrationInfo), + false, + ); + } + async executeMigration() { throw Error('Execute migration method not implemented'); } diff --git a/src/migration/migration-executor.js b/src/migration/migration-executor.js new file mode 100644 index 0000000000..aed10123e0 --- /dev/null +++ b/src/migration/migration-executor.js @@ -0,0 +1,268 @@ +import { NODE_ENVIRONMENTS } from '../constants/constants.js'; +import PullBlockchainShardingTableMigration from './pull-sharding-table-migration.js'; +import PrivateAssetsMetadataMigration from './private-assets-metadata-migration.js'; +import TelemetryModuleUserConfigurationMigration from './telemetry-module-user-configuration-migration.js'; +import TripleStoreUserConfigurationMigration from './triple-store-user-configuration-migration.js'; +import ServiceAgreementsMetadataMigration from './service-agreements-metadata-migration.js'; +import RemoveAgreementStartEndTimeMigration from './remove-agreement-start-end-time-migration.js'; +import TripleStoreMetadataMigration from './triple-store-metadata-migration.js'; +import RemoveOldEpochCommandsMigration from './remove-old-epoch-commands-migration.js'; +import PendingStorageMigration from './pending-storage-migration.js'; +import MarkOldBlockchainEventsAsProcessedMigration from './mark-old-blockchain-events-as-processed-migration.js'; +import ServiceAgreementsOpDatabaseMigration from './service-agreements-op-database-migration.js'; + +class MigrationExecutor { + static async executePullShardingTableMigration(container, logger, config) { + if ( + process.env.NODE_ENV === NODE_ENVIRONMENTS.DEVELOPMENT || + process.env.NODE_ENV === NODE_ENVIRONMENTS.TEST + ) + return; + + const blockchainModuleManager = container.resolve('blockchainModuleManager'); + const repositoryModuleManager = container.resolve('repositoryModuleManager'); + const validationModuleManager = container.resolve('validationModuleManager'); + + const migration = new PullBlockchainShardingTableMigration( + 'pullShardingTableMigrationV612', + logger, + config, + repositoryModuleManager, + blockchainModuleManager, + validationModuleManager, + ); + if (!(await migration.migrationAlreadyExecuted())) { + await migration.migrate(); + } + } + + static async executePrivateAssetsMetadataMigration(container, logger, config) { + if ( + process.env.NODE_ENV === NODE_ENVIRONMENTS.DEVELOPMENT || + process.env.NODE_ENV === NODE_ENVIRONMENTS.TEST + ) + return; + const blockchainModuleManager = container.resolve('blockchainModuleManager'); + const tripleStoreService = container.resolve('tripleStoreService'); + const serviceAgreementService = container.resolve('serviceAgreementService'); + const ualService = container.resolve('ualService'); + const dataService = container.resolve('dataService'); + + const migration = new PrivateAssetsMetadataMigration( + 'privateAssetsMetadataMigration', + logger, + config, + tripleStoreService, + blockchainModuleManager, + serviceAgreementService, + ualService, + dataService, + ); + + if (!(await migration.migrationAlreadyExecuted())) { + await migration.migrate(); + logger.info('Node will now restart!'); + MigrationExecutor.exitNode(1); + } + } + + static async executeTelemetryModuleUserConfigurationMigration(logger, config) { + if ( + process.env.NODE_ENV === NODE_ENVIRONMENTS.DEVELOPMENT || + process.env.NODE_ENV === NODE_ENVIRONMENTS.TEST + ) + return; + + const migration = new TelemetryModuleUserConfigurationMigration( + 'telemetryModuleUserConfigurationMigration', + logger, + config, + ); + if (!(await migration.migrationAlreadyExecuted())) { + await migration.migrate(); + logger.info('Node will now restart!'); + MigrationExecutor.exitNode(1); + } + } + + static async executeTripleStoreUserConfigurationMigration(logger, config) { + if ( + process.env.NODE_ENV === NODE_ENVIRONMENTS.DEVELOPMENT || + process.env.NODE_ENV === NODE_ENVIRONMENTS.TEST + ) + return; + + const migration = new TripleStoreUserConfigurationMigration( + 'tripleStoreUserConfigurationMigration', + logger, + config, + ); + if (!(await migration.migrationAlreadyExecuted())) { + await migration.migrate(); + logger.info('Node will now restart!'); + MigrationExecutor.exitNode(1); + } + } + + static async executeServiceAgreementsMetadataMigration(container, logger, config) { + if ( + process.env.NODE_ENV === NODE_ENVIRONMENTS.DEVELOPMENT || + process.env.NODE_ENV === NODE_ENVIRONMENTS.TEST + ) + return; + + const blockchainModuleManager = container.resolve('blockchainModuleManager'); + const repositoryModuleManager = container.resolve('repositoryModuleManager'); + const tripleStoreService = container.resolve('tripleStoreService'); + const serviceAgreementService = container.resolve('serviceAgreementService'); + const ualService = container.resolve('ualService'); + + const migration = new ServiceAgreementsMetadataMigration( + 'serviceAgreementsMetadataMigration', + logger, + config, + tripleStoreService, + blockchainModuleManager, + repositoryModuleManager, + serviceAgreementService, + ualService, + ); + if (!(await migration.migrationAlreadyExecuted())) { + await migration.migrate(); + } + } + + static async executeRemoveAgreementStartEndTimeMigration(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 RemoveAgreementStartEndTimeMigration( + 'removeAgreementStartEndTimeMigration', + logger, + config, + tripleStoreService, + ); + if (!(await migration.migrationAlreadyExecuted())) { + await migration.migrate(); + } + } + + static async executeTripleStoreMetadataMigration(container, logger, config) { + if ( + process.env.NODE_ENV === NODE_ENVIRONMENTS.DEVELOPMENT || + process.env.NODE_ENV === NODE_ENVIRONMENTS.TEST + ) + return; + const blockchainModuleManager = container.resolve('blockchainModuleManager'); + const tripleStoreService = container.resolve('tripleStoreService'); + const serviceAgreementService = container.resolve('serviceAgreementService'); + const ualService = container.resolve('ualService'); + const dataService = container.resolve('dataService'); + + const migration = new TripleStoreMetadataMigration( + 'tripleStoreMetadataMigration', + logger, + config, + tripleStoreService, + blockchainModuleManager, + serviceAgreementService, + ualService, + dataService, + ); + + if (!(await migration.migrationAlreadyExecuted())) { + await migration.migrate(); + } + } + + static async executeRemoveOldEpochCommandsMigration(container, logger, config) { + if ( + process.env.NODE_ENV === NODE_ENVIRONMENTS.DEVELOPMENT || + process.env.NODE_ENV === NODE_ENVIRONMENTS.TEST + ) + return; + + const repositoryModuleManager = container.resolve('repositoryModuleManager'); + + const migration = new RemoveOldEpochCommandsMigration( + 'removeOldEpochCommandsMigration', + logger, + config, + repositoryModuleManager, + ); + if (!(await migration.migrationAlreadyExecuted())) { + await migration.migrate(); + } + } + + static async executePendingStorageMigration(logger, config) { + if ( + process.env.NODE_ENV === NODE_ENVIRONMENTS.DEVELOPMENT || + process.env.NODE_ENV === NODE_ENVIRONMENTS.TEST + ) + return; + + const migration = new PendingStorageMigration('pendingStorageMigration', logger, config); + if (!(await migration.migrationAlreadyExecuted())) { + await migration.migrate(); + } + } + + static async executeMarkOldBlockchainEventsAsProcessedMigration(container, logger, config) { + if ( + process.env.NODE_ENV === NODE_ENVIRONMENTS.DEVELOPMENT || + process.env.NODE_ENV === NODE_ENVIRONMENTS.TEST + ) + return; + + const repositoryModuleManager = container.resolve('repositoryModuleManager'); + + const migration = new MarkOldBlockchainEventsAsProcessedMigration( + 'markOldBlockchainEventsAsProcessedMigration', + logger, + config, + repositoryModuleManager, + ); + if (!(await migration.migrationAlreadyExecuted())) { + await migration.migrate(); + } + } + + static async executeServiceAgreementsOpDatabaseMigration(container, logger, config) { + // todo should we also exclude testnet? + if ( + process.env.NODE_ENV === NODE_ENVIRONMENTS.DEVELOPMENT || + process.env.NODE_ENV === NODE_ENVIRONMENTS.TEST + ) + return; + + const blockchainModuleManager = container.resolve('blockchainModuleManager'); + const repositoryModuleManager = container.resolve('repositoryModuleManager'); + const serviceAgreementService = container.resolve('serviceAgreementService'); + const ualService = container.resolve('ualService'); + + const migration = new ServiceAgreementsOpDatabaseMigration( + 'serviceAgreementsOpDatabaseMigration', + logger, + config, + blockchainModuleManager, + repositoryModuleManager, + serviceAgreementService, + ualService, + ); + if (!(await migration.migrationAlreadyExecuted())) { + await migration.migrate(); + } + } + + static exitNode(code = 0) { + process.exit(code); + } +} + +export default MigrationExecutor; diff --git a/src/migration/service-agreements-op-database-migration.js b/src/migration/service-agreements-op-database-migration.js new file mode 100644 index 0000000000..d5dd752a5b --- /dev/null +++ b/src/migration/service-agreements-op-database-migration.js @@ -0,0 +1,137 @@ +/* eslint-disable no-await-in-loop */ +import BaseMigration from './base-migration.js'; + +let wrongAgreementsCount = 0; +const MAX_BATCH_SIZE = 10000; +const CONCURRENCY = 3; + +class ServiceAgreementsOpDatabaseMigration extends BaseMigration { + constructor( + migrationName, + logger, + config, + blockchainModuleManager, + repositoryModuleManager, + serviceAgreementService, + ualService, + ) { + super(migrationName, logger, config); + this.blockchainModuleManager = blockchainModuleManager; + this.repositoryModuleManager = repositoryModuleManager; + this.serviceAgreementService = serviceAgreementService; + this.ualService = ualService; + } + + async executeMigration() { + let migrationInfo = await this.getMigrationInfo(); + if (!migrationInfo?.lastProcessedTokenId) { + migrationInfo = { + lastProcessedTokenId: 0, + }; + } + + const numberOfActiveServiceAgreements = + await this.repositoryModuleManager.getNumberOfActiveServiceAgreements(); + let processed = 0; + const batchSize = + numberOfActiveServiceAgreements > MAX_BATCH_SIZE + ? MAX_BATCH_SIZE + : numberOfActiveServiceAgreements; + + while (processed < numberOfActiveServiceAgreements) { + const serviceAgreementsToProcess = + await this.repositoryModuleManager.getServiceAgreements( + migrationInfo.lastProcessedTokenId, + batchSize, + ); + let promises = []; + + for (const serviceAgreement of serviceAgreementsToProcess) { + promises.push(this.processServiceAgreement(serviceAgreement)); + + if ( + promises.length >= CONCURRENCY || + promises.length === serviceAgreementsToProcess.length + ) { + try { + await Promise.all(promises); + } catch (error) { + this.logger.warn( + `Unable to process invalid service agreements. Error: ${error}`, + ); + } + promises = []; + migrationInfo.lastProcessedTokenId = + serviceAgreementsToProcess.slice(-1)[0].tokenId; + await this.saveMigrationInfo(migrationInfo); + this.logger.trace( + `${this.migrationName} Last token id processed ${migrationInfo.lastProcessedTokenId}.`, + ); + } + } + + processed += batchSize; + } + + this.logger.trace( + `${this.migrationName} Total number of processed agreements ${processed}. Found invalid agreements: ${wrongAgreementsCount}`, + ); + } + + async processServiceAgreement(serviceAgreement) { + const updatedServiceAgreement = {}; + let updated = false; + const keyword = await this.ualService.calculateLocationKeyword( + serviceAgreement.blockchainId, + serviceAgreement.assetStorageContractAddress, + serviceAgreement.tokenId, + ); + + if (serviceAgreement.keyword !== keyword) { + updatedServiceAgreement.keyword = keyword; + updated = true; + } + + const agreementId = await this.serviceAgreementService.generateId( + serviceAgreement.blockchainId, + serviceAgreement.assetStorageContractAddress, + serviceAgreement.tokenId, + keyword, + serviceAgreement.hashFunctionId, + ); + + if (serviceAgreement.agreementId !== agreementId) { + updatedServiceAgreement.agreementId = agreementId; + updated = true; + } + + const assertionIds = await this.blockchainModuleManager.getAssertionIds( + serviceAgreement.blockchain, + serviceAgreement.assetStorageContractAddress, + serviceAgreement.tokenId, + ); + const stateIndex = assertionIds.length - 1; + + if (serviceAgreement.assertionId !== assertionIds[stateIndex]) { + updatedServiceAgreement.assertionId = assertionIds[stateIndex]; + updated = true; + } + + if (serviceAgreement.stateIndex !== stateIndex) { + updatedServiceAgreement.stateIndex = stateIndex; + updated = true; + } + if (updated) { + await this.repositoryModuleManager.updateServiceAgreementForTokenId( + serviceAgreement.tokenId, + updatedServiceAgreement.agreementId ?? serviceAgreement.agreementId, + updatedServiceAgreement.keyword ?? serviceAgreement.keyword, + updatedServiceAgreement.assertionId ?? serviceAgreement.assertionId, + updatedServiceAgreement.stateIndex ?? serviceAgreement.stateIndex, + ); + wrongAgreementsCount += 1; + } + } +} + +export default ServiceAgreementsOpDatabaseMigration; diff --git a/src/modules/blockchain/implementation/web3-service.js b/src/modules/blockchain/implementation/web3-service.js index 5f7478ec2f..c53d56d2cd 100644 --- a/src/modules/blockchain/implementation/web3-service.js +++ b/src/modules/blockchain/implementation/web3-service.js @@ -215,12 +215,18 @@ class Web3Service { let message = `${functionName}(${inputs}) ${method} has been successfully executed; `; if (info.backend.result !== null && method !== 'estimateGas') { - const decodedResultData = this._decodeResultData( - inputData.slice(0, 10), - info.backend.result, - contractInstance.interface, - ); - message += `Result: ${decodedResultData}; `; + try { + const decodedResultData = this._decodeResultData( + inputData.slice(0, 10), + info.backend.result, + contractInstance.interface, + ); + message += `Result: ${decodedResultData}; `; + } catch (error) { + this.logger.warn( + `Unable to decode result data for. Message: ${message}`, + ); + } } message += `RPC: ${info.backend.provider.connection.url}.`; @@ -409,9 +415,8 @@ class Web3Service { (input, i) => `${input.name}=${args[i]}`, ); - // eslint-disable-next-line no-await-in-loop - await this.handleError( - Error(`Call ${functionName}(${inputs}) failed, reason: ${decodedErrorData}`), + throw new Error( + `Call ${functionName}(${inputs}) failed, reason: ${decodedErrorData}`, ); } } @@ -440,10 +445,8 @@ class Web3Service { (input, i) => `${input.name}=${args[i]}`, ); - await this.handleError( - Error( - `Gas estimation ${functionName}(${inputs}) failed, reason: ${decodedErrorData}`, - ), + throw new Error( + `Gas estimation ${functionName}(${inputs}) failed, reason: ${decodedErrorData}`, ); } @@ -479,10 +482,7 @@ class Web3Service { gasPrice = Math.ceil(gasPrice * 1.2); transactionRetried = true; } else { - await this.handleError( - Error(`Transaction reverted, reason: ${decodedErrorData}`), - functionName, - ); + throw new Error(`Transaction reverted, reason: ${decodedErrorData}`); } } } @@ -1023,20 +1023,6 @@ class Web3Service { await this.initializeContracts(); } - async handleError(error, functionName) { - let isRpcError = false; - try { - await this.provider.getNetwork(); - } catch (rpcError) { - isRpcError = true; - this.logger.warn( - `Unable to execute smart contract function ${functionName} using Fallback RPC Provider.`, - ); - await this.restartService(); - } - if (!isRpcError) throw error; - } - async getUpdateCommitWindowDuration() { const commitWindowDurationPerc = await this.callContractFunction( this.ParametersStorageContract, diff --git a/src/modules/repository/implementation/sequelize/repositories/service-agreement-repository.js b/src/modules/repository/implementation/sequelize/repositories/service-agreement-repository.js index fdca41bf7c..deec201839 100644 --- a/src/modules/repository/implementation/sequelize/repositories/service-agreement-repository.js +++ b/src/modules/repository/implementation/sequelize/repositories/service-agreement-repository.js @@ -23,7 +23,7 @@ class ServiceAgreementRepository { async updateServiceAgreementRecord( blockchainId, - contract, + assetStorageContractAddress, tokenId, agreementId, startTime, @@ -40,7 +40,7 @@ class ServiceAgreementRepository { ) { return this.model.upsert({ blockchainId, - assetStorageContractAddress: contract, + assetStorageContractAddress, tokenId, agreementId, startTime, @@ -57,6 +57,22 @@ class ServiceAgreementRepository { }); } + async updateServiceAgreementForTokenId(tokenId, agreementId, keyword, assertionId, stateIndex) { + return this.model.update( + { + agreementId, + keyword, + assertionId, + stateIndex, + }, + { + where: { + tokenId, + }, + }, + ); + } + async bulkCreateServiceAgreementRecords(serviceAgreements) { return this.model.bulkCreate(serviceAgreements, { validate: true, @@ -202,6 +218,20 @@ class ServiceAgreementRepository { raw: true, }); } + + async getNumberOfActiveServiceAgreements() { + return this.model.count(); + } + + async getServiceAgreements(fromTokenId, batchSize) { + return this.model.findAll({ + where: { + tokenId: { [Sequelize.Op.gte]: fromTokenId }, + }, + limit: batchSize, + order: [['token_id', 'asc']], + }); + } } export default ServiceAgreementRepository; diff --git a/src/modules/repository/repository-module-manager.js b/src/modules/repository/repository-module-manager.js index 74f832901b..5cf4a83153 100644 --- a/src/modules/repository/repository-module-manager.js +++ b/src/modules/repository/repository-module-manager.js @@ -325,6 +325,18 @@ class RepositoryModuleManager extends BaseModuleManager { } } + async updateServiceAgreementForTokenId(tokenId, agreementId, keyword, assertionId, stateIndex) { + if (this.initialized) { + return this.getRepository('service_agreement').updateServiceAgreementForTokenId( + tokenId, + agreementId, + keyword, + assertionId, + stateIndex, + ); + } + } + async bulkCreateServiceAgreementRecords(records) { if (this.initialized) { return this.getRepository('service_agreement').bulkCreateServiceAgreementRecords( @@ -405,6 +417,14 @@ class RepositoryModuleManager extends BaseModuleManager { epochsNumber, ); } + + async getNumberOfActiveServiceAgreements() { + return this.getRepository('service_agreement').getNumberOfActiveServiceAgreements(); + } + + async getServiceAgreements(fromTokenId, batchSize) { + return this.getRepository('service_agreement').getServiceAgreements(fromTokenId, batchSize); + } } export default RepositoryModuleManager; diff --git a/src/service/file-service.js b/src/service/file-service.js index 68096b91f6..7d92ce8a84 100644 --- a/src/service/file-service.js +++ b/src/service/file-service.js @@ -90,8 +90,7 @@ class FileService { } async removeFolder(folderPath) { - this.logger.trace(`Removing folder at path: ${folderPath}`); - + this.logger.debug(`Removing folder at path: ${folderPath}`); try { await rm(folderPath, { recursive: true }); return true; From 58e085041dd1c8435752466ddbad82f8172cd066 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 14 Nov 2023 11:56:41 +0100 Subject: [PATCH 02/11] Bump undici from 5.21.0 to 5.27.2 (#2762) Bumps [undici](https://github.com/nodejs/undici) from 5.21.0 to 5.27.2. - [Release notes](https://github.com/nodejs/undici/releases) - [Commits](https://github.com/nodejs/undici/compare/v5.21.0...v5.27.2) --- updated-dependencies: - dependency-name: undici dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: djordjekovac --- package-lock.json | 35 ++++++++++++++++++++++++----------- 1 file changed, 24 insertions(+), 11 deletions(-) diff --git a/package-lock.json b/package-lock.json index c4bc3b26fd..bed34ef0d5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "origintrail_node", - "version": "6.0.18", + "version": "6.0.19", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "origintrail_node", - "version": "6.0.18", + "version": "6.0.19", "license": "ISC", "dependencies": { "@comunica/query-sparql": "^2.4.3", @@ -3662,6 +3662,14 @@ "@ethersproject/strings": "^5.7.0" } }, + "node_modules/@fastify/busboy": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@fastify/busboy/-/busboy-2.0.0.tgz", + "integrity": "sha512-JUFJad5lv7jxj926GPgymrWQxxjPYuJNiNjNMzqT+HiuP6Vl3dk5xzG+8sTX96np0ZAluvaMzPsjhHZ5rNuNQQ==", + "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", @@ -18268,14 +18276,14 @@ } }, "node_modules/undici": { - "version": "5.21.0", - "resolved": "https://registry.npmjs.org/undici/-/undici-5.21.0.tgz", - "integrity": "sha512-HOjK8l6a57b2ZGXOcUsI5NLfoTrfmbOl90ixJDl0AEFG4wgHNDQxtZy15/ZQp7HhjkpaGlp/eneMgtsu1dIlUA==", + "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==", "dependencies": { - "busboy": "^1.6.0" + "@fastify/busboy": "^2.0.0" }, "engines": { - "node": ">=12.18" + "node": ">=14.0" } }, "node_modules/universalify": { @@ -22506,6 +22514,11 @@ "@ethersproject/strings": "^5.7.0" } }, + "@fastify/busboy": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@fastify/busboy/-/busboy-2.0.0.tgz", + "integrity": "sha512-JUFJad5lv7jxj926GPgymrWQxxjPYuJNiNjNMzqT+HiuP6Vl3dk5xzG+8sTX96np0ZAluvaMzPsjhHZ5rNuNQQ==" + }, "@humanwhocodes/config-array": { "version": "0.11.8", "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.8.tgz", @@ -33965,11 +33978,11 @@ } }, "undici": { - "version": "5.21.0", - "resolved": "https://registry.npmjs.org/undici/-/undici-5.21.0.tgz", - "integrity": "sha512-HOjK8l6a57b2ZGXOcUsI5NLfoTrfmbOl90ixJDl0AEFG4wgHNDQxtZy15/ZQp7HhjkpaGlp/eneMgtsu1dIlUA==", + "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==", "requires": { - "busboy": "^1.6.0" + "@fastify/busboy": "^2.0.0" } }, "universalify": { From 20eb5037adbd0133ed72f527bb92f8ea95cc0806 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 14 Nov 2023 12:03:55 +0100 Subject: [PATCH 03/11] Bump @openzeppelin/contracts from 4.9.2 to 4.9.3 (#2664) Bumps [@openzeppelin/contracts](https://github.com/OpenZeppelin/openzeppelin-contracts) from 4.9.2 to 4.9.3. - [Release notes](https://github.com/OpenZeppelin/openzeppelin-contracts/releases) - [Changelog](https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.3/CHANGELOG.md) - [Commits](https://github.com/OpenZeppelin/openzeppelin-contracts/compare/v4.9.2...v4.9.3) --- updated-dependencies: - dependency-name: "@openzeppelin/contracts" dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: djordjekovac --- package-lock.json | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/package-lock.json b/package-lock.json index bed34ef0d5..a284a9ae7e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4365,9 +4365,9 @@ } }, "node_modules/@openzeppelin/contracts": { - "version": "4.9.2", - "resolved": "https://registry.npmjs.org/@openzeppelin/contracts/-/contracts-4.9.2.tgz", - "integrity": "sha512-mO+y6JaqXjWeMh9glYVzVu8HYPGknAAnWyxTRhGeckOruyXQMNnlcW6w/Dx9ftLeIQk6N+ZJFuVmTwF7lEIFrg==" + "version": "4.9.3", + "resolved": "https://registry.npmjs.org/@openzeppelin/contracts/-/contracts-4.9.3.tgz", + "integrity": "sha512-He3LieZ1pP2TNt5JbkPA4PNT9WC3gOTOlDcFGJW4Le4QKqwmiNJCRt44APfxMxvq7OugU/cqYuPcSBzOw38DAg==" }, "node_modules/@polkadot/api": { "version": "9.14.2", @@ -23012,9 +23012,9 @@ "optional": true }, "@openzeppelin/contracts": { - "version": "4.9.2", - "resolved": "https://registry.npmjs.org/@openzeppelin/contracts/-/contracts-4.9.2.tgz", - "integrity": "sha512-mO+y6JaqXjWeMh9glYVzVu8HYPGknAAnWyxTRhGeckOruyXQMNnlcW6w/Dx9ftLeIQk6N+ZJFuVmTwF7lEIFrg==" + "version": "4.9.3", + "resolved": "https://registry.npmjs.org/@openzeppelin/contracts/-/contracts-4.9.3.tgz", + "integrity": "sha512-He3LieZ1pP2TNt5JbkPA4PNT9WC3gOTOlDcFGJW4Le4QKqwmiNJCRt44APfxMxvq7OugU/cqYuPcSBzOw38DAg==" }, "@polkadot/api": { "version": "9.14.2", From cc4ed08d3e01d466814589f9382e9d91fecc1429 Mon Sep 17 00:00:00 2001 From: Nikita Abraskin Date: Tue, 14 Nov 2023 12:04:11 +0100 Subject: [PATCH 04/11] installer upgrades: node.js installation process, check OS, check user. (#2713) Co-authored-by: djordjekovac Co-authored-by: Nikola Todorovic --- installer/installer.sh | 96 +++++++++++++++++++++++++++++++++--------- 1 file changed, 76 insertions(+), 20 deletions(-) diff --git a/installer/installer.sh b/installer/installer.sh index b9d090e96d..dda03af907 100755 --- a/installer/installer.sh +++ b/installer/installer.sh @@ -9,12 +9,15 @@ text_color() { BRED='\033[1;31m' YELLOW='\033[0;33m' BYELLOW='\033[1;33m' + BOLD='\033[1m' NC='\033[0m' # No Color echo -e "$@$NC" } header_color() { - echo && text_color $@ && echo + LIGHTCYAN='\033[1;36m' + NC='\033[0m' # No Color + echo -e "${LIGHTCYAN}$@$NC" } perform_step() { @@ -24,11 +27,41 @@ perform_step() { OUTPUT=$(${@:1:$#-1} 2>&1) if [[ $? -ne 0 ]]; then - text_color $RED FAILED + text_color $BOLD$RED FAILED echo -e "${N1}Step failed. Output of error is:${N1}${N1}$OUTPUT" + echo -e "${BRED}Press Enter to exit the installer.${NC}" + read exit 1 else - text_color $GREEN OK + text_color $BOLD$GREEN OK + fi +} + +# Function to display a notification box +notification_box() { + local message="$1" + text_color "$BOLD$message" + echo -e "${BRED}Press Enter to exit the installer.${NC}" + read +} + +# Check Ubuntu version +check_ubuntu_version() { + UBUNTU_VERSION=$(lsb_release -r -s) + + if [[ "$UBUNTU_VERSION" != "20.04" && "$UBUNTU_VERSION" != "22.04" ]]; then + notification_box "Error: OriginTrail node installer currently requires Ubuntu 20.04 LTS or 22.04 LTS versions in order to execute successfully. You are installing on Ubuntu $UBUNTU_VERSION." + echo -e "${BRED}Please make sure that you get familiar with the requirements before setting up your OriginTrail node! Documentation: docs.origintrail.io${NC}" + exit 1 + fi +} + +# Check if script is running as root +check_root() { + if [[ $EUID -ne 0 ]]; then + notification_box "Error: This script must be run as root." + echo -e "${BRED}Please re-run the script as root using 'sudo'.${NC}" + exit 1 fi } @@ -74,24 +107,36 @@ install_prereqs() { export DEBIAN_FRONTEND=noninteractive NODEJS_VER="16" - perform_step install_aliases "Updating .bashrc file with OriginTrail node aliases" - perform_step rm -rf /var/lib/dpkg/lock-frontend "Removing any frontend locks" - perform_step apt update "Updating Ubuntu package repository" - perform_step apt upgrade -y "Updating Ubuntu to latest version" - perform_step apt install unzip jq -y "Installing unzip, jq" - perform_step apt install default-jre -y "Installing default-jre" - perform_step apt install build-essential -y "Installing build-essential" - perform_step wget https://deb.nodesource.com/setup_$NODEJS_VER.x "Downloading Node.js v$NODEJS_VER" - chmod +x setup_$NODEJS_VER.x - perform_step ./setup_$NODEJS_VER.x "Installing Node.js v$NODEJS_VER" - rm -rf setup_$NODEJS_VER.x - perform_step apt update "Updating Ubuntu package repository" - perform_step apt-get install nodejs -y "Installing node.js" - perform_step npm install -g npm@^8 "Installing npm" - perform_step install_firewall "Configuring firewall" - perform_step apt remove unattended-upgrades -y "Remove unattended upgrades" + perform_step install_aliases "Updating .bashrc file with OriginTrail node aliases" > /dev/null 2>&1 + perform_step rm -rf /var/lib/dpkg/lock-frontend "Removing any frontend locks" > /dev/null 2>&1 + perform_step apt update "Updating Ubuntu package repository" > /dev/null 2>&1 + perform_step apt upgrade -y "Updating Ubuntu to the latest version" > /dev/null 2>&1 + perform_step apt install unzip jq -y "Installing unzip, jq" > /dev/null 2>&1 + perform_step apt install default-jre -y "Installing default-jre" > /dev/null 2>&1 + perform_step apt install build-essential -y "Installing build-essential" > /dev/null 2>&1 + + # Install nodejs 16 (via NVM). + wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash > /dev/null 2>&1 + export NVM_DIR="$HOME/.nvm" + # This loads nvm + [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" + # This loads nvm bash_completion + [ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" + nvm install v16.20.1 > /dev/null 2>&1 + nvm use v16.20.1 > /dev/null 2>&1 + + # Set nodejs 16.20.1 as default and link node to /usr/bin/ + nvm alias default 16.20.1 > /dev/null 2>&1 + sudo ln -s $(which node) /usr/bin/ > /dev/null 2>&1 + sudo ln -s $(which npm) /usr/bin/ > /dev/null 2>&1 + + apt remove unattended-upgrades -y > /dev/null 2>&1 + + perform_step install_firewall "Configuring firewall" > /dev/null 2>&1 + perform_step apt remove unattended-upgrades -y "Remove unattended upgrades" > /dev/null 2>&1 } + install_fuseki() { FUSEKI_VER="apache-jena-fuseki-$(git ls-remote --tags https://github.com/apache/jena | grep -o 'refs/tags/jena-[0-9]*\.[0-9]*\.[0-9]*' | sort -r | head -n 1 | grep -o '[^\/-]*$')" FUSEKI_PREV_VER="apache-jena-fuseki-$(git ls-remote --tags https://github.com/apache/jena | grep -o 'refs/tags/jena-[0-9]*\.[0-9]*\.[0-9]*' | sort -r | head -n 3 | tail -n 1 | grep -o '[^\/-]*$')" @@ -221,7 +266,7 @@ install_node() { #for ((i = 0; i < ${#blockchains[@]}; ++i)); #do # read -p "Do you want to connect your node to blockchain: ${blockchains[$i]} ? [Y]Yes [N]No [E]Exit: " choice - # case "$choice" in + # case "$choice" in # [Yy]* ) # read -p "Enter your substrate operational wallet address: " SUBSTRATE_OPERATIONAL_WALLET @@ -322,6 +367,17 @@ if [[ ! -z $(grep "arch" "/etc/os-release") ]]; then source <(curl -s https://raw.githubusercontent.com/OriginTrail/ot-node/v6/develop/installer/data/archlinux) fi + + +# Perform checks +header_color "Checking Ubuntu version" +check_ubuntu_version + +header_color "Checking root privilege" +check_root + + + #### INSTALLATION START #### clear From a894849c368e8719063f4cae5a504d1cd63c9511 Mon Sep 17 00:00:00 2001 From: Uladzislau Hubar <71610423+u-hubar@users.noreply.github.com> Date: Tue, 14 Nov 2023 12:17:18 +0100 Subject: [PATCH 05/11] Fixed non-breaking dependency vulnerabilities (#2783) Co-authored-by: djordjekovac --- package-lock.json | 1674 +++++++++++++++++++++++++++++---------------- 1 file changed, 1068 insertions(+), 606 deletions(-) diff --git a/package-lock.json b/package-lock.json index a284a9ae7e..33b0e5a3e2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -103,17 +103,89 @@ } }, "node_modules/@babel/code-frame": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.18.6.tgz", - "integrity": "sha512-TDCmlK5eOvH+eH7cdAFlNXeVJqWIQ7gW9tY1GJIpUtFb6CmjVyq2VM3u71bOyR8CRihcCgMUYoDNyLXao3+70Q==", + "version": "7.22.13", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.22.13.tgz", + "integrity": "sha512-XktuhWlJ5g+3TJXc5upd9Ks1HutSArik6jf2eAjYFyIOf4ej3RN+184cZbzDvbPnuTJIUhPKKJE3cIsYTiAT3w==", "dev": true, "dependencies": { - "@babel/highlight": "^7.18.6" + "@babel/highlight": "^7.22.13", + "chalk": "^2.4.2" }, "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", @@ -154,21 +226,21 @@ } }, "node_modules/@babel/core/node_modules/semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "dev": true, "bin": { "semver": "bin/semver.js" } }, "node_modules/@babel/generator": { - "version": "7.21.3", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.21.3.tgz", - "integrity": "sha512-QS3iR1GYC/YGUnW7IdggFeN5c1poPUurnGttOV/bZgPGV+izC/D8HnD6DLwod0fsatNyVn1G3EVWMYIF0nHbeA==", + "version": "7.23.3", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.23.3.tgz", + "integrity": "sha512-keeZWAV4LU3tW0qRi19HRpabC/ilM0HRBBzf9/k8FFiG4KVpiv0FIy4hHfLfFQZNhziCTPTmd59zoyv6DNISzg==", "dev": true, "dependencies": { - "@babel/types": "^7.21.3", + "@babel/types": "^7.23.3", "@jridgewell/gen-mapping": "^0.3.2", "@jridgewell/trace-mapping": "^0.3.17", "jsesc": "^2.5.1" @@ -220,43 +292,43 @@ } }, "node_modules/@babel/helper-compilation-targets/node_modules/semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "dev": true, "bin": { "semver": "bin/semver.js" } }, "node_modules/@babel/helper-environment-visitor": { - "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==", + "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==", "dev": true, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-function-name": { - "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==", + "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==", "dev": true, "dependencies": { - "@babel/template": "^7.20.7", - "@babel/types": "^7.21.0" + "@babel/template": "^7.22.15", + "@babel/types": "^7.23.0" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-hoist-variables": { - "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==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.22.5.tgz", + "integrity": "sha512-wGjk9QZVzvknA6yKIUURb8zY3grXCcOZt+/7Wcy8O2uctxhplmUPkOdlgoNhmdVee2c92JXbf1xpMtVNbfoxRw==", "dev": true, "dependencies": { - "@babel/types": "^7.18.6" + "@babel/types": "^7.22.5" }, "engines": { "node": ">=6.9.0" @@ -306,30 +378,30 @@ } }, "node_modules/@babel/helper-split-export-declaration": { - "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==", + "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==", "dev": true, "dependencies": { - "@babel/types": "^7.18.6" + "@babel/types": "^7.22.5" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-string-parser": { - "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==", + "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==", "dev": true, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-validator-identifier": { - "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==", + "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==", "dev": true, "engines": { "node": ">=6.9.0" @@ -359,13 +431,13 @@ } }, "node_modules/@babel/highlight": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.18.6.tgz", - "integrity": "sha512-u7stbOuYjaPezCuLj29hNW1v64M2Md2qupEKP1fHc7WdOA3DgLh37suiSrZYY7haUB7iBeQZ9P1uiRF359do3g==", + "version": "7.22.20", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.22.20.tgz", + "integrity": "sha512-dkdMCN3py0+ksCgYmGG8jKeGA/8Tk+gJwSYYlFGxG5lmhfKNoAy004YpLxpS1W2J8m/EK2Ew+yOs9pVRwO89mg==", "dev": true, "dependencies": { - "@babel/helper-validator-identifier": "^7.18.6", - "chalk": "^2.0.0", + "@babel/helper-validator-identifier": "^7.22.20", + "chalk": "^2.4.2", "js-tokens": "^4.0.0" }, "engines": { @@ -444,9 +516,9 @@ } }, "node_modules/@babel/parser": { - "version": "7.21.3", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.21.3.tgz", - "integrity": "sha512-lobG0d7aOfQRXh8AyklEAgZGvA4FShxo6xQbUrrT/cNBPUdIDojlokwJsQyCC/eKia7ifqM0yP+2DRZ4WKw2RQ==", + "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==", "dev": true, "bin": { "parser": "bin/babel-parser.js" @@ -467,33 +539,33 @@ } }, "node_modules/@babel/template": { - "version": "7.20.7", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.20.7.tgz", - "integrity": "sha512-8SegXApWe6VoNw0r9JHpSteLKTpTiLZ4rMlGIm9JQ18KiCtyQiAMEazujAHrUS5flrcqYZa75ukev3P6QmUwUw==", + "version": "7.22.15", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.22.15.tgz", + "integrity": "sha512-QPErUVm4uyJa60rkI73qneDacvdvzxshT3kksGqlGWYdOTIUOwJ7RDUL8sGqslY1uXWSL6xMFKEXDS3ox2uF0w==", "dev": true, "dependencies": { - "@babel/code-frame": "^7.18.6", - "@babel/parser": "^7.20.7", - "@babel/types": "^7.20.7" + "@babel/code-frame": "^7.22.13", + "@babel/parser": "^7.22.15", + "@babel/types": "^7.22.15" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/traverse": { - "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", + "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", "debug": "^4.1.0", "globals": "^11.1.0" }, @@ -511,13 +583,13 @@ } }, "node_modules/@babel/types": { - "version": "7.21.3", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.21.3.tgz", - "integrity": "sha512-sBGdETxC+/M4o/zKC0sl6sjWv62WFR/uzxrJ6uYyMLZOUlPnwzw0tKgVHOXxaAd5l2g8pEDM5RZ495GPQI77kg==", + "version": "7.23.3", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.23.3.tgz", + "integrity": "sha512-OZnvoH2l8PK5eUvEcUyCt/sXgr/h+UWpVuBbOljwcrAgUl6lpchoQ++PHGyQy1AtYnVA6CEq3y5xeEI10brpXw==", "dev": true, "dependencies": { - "@babel/helper-string-parser": "^7.19.4", - "@babel/helper-validator-identifier": "^7.19.1", + "@babel/helper-string-parser": "^7.22.5", + "@babel/helper-validator-identifier": "^7.22.20", "to-fast-properties": "^2.0.0" }, "engines": { @@ -2952,23 +3024,94 @@ } }, "node_modules/@ethereumjs/common": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/@ethereumjs/common/-/common-2.5.0.tgz", - "integrity": "sha512-DEHjW6e38o+JmB/NO3GZBpW4lpaiBpkFgXF6jLcJ6gETBYpEyaA5nTimsWBUJR3Vmtm/didUEbNjajskugZORg==", + "version": "2.6.5", + "resolved": "https://registry.npmjs.org/@ethereumjs/common/-/common-2.6.5.tgz", + "integrity": "sha512-lRyVQOeCDaIVtgfbowla32pzeDv2Obr8oR8Put5RdUBNRGr1VGPGQNGP6elWIpgK3YdpzqTOh4GyUGOureVeeA==", "dev": true, "dependencies": { "crc-32": "^1.2.0", - "ethereumjs-util": "^7.1.1" + "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" } }, "node_modules/@ethereumjs/tx": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/@ethereumjs/tx/-/tx-3.3.2.tgz", - "integrity": "sha512-6AaJhwg4ucmwTvw/1qLaZUX5miWrwZ4nLOUsKyb/HtzS3BMw/CasKhdi1ims9mBKeK9sOJCH4qGKOBGyJCeeog==", + "version": "3.5.2", + "resolved": "https://registry.npmjs.org/@ethereumjs/tx/-/tx-3.5.2.tgz", + "integrity": "sha512-gQDNJWKrSDGu2w7w0PzVXVBNMzb7wwdDOmOqczmhNjqFxFuIbhVJDwiGEnxFNC2/b8ifcZzY7MLcluizohRzNw==", "dev": true, "dependencies": { - "@ethereumjs/common": "^2.5.0", - "ethereumjs-util": "^7.1.2" + "@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" } }, "node_modules/@ethersproject/abi": { @@ -3663,9 +3806,9 @@ } }, "node_modules/@fastify/busboy": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@fastify/busboy/-/busboy-2.0.0.tgz", - "integrity": "sha512-JUFJad5lv7jxj926GPgymrWQxxjPYuJNiNjNMzqT+HiuP6Vl3dk5xzG+8sTX96np0ZAluvaMzPsjhHZ5rNuNQQ==", + "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" } @@ -3947,6 +4090,28 @@ } } }, + "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", @@ -5421,9 +5586,9 @@ } }, "node_modules/@types/http-cache-semantics": { - "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==", + "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==", "dev": true }, "node_modules/@types/http-link-header": { @@ -5536,9 +5701,9 @@ "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" }, "node_modules/@types/responselike": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/@types/responselike/-/responselike-1.0.0.tgz", - "integrity": "sha512-85Y2BjiufFzaMIlvJDvTTB8Fxl2xfLo4HgmHzVBz08w4wDePCTjYw66PdrolO0kzli3yam/YCgRufyo1DdQVTA==", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@types/responselike/-/responselike-1.0.3.tgz", + "integrity": "sha512-H/+L+UkTV33uf49PH5pCAUBVPNj2nDBXTN+qS1dOwyyg24l3CcicicCA7ca+HMvJBZcFgl5r8e+RR6elsb4Lyw==", "dev": true, "dependencies": { "@types/node": "*" @@ -6032,30 +6197,15 @@ } }, "node_modules/assertion-tools": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/assertion-tools/-/assertion-tools-2.0.2.tgz", - "integrity": "sha512-wntV3+hNWfd0vAs1vaBsSBEaa7W7Qs3Wbu9Sh0WeZEr+RZ55ImjFICh1Bfi1ArGTXYgjd/zQa5YSSOFvs18UGQ==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/assertion-tools/-/assertion-tools-2.1.0.tgz", + "integrity": "sha512-HCI/K2G9x/PlTpj0XuB2K3gR09C5VSXfqOfhzeqONC1x3WHRlUOIZmSSodaA5uLamUE45x8pnHjJxSyqxOI7tA==", "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", @@ -6617,9 +6767,9 @@ } }, "node_modules/cacheable-request": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/cacheable-request/-/cacheable-request-7.0.2.tgz", - "integrity": "sha512-pouW8/FmiPQbuGpkXQ9BAPv/Mo5xDGANgSNXzTzJ8DrKGuXOssM4wIQRjfanNRh3Yu5cfYPvcorqbhg2KIJtew==", + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/cacheable-request/-/cacheable-request-7.0.4.tgz", + "integrity": "sha512-v+p6ongsrp0yTGbJXjgxPow2+DL93DASP4kXCDKb8/bwRtt9OEF3whggkkDkGNzgcWy2XaF4a8nZglC7uElscg==", "dev": true, "dependencies": { "clone-response": "^1.0.2", @@ -7387,9 +7537,9 @@ } }, "node_modules/crypto-js": { - "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==" + "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==" }, "node_modules/d": { "version": "1.0.1", @@ -8172,12 +8322,12 @@ "optional": true }, "node_modules/dkg.js": { - "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==", + "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==", "dev": true, "dependencies": { - "assertion-tools": "^2.0.2", + "assertion-tools": "^2.1.0", "axios": "^0.27.2", "dkg-evm-module": "^4.0.4", "ethers": "^6.1.0", @@ -8862,9 +9012,9 @@ } }, "node_modules/eslint-config-airbnb-base/node_modules/semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "dev": true, "bin": { "semver": "bin/semver.js" @@ -8997,9 +9147,9 @@ } }, "node_modules/eslint-plugin-import/node_modules/semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "dev": true, "peer": true, "bin": { @@ -9038,9 +9188,9 @@ } }, "node_modules/eslint-plugin-jsx-a11y/node_modules/semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "dev": true, "peer": true, "bin": { @@ -9122,9 +9272,9 @@ } }, "node_modules/eslint-plugin-react/node_modules/semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "dev": true, "peer": true, "bin": { @@ -9349,6 +9499,7 @@ "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", @@ -10209,9 +10360,9 @@ } }, "node_modules/get-func-name": { - "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==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.2.tgz", + "integrity": "sha512-8vXOvuE167CtIc3OyItco7N/dpRtBbYOsPsXCz7X/PMnlGjYjSGuZJgM1Y7mmew7BKf9BqvLX2tnOVy1BBUsxQ==", "dev": true, "engines": { "node": "*" @@ -10659,23 +10810,34 @@ } }, "node_modules/hardhat-deploy": { - "version": "0.11.25", - "resolved": "https://registry.npmjs.org/hardhat-deploy/-/hardhat-deploy-0.11.25.tgz", - "integrity": "sha512-ppSgrVE9A13YgTmf2PQGoyIs9o/jgJOMORrUP/rblU5K8mQ2YHWlPvkzZmP4h+SBW+tNmlnvSrf5K5DmMmExhw==", + "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==", "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.5.3", + "ethers": "^5.7.0", "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.8.1" + "zksync-web3": "^0.14.3" } }, "node_modules/hardhat-deploy-ethers": { @@ -10890,9 +11052,9 @@ } }, "node_modules/hardhat/node_modules/semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "bin": { "semver": "bin/semver.js" } @@ -11248,9 +11410,9 @@ } }, "node_modules/http2-wrapper": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/http2-wrapper/-/http2-wrapper-2.2.0.tgz", - "integrity": "sha512-kZB0wxMo0sh1PehyjJUWRFEd99KC5TLjZ2cULC4f9iqJBAmKQQXEICjxl5iPJRwP40dpeHFqqhm7tYCvODpqpQ==", + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/http2-wrapper/-/http2-wrapper-2.2.1.tgz", + "integrity": "sha512-V5nVw1PAOgfI3Lmeaj2Exmeg7fenjhRUgz1lPSezy1CuhPYbgQtbQj4jZfEAEMlaL+vupsvhjqCyjzob0yxsmQ==", "dev": true, "dependencies": { "quick-lru": "^5.1.1", @@ -12080,9 +12242,9 @@ } }, "node_modules/istanbul-lib-instrument/node_modules/semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "dev": true, "bin": { "semver": "bin/semver.js" @@ -12657,9 +12819,9 @@ "integrity": "sha512-zwhgOhhniaL7oxMgUMKKw5219PWWABMO+dgMnzJOQ2/5L3XJtTJGhW2PEXlxXj9zaccdReZJZ83+4NPhVfNVDg==" }, "node_modules/keyv": { - "version": "4.5.2", - "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.2.tgz", - "integrity": "sha512-5MHbFaKn8cNSmVW7BYnijeAVlE4cYA/SVkifVgrh7yotnfhKmjuXpDKjrABLnT0SfHWV21P8ow07OGfRrNDg8g==", + "version": "4.5.4", + "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", + "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==", "dev": true, "dependencies": { "json-buffer": "3.0.1" @@ -13233,9 +13395,9 @@ } }, "node_modules/lint-staged/node_modules/yaml": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.2.1.tgz", - "integrity": "sha512-e0WHiYql7+9wr4cWMx3TVQrNwejKaEe7/rHNmQmqRjazfOP5W8PB6Jpebb5o6fIapbz9o9+2ipcaTM2ZwDI6lw==", + "version": "2.3.4", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.3.4.tgz", + "integrity": "sha512-8aAvwVUSHpfEqTQ4w/KMlf3HcRdt50E5ODIQJBw1fQ5RL34xabzxtUlzTXVqc4rkZsPbvrXKWnABCD7kWSmocA==", "dev": true, "engines": { "node": ">= 14" @@ -13539,9 +13701,9 @@ } }, "node_modules/make-dir/node_modules/semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "dev": true, "bin": { "semver": "bin/semver.js" @@ -13655,6 +13817,21 @@ "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", @@ -13663,6 +13840,11 @@ "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", @@ -17080,9 +17262,9 @@ } }, "node_modules/solc/node_modules/semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", + "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", "bin": { "semver": "bin/semver" } @@ -17278,9 +17460,9 @@ } }, "node_modules/sshpk": { - "version": "1.17.0", - "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.17.0.tgz", - "integrity": "sha512-/9HIEs1ZXGhSPE8X6Ccm7Nam1z8KcoCqPdI7ecm1N33EzAetWahvQWVqLZtaZQ+IDKX4IyA2o0gBzqIMkAagHQ==", + "version": "1.18.0", + "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.18.0.tgz", + "integrity": "sha512-2p2KJZTSqQ/I3+HX42EpYOa2l3f8Erv8MWKsy2I9uf4wA7yFIkXRffYdsx86y6z4vHtV8u7g+pPlr8/4ouAxsQ==", "dev": true, "dependencies": { "asn1": "~0.2.3", @@ -18544,28 +18726,28 @@ "integrity": "sha512-LCHW+fE2UBJ2vjhqJujqmoxh1ytEDEr0dPO3CabMdMDJPKmsaxzS90V1Ar6LtNE5VHLqxR4YMEj1i4lzMAccIA==" }, "node_modules/web3": { - "version": "1.8.2", - "resolved": "https://registry.npmjs.org/web3/-/web3-1.8.2.tgz", - "integrity": "sha512-92h0GdEHW9wqDICQQKyG4foZBYi0OQkyg4CRml2F7XBl/NG+fu9o6J19kzfFXzSBoA4DnJXbyRgj/RHZv5LRiw==", + "version": "1.10.3", + "resolved": "https://registry.npmjs.org/web3/-/web3-1.10.3.tgz", + "integrity": "sha512-DgUdOOqC/gTqW+VQl1EdPxrVRPB66xVNtuZ5KD4adVBtko87hkgM8BTZ0lZ8IbUfnQk6DyjcDujMiH3oszllAw==", "dev": true, "hasInstallScript": true, "dependencies": { - "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": "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" }, "engines": { "node": ">=8.0.0" } }, "node_modules/web3-bzz": { - "version": "1.8.2", - "resolved": "https://registry.npmjs.org/web3-bzz/-/web3-bzz-1.8.2.tgz", - "integrity": "sha512-1EEnxjPnFnvNWw3XeeKuTR8PBxYd0+XWzvaLK7OJC/Go9O8llLGxrxICbKV+8cgIE0sDRBxiYx02X+6OhoAQ9w==", + "version": "1.10.3", + "resolved": "https://registry.npmjs.org/web3-bzz/-/web3-bzz-1.10.3.tgz", + "integrity": "sha512-XDIRsTwekdBXtFytMpHBuun4cK4x0ZMIDXSoo1UVYp+oMyZj07c7gf7tNQY5qZ/sN+CJIas4ilhN25VJcjSijQ==", "dev": true, "hasInstallScript": true, "dependencies": { @@ -18584,56 +18766,56 @@ "dev": true }, "node_modules/web3-core": { - "version": "1.8.2", - "resolved": "https://registry.npmjs.org/web3-core/-/web3-core-1.8.2.tgz", - "integrity": "sha512-DJTVEAYcNqxkqruJE+Rxp3CIv0y5AZMwPHQmOkz/cz+MM75SIzMTc0AUdXzGyTS8xMF8h3YWMQGgGEy8SBf1PQ==", + "version": "1.10.3", + "resolved": "https://registry.npmjs.org/web3-core/-/web3-core-1.10.3.tgz", + "integrity": "sha512-Vbk0/vUNZxJlz3RFjAhNNt7qTpX8yE3dn3uFxfX5OHbuon5u65YEOd3civ/aQNW745N0vGUlHFNxxmn+sG9DIw==", "dev": true, "dependencies": { - "@types/bn.js": "^5.1.0", + "@types/bn.js": "^5.1.1", "@types/node": "^12.12.6", "bignumber.js": "^9.0.0", - "web3-core-helpers": "1.8.2", - "web3-core-method": "1.8.2", - "web3-core-requestmanager": "1.8.2", - "web3-utils": "1.8.2" + "web3-core-helpers": "1.10.3", + "web3-core-method": "1.10.3", + "web3-core-requestmanager": "1.10.3", + "web3-utils": "1.10.3" }, "engines": { "node": ">=8.0.0" } }, "node_modules/web3-core-helpers": { - "version": "1.8.2", - "resolved": "https://registry.npmjs.org/web3-core-helpers/-/web3-core-helpers-1.8.2.tgz", - "integrity": "sha512-6B1eLlq9JFrfealZBomd1fmlq1o4A09vrCVQSa51ANoib/jllT3atZrRDr0zt1rfI7TSZTZBXdN/aTdeN99DWw==", + "version": "1.10.3", + "resolved": "https://registry.npmjs.org/web3-core-helpers/-/web3-core-helpers-1.10.3.tgz", + "integrity": "sha512-Yv7dQC3B9ipOc5sWm3VAz1ys70Izfzb8n9rSiQYIPjpqtJM+3V4EeK6ghzNR6CO2es0+Yu9CtCkw0h8gQhrTxA==", "dev": true, "dependencies": { - "web3-eth-iban": "1.8.2", - "web3-utils": "1.8.2" + "web3-eth-iban": "1.10.3", + "web3-utils": "1.10.3" }, "engines": { "node": ">=8.0.0" } }, "node_modules/web3-core-method": { - "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==", + "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==", "dev": true, "dependencies": { "@ethersproject/transactions": "^5.6.2", - "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-helpers": "1.10.3", + "web3-core-promievent": "1.10.3", + "web3-core-subscriptions": "1.10.3", + "web3-utils": "1.10.3" }, "engines": { "node": ">=8.0.0" } }, "node_modules/web3-core-promievent": { - "version": "1.8.2", - "resolved": "https://registry.npmjs.org/web3-core-promievent/-/web3-core-promievent-1.8.2.tgz", - "integrity": "sha512-nvkJWDVgoOSsolJldN33tKW6bKKRJX3MCPDYMwP5SUFOA/mCzDEoI88N0JFofDTXkh1k7gOqp1pvwi9heuaxGg==", + "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==", "dev": true, "dependencies": { "eventemitter3": "4.0.4" @@ -18649,29 +18831,29 @@ "dev": true }, "node_modules/web3-core-requestmanager": { - "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==", + "version": "1.10.3", + "resolved": "https://registry.npmjs.org/web3-core-requestmanager/-/web3-core-requestmanager-1.10.3.tgz", + "integrity": "sha512-VT9sKJfgM2yBOIxOXeXiDuFMP4pxzF6FT+y8KTLqhDFHkbG3XRe42Vm97mB/IvLQCJOmokEjl3ps8yP1kbggyw==", "dev": true, "dependencies": { "util": "^0.12.5", - "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-helpers": "1.10.3", + "web3-providers-http": "1.10.3", + "web3-providers-ipc": "1.10.3", + "web3-providers-ws": "1.10.3" }, "engines": { "node": ">=8.0.0" } }, "node_modules/web3-core-subscriptions": { - "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==", + "version": "1.10.3", + "resolved": "https://registry.npmjs.org/web3-core-subscriptions/-/web3-core-subscriptions-1.10.3.tgz", + "integrity": "sha512-KW0Mc8sgn70WadZu7RjQ4H5sNDJ5Lx8JMI3BWos+f2rW0foegOCyWhRu33W1s6ntXnqeBUw5rRCXZRlA3z+HNA==", "dev": true, "dependencies": { "eventemitter3": "4.0.4", - "web3-core-helpers": "1.8.2" + "web3-core-helpers": "1.10.3" }, "engines": { "node": ">=8.0.0" @@ -18690,57 +18872,57 @@ "dev": true }, "node_modules/web3-eth": { - "version": "1.8.2", - "resolved": "https://registry.npmjs.org/web3-eth/-/web3-eth-1.8.2.tgz", - "integrity": "sha512-JoTiWWc4F4TInpbvDUGb0WgDYJsFhuIjJlinc5ByjWD88Gvh+GKLsRjjFdbqe5YtwIGT4NymwoC5LQd1K6u/QQ==", + "version": "1.10.3", + "resolved": "https://registry.npmjs.org/web3-eth/-/web3-eth-1.10.3.tgz", + "integrity": "sha512-Uk1U2qGiif2mIG8iKu23/EQJ2ksB1BQXy3wF3RvFuyxt8Ft9OEpmGlO7wOtAyJdoKzD5vcul19bJpPcWSAYZhA==", "dev": true, "dependencies": { - "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-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" }, "engines": { "node": ">=8.0.0" } }, "node_modules/web3-eth-abi": { - "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==", + "version": "1.10.3", + "resolved": "https://registry.npmjs.org/web3-eth-abi/-/web3-eth-abi-1.10.3.tgz", + "integrity": "sha512-O8EvV67uhq0OiCMekqYsDtb6FzfYzMXT7VMHowF8HV6qLZXCGTdB/NH4nJrEh2mFtEwVdS6AmLFJAQd2kVyoMQ==", "dev": true, "dependencies": { "@ethersproject/abi": "^5.6.3", - "web3-utils": "1.8.2" + "web3-utils": "1.10.3" }, "engines": { "node": ">=8.0.0" } }, "node_modules/web3-eth-accounts": { - "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==", + "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==", "dev": true, "dependencies": { - "@ethereumjs/common": "2.5.0", - "@ethereumjs/tx": "3.3.2", + "@ethereumjs/common": "2.6.5", + "@ethereumjs/tx": "3.5.2", + "@ethereumjs/util": "^8.1.0", "eth-lib": "0.2.8", - "ethereumjs-util": "^7.1.5", "scrypt-js": "^3.0.1", "uuid": "^9.0.0", - "web3-core": "1.8.2", - "web3-core-helpers": "1.8.2", - "web3-core-method": "1.8.2", - "web3-utils": "1.8.2" + "web3-core": "1.10.3", + "web3-core-helpers": "1.10.3", + "web3-core-method": "1.10.3", + "web3-utils": "1.10.3" }, "engines": { "node": ">=8.0.0" @@ -18764,77 +18946,81 @@ } }, "node_modules/web3-eth-accounts/node_modules/uuid": { - "version": "9.0.0", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.0.tgz", - "integrity": "sha512-MXcSTerfPa4uqyzStbRoTgt5XIe3x5+42+q1sDuy3R5MDk66URdLMOZe5aPX/SQd+kuYAh0FdP/pO28IkQyTeg==", + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.1.tgz", + "integrity": "sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==", "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.8.2", - "resolved": "https://registry.npmjs.org/web3-eth-contract/-/web3-eth-contract-1.8.2.tgz", - "integrity": "sha512-ID5A25tHTSBNwOPjiXSVzxruz006ULRIDbzWTYIFTp7NJ7vXu/kynKK2ag/ObuTqBpMbobP8nXcA9b5EDkIdQA==", + "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==", "dev": true, "dependencies": { - "@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" + "@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" }, "engines": { "node": ">=8.0.0" } }, "node_modules/web3-eth-ens": { - "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==", + "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==", "dev": true, "dependencies": { "content-hash": "^2.5.2", "eth-ens-namehash": "2.0.8", - "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-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" }, "engines": { "node": ">=8.0.0" } }, "node_modules/web3-eth-iban": { - "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==", + "version": "1.10.3", + "resolved": "https://registry.npmjs.org/web3-eth-iban/-/web3-eth-iban-1.10.3.tgz", + "integrity": "sha512-ZCfOjYKAjaX2TGI8uif5ah+J3BYFuo+47JOIV1RIz2l7kD9VfnxvRH5UiQDRyMALQC7KFd2hUqIEtHklapNyKA==", "dev": true, "dependencies": { "bn.js": "^5.2.1", - "web3-utils": "1.8.2" + "web3-utils": "1.10.3" }, "engines": { "node": ">=8.0.0" } }, "node_modules/web3-eth-personal": { - "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==", + "version": "1.10.3", + "resolved": "https://registry.npmjs.org/web3-eth-personal/-/web3-eth-personal-1.10.3.tgz", + "integrity": "sha512-avrQ6yWdADIvuNQcFZXmGLCEzulQa76hUOuVywN7O3cklB4nFc/Gp3yTvD3bOAaE7DhjLQfhUTCzXL7WMxVTsw==", "dev": true, "dependencies": { "@types/node": "^12.12.6", - "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" + "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" }, "engines": { "node": ">=8.0.0" @@ -18847,55 +19033,84 @@ "dev": true }, "node_modules/web3-net": { - "version": "1.8.2", - "resolved": "https://registry.npmjs.org/web3-net/-/web3-net-1.8.2.tgz", - "integrity": "sha512-1itkDMGmbgb83Dg9nporFes9/fxsU7smJ3oRXlFkg4ZHn8YJyP1MSQFPJWWwSc+GrcCFt4O5IrUTvEkHqE3xag==", + "version": "1.10.3", + "resolved": "https://registry.npmjs.org/web3-net/-/web3-net-1.10.3.tgz", + "integrity": "sha512-IoSr33235qVoI1vtKssPUigJU9Fc/Ph0T9CgRi15sx+itysmvtlmXMNoyd6Xrgm9LuM4CIhxz7yDzH93B79IFg==", "dev": true, "dependencies": { - "web3-core": "1.8.2", - "web3-core-method": "1.8.2", - "web3-utils": "1.8.2" + "web3-core": "1.10.3", + "web3-core-method": "1.10.3", + "web3-utils": "1.10.3" }, "engines": { "node": ">=8.0.0" } }, "node_modules/web3-providers-http": { - "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==", + "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==", "dev": true, "dependencies": { - "abortcontroller-polyfill": "^1.7.3", - "cross-fetch": "^3.1.4", + "abortcontroller-polyfill": "^1.7.5", + "cross-fetch": "^4.0.0", "es6-promise": "^4.2.8", - "web3-core-helpers": "1.8.2" + "web3-core-helpers": "1.10.3" }, "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.8.2", - "resolved": "https://registry.npmjs.org/web3-providers-ipc/-/web3-providers-ipc-1.8.2.tgz", - "integrity": "sha512-p6fqKVGFg+WiXGHWnB1hu43PbvPkDHTz4RgoEzbXugv5rtv5zfYLqm8Ba6lrJOS5ks9kGKR21a0y3NzE3u7V4w==", + "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==", "dev": true, "dependencies": { "oboe": "2.1.5", - "web3-core-helpers": "1.8.2" + "web3-core-helpers": "1.10.3" }, "engines": { "node": ">=8.0.0" } }, "node_modules/web3-providers-ws": { - "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==", + "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==", "dev": true, "dependencies": { "eventemitter3": "4.0.4", - "web3-core-helpers": "1.8.2", + "web3-core-helpers": "1.10.3", "websocket": "^1.0.32" }, "engines": { @@ -18909,29 +19124,30 @@ "dev": true }, "node_modules/web3-shh": { - "version": "1.8.2", - "resolved": "https://registry.npmjs.org/web3-shh/-/web3-shh-1.8.2.tgz", - "integrity": "sha512-uZ+3MAoNcaJsXXNCDnizKJ5viBNeHOFYsCbFhV755Uu52FswzTOw6DtE7yK9nYXMtIhiSgi7nwl1RYzP8pystw==", + "version": "1.10.3", + "resolved": "https://registry.npmjs.org/web3-shh/-/web3-shh-1.10.3.tgz", + "integrity": "sha512-cAZ60CPvs9azdwMSQ/PSUdyV4PEtaW5edAZhu3rCXf6XxQRliBboic+AvwUvB6j3eswY50VGa5FygfVmJ1JVng==", "dev": true, "hasInstallScript": true, "dependencies": { - "web3-core": "1.8.2", - "web3-core-method": "1.8.2", - "web3-core-subscriptions": "1.8.2", - "web3-net": "1.8.2" + "web3-core": "1.10.3", + "web3-core-method": "1.10.3", + "web3-core-subscriptions": "1.10.3", + "web3-net": "1.10.3" }, "engines": { "node": ">=8.0.0" } }, "node_modules/web3-utils": { - "version": "1.8.2", - "resolved": "https://registry.npmjs.org/web3-utils/-/web3-utils-1.8.2.tgz", - "integrity": "sha512-v7j6xhfLQfY7xQDrUP0BKbaNrmZ2/+egbqP9q3KYmOiPpnvAfol+32slgL0WX/5n8VPvKCK5EZ1HGrAVICSToA==", + "version": "1.10.3", + "resolved": "https://registry.npmjs.org/web3-utils/-/web3-utils-1.10.3.tgz", + "integrity": "sha512-OqcUrEE16fDBbGoQtZXWdavsPzbGIDc5v3VrRTZ0XrIpefC/viZ1ZU9bGEemazyS0catk/3rkOOxpzTfY+XsyQ==", "dependencies": { + "@ethereumjs/util": "^8.1.0", "bn.js": "^5.2.1", "ethereum-bloom-filters": "^1.0.6", - "ethereumjs-util": "^7.1.0", + "ethereum-cryptography": "^2.1.2", "ethjs-unit": "0.1.6", "number-to-bn": "1.7.0", "randombytes": "^2.1.0", @@ -18941,6 +19157,53 @@ "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", @@ -19418,11 +19681,11 @@ } }, "node_modules/zksync-web3": { - "version": "0.8.1", - "resolved": "https://registry.npmjs.org/zksync-web3/-/zksync-web3-0.8.1.tgz", - "integrity": "sha512-1A4aHPQ3MyuGjpv5X/8pVEN+MdZqMjfVmiweQSRjOlklXYu65wT9BGEOtCmMs5d3gIvLp4ssfTeuR5OCKOD2kw==", + "version": "0.14.4", + "resolved": "https://registry.npmjs.org/zksync-web3/-/zksync-web3-0.14.4.tgz", + "integrity": "sha512-kYehMD/S6Uhe1g434UnaMN+sBr9nQm23Ywn0EUP5BfQCsbjcr3ORuS68PosZw8xUTu3pac7G6YMSnNHk+fwzvg==", "peerDependencies": { - "ethers": "~5.7.0" + "ethers": "^5.7.0" } } }, @@ -19444,12 +19707,71 @@ } }, "@babel/code-frame": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.18.6.tgz", - "integrity": "sha512-TDCmlK5eOvH+eH7cdAFlNXeVJqWIQ7gW9tY1GJIpUtFb6CmjVyq2VM3u71bOyR8CRihcCgMUYoDNyLXao3+70Q==", + "version": "7.22.13", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.22.13.tgz", + "integrity": "sha512-XktuhWlJ5g+3TJXc5upd9Ks1HutSArik6jf2eAjYFyIOf4ej3RN+184cZbzDvbPnuTJIUhPKKJE3cIsYTiAT3w==", "dev": true, "requires": { - "@babel/highlight": "^7.18.6" + "@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/compat-data": { @@ -19482,20 +19804,20 @@ }, "dependencies": { "semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "dev": true } } }, "@babel/generator": { - "version": "7.21.3", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.21.3.tgz", - "integrity": "sha512-QS3iR1GYC/YGUnW7IdggFeN5c1poPUurnGttOV/bZgPGV+izC/D8HnD6DLwod0fsatNyVn1G3EVWMYIF0nHbeA==", + "version": "7.23.3", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.23.3.tgz", + "integrity": "sha512-keeZWAV4LU3tW0qRi19HRpabC/ilM0HRBBzf9/k8FFiG4KVpiv0FIy4hHfLfFQZNhziCTPTmd59zoyv6DNISzg==", "dev": true, "requires": { - "@babel/types": "^7.21.3", + "@babel/types": "^7.23.3", "@jridgewell/gen-mapping": "^0.3.2", "@jridgewell/trace-mapping": "^0.3.17", "jsesc": "^2.5.1" @@ -19537,36 +19859,36 @@ } }, "semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "dev": true } } }, "@babel/helper-environment-visitor": { - "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==", + "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==", "dev": true }, "@babel/helper-function-name": { - "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==", + "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==", "dev": true, "requires": { - "@babel/template": "^7.20.7", - "@babel/types": "^7.21.0" + "@babel/template": "^7.22.15", + "@babel/types": "^7.23.0" } }, "@babel/helper-hoist-variables": { - "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==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.22.5.tgz", + "integrity": "sha512-wGjk9QZVzvknA6yKIUURb8zY3grXCcOZt+/7Wcy8O2uctxhplmUPkOdlgoNhmdVee2c92JXbf1xpMtVNbfoxRw==", "dev": true, "requires": { - "@babel/types": "^7.18.6" + "@babel/types": "^7.22.5" } }, "@babel/helper-module-imports": { @@ -19604,24 +19926,24 @@ } }, "@babel/helper-split-export-declaration": { - "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==", + "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==", "dev": true, "requires": { - "@babel/types": "^7.18.6" + "@babel/types": "^7.22.5" } }, "@babel/helper-string-parser": { - "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==", + "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==", "dev": true }, "@babel/helper-validator-identifier": { - "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==", + "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==", "dev": true }, "@babel/helper-validator-option": { @@ -19642,13 +19964,13 @@ } }, "@babel/highlight": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.18.6.tgz", - "integrity": "sha512-u7stbOuYjaPezCuLj29hNW1v64M2Md2qupEKP1fHc7WdOA3DgLh37suiSrZYY7haUB7iBeQZ9P1uiRF359do3g==", + "version": "7.22.20", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.22.20.tgz", + "integrity": "sha512-dkdMCN3py0+ksCgYmGG8jKeGA/8Tk+gJwSYYlFGxG5lmhfKNoAy004YpLxpS1W2J8m/EK2Ew+yOs9pVRwO89mg==", "dev": true, "requires": { - "@babel/helper-validator-identifier": "^7.18.6", - "chalk": "^2.0.0", + "@babel/helper-validator-identifier": "^7.22.20", + "chalk": "^2.4.2", "js-tokens": "^4.0.0" }, "dependencies": { @@ -19711,9 +20033,9 @@ } }, "@babel/parser": { - "version": "7.21.3", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.21.3.tgz", - "integrity": "sha512-lobG0d7aOfQRXh8AyklEAgZGvA4FShxo6xQbUrrT/cNBPUdIDojlokwJsQyCC/eKia7ifqM0yP+2DRZ4WKw2RQ==", + "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==", "dev": true }, "@babel/runtime": { @@ -19725,30 +20047,30 @@ } }, "@babel/template": { - "version": "7.20.7", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.20.7.tgz", - "integrity": "sha512-8SegXApWe6VoNw0r9JHpSteLKTpTiLZ4rMlGIm9JQ18KiCtyQiAMEazujAHrUS5flrcqYZa75ukev3P6QmUwUw==", + "version": "7.22.15", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.22.15.tgz", + "integrity": "sha512-QPErUVm4uyJa60rkI73qneDacvdvzxshT3kksGqlGWYdOTIUOwJ7RDUL8sGqslY1uXWSL6xMFKEXDS3ox2uF0w==", "dev": true, "requires": { - "@babel/code-frame": "^7.18.6", - "@babel/parser": "^7.20.7", - "@babel/types": "^7.20.7" + "@babel/code-frame": "^7.22.13", + "@babel/parser": "^7.22.15", + "@babel/types": "^7.22.15" } }, "@babel/traverse": { - "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", + "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", "debug": "^4.1.0", "globals": "^11.1.0" }, @@ -19762,13 +20084,13 @@ } }, "@babel/types": { - "version": "7.21.3", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.21.3.tgz", - "integrity": "sha512-sBGdETxC+/M4o/zKC0sl6sjWv62WFR/uzxrJ6uYyMLZOUlPnwzw0tKgVHOXxaAd5l2g8pEDM5RZ495GPQI77kg==", + "version": "7.23.3", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.23.3.tgz", + "integrity": "sha512-OZnvoH2l8PK5eUvEcUyCt/sXgr/h+UWpVuBbOljwcrAgUl6lpchoQ++PHGyQy1AtYnVA6CEq3y5xeEI10brpXw==", "dev": true, "requires": { - "@babel/helper-string-parser": "^7.19.4", - "@babel/helper-validator-identifier": "^7.19.1", + "@babel/helper-string-parser": "^7.22.5", + "@babel/helper-validator-identifier": "^7.22.20", "to-fast-properties": "^2.0.0" } }, @@ -22116,23 +22438,75 @@ "integrity": "sha512-lxJ9R5ygVm8ZWgYdUweoq5ownDlJ4upvoWmO4eLxBYHdMo+vZ/Rx0EN6MbKWDJOSUGrqJy2Gt+Dyv/VKml0fjg==" }, "@ethereumjs/common": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/@ethereumjs/common/-/common-2.5.0.tgz", - "integrity": "sha512-DEHjW6e38o+JmB/NO3GZBpW4lpaiBpkFgXF6jLcJ6gETBYpEyaA5nTimsWBUJR3Vmtm/didUEbNjajskugZORg==", + "version": "2.6.5", + "resolved": "https://registry.npmjs.org/@ethereumjs/common/-/common-2.6.5.tgz", + "integrity": "sha512-lRyVQOeCDaIVtgfbowla32pzeDv2Obr8oR8Put5RdUBNRGr1VGPGQNGP6elWIpgK3YdpzqTOh4GyUGOureVeeA==", "dev": true, "requires": { "crc-32": "^1.2.0", - "ethereumjs-util": "^7.1.1" + "ethereumjs-util": "^7.1.5" } }, + "@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.3.2", - "resolved": "https://registry.npmjs.org/@ethereumjs/tx/-/tx-3.3.2.tgz", - "integrity": "sha512-6AaJhwg4ucmwTvw/1qLaZUX5miWrwZ4nLOUsKyb/HtzS3BMw/CasKhdi1ims9mBKeK9sOJCH4qGKOBGyJCeeog==", + "version": "3.5.2", + "resolved": "https://registry.npmjs.org/@ethereumjs/tx/-/tx-3.5.2.tgz", + "integrity": "sha512-gQDNJWKrSDGu2w7w0PzVXVBNMzb7wwdDOmOqczmhNjqFxFuIbhVJDwiGEnxFNC2/b8ifcZzY7MLcluizohRzNw==", "dev": true, "requires": { - "@ethereumjs/common": "^2.5.0", - "ethereumjs-util": "^7.1.2" + "@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" + } + } } }, "@ethersproject/abi": { @@ -22515,9 +22889,9 @@ } }, "@fastify/busboy": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@fastify/busboy/-/busboy-2.0.0.tgz", - "integrity": "sha512-JUFJad5lv7jxj926GPgymrWQxxjPYuJNiNjNMzqT+HiuP6Vl3dk5xzG+8sTX96np0ZAluvaMzPsjhHZ5rNuNQQ==" + "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", @@ -22737,6 +23111,21 @@ } } }, + "@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", @@ -23907,9 +24296,9 @@ } }, "@types/http-cache-semantics": { - "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==", + "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==", "dev": true }, "@types/http-link-header": { @@ -24023,9 +24412,9 @@ } }, "@types/responselike": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/@types/responselike/-/responselike-1.0.0.tgz", - "integrity": "sha512-85Y2BjiufFzaMIlvJDvTTB8Fxl2xfLo4HgmHzVBz08w4wDePCTjYw66PdrolO0kzli3yam/YCgRufyo1DdQVTA==", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@types/responselike/-/responselike-1.0.3.tgz", + "integrity": "sha512-H/+L+UkTV33uf49PH5pCAUBVPNj2nDBXTN+qS1dOwyyg24l3CcicicCA7ca+HMvJBZcFgl5r8e+RR6elsb4Lyw==", "dev": true, "requires": { "@types/node": "*" @@ -24430,27 +24819,13 @@ } }, "assertion-tools": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/assertion-tools/-/assertion-tools-2.0.2.tgz", - "integrity": "sha512-wntV3+hNWfd0vAs1vaBsSBEaa7W7Qs3Wbu9Sh0WeZEr+RZ55ImjFICh1Bfi1ArGTXYgjd/zQa5YSSOFvs18UGQ==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/assertion-tools/-/assertion-tools-2.1.0.tgz", + "integrity": "sha512-HCI/K2G9x/PlTpj0XuB2K3gR09C5VSXfqOfhzeqONC1x3WHRlUOIZmSSodaA5uLamUE45x8pnHjJxSyqxOI7tA==", "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": { @@ -24906,9 +25281,9 @@ "dev": true }, "cacheable-request": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/cacheable-request/-/cacheable-request-7.0.2.tgz", - "integrity": "sha512-pouW8/FmiPQbuGpkXQ9BAPv/Mo5xDGANgSNXzTzJ8DrKGuXOssM4wIQRjfanNRh3Yu5cfYPvcorqbhg2KIJtew==", + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/cacheable-request/-/cacheable-request-7.0.4.tgz", + "integrity": "sha512-v+p6ongsrp0yTGbJXjgxPow2+DL93DASP4kXCDKb8/bwRtt9OEF3whggkkDkGNzgcWy2XaF4a8nZglC7uElscg==", "dev": true, "requires": { "clone-response": "^1.0.2", @@ -25501,9 +25876,9 @@ } }, "crypto-js": { - "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==" + "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==" }, "d": { "version": "1.0.1", @@ -26090,12 +26465,12 @@ } }, "dkg.js": { - "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==", + "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==", "dev": true, "requires": { - "assertion-tools": "^2.0.2", + "assertion-tools": "^2.1.0", "axios": "^0.27.2", "dkg-evm-module": "^4.0.4", "ethers": "^6.1.0", @@ -26646,9 +27021,9 @@ }, "dependencies": { "semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "dev": true } } @@ -26757,9 +27132,9 @@ } }, "semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "dev": true, "peer": true } @@ -26791,9 +27166,9 @@ }, "dependencies": { "semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "dev": true, "peer": true } @@ -26846,9 +27221,9 @@ } }, "semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "dev": true, "peer": true } @@ -27052,6 +27427,7 @@ "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", @@ -27718,9 +28094,9 @@ "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==" }, "get-func-name": { - "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==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.2.tgz", + "integrity": "sha512-8vXOvuE167CtIc3OyItco7N/dpRtBbYOsPsXCz7X/PMnlGjYjSGuZJgM1Y7mmew7BKf9BqvLX2tnOVy1BBUsxQ==", "dev": true }, "get-intrinsic": { @@ -28213,9 +28589,9 @@ } }, "semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==" + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==" }, "supports-color": { "version": "5.5.0", @@ -28239,23 +28615,34 @@ } }, "hardhat-deploy": { - "version": "0.11.25", - "resolved": "https://registry.npmjs.org/hardhat-deploy/-/hardhat-deploy-0.11.25.tgz", - "integrity": "sha512-ppSgrVE9A13YgTmf2PQGoyIs9o/jgJOMORrUP/rblU5K8mQ2YHWlPvkzZmP4h+SBW+tNmlnvSrf5K5DmMmExhw==", + "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==", "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.5.3", + "ethers": "^5.7.0", "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.8.1" + "zksync-web3": "^0.14.3" }, "dependencies": { "axios": { @@ -28522,9 +28909,9 @@ } }, "http2-wrapper": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/http2-wrapper/-/http2-wrapper-2.2.0.tgz", - "integrity": "sha512-kZB0wxMo0sh1PehyjJUWRFEd99KC5TLjZ2cULC4f9iqJBAmKQQXEICjxl5iPJRwP40dpeHFqqhm7tYCvODpqpQ==", + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/http2-wrapper/-/http2-wrapper-2.2.1.tgz", + "integrity": "sha512-V5nVw1PAOgfI3Lmeaj2Exmeg7fenjhRUgz1lPSezy1CuhPYbgQtbQj4jZfEAEMlaL+vupsvhjqCyjzob0yxsmQ==", "dev": true, "requires": { "quick-lru": "^5.1.1", @@ -29097,9 +29484,9 @@ }, "dependencies": { "semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "dev": true } } @@ -29599,9 +29986,9 @@ "integrity": "sha512-zwhgOhhniaL7oxMgUMKKw5219PWWABMO+dgMnzJOQ2/5L3XJtTJGhW2PEXlxXj9zaccdReZJZ83+4NPhVfNVDg==" }, "keyv": { - "version": "4.5.2", - "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.2.tgz", - "integrity": "sha512-5MHbFaKn8cNSmVW7BYnijeAVlE4cYA/SVkifVgrh7yotnfhKmjuXpDKjrABLnT0SfHWV21P8ow07OGfRrNDg8g==", + "version": "4.5.4", + "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", + "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==", "dev": true, "requires": { "json-buffer": "3.0.1" @@ -30058,9 +30445,9 @@ "dev": true }, "yaml": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.2.1.tgz", - "integrity": "sha512-e0WHiYql7+9wr4cWMx3TVQrNwejKaEe7/rHNmQmqRjazfOP5W8PB6Jpebb5o6fIapbz9o9+2ipcaTM2ZwDI6lw==", + "version": "2.3.4", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.3.4.tgz", + "integrity": "sha512-8aAvwVUSHpfEqTQ4w/KMlf3HcRdt50E5ODIQJBw1fQ5RL34xabzxtUlzTXVqc4rkZsPbvrXKWnABCD7kWSmocA==", "dev": true } } @@ -30293,9 +30680,9 @@ }, "dependencies": { "semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "dev": true } } @@ -30384,11 +30771,28 @@ "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", @@ -33042,9 +33446,9 @@ } }, "semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==" + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", + "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==" }, "tmp": { "version": "0.0.33", @@ -33211,9 +33615,9 @@ "integrity": "sha512-qC9iz2FlN7DQl3+wjwn3802RTyjCx7sDvfQEXchwa6CWOx07/WVfh91gBmQ9fahw8snwGEWU3xGzOt4tFyHLxg==" }, "sshpk": { - "version": "1.17.0", - "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.17.0.tgz", - "integrity": "sha512-/9HIEs1ZXGhSPE8X6Ccm7Nam1z8KcoCqPdI7ecm1N33EzAetWahvQWVqLZtaZQ+IDKX4IyA2o0gBzqIMkAagHQ==", + "version": "1.18.0", + "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.18.0.tgz", + "integrity": "sha512-2p2KJZTSqQ/I3+HX42EpYOa2l3f8Erv8MWKsy2I9uf4wA7yFIkXRffYdsx86y6z4vHtV8u7g+pPlr8/4ouAxsQ==", "dev": true, "requires": { "asn1": "~0.2.3", @@ -34197,24 +34601,24 @@ "integrity": "sha512-LCHW+fE2UBJ2vjhqJujqmoxh1ytEDEr0dPO3CabMdMDJPKmsaxzS90V1Ar6LtNE5VHLqxR4YMEj1i4lzMAccIA==" }, "web3": { - "version": "1.8.2", - "resolved": "https://registry.npmjs.org/web3/-/web3-1.8.2.tgz", - "integrity": "sha512-92h0GdEHW9wqDICQQKyG4foZBYi0OQkyg4CRml2F7XBl/NG+fu9o6J19kzfFXzSBoA4DnJXbyRgj/RHZv5LRiw==", + "version": "1.10.3", + "resolved": "https://registry.npmjs.org/web3/-/web3-1.10.3.tgz", + "integrity": "sha512-DgUdOOqC/gTqW+VQl1EdPxrVRPB66xVNtuZ5KD4adVBtko87hkgM8BTZ0lZ8IbUfnQk6DyjcDujMiH3oszllAw==", "dev": true, "requires": { - "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": "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": { - "version": "1.8.2", - "resolved": "https://registry.npmjs.org/web3-bzz/-/web3-bzz-1.8.2.tgz", - "integrity": "sha512-1EEnxjPnFnvNWw3XeeKuTR8PBxYd0+XWzvaLK7OJC/Go9O8llLGxrxICbKV+8cgIE0sDRBxiYx02X+6OhoAQ9w==", + "version": "1.10.3", + "resolved": "https://registry.npmjs.org/web3-bzz/-/web3-bzz-1.10.3.tgz", + "integrity": "sha512-XDIRsTwekdBXtFytMpHBuun4cK4x0ZMIDXSoo1UVYp+oMyZj07c7gf7tNQY5qZ/sN+CJIas4ilhN25VJcjSijQ==", "dev": true, "requires": { "@types/node": "^12.12.6", @@ -34231,18 +34635,18 @@ } }, "web3-core": { - "version": "1.8.2", - "resolved": "https://registry.npmjs.org/web3-core/-/web3-core-1.8.2.tgz", - "integrity": "sha512-DJTVEAYcNqxkqruJE+Rxp3CIv0y5AZMwPHQmOkz/cz+MM75SIzMTc0AUdXzGyTS8xMF8h3YWMQGgGEy8SBf1PQ==", + "version": "1.10.3", + "resolved": "https://registry.npmjs.org/web3-core/-/web3-core-1.10.3.tgz", + "integrity": "sha512-Vbk0/vUNZxJlz3RFjAhNNt7qTpX8yE3dn3uFxfX5OHbuon5u65YEOd3civ/aQNW745N0vGUlHFNxxmn+sG9DIw==", "dev": true, "requires": { - "@types/bn.js": "^5.1.0", + "@types/bn.js": "^5.1.1", "@types/node": "^12.12.6", "bignumber.js": "^9.0.0", - "web3-core-helpers": "1.8.2", - "web3-core-method": "1.8.2", - "web3-core-requestmanager": "1.8.2", - "web3-utils": "1.8.2" + "web3-core-helpers": "1.10.3", + "web3-core-method": "1.10.3", + "web3-core-requestmanager": "1.10.3", + "web3-utils": "1.10.3" }, "dependencies": { "@types/node": { @@ -34254,32 +34658,32 @@ } }, "web3-core-helpers": { - "version": "1.8.2", - "resolved": "https://registry.npmjs.org/web3-core-helpers/-/web3-core-helpers-1.8.2.tgz", - "integrity": "sha512-6B1eLlq9JFrfealZBomd1fmlq1o4A09vrCVQSa51ANoib/jllT3atZrRDr0zt1rfI7TSZTZBXdN/aTdeN99DWw==", + "version": "1.10.3", + "resolved": "https://registry.npmjs.org/web3-core-helpers/-/web3-core-helpers-1.10.3.tgz", + "integrity": "sha512-Yv7dQC3B9ipOc5sWm3VAz1ys70Izfzb8n9rSiQYIPjpqtJM+3V4EeK6ghzNR6CO2es0+Yu9CtCkw0h8gQhrTxA==", "dev": true, "requires": { - "web3-eth-iban": "1.8.2", - "web3-utils": "1.8.2" + "web3-eth-iban": "1.10.3", + "web3-utils": "1.10.3" } }, "web3-core-method": { - "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==", + "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==", "dev": true, "requires": { "@ethersproject/transactions": "^5.6.2", - "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-helpers": "1.10.3", + "web3-core-promievent": "1.10.3", + "web3-core-subscriptions": "1.10.3", + "web3-utils": "1.10.3" } }, "web3-core-promievent": { - "version": "1.8.2", - "resolved": "https://registry.npmjs.org/web3-core-promievent/-/web3-core-promievent-1.8.2.tgz", - "integrity": "sha512-nvkJWDVgoOSsolJldN33tKW6bKKRJX3MCPDYMwP5SUFOA/mCzDEoI88N0JFofDTXkh1k7gOqp1pvwi9heuaxGg==", + "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==", "dev": true, "requires": { "eventemitter3": "4.0.4" @@ -34294,26 +34698,26 @@ } }, "web3-core-requestmanager": { - "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==", + "version": "1.10.3", + "resolved": "https://registry.npmjs.org/web3-core-requestmanager/-/web3-core-requestmanager-1.10.3.tgz", + "integrity": "sha512-VT9sKJfgM2yBOIxOXeXiDuFMP4pxzF6FT+y8KTLqhDFHkbG3XRe42Vm97mB/IvLQCJOmokEjl3ps8yP1kbggyw==", "dev": true, "requires": { "util": "^0.12.5", - "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-helpers": "1.10.3", + "web3-providers-http": "1.10.3", + "web3-providers-ipc": "1.10.3", + "web3-providers-ws": "1.10.3" } }, "web3-core-subscriptions": { - "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==", + "version": "1.10.3", + "resolved": "https://registry.npmjs.org/web3-core-subscriptions/-/web3-core-subscriptions-1.10.3.tgz", + "integrity": "sha512-KW0Mc8sgn70WadZu7RjQ4H5sNDJ5Lx8JMI3BWos+f2rW0foegOCyWhRu33W1s6ntXnqeBUw5rRCXZRlA3z+HNA==", "dev": true, "requires": { "eventemitter3": "4.0.4", - "web3-core-helpers": "1.8.2" + "web3-core-helpers": "1.10.3" }, "dependencies": { "eventemitter3": { @@ -34325,51 +34729,51 @@ } }, "web3-eth": { - "version": "1.8.2", - "resolved": "https://registry.npmjs.org/web3-eth/-/web3-eth-1.8.2.tgz", - "integrity": "sha512-JoTiWWc4F4TInpbvDUGb0WgDYJsFhuIjJlinc5ByjWD88Gvh+GKLsRjjFdbqe5YtwIGT4NymwoC5LQd1K6u/QQ==", + "version": "1.10.3", + "resolved": "https://registry.npmjs.org/web3-eth/-/web3-eth-1.10.3.tgz", + "integrity": "sha512-Uk1U2qGiif2mIG8iKu23/EQJ2ksB1BQXy3wF3RvFuyxt8Ft9OEpmGlO7wOtAyJdoKzD5vcul19bJpPcWSAYZhA==", "dev": true, "requires": { - "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-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-eth-abi": { - "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==", + "version": "1.10.3", + "resolved": "https://registry.npmjs.org/web3-eth-abi/-/web3-eth-abi-1.10.3.tgz", + "integrity": "sha512-O8EvV67uhq0OiCMekqYsDtb6FzfYzMXT7VMHowF8HV6qLZXCGTdB/NH4nJrEh2mFtEwVdS6AmLFJAQd2kVyoMQ==", "dev": true, "requires": { "@ethersproject/abi": "^5.6.3", - "web3-utils": "1.8.2" + "web3-utils": "1.10.3" } }, "web3-eth-accounts": { - "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==", + "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==", "dev": true, "requires": { - "@ethereumjs/common": "2.5.0", - "@ethereumjs/tx": "3.3.2", + "@ethereumjs/common": "2.6.5", + "@ethereumjs/tx": "3.5.2", + "@ethereumjs/util": "^8.1.0", "eth-lib": "0.2.8", - "ethereumjs-util": "^7.1.5", "scrypt-js": "^3.0.1", "uuid": "^9.0.0", - "web3-core": "1.8.2", - "web3-core-helpers": "1.8.2", - "web3-core-method": "1.8.2", - "web3-utils": "1.8.2" + "web3-core": "1.10.3", + "web3-core-helpers": "1.10.3", + "web3-core-method": "1.10.3", + "web3-utils": "1.10.3" }, "dependencies": { "bn.js": { @@ -34390,67 +34794,67 @@ } }, "uuid": { - "version": "9.0.0", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.0.tgz", - "integrity": "sha512-MXcSTerfPa4uqyzStbRoTgt5XIe3x5+42+q1sDuy3R5MDk66URdLMOZe5aPX/SQd+kuYAh0FdP/pO28IkQyTeg==", + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.1.tgz", + "integrity": "sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==", "dev": true } } }, "web3-eth-contract": { - "version": "1.8.2", - "resolved": "https://registry.npmjs.org/web3-eth-contract/-/web3-eth-contract-1.8.2.tgz", - "integrity": "sha512-ID5A25tHTSBNwOPjiXSVzxruz006ULRIDbzWTYIFTp7NJ7vXu/kynKK2ag/ObuTqBpMbobP8nXcA9b5EDkIdQA==", + "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==", "dev": true, "requires": { - "@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" + "@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" } }, "web3-eth-ens": { - "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==", + "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==", "dev": true, "requires": { "content-hash": "^2.5.2", "eth-ens-namehash": "2.0.8", - "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-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-eth-iban": { - "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==", + "version": "1.10.3", + "resolved": "https://registry.npmjs.org/web3-eth-iban/-/web3-eth-iban-1.10.3.tgz", + "integrity": "sha512-ZCfOjYKAjaX2TGI8uif5ah+J3BYFuo+47JOIV1RIz2l7kD9VfnxvRH5UiQDRyMALQC7KFd2hUqIEtHklapNyKA==", "dev": true, "requires": { "bn.js": "^5.2.1", - "web3-utils": "1.8.2" + "web3-utils": "1.10.3" } }, "web3-eth-personal": { - "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==", + "version": "1.10.3", + "resolved": "https://registry.npmjs.org/web3-eth-personal/-/web3-eth-personal-1.10.3.tgz", + "integrity": "sha512-avrQ6yWdADIvuNQcFZXmGLCEzulQa76hUOuVywN7O3cklB4nFc/Gp3yTvD3bOAaE7DhjLQfhUTCzXL7WMxVTsw==", "dev": true, "requires": { "@types/node": "^12.12.6", - "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" + "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" }, "dependencies": { "@types/node": { @@ -34462,46 +34866,66 @@ } }, "web3-net": { - "version": "1.8.2", - "resolved": "https://registry.npmjs.org/web3-net/-/web3-net-1.8.2.tgz", - "integrity": "sha512-1itkDMGmbgb83Dg9nporFes9/fxsU7smJ3oRXlFkg4ZHn8YJyP1MSQFPJWWwSc+GrcCFt4O5IrUTvEkHqE3xag==", + "version": "1.10.3", + "resolved": "https://registry.npmjs.org/web3-net/-/web3-net-1.10.3.tgz", + "integrity": "sha512-IoSr33235qVoI1vtKssPUigJU9Fc/Ph0T9CgRi15sx+itysmvtlmXMNoyd6Xrgm9LuM4CIhxz7yDzH93B79IFg==", "dev": true, "requires": { - "web3-core": "1.8.2", - "web3-core-method": "1.8.2", - "web3-utils": "1.8.2" + "web3-core": "1.10.3", + "web3-core-method": "1.10.3", + "web3-utils": "1.10.3" } }, "web3-providers-http": { - "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==", + "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==", "dev": true, "requires": { - "abortcontroller-polyfill": "^1.7.3", - "cross-fetch": "^3.1.4", + "abortcontroller-polyfill": "^1.7.5", + "cross-fetch": "^4.0.0", "es6-promise": "^4.2.8", - "web3-core-helpers": "1.8.2" + "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-providers-ipc": { - "version": "1.8.2", - "resolved": "https://registry.npmjs.org/web3-providers-ipc/-/web3-providers-ipc-1.8.2.tgz", - "integrity": "sha512-p6fqKVGFg+WiXGHWnB1hu43PbvPkDHTz4RgoEzbXugv5rtv5zfYLqm8Ba6lrJOS5ks9kGKR21a0y3NzE3u7V4w==", + "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==", "dev": true, "requires": { "oboe": "2.1.5", - "web3-core-helpers": "1.8.2" + "web3-core-helpers": "1.10.3" } }, "web3-providers-ws": { - "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==", + "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==", "dev": true, "requires": { "eventemitter3": "4.0.4", - "web3-core-helpers": "1.8.2", + "web3-core-helpers": "1.10.3", "websocket": "^1.0.32" }, "dependencies": { @@ -34514,29 +34938,67 @@ } }, "web3-shh": { - "version": "1.8.2", - "resolved": "https://registry.npmjs.org/web3-shh/-/web3-shh-1.8.2.tgz", - "integrity": "sha512-uZ+3MAoNcaJsXXNCDnizKJ5viBNeHOFYsCbFhV755Uu52FswzTOw6DtE7yK9nYXMtIhiSgi7nwl1RYzP8pystw==", + "version": "1.10.3", + "resolved": "https://registry.npmjs.org/web3-shh/-/web3-shh-1.10.3.tgz", + "integrity": "sha512-cAZ60CPvs9azdwMSQ/PSUdyV4PEtaW5edAZhu3rCXf6XxQRliBboic+AvwUvB6j3eswY50VGa5FygfVmJ1JVng==", "dev": true, "requires": { - "web3-core": "1.8.2", - "web3-core-method": "1.8.2", - "web3-core-subscriptions": "1.8.2", - "web3-net": "1.8.2" + "web3-core": "1.10.3", + "web3-core-method": "1.10.3", + "web3-core-subscriptions": "1.10.3", + "web3-net": "1.10.3" } }, "web3-utils": { - "version": "1.8.2", - "resolved": "https://registry.npmjs.org/web3-utils/-/web3-utils-1.8.2.tgz", - "integrity": "sha512-v7j6xhfLQfY7xQDrUP0BKbaNrmZ2/+egbqP9q3KYmOiPpnvAfol+32slgL0WX/5n8VPvKCK5EZ1HGrAVICSToA==", + "version": "1.10.3", + "resolved": "https://registry.npmjs.org/web3-utils/-/web3-utils-1.10.3.tgz", + "integrity": "sha512-OqcUrEE16fDBbGoQtZXWdavsPzbGIDc5v3VrRTZ0XrIpefC/viZ1ZU9bGEemazyS0catk/3rkOOxpzTfY+XsyQ==", "requires": { + "@ethereumjs/util": "^8.1.0", "bn.js": "^5.2.1", "ethereum-bloom-filters": "^1.0.6", - "ethereumjs-util": "^7.1.0", + "ethereum-cryptography": "^2.1.2", "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": { @@ -34911,9 +35373,9 @@ } }, "zksync-web3": { - "version": "0.8.1", - "resolved": "https://registry.npmjs.org/zksync-web3/-/zksync-web3-0.8.1.tgz", - "integrity": "sha512-1A4aHPQ3MyuGjpv5X/8pVEN+MdZqMjfVmiweQSRjOlklXYu65wT9BGEOtCmMs5d3gIvLp4ssfTeuR5OCKOD2kw==", + "version": "0.14.4", + "resolved": "https://registry.npmjs.org/zksync-web3/-/zksync-web3-0.14.4.tgz", + "integrity": "sha512-kYehMD/S6Uhe1g434UnaMN+sBr9nQm23Ywn0EUP5BfQCsbjcr3ORuS68PosZw8xUTu3pac7G6YMSnNHk+fwzvg==", "requires": {} } } From abaa2e72f205717a01eb349637c4930e3e1db022 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 14 Nov 2023 12:20:11 +0100 Subject: [PATCH 06/11] Bump axios from 0.27.2 to 1.6.0 (#2781) Bumps [axios](https://github.com/axios/axios) from 0.27.2 to 1.6.0. - [Release notes](https://github.com/axios/axios/releases) - [Changelog](https://github.com/axios/axios/blob/v1.x/CHANGELOG.md) - [Commits](https://github.com/axios/axios/compare/v0.27.2...v1.6.0) --- updated-dependencies: - dependency-name: axios dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: djordjekovac --- package-lock.json | 79 ++++++++++++++++++++++++++++++++++++++++------- package.json | 2 +- 2 files changed, 69 insertions(+), 12 deletions(-) diff --git a/package-lock.json b/package-lock.json index 33b0e5a3e2..ea8847f5c5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -22,7 +22,7 @@ "async": "^3.2.4", "async-mutex": "^0.3.2", "awilix": "^7.0.3", - "axios": "^0.27.2", + "axios": "^1.6.0", "cors": "^2.8.5", "deep-extend": "^0.6.0", "dkg-evm-module": "^4.0.7", @@ -6333,12 +6333,13 @@ } }, "node_modules/axios": { - "version": "0.27.2", - "resolved": "https://registry.npmjs.org/axios/-/axios-0.27.2.tgz", - "integrity": "sha512-t+yRIyySRTp/wua5xEr+z1q60QmLq8ABsS5O9Me1AsE5dfKqgnCFzwiCZZ/cGNd1lq4/7akDWMxdhVlucjmnOQ==", + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.6.0.tgz", + "integrity": "sha512-EZ1DYihju9pwVB+jg67ogm+Tmqc6JmhamRN6I4Zt8DfZu5lbcQGw3ozH9lFejSJgs/ibaef3A9PMXPLeefFGJg==", "dependencies": { - "follow-redirects": "^1.14.9", - "form-data": "^4.0.0" + "follow-redirects": "^1.15.0", + "form-data": "^4.0.0", + "proxy-from-env": "^1.1.0" } }, "node_modules/axios/node_modules/form-data": { @@ -8353,6 +8354,16 @@ "integrity": "sha512-/xJX0/VTPcbc5xQE2VUP91y1xN8q/rDfhEzLm+vLc3hYvb5+qHCnpJRuFcrKn63zumK/sCwYYzhG8HP78JYSTA==", "dev": true }, + "node_modules/dkg.js/node_modules/axios": { + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/axios/-/axios-0.27.2.tgz", + "integrity": "sha512-t+yRIyySRTp/wua5xEr+z1q60QmLq8ABsS5O9Me1AsE5dfKqgnCFzwiCZZ/cGNd1lq4/7akDWMxdhVlucjmnOQ==", + "dev": true, + "dependencies": { + "follow-redirects": "^1.14.9", + "form-data": "^4.0.0" + } + }, "node_modules/dkg.js/node_modules/ethers": { "version": "6.2.2", "resolved": "https://registry.npmjs.org/ethers/-/ethers-6.2.2.tgz", @@ -8380,6 +8391,20 @@ "node": ">=14.0.0" } }, + "node_modules/dkg.js/node_modules/form-data": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", + "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", + "dev": true, + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "mime-types": "^2.1.12" + }, + "engines": { + "node": ">= 6" + } + }, "node_modules/dkg.js/node_modules/tslib": { "version": "2.4.0", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.0.tgz", @@ -15836,6 +15861,11 @@ "node": ">= 0.10" } }, + "node_modules/proxy-from-env": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", + "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==" + }, "node_modules/psl": { "version": "1.9.0", "resolved": "https://registry.npmjs.org/psl/-/psl-1.9.0.tgz", @@ -24936,12 +24966,13 @@ "peer": true }, "axios": { - "version": "0.27.2", - "resolved": "https://registry.npmjs.org/axios/-/axios-0.27.2.tgz", - "integrity": "sha512-t+yRIyySRTp/wua5xEr+z1q60QmLq8ABsS5O9Me1AsE5dfKqgnCFzwiCZZ/cGNd1lq4/7akDWMxdhVlucjmnOQ==", + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.6.0.tgz", + "integrity": "sha512-EZ1DYihju9pwVB+jg67ogm+Tmqc6JmhamRN6I4Zt8DfZu5lbcQGw3ozH9lFejSJgs/ibaef3A9PMXPLeefFGJg==", "requires": { - "follow-redirects": "^1.14.9", - "form-data": "^4.0.0" + "follow-redirects": "^1.15.0", + "form-data": "^4.0.0", + "proxy-from-env": "^1.1.0" }, "dependencies": { "form-data": { @@ -26490,6 +26521,16 @@ "integrity": "sha512-/xJX0/VTPcbc5xQE2VUP91y1xN8q/rDfhEzLm+vLc3hYvb5+qHCnpJRuFcrKn63zumK/sCwYYzhG8HP78JYSTA==", "dev": true }, + "axios": { + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/axios/-/axios-0.27.2.tgz", + "integrity": "sha512-t+yRIyySRTp/wua5xEr+z1q60QmLq8ABsS5O9Me1AsE5dfKqgnCFzwiCZZ/cGNd1lq4/7akDWMxdhVlucjmnOQ==", + "dev": true, + "requires": { + "follow-redirects": "^1.14.9", + "form-data": "^4.0.0" + } + }, "ethers": { "version": "6.2.2", "resolved": "https://registry.npmjs.org/ethers/-/ethers-6.2.2.tgz", @@ -26504,6 +26545,17 @@ "ws": "8.5.0" } }, + "form-data": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", + "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", + "dev": true, + "requires": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "mime-types": "^2.1.12" + } + }, "tslib": { "version": "2.4.0", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.0.tgz", @@ -32325,6 +32377,11 @@ } } }, + "proxy-from-env": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", + "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==" + }, "psl": { "version": "1.9.0", "resolved": "https://registry.npmjs.org/psl/-/psl-1.9.0.tgz", diff --git a/package.json b/package.json index 78fca32837..2b0fcf6fa2 100644 --- a/package.json +++ b/package.json @@ -72,7 +72,7 @@ "async": "^3.2.4", "async-mutex": "^0.3.2", "awilix": "^7.0.3", - "axios": "^0.27.2", + "axios": "^1.6.0", "cors": "^2.8.5", "deep-extend": "^0.6.0", "dkg-evm-module": "^4.0.7", From 1dab299e5ed329c65f6055d2b5917b4702a0c3c8 Mon Sep 17 00:00:00 2001 From: Ana <48334075+AnaDjokovic@users.noreply.github.com> Date: Tue, 14 Nov 2023 12:20:27 +0100 Subject: [PATCH 07/11] v6: Unit tests for validation module manager (#2663) * adding new unit tests * adding unit tests for validation manager module * update package.json script * remove unused methods * implement code review feedback and handle null in the validation functions * update test description * fix eslint errors * update operator from OR to AND --------- Co-authored-by: djordjekovac --- package.json | 2 +- .../validation/validation-module-manager.js | 21 ++- .../{ => unit}/modules/repository/config.json | 0 .../modules/repository/repository.test.js} | 8 +- .../modules/triple-store/config.json | 0 .../triple-store/triple-store.test.js} | 0 test/unit/modules/validation/config.json | 14 ++ .../validation-module-manager.test.js | 176 ++++++++++++++++++ 8 files changed, 215 insertions(+), 6 deletions(-) rename test/{ => unit}/modules/repository/config.json (100%) rename test/{modules/repository/repository.js => unit/modules/repository/repository.test.js} (98%) rename test/{ => unit}/modules/triple-store/config.json (100%) rename test/{modules/triple-store/triple-store.js => unit/modules/triple-store/triple-store.test.js} (100%) create mode 100644 test/unit/modules/validation/config.json create mode 100644 test/unit/modules/validation/validation-module-manager.test.js diff --git a/package.json b/package.json index 2b0fcf6fa2..00e8d27012 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,7 @@ "kill:local_blockchain": "npx kill-port 8545", "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/modules -name '*.js')", + "test:modules": "nyc --all mocha --exit $(find test/unit/modules -name '*.js')", "test:bdd:release": "cucumber-js --tags=@release --fail-fast --format progress --format-options '{\"colorsEnabled\": true}' test/bdd/ --import test/bdd/steps/", "test:bdd:publish-errors": "cucumber-js --tags=@publish-errors --fail-fast --format progress --format-options '{\"colorsEnabled\": true}' test/bdd/ --import test/bdd/steps/", "test:bdd:update-errors": "cucumber-js --tags=@update-errors --fail-fast --format progress --format-options '{\"colorsEnabled\": true}' test/bdd/ --import test/bdd/steps/", diff --git a/src/modules/validation/validation-module-manager.js b/src/modules/validation/validation-module-manager.js index ce99f66cce..8f326905ae 100644 --- a/src/modules/validation/validation-module-manager.js +++ b/src/modules/validation/validation-module-manager.js @@ -7,25 +7,44 @@ class ValidationModuleManager extends BaseModuleManager { calculateRoot(assertion) { if (this.initialized) { + if (!assertion) { + throw new Error('Calculation failed: Assertion cannot be null or undefined.'); + } return this.getImplementation().module.calculateRoot(assertion); } + throw new Error('Validation module is not initialized.'); } getMerkleProof(assertion, index) { if (this.initialized) { + if (!assertion) { + throw new Error('Get merkle proof failed: Assertion cannot be null or undefined.'); + } return this.getImplementation().module.getMerkleProof(assertion, index); } + throw new Error('Validation module is not initialized.'); } getHashFunctionName(hashFunctionId) { if (this.initialized) { + if (!hashFunctionId) { + throw new Error( + 'Getting function name failed: Function ID cannot be null or undefined.', + ); + } return this.getImplementation().module.getHashFunctionName(hashFunctionId); } + throw new Error('Validation module is not initialized.'); } async callHashFunction(hashFunctionId, data) { if (this.initialized) { - return this.getImplementation().module.callHashFunction(hashFunctionId, data); + if (!!hashFunctionId && !!data) { + return this.getImplementation().module.callHashFunction(hashFunctionId, data); + } + throw new Error('Calling hash fn failed: Values cannot be null or undefined.'); + } else { + throw new Error('Validation module is not initialized.'); } } } diff --git a/test/modules/repository/config.json b/test/unit/modules/repository/config.json similarity index 100% rename from test/modules/repository/config.json rename to test/unit/modules/repository/config.json diff --git a/test/modules/repository/repository.js b/test/unit/modules/repository/repository.test.js similarity index 98% rename from test/modules/repository/repository.js rename to test/unit/modules/repository/repository.test.js index 05955685cc..793c99705f 100644 --- a/test/modules/repository/repository.js +++ b/test/unit/modules/repository/repository.test.js @@ -2,12 +2,12 @@ import { utils } from 'ethers'; import { describe, it, before, beforeEach, afterEach, after } from 'mocha'; import { expect, assert } from 'chai'; import { readFile } from 'fs/promises'; -import Logger from '../../../src/logger/logger.js'; -import RepositoryModuleManager from '../../../src/modules/repository/repository-module-manager.js'; +import Logger from '../../../../src/logger/logger.js'; +import RepositoryModuleManager from '../../../../src/modules/repository/repository-module-manager.js'; let logger; let repositoryModuleManager; -const config = JSON.parse(await readFile('./test/modules/repository/config.json')); +const config = JSON.parse(await readFile('./test/unit/modules/repository/config.json')); const blockchain = 'hardhat'; const createAgreement = ({ @@ -391,7 +391,7 @@ describe('Repository module', () => { } } - describe('test load', () => { + describe.skip('test load', () => { describe('100_000 rows', () => { beforeEach(async function t() { this.timeout(0); diff --git a/test/modules/triple-store/config.json b/test/unit/modules/triple-store/config.json similarity index 100% rename from test/modules/triple-store/config.json rename to test/unit/modules/triple-store/config.json diff --git a/test/modules/triple-store/triple-store.js b/test/unit/modules/triple-store/triple-store.test.js similarity index 100% rename from test/modules/triple-store/triple-store.js rename to test/unit/modules/triple-store/triple-store.test.js diff --git a/test/unit/modules/validation/config.json b/test/unit/modules/validation/config.json new file mode 100644 index 0000000000..406942f078 --- /dev/null +++ b/test/unit/modules/validation/config.json @@ -0,0 +1,14 @@ +{ + "modules":{ + "validation":{ + "enabled":true, + "implementation":{ + "merkle-validation":{ + "enabled":true, + "package":"./validation/implementation/merkle-validation.js", + "config":{} + } + } + } + } +} diff --git a/test/unit/modules/validation/validation-module-manager.test.js b/test/unit/modules/validation/validation-module-manager.test.js new file mode 100644 index 0000000000..4cabe5041a --- /dev/null +++ b/test/unit/modules/validation/validation-module-manager.test.js @@ -0,0 +1,176 @@ +import { describe, it, beforeEach } from 'mocha'; +import { expect, assert } from 'chai'; +import { readFile } from 'fs/promises'; +import { calculateRoot } from 'assertion-tools'; +import ValidationModuleManager from '../../../../src/modules/validation/validation-module-manager.js'; +import Logger from '../../../../src/logger/logger.js'; + +let validationManager; + +const config = JSON.parse(await readFile('./test/unit/modules/validation/config.json', 'utf-8')); +const assertion = [ + { + '@context': 'https://schema.org', + '@id': 'https://tesla.modelX/2321', + '@type': 'Car', + name: 'Tesla Model X', + brand: { + '@type': 'Brand', + name: 'Tesla', + }, + model: 'Model X', + manufacturer: { + '@type': 'Organization', + name: 'Tesla, Inc.', + }, + fuelType: 'Electric', + }, +]; +const invalidValues = [null, undefined]; +const hashFunctionId = 1; +const keyword = + '0xB0D4afd8879eD9F52b28595d31B441D079B2Ca0768e44dc71bf509adfccbea9df949f253afa56796a3a926203f90a1e4914247d3'; + +describe.only('Validation module manager', async () => { + beforeEach('initialize validation module manage', async () => { + validationManager = new ValidationModuleManager({ + config, + logger: new Logger(), + }); + + validationManager.initialized = true; + expect(await validationManager.initialize()).to.be.true; + }); + + it('validates module name is as expected', async () => { + const moduleName = await validationManager.getName(); + + expect(moduleName).to.equal('validation'); + }); + + it('validate successful root hash calculation, expect to be matched', async () => { + const expectedRootHash = calculateRoot(assertion); + const calculatedRootHash = validationManager.calculateRoot(assertion); + + assert(expect(calculatedRootHash).to.exist); + expect(calculatedRootHash).to.equal(expectedRootHash); + }); + + it('root hash cannot be calculated without initialization', async () => { + validationManager.initialized = false; + + try { + validationManager.calculateRoot(assertion); + } catch (error) { + expect(error.message).to.equal('Validation module is not initialized.'); + } + }); + + it('root hash calculation failed when assertion is null or undefined', async () => { + invalidValues.forEach((value) => { + expect(() => validationManager.calculateRoot(value)).to.throw( + Error, + 'Calculation failed: Assertion cannot be null or undefined.', + ); + }); + }); + + it('successful getting merkle proof hash', async () => { + const calculatedMerkleHash = validationManager.getMerkleProof(assertion, 0); + + assert(expect(calculatedMerkleHash).to.exist); + expect(calculatedMerkleHash).to.be.instanceof(Object); + expect(calculatedMerkleHash).to.haveOwnProperty('leaf').and.to.be.a('string'); + expect(calculatedMerkleHash).to.haveOwnProperty('proof').and.to.be.a('array'); + }); + + it('merkle prof hash cannot be calculated without initialization', async () => { + validationManager.initialized = false; + + try { + validationManager.getMerkleProof(assertion, 0); + } catch (error) { + expect(error.message).to.equal('Validation module is not initialized.'); + } + }); + + it('failed merkle prof hash calculation when assertion is null or undefined', async () => { + invalidValues.forEach((value) => { + expect(() => validationManager.getMerkleProof(value, 0)).to.throw( + Error, + 'Get merkle proof failed: Assertion cannot be null or undefined.', + ); + }); + }); + + it('validate getting function name', async () => { + const getFnHashName = validationManager.getHashFunctionName(hashFunctionId); + + assert(expect(getFnHashName).to.exist); + expect(getFnHashName).to.equal('sha256'); + }); + + it('failed getting function name without initialization', async () => { + validationManager.initialized = false; + + try { + validationManager.getHashFunctionName(hashFunctionId); + } catch (error) { + expect(error.message).to.equal('Validation module is not initialized.'); + } + }); + + it('validate successful calling function name', async () => { + const callFunction = await validationManager.callHashFunction(hashFunctionId, keyword); + + assert(expect(callFunction).to.exist); + expect(callFunction).to.be.a('string'); + expect(callFunction).to.equal( + '0x5fe7425e0d956e2cafeac276c3ee8e70f377b2bd14790bc6d4777c3e7ba63b46', + ); + }); + + it('unsuccessful calling function name without initialization', async () => { + validationManager.initialized = false; + + try { + await validationManager.callHashFunction(hashFunctionId, keyword); + } catch (error) { + expect(error.message).to.equal('Validation module is not initialized.'); + } + }); + + it('failed function name initialization when function id is null or undefined', async () => { + async function testInvalidValues() { + for (const value of invalidValues) { + try { + // eslint-disable-next-line no-await-in-loop + await validationManager.getMerkleProof(value, 0); + } catch (error) { + expect(error.message).to.equal( + 'Get merkle proof failed: Assertion cannot be null or undefined.', + ); + } + } + } + + await testInvalidValues(); + }); + + it('failed function name initialization when data is null or undefined', async () => { + async function testInvalidValues() { + for (const value of invalidValues) { + try { + // eslint-disable-next-line no-await-in-loop + await validationManager.callHashFunction(value, 0); + } catch (error) { + expect(error.message).to.equal( + 'Calling hash fn failed: Values cannot be null or undefined.', + ); + } + } + } + + await testInvalidValues(); + }); +}); From ac45f1b693bdbf288f31f2689d8fb089effdf6e3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 14 Nov 2023 12:34:53 +0100 Subject: [PATCH 08/11] Bump @babel/traverse from 7.21.3 to 7.23.2 (#2739) Bumps [@babel/traverse](https://github.com/babel/babel/tree/HEAD/packages/babel-traverse) from 7.21.3 to 7.23.2. - [Release notes](https://github.com/babel/babel/releases) - [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md) - [Commits](https://github.com/babel/babel/commits/v7.23.2/packages/babel-traverse) --- updated-dependencies: - dependency-name: "@babel/traverse" dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: djordjekovac From 3c2e4465e32169b33ac5b391d1555a3550af0bf6 Mon Sep 17 00:00:00 2001 From: Uladzislau Hubar <71610423+u-hubar@users.noreply.github.com> Date: Tue, 14 Nov 2023 13:12:45 +0100 Subject: [PATCH 09/11] Commit/Proofs Command Retry Mechanism Rework (#2782) * Added possibility to update command data in the executor, removed txs retry mechanism, added gasPrice to the command data for the commits/proofs, added mechanism to increase gasPrice on timeouts for commits/proofs commands retries * Removed command executor update function, added data update in the command retry handler * Fixed event emission in the SubmitUpdateCommitCommand * Fixed callbacks for commits/proofs txs * Added additional logs for failed commits/proofs commands * Moved failed commits/proofs command logs to WARN level, added function to calculate sigHash of the function with given arguments (taking into account overloaded functions), fixed functionFragment search in the executeContractFunction * Fixed function to get sighash of the smart contract function * Changed throw Error -> throw new Error in Web3Service --- src/commands/command-executor.js | 1 + src/commands/command.js | 2 +- .../protocols/common/submit-commit-command.js | 89 ++++++-- .../protocols/common/submit-proofs-command.js | 83 +++++-- .../receiver/submit-update-commit-command.js | 134 +++++++----- src/constants/constants.js | 12 +- .../blockchain/blockchain-module-manager.js | 10 + .../blockchain/implementation/web3-service.js | 206 ++++++++++++------ 8 files changed, 373 insertions(+), 164 deletions(-) diff --git a/src/commands/command-executor.js b/src/commands/command-executor.js index 9f2a85933a..776483f56e 100644 --- a/src/commands/command-executor.js +++ b/src/commands/command-executor.js @@ -291,6 +291,7 @@ class CommandExecutor { command.data = handler.pack(command.data); await this._update(command, { status: COMMAND_STATUS.PENDING, + data: command.data, retries: command.retries - 1, }); const period = command.period ?? 0; diff --git a/src/commands/command.js b/src/commands/command.js index 9190fc7005..164c1f73e0 100644 --- a/src/commands/command.js +++ b/src/commands/command.js @@ -25,7 +25,7 @@ class Command { */ async recover(command, err) { const { operationId } = command.data; - await this.handleError(operationId, err.message, this.errorType, true, command.data); + await this.handleError(operationId, err.message, this.errorType, true); return Command.empty(); } diff --git a/src/commands/protocols/common/submit-commit-command.js b/src/commands/protocols/common/submit-commit-command.js index e8534b0ee2..1151062811 100644 --- a/src/commands/protocols/common/submit-commit-command.js +++ b/src/commands/protocols/common/submit-commit-command.js @@ -1,4 +1,9 @@ -import { OPERATION_ID_STATUS, ERROR_TYPE, COMMAND_RETRIES } from '../../../constants/constants.js'; +import { + OPERATION_ID_STATUS, + ERROR_TYPE, + COMMAND_RETRIES, + COMMAND_TX_GAS_INCREASE_FACTORS, +} from '../../../constants/constants.js'; import Command from '../../command.js'; class SubmitCommitCommand extends Command { @@ -22,14 +27,15 @@ class SubmitCommitCommand extends Command { epoch, agreementId, stateIndex, + gasPrice, } = command.data; this.logger.trace( - `Started ${command.name} for agreement id: ${agreementId} ` + - `blockchain: ${blockchain}, contract: ${contract}, token id: ${tokenId},` + - `keyword: ${keyword}, hash function id: ${hashFunctionId}, epoch: ${epoch}, ` + - `stateIndex: ${stateIndex}, operationId: ${operationId}, ` + - ` Retry number ${COMMAND_RETRIES.SUBMIT_COMMIT - command.retries + 1}`, + `Started ${command.name} 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}, ` + + `Retry number: ${COMMAND_RETRIES.SUBMIT_COMMIT - command.retries + 1}`, ); if (command.retries === COMMAND_RETRIES.SUBMIT_COMMIT) { @@ -49,8 +55,12 @@ class SubmitCommitCommand extends Command { stateIndex, ); if (alreadySubmitted) { - const errorMessage = `Commit already submitted for blockchain: ${blockchain} agreement id: ${agreementId}, epoch: ${epoch}, state index: ${stateIndex}`; - this.logger.trace(errorMessage); + this.logger.trace( + `Commit has already been submitted 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}`, + ); this.operationIdService.emitChangeEvent( OPERATION_ID_STATUS.COMMIT_PROOF.SUBMIT_COMMIT_END, @@ -58,9 +68,12 @@ class SubmitCommitCommand extends Command { agreementId, epoch, ); + return Command.empty(); } + const txGasPrice = gasPrice ?? (await this.blockchainModuleManager.getGasPrice()); + const transactionCompletePromise = new Promise((resolve, reject) => { this.blockchainModuleManager.submitCommit( blockchain, @@ -71,26 +84,62 @@ class SubmitCommitCommand extends Command { epoch, stateIndex, (result) => { - if ( - result?.error && - !result.error.message.includes('NodeAlreadySubmittedCommit') - ) { - reject(result.error); + if (result?.error) { + if (result.error.message.includes('NodeAlreadySubmittedCommit')) { + resolve(false); + } else { + reject(result.error); + } } - resolve(); + + resolve(true); }, + txGasPrice, ); }); - await transactionCompletePromise; + let txSuccess; + try { + txSuccess = await transactionCompletePromise; + } catch (error) { + this.logger.warn( + `Failed to execute ${command.name}, Error Message: ${error.message} 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}, ` + + `Retry number: ${COMMAND_RETRIES.SUBMIT_COMMIT - command.retries + 1}.`, + ); + + let newGasPrice; + if ( + error.message.includes(`timeout exceeded`) || + error.message.includes(`Pool(TooLowPriority`) + ) { + newGasPrice = Math.ceil(txGasPrice * COMMAND_TX_GAS_INCREASE_FACTORS.SUBMIT_COMMIT); + } else { + newGasPrice = null; + } + + Object.assign(command.data, { gasPrice: newGasPrice }); + + return Command.retry(); + } + + let msgBase; + if (txSuccess) { + msgBase = 'Successfully executed'; + } else { + msgBase = 'Node has already submitted commit. Finishing'; + } this.logger.trace( - `Successfully executed ${command.name} for agreement id: ${agreementId} ` + - `contract: ${contract}, token id: ${tokenId}, keyword: ${keyword}, ` + - `hash function id: ${hashFunctionId}. Retry number ${ - COMMAND_RETRIES.SUBMIT_COMMIT - command.retries + 1 - }`, + `${msgBase} ${command.name} 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}, ` + + `Retry number: ${COMMAND_RETRIES.SUBMIT_COMMIT - command.retries + 1}`, ); + this.operationIdService.emitChangeEvent( OPERATION_ID_STATUS.COMMIT_PROOF.SUBMIT_COMMIT_END, operationId, diff --git a/src/commands/protocols/common/submit-proofs-command.js b/src/commands/protocols/common/submit-proofs-command.js index 699f7e2cb3..832e8a6461 100644 --- a/src/commands/protocols/common/submit-proofs-command.js +++ b/src/commands/protocols/common/submit-proofs-command.js @@ -2,6 +2,7 @@ import { OPERATION_ID_STATUS, ERROR_TYPE, COMMAND_RETRIES, + COMMAND_TX_GAS_INCREASE_FACTORS, TRIPLE_STORE_REPOSITORIES, } from '../../../constants/constants.js'; import Command from '../../command.js'; @@ -32,14 +33,15 @@ class SubmitProofsCommand extends Command { agreementId, assertionId, stateIndex, + gasPrice, } = command.data; this.logger.trace( - `Started ${command.name} for agreement id: ${agreementId} ` + - `blockchain: ${blockchain}, contract: ${contract}, token id: ${tokenId},` + - `keyword: ${keyword}, hash function id: ${hashFunctionId}, epoch: ${epoch}, ` + - `stateIndex: ${stateIndex}, operationId: ${operationId}, ` + - ` Retry number ${COMMAND_RETRIES.SUBMIT_PROOFS - command.retries + 1}`, + `Started ${command.name} 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}, ` + + `Retry number: ${COMMAND_RETRIES.SUBMIT_PROOFS - command.retries + 1}`, ); if (command.retries === COMMAND_RETRIES.SUBMIT_PROOFS) { @@ -51,7 +53,6 @@ class SubmitProofsCommand extends Command { ); } - this.logger.trace(`Calculating proofs for agreement id : ${agreementId}`); const { challenge } = await this.blockchainModuleManager.getChallenge( blockchain, contract, @@ -66,10 +67,11 @@ class SubmitProofsCommand extends Command { ); if (!assertion.length) { - const errorMessage = `Assertion with id: ${assertionId} not found in triple store.`; + const errorMessage = `Assertion with id: ${assertionId} not found in the triple store.`; this.logger.trace(errorMessage); await this.handleError(operationId, errorMessage, this.errorType, true); + return Command.empty(); } @@ -100,8 +102,12 @@ class SubmitProofsCommand extends Command { stateIndex, ); if (alreadySubmitted) { - const errorMessage = `Proofs already submitted for blockchain: ${blockchain} agreement id: ${agreementId}, epoch: ${epoch}, state index: ${stateIndex}`; - this.logger.trace(errorMessage); + this.logger.trace( + `Proof has already been submitted 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}`, + ); this.operationIdService.emitChangeEvent( OPERATION_ID_STATUS.COMMIT_PROOF.SUBMIT_PROOFS_END, @@ -109,9 +115,12 @@ class SubmitProofsCommand extends Command { agreementId, epoch, ); + return Command.empty(); } + const txGasPrice = gasPrice ?? (await this.blockchainModuleManager.getGasPrice()); + const transactionCompletePromise = new Promise((resolve, reject) => { this.blockchainModuleManager.sendProof( blockchain, @@ -124,22 +133,60 @@ class SubmitProofsCommand extends Command { leaf, stateIndex, (result) => { - if (result?.error && !result.error.message.includes('NodeAlreadyRewarded')) { - reject(result.error); + if (result?.error) { + if (result.error.message.includes('NodeAlreadyRewarded')) { + resolve(false); + } else { + reject(result.error); + } } - resolve(); + + resolve(true); }, + txGasPrice, ); }); - await transactionCompletePromise; + let txSuccess; + try { + txSuccess = await transactionCompletePromise; + } catch (error) { + this.logger.warn( + `Failed to execute ${command.name}, Error Message: ${error.message} 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}, ` + + `Retry number: ${COMMAND_RETRIES.SUBMIT_PROOFS - command.retries + 1}.`, + ); + + let newGasPrice; + if ( + error.message.includes(`timeout exceeded`) || + error.message.includes(`Pool(TooLowPriority`) + ) { + newGasPrice = Math.ceil(txGasPrice * COMMAND_TX_GAS_INCREASE_FACTORS.SUBMIT_PROOFS); + } else { + newGasPrice = null; + } + + Object.assign(command.data, { gasPrice: newGasPrice }); + + return Command.retry(); + } + + let msgBase; + if (txSuccess) { + msgBase = 'Successfully executed'; + } else { + msgBase = 'Node has already sent proof. Finishing'; + } this.logger.trace( - `Successfully executed ${command.name} for agreement id: ${agreementId} ` + - `contract: ${contract}, token id: ${tokenId}, keyword: ${keyword}, ` + - `hash function id: ${hashFunctionId}. Retry number ${ - COMMAND_RETRIES.SUBMIT_PROOFS - command.retries + 1 - }`, + `${msgBase} ${command.name} 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}, ` + + `Retry number: ${COMMAND_RETRIES.SUBMIT_PROOFS - command.retries + 1}`, ); this.operationIdService.emitChangeEvent( 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 bf5289600a..7a6cbe098f 100644 --- a/src/commands/protocols/update/receiver/submit-update-commit-command.js +++ b/src/commands/protocols/update/receiver/submit-update-commit-command.js @@ -3,6 +3,7 @@ import { OPERATION_ID_STATUS, ERROR_TYPE, COMMAND_RETRIES, + COMMAND_TX_GAS_INCREASE_FACTORS, } from '../../../../constants/constants.js'; class SubmitUpdateCommitCommand extends Command { @@ -25,14 +26,14 @@ class SubmitUpdateCommitCommand extends Command { agreementData, agreementId, operationId, + gasPrice, } = command.data; this.logger.trace( - `Started ${command.name} for agreement id: ${agreementId} ` + - `blockchain: ${blockchain} contract: ${contract}, token id: ${tokenId}, ` + - `keyword: ${keyword}, hash function id: ${hashFunctionId}. Retry number ${ - COMMAND_RETRIES.SUBMIT_UPDATE_COMMIT - command.retries + 1 - }`, + `Started ${command.name} for the Service Agreement with the ID: ${agreementId}, ` + + `Blockchain: ${blockchain}, Contract: ${contract}, Token ID: ${tokenId}, ` + + `Keyword: ${keyword}, Hash function ID: ${hashFunctionId}, Operation ID: ${operationId}, ` + + `Retry number: ${COMMAND_RETRIES.SUBMIT_UPDATE_COMMIT - command.retries + 1}`, ); const epoch = await this.calculateCurrentEpoch( @@ -56,60 +57,87 @@ class SubmitUpdateCommitCommand extends Command { ); if (!hasPendingUpdate) { - this.logger.trace(`Not submitting as state is already finalized for update.`); + this.logger.trace( + `Not submitting update commit as state has been already finalized for the Service Agreement ` + + `with the ID: ${agreementId}, Blockchain: ${blockchain}, Contract: ${contract}, ` + + `Token ID: ${tokenId}, Keyword: ${keyword}, Hash function ID: ${hashFunctionId}, ` + + `Epoch: ${epoch}, Operation ID: ${operationId}`, + ); + + this.operationIdService.emitChangeEvent( + OPERATION_ID_STATUS.COMMIT_PROOF.SUBMIT_UPDATE_COMMIT_END, + operationId, + agreementId, + epoch, + ); + return Command.empty(); } - this.blockchainModuleManager.submitUpdateCommit( - blockchain, - contract, - tokenId, - keyword, - hashFunctionId, - epoch, - async (result) => { - if (!result.error) { - this.operationIdService.emitChangeEvent( - OPERATION_ID_STATUS.COMMIT_PROOF.SUBMIT_UPDATE_COMMIT_END, - operationId, - agreementId, - epoch, - ); - this.logger.info('Successfully executed submit update commit'); - } else if (command.retries - 1 === 0) { - const errorMessage = `Failed executing submit update commit command, maximum number of retries reached. Error: ${result.error.message}`; - this.logger.error(errorMessage); - this.operationIdService.emitChangeEvent( - OPERATION_ID_STATUS.FAILED, - operationId, - errorMessage, - this.errorType, - epoch, - ); - } else { - const blockTime = this.blockchainModuleManager.getBlockTimeMillis(blockchain); - this.logger.warn( - `Failed executing submit update commit command, retrying in ${blockTime}ms. Error: ${result.error.message}`, - ); - await this.commandExecutor.add({ - name: 'submitUpdateCommitCommand', - delay: blockTime, - retries: command.retries - 1, - data: command.data, - transactional: false, - }); - } - }, - ); + const txGasPrice = gasPrice ?? (await this.blockchainModuleManager.getGasPrice()); - const transactionQueueLength = - this.blockchainModuleManager.getTransactionQueueLength(blockchain); + const transactionCompletePromise = new Promise((resolve, reject) => { + this.blockchainModuleManager.submitUpdateCommit( + blockchain, + contract, + tokenId, + keyword, + hashFunctionId, + epoch, + (result) => { + if (result?.error) { + reject(result.error); + } + + resolve(); + }, + txGasPrice, + ); + }); + + try { + await transactionCompletePromise; + } catch (error) { + this.logger.warn( + `Failed to execute ${command.name}, Error Message: ${error.message} for the Service Agreement ` + + `with the ID: ${agreementId}, Blockchain: ${blockchain}, Contract: ${contract}, ` + + `Token ID: ${tokenId}, Keyword: ${keyword}, Hash function ID: ${hashFunctionId}, ` + + `Epoch: ${epoch}, Operation ID: ${operationId}, Retry number: ${ + COMMAND_RETRIES.SUBMIT_UPDATE_COMMIT - command.retries + 1 + }.`, + ); + + let newGasPrice; + if ( + error.message.includes(`timeout exceeded`) || + error.message.includes(`Pool(TooLowPriority`) + ) { + newGasPrice = Math.ceil( + txGasPrice * COMMAND_TX_GAS_INCREASE_FACTORS.SUBMIT_UPDATE_COMMIT, + ); + } else { + newGasPrice = null; + } + + Object.assign(command.data, { gasPrice: newGasPrice }); + + return Command.retry(); + } this.logger.trace( - `Scheduled submit update commit transaction for agreement id: ${agreementId} ` + - `blockchain: ${blockchain} contract: ${contract}, token id: ${tokenId}, ` + - `keyword: ${keyword}, hash function id: ${hashFunctionId}, operationId ${operationId}. ` + - `Transaction queue length: ${transactionQueueLength}.`, + `Successfully executed ${command.name} for the Service Agreement with the ID: ${agreementId}, ` + + `Blockchain: ${blockchain}, Contract: ${contract}, Token ID: ${tokenId}, ` + + `Keyword: ${keyword}, Hash function ID: ${hashFunctionId}, Epoch: ${epoch}, ` + + `Operation ID: ${operationId}, Retry number: ${ + COMMAND_RETRIES.SUBMIT_UPDATE_COMMIT - command.retries + 1 + }`, + ); + + this.operationIdService.emitChangeEvent( + OPERATION_ID_STATUS.COMMIT_PROOF.SUBMIT_UPDATE_COMMIT_END, + operationId, + agreementId, + epoch, ); return Command.empty(); diff --git a/src/constants/constants.js b/src/constants/constants.js index ba1d328b3c..47f5f8f798 100644 --- a/src/constants/constants.js +++ b/src/constants/constants.js @@ -175,9 +175,15 @@ export const DEFAULT_COMMAND_REPEAT_INTERVAL_IN_MILLS = 5000; // 5 seconds export const DEFAULT_COMMAND_DELAY_IN_MILLS = 60 * 1000; // 60 seconds export const COMMAND_RETRIES = { - SUBMIT_COMMIT: 0, - SUBMIT_UPDATE_COMMIT: 0, - SUBMIT_PROOFS: 0, + SUBMIT_COMMIT: 5, + SUBMIT_UPDATE_COMMIT: 5, + SUBMIT_PROOFS: 5, +}; + +export const COMMAND_TX_GAS_INCREASE_FACTORS = { + SUBMIT_COMMIT: 1.2, + SUBMIT_UPDATE_COMMIT: 1.2, + SUBMIT_PROOFS: 1.2, }; export const WEBSOCKET_PROVIDER_OPTIONS = { diff --git a/src/modules/blockchain/blockchain-module-manager.js b/src/modules/blockchain/blockchain-module-manager.js index 55ea81e810..bf94cc5e2d 100644 --- a/src/modules/blockchain/blockchain-module-manager.js +++ b/src/modules/blockchain/blockchain-module-manager.js @@ -68,6 +68,10 @@ class BlockchainModuleManager extends BaseModuleManager { return this.callImplementationFunction(blockchain, 'createProfile', [peerId]); } + async getGasPrice(blockchain) { + return this.callImplementationFunction(blockchain, 'getGasPrice'); + } + async healthCheck(blockchain) { return this.callImplementationFunction(blockchain, 'healthCheck'); } @@ -254,6 +258,7 @@ class BlockchainModuleManager extends BaseModuleManager { epoch, latestStateIndex, callback, + gasPrice, ) { return this.callImplementationFunction(blockchain, 'submitCommit', [ assetContractAddress, @@ -263,6 +268,7 @@ class BlockchainModuleManager extends BaseModuleManager { epoch, latestStateIndex, callback, + gasPrice, ]); } @@ -274,6 +280,7 @@ class BlockchainModuleManager extends BaseModuleManager { hashFunctionId, epoch, callback, + gasPrice, ) { return this.callImplementationFunction(blockchain, 'submitUpdateCommit', [ assetContractAddress, @@ -282,6 +289,7 @@ class BlockchainModuleManager extends BaseModuleManager { hashFunctionId, epoch, callback, + gasPrice, ]); } @@ -313,6 +321,7 @@ class BlockchainModuleManager extends BaseModuleManager { chunkHash, latestStateIndex, callback, + gasPrice, ) { return this.callImplementationFunction(blockchain, 'sendProof', [ assetContractAddress, @@ -324,6 +333,7 @@ class BlockchainModuleManager extends BaseModuleManager { chunkHash, latestStateIndex, callback, + gasPrice, ]); } diff --git a/src/modules/blockchain/implementation/web3-service.js b/src/modules/blockchain/implementation/web3-service.js index c53d56d2cd..dd0472aee6 100644 --- a/src/modules/blockchain/implementation/web3-service.js +++ b/src/modules/blockchain/implementation/web3-service.js @@ -66,8 +66,8 @@ class Web3Service { initializeTransactionQueue(concurrency) { this.transactionQueue = async.queue((args, cb) => { - const { contractInstance, functionName, transactionArgs } = args; - this._executeContractFunction(contractInstance, functionName, transactionArgs) + const { contractInstance, functionName, transactionArgs, gasPrice } = args; + this._executeContractFunction(contractInstance, functionName, transactionArgs, gasPrice) .then((result) => { cb({ result }); }) @@ -77,12 +77,13 @@ class Web3Service { }, concurrency); } - queueTransaction(contractInstance, functionName, transactionArgs, callback) { + queueTransaction(contractInstance, functionName, transactionArgs, callback, gasPrice) { this.transactionQueue.push( { contractInstance, functionName, transactionArgs, + gasPrice, }, callback, ); @@ -128,7 +129,7 @@ class Web3Service { // eslint-disable-next-line no-await-in-loop await this.providerReady(); } catch (e) { - throw Error( + throw new Error( `RPC Fallback Provider initialization failed. Fallback Provider quorum: ${FALLBACK_PROVIDER_QUORUM}. Error: ${e.message}.`, ); } @@ -199,9 +200,13 @@ class Web3Service { inputData.slice(0, 10), ); const functionName = functionFragment.name; - const inputs = functionFragment.inputs.map( - (input, i) => `${input.name}=${decodedInputData[i]}`, - ); + const inputs = functionFragment.inputs + .map((input, i) => { + const argName = input.name; + const argValue = this._formatArgument(decodedInputData[i]); + return `${argName}=${argValue}`; + }) + .join(', '); if (info.backend.error) { const decodedErrorData = this._decodeErrorData( info.backend.error, @@ -347,7 +352,7 @@ class Web3Service { async createProfile(peerId) { if (!this.config.sharesTokenName || !this.config.sharesTokenSymbol) { - throw Error( + throw new Error( 'Missing sharesTokenName and sharesTokenSymbol in blockchain configuration. Please add it and start the node again.', ); } @@ -411,9 +416,13 @@ class Web3Service { const functionFragment = contractInstance.interface.getFunction( error.transaction.data.slice(0, 10), ); - const inputs = functionFragment.inputs.map( - (input, i) => `${input.name}=${args[i]}`, - ); + const inputs = functionFragment.inputs + .map((input, i) => { + const argName = input.name; + const argValue = this._formatArgument(args[i]); + return `${argName}=${argValue}`; + }) + .join(', '); throw new Error( `Call ${functionName}(${inputs}) failed, reason: ${decodedErrorData}`, @@ -424,69 +433,108 @@ class Web3Service { return result; } - async _executeContractFunction(contractInstance, functionName, args) { + async _executeContractFunction(contractInstance, functionName, args, predefinedGasPrice) { let result; - let gasPrice = (await this.getGasPrice()) ?? this.convertToWei(20, 'gwei'); - let transactionRetried = false; + const gasPrice = + predefinedGasPrice ?? (await this.getGasPrice()) ?? this.convertToWei(20, 'gwei'); + let gasLimit; - while (result === undefined) { - let gasLimit; + try { + /* eslint-disable no-await-in-loop */ + gasLimit = await contractInstance.estimateGas[functionName](...args); + } catch (error) { + const decodedErrorData = this._decodeErrorData(error, contractInstance.interface); - try { - /* eslint-disable no-await-in-loop */ - gasLimit = await contractInstance.estimateGas[functionName](...args); - } catch (error) { - const decodedErrorData = this._decodeErrorData(error, contractInstance.interface); + const functionFragment = contractInstance.interface.getFunction( + error.transaction.data.slice(0, 10), + ); + const inputs = functionFragment.inputs + .map((input, i) => { + const argName = input.name; + const argValue = this._formatArgument(args[i]); + return `${argName}=${argValue}`; + }) + .join(', '); - const functionFragment = contractInstance.interface.getFunction( - error.transaction.data.slice(0, 10), - ); - const inputs = functionFragment.inputs.map( - (input, i) => `${input.name}=${args[i]}`, - ); + throw new Error( + `Gas estimation for ${functionName}(${inputs}) has failed, reason: ${decodedErrorData}`, + ); + } - throw new Error( - `Gas estimation ${functionName}(${inputs}) failed, reason: ${decodedErrorData}`, - ); + gasLimit = gasLimit ?? this.convertToWei(900, 'kwei'); + + this.logger.debug( + `Sending signed transaction ${functionName} to the blockchain ` + + `with gas limit: ${gasLimit.toString()} and gasPrice ${gasPrice.toString()}. ` + + `Transaction queue length: ${this.getTransactionQueueLength()}.`, + ); + + const tx = await contractInstance[functionName](...args, { + gasPrice, + gasLimit, + }); + + try { + result = await this.provider.waitForTransaction( + tx.hash, + TRANSACTION_CONFIRMATIONS, + TRANSACTION_POLLING_TIMEOUT_MILLIS, + ); + + if (result.status === 0) { + await this.provider.call(tx, tx.blockNumber); + } + } catch (error) { + const decodedErrorData = this._decodeErrorData(error, contractInstance.interface); + + let sigHash; + if (error.transaction) { + sigHash = error.transaction.data.slice(0, 10); + } else { + sigHash = this._getFunctionSighash(contractInstance, functionName, args); } - gasLimit = gasLimit ?? this.convertToWei(900, 'kwei'); + const functionFragment = contractInstance.interface.getFunction(sigHash); + const inputs = functionFragment.inputs + .map((input, i) => { + const argName = input.name; + const argValue = this._formatArgument(args[i]); + return `${argName}=${argValue}`; + }) + .join(', '); - this.logger.debug( - `Sending signed transaction ${functionName} to the blockchain ` + - `with gas limit: ${gasLimit.toString()} and gasPrice ${gasPrice.toString()}. ` + - `Transaction queue length: ${this.getTransactionQueueLength()}.`, + throw new Error( + `Transaction ${functionName}(${inputs}) has been reverted, reason: ${decodedErrorData}`, ); + } + return result; + } + + _getFunctionSighash(contractInstance, functionName, args) { + const functions = Object.keys(contractInstance.interface.functions) + .filter((key) => contractInstance.interface.functions[key].name === functionName) + .map((key) => ({ signature: key, ...contractInstance.interface.functions[key] })); + for (const func of functions) { try { - const tx = await contractInstance[functionName](...args, { - gasPrice, - gasLimit, - }); - result = await this.provider.waitForTransaction( - tx.hash, - TRANSACTION_CONFIRMATIONS, - TRANSACTION_POLLING_TIMEOUT_MILLIS, + // Checks if given arguments can be encoded with function ABI inputs + // may be useful for overloaded functions as it would help to find + // needed function fragment + ethers.utils.defaultAbiCoder.encode(func.inputs, args); + + const sighash = ethers.utils.hexDataSlice( + ethers.utils.keccak256(ethers.utils.toUtf8Bytes(func.signature)), + 0, + 4, ); - if (result.status === 0) { - await this.provider.call(tx, tx.blockNumber); - } + return sighash; } catch (error) { - const decodedErrorData = this._decodeErrorData(error, contractInstance.interface); - if ( - !transactionRetried && - (error.message.includes(`timeout exceeded`) || - error.message.includes(`Pool(TooLowPriority`)) - ) { - gasPrice = Math.ceil(gasPrice * 1.2); - transactionRetried = true; - } else { - throw new Error(`Transaction reverted, reason: ${decodedErrorData}`); - } + continue; } } - return result; + + throw new Error('No matching function signature found'); } _getErrorData(error) { @@ -564,7 +612,7 @@ class Web3Service { const formattedArgs = decodedCustomError.errorFragment.inputs .map((input, i) => { const argName = input.name; - const argValue = this._formatCustomErrorArgument(decodedCustomError.args[i]); + const argValue = this._formatArgument(decodedCustomError.args[i]); return `${argName}=${argValue}`; }) .join(', '); @@ -582,7 +630,7 @@ class Web3Service { return contractInterface.decodeFunctionResult(fragment, resultData); } - _formatCustomErrorArgument(value) { + _formatArgument(value) { if (value === null || value === undefined) { return 'null'; } @@ -596,12 +644,12 @@ class Web3Service { } if (Array.isArray(value)) { - return `[${value.map((v) => this._formatCustomErrorArgument(v)).join(', ')}]`; + return `[${value.map((v) => this._formatArgument(v)).join(', ')}]`; } if (typeof value === 'object') { const formattedEntries = Object.entries(value).map( - ([k, v]) => `${k}: ${this._formatCustomErrorArgument(v)}`, + ([k, v]) => `${k}: ${this._formatArgument(v)}`, ); return `{${formattedEntries.join(', ')}}`; } @@ -619,7 +667,9 @@ class Web3Service { ) { const contract = this[contractName]; if (!contract) { - throw Error(`Error while getting all past events. Unknown contract: ${contractName}`); + throw new Error( + `Error while getting all past events. Unknown contract: ${contractName}`, + ); } let fromBlock; @@ -695,7 +745,8 @@ class Web3Service { async getAssertionIdByIndex(assetContractAddress, tokenId, index) { const assetStorageContractInstance = this.assetStorageContracts[assetContractAddress.toLowerCase()]; - if (!assetStorageContractInstance) throw Error('Unknown asset storage contract address'); + if (!assetStorageContractInstance) + throw new Error('Unknown asset storage contract address'); return this.callContractFunction(assetStorageContractInstance, 'getAssertionIdByIndex', [ tokenId, @@ -706,7 +757,8 @@ class Web3Service { async getLatestAssertionId(assetContractAddress, tokenId) { const assetStorageContractInstance = this.assetStorageContracts[assetContractAddress.toString().toLowerCase()]; - if (!assetStorageContractInstance) throw Error('Unknown asset storage contract address'); + if (!assetStorageContractInstance) + throw new Error('Unknown asset storage contract address'); return this.callContractFunction(assetStorageContractInstance, 'getLatestAssertionId', [ tokenId, @@ -724,7 +776,8 @@ class Web3Service { async getAssertionIds(assetContractAddress, tokenId) { const assetStorageContractInstance = this.assetStorageContracts[assetContractAddress.toString().toLowerCase()]; - if (!assetStorageContractInstance) throw Error('Unknown asset storage contract address'); + if (!assetStorageContractInstance) + throw new Error('Unknown asset storage contract address'); return this.callContractFunction(assetStorageContractInstance, 'getAssertionIds', [ tokenId, @@ -734,7 +787,8 @@ class Web3Service { async getAssertionIdsLength(assetContractAddress, tokenId) { const assetStorageContractInstance = this.assetStorageContracts[assetContractAddress.toString().toLowerCase()]; - if (!assetStorageContractInstance) throw Error('Unknown asset storage contract address'); + if (!assetStorageContractInstance) + throw new Error('Unknown asset storage contract address'); return this.callContractFunction(assetStorageContractInstance, 'getAssertionIdsLength', [ tokenId, @@ -744,7 +798,8 @@ class Web3Service { async getKnowledgeAssetOwner(assetContractAddress, tokenId) { const assetStorageContractInstance = this.assetStorageContracts[assetContractAddress.toString().toLowerCase()]; - if (!assetStorageContractInstance) throw Error('Unknown asset storage contract address'); + if (!assetStorageContractInstance) + throw new Error('Unknown asset storage contract address'); return this.callContractFunction(assetStorageContractInstance, 'ownerOf', [tokenId]); } @@ -882,21 +937,32 @@ class Web3Service { epoch, latestStateIndex, callback, + gasPrice, ) { return this.queueTransaction( this.selectCommitManagerContract(latestStateIndex), 'submitCommit', [[assetContractAddress, tokenId, keyword, hashFunctionId, epoch]], callback, + gasPrice, ); } - submitUpdateCommit(assetContractAddress, tokenId, keyword, hashFunctionId, epoch, callback) { + submitUpdateCommit( + assetContractAddress, + tokenId, + keyword, + hashFunctionId, + epoch, + callback, + gasPrice, + ) { return this.queueTransaction( this.CommitManagerV1U1Contract, 'submitUpdateCommit', [[assetContractAddress, tokenId, keyword, hashFunctionId, epoch]], callback, + gasPrice, ); } @@ -937,12 +1003,14 @@ class Web3Service { chunkHash, latestStateIndex, callback, + gasPrice, ) { return this.queueTransaction( this.selectProofManagerContract(latestStateIndex), 'sendProof', [[assetContractAddress, tokenId, keyword, hashFunctionId, epoch, proof, chunkHash]], callback, + gasPrice, ); } From 2f6f2769ee1bb2b2c1971dea15202e0710822fe0 Mon Sep 17 00:00:00 2001 From: Uladzislau Hubar Date: Tue, 14 Nov 2023 13:14:35 +0100 Subject: [PATCH 10/11] Bumped version to 6.0.20 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index ea8847f5c5..2186691d6a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "origintrail_node", - "version": "6.0.19", + "version": "6.0.20", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "origintrail_node", - "version": "6.0.19", + "version": "6.0.20", "license": "ISC", "dependencies": { "@comunica/query-sparql": "^2.4.3", diff --git a/package.json b/package.json index 00e8d27012..6fe84eebb7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "origintrail_node", - "version": "6.0.19", + "version": "6.0.20", "description": "OTNode V6", "main": "index.js", "type": "module", From 3d12040d5e320644d34d4660bb6df3abc1847f05 Mon Sep 17 00:00:00 2001 From: Uladzislau Hubar Date: Tue, 14 Nov 2023 13:25:35 +0100 Subject: [PATCH 11/11] Increated tx polling timeout to 5 mins --- src/constants/constants.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/constants/constants.js b/src/constants/constants.js index 47f5f8f798..7f05315ec4 100644 --- a/src/constants/constants.js +++ b/src/constants/constants.js @@ -29,7 +29,7 @@ export const COMMIT_BLOCK_DURATION_IN_BLOCKS = 5; export const COMMITS_DELAY_BETWEEN_NODES_IN_BLOCKS = 2; -export const TRANSACTION_POLLING_TIMEOUT_MILLIS = 120 * 1000; +export const TRANSACTION_POLLING_TIMEOUT_MILLIS = 300 * 1000; export const SOLIDITY_ERROR_STRING_PREFIX = '0x08c379a0';