Skip to content

Commit

Permalink
OriginTrail Testnet Release v6.5.1 Hotfix 1 (#3249)
Browse files Browse the repository at this point in the history
* OriginTrail Testnet prerelease v6.5.0 (#3225)

* Resolving sequelize timeout errors

* Hotfix version updated

* Updated Simulation script for LinearSum, updated dkg-evm-module package (#3215)

* Add support for BASE blockchain (#3216)

* Default config update

* Fix package path for base integration

* Add base-service implementation

* Add Hub contracts for devnet and testnet

* Version bump

* Fix baseTokenTicker in BaseService

* Update dkg.js version. Add typesrcipt dependecy for hardhat support

* Set version to 6.5.0

* OriginTrail Devnet prerelease v6.5.0  (#3218)

* Updated Simulation script for LinearSum, updated dkg-evm-module package (#3215)

* Add support for BASE blockchain (#3216)

* Default config update

* Fix package path for base integration

* Add base-service implementation

* Add Hub contracts for devnet and testnet

* Version bump

* Fix baseTokenTicker in BaseService

* Update dkg.js version. Add typesrcipt dependecy for hardhat support

* Set version to 6.5.0

---------

Co-authored-by: Uladzislau Hubar <71610423+u-hubar@users.noreply.github.com>

* Fix/get gas price in scripts (#3219)

* Update getGasPrice in set-stake

* Update set-ask getGasPrice

* Version update

---------

Co-authored-by: djordjekovac <djordje.kovacevic@origin-trail.com>
Co-authored-by: Nikola Todorovic <nikolaztodorovic26@gmail.com>
Co-authored-by: Uladzislau Hubar <71610423+u-hubar@users.noreply.github.com>

* OriginTrail Testnet Prerelease v6.5.0 (#3232)

* Updated Simulation script for LinearSum, updated dkg-evm-module package (#3215)

* Add support for BASE blockchain (#3216)

* Default config update

* Fix package path for base integration

* Add base-service implementation

* Add Hub contracts for devnet and testnet

* Version bump

* Fix baseTokenTicker in BaseService

* Update dkg.js version. Add typesrcipt dependecy for hardhat support

* Set version to 6.5.0

* OriginTrail Devnet prerelease v6.5.0  (#3218)

* Updated Simulation script for LinearSum, updated dkg-evm-module package (#3215)

* Add support for BASE blockchain (#3216)

* Default config update

* Fix package path for base integration

* Add base-service implementation

* Add Hub contracts for devnet and testnet

* Version bump

* Fix baseTokenTicker in BaseService

* Update dkg.js version. Add typesrcipt dependecy for hardhat support

* Set version to 6.5.0

---------

Co-authored-by: Uladzislau Hubar <71610423+u-hubar@users.noreply.github.com>

* Fix/get gas price in scripts (#3219)

* Update getGasPrice in set-stake

* Update set-ask getGasPrice

* Version update

* OriginTrail Devnet Release v6.5.0 (#3231)

* branch fix 2

---------

Co-authored-by: djordjekovac <djordje.kovacevic@origin-trail.com>
Co-authored-by: Nikola Todorovic <nikolaztodorovic26@gmail.com>
Co-authored-by: Uladzislau Hubar <71610423+u-hubar@users.noreply.github.com>

* OriginTrail Testnet Prerelease v6.5.1  (#3244)

* Updated Simulation script for LinearSum, updated dkg-evm-module package (#3215)

* Add support for BASE blockchain (#3216)

* Default config update

* Fix package path for base integration

* Add base-service implementation

* Add Hub contracts for devnet and testnet

* Version bump

* Fix baseTokenTicker in BaseService

* Update dkg.js version. Add typesrcipt dependecy for hardhat support

* Set version to 6.5.0

* OriginTrail Devnet prerelease v6.5.0  (#3218)

* Updated Simulation script for LinearSum, updated dkg-evm-module package (#3215)

* Add support for BASE blockchain (#3216)

* Default config update

* Fix package path for base integration

* Add base-service implementation

* Add Hub contracts for devnet and testnet

* Version bump

* Fix baseTokenTicker in BaseService

* Update dkg.js version. Add typesrcipt dependecy for hardhat support

* Set version to 6.5.0

---------

Co-authored-by: Uladzislau Hubar <71610423+u-hubar@users.noreply.github.com>

* Fix/get gas price in scripts (#3219)

* Update getGasPrice in set-stake

* Update set-ask getGasPrice

* Version update

* OriginTrail Devnet Release v6.5.0 (#3231)

* branch fix 2

* OriginTrail Devnet Release v6.5.1 (#3243)

* OriginTrail Devnet prerelease v6.5.0  (#3217)

* Updated Simulation script for LinearSum, updated dkg-evm-module package (#3215)

* Add support for BASE blockchain (#3216)

* Default config update

* Fix package path for base integration

* Add base-service implementation

* Add Hub contracts for devnet and testnet

* Version bump

* Fix baseTokenTicker in BaseService

* Update dkg.js version. Add typesrcipt dependecy for hardhat support

* Set version to 6.5.0

---------

Co-authored-by: Uladzislau Hubar <71610423+u-hubar@users.noreply.github.com>

* OriginTrail Devnet Preelease v6.5.0 (#3230)

* Update installer.sh (#3224)

- Added base blockchain integration.

Co-authored-by: Mihajlo Pavlovic <mihajlo.pavlovic@origin-trail.com>

* Base mainnet integration (#3229)

* Add hub contract

* Update set scripts

* Remove hotfix

* Update package-lock

---------

Co-authored-by: Samuel Wamala <35219064+swamala@users.noreply.github.com>

* OriginTrail Devnet Preelease v6.5.1 (#3242)

* Update installer.sh (#3224)

- Added base blockchain integration.

Co-authored-by: Mihajlo Pavlovic <mihajlo.pavlovic@origin-trail.com>

* Base mainnet integration (#3229)

* Add hub contract

* Update set scripts

* Remove hotfix

* Update package-lock

* Fixed removal of the AbortSignal event listener (#3227)

* Increasing number of service agreements considered in command and command executor  (#3241)

* Increase number of service agreements for commits fetched from DB

* Increase number of service agreements for commits fetched from DB

* Increse limit and command queue pararelism

* Add dynamic scaling factor when scheduling commits and proofs

* Migration to remove duplicate service agreements (#3240)

* Add findDuplicateServiceAgreement function

* Expand query in findDuplicateServiceAgreement function

* Add RemoveDuplicateServiceAgreementMigration

* Fix migration queries

* Migration tested and working

* version bump

* Add default connection pool to node (#3238)

* Prune corrupted service agreement (#3237)

* Add removeServiceAgreementsByBlockchainAndContract function

* Change removeServiceAgreementsByBlockchainAndContract to remove all service agreements except ones with  given contract

* Add service agreement pruning migration

* Fix epoch check scaling factor

---------

Co-authored-by: Samuel Wamala <35219064+swamala@users.noreply.github.com>
Co-authored-by: Uladzislau Hubar <71610423+u-hubar@users.noreply.github.com>

---------

Co-authored-by: Uladzislau Hubar <71610423+u-hubar@users.noreply.github.com>
Co-authored-by: Nikola Todorovic <nikolaztodorovic26@gmail.com>
Co-authored-by: Samuel Wamala <35219064+swamala@users.noreply.github.com>

---------

Co-authored-by: djordjekovac <djordje.kovacevic@origin-trail.com>
Co-authored-by: Nikola Todorovic <nikolaztodorovic26@gmail.com>
Co-authored-by: Uladzislau Hubar <71610423+u-hubar@users.noreply.github.com>
Co-authored-by: Samuel Wamala <35219064+swamala@users.noreply.github.com>

* OriginTrail Testnet Prerelease v6.5.1 Hotfix 1 (#3248)

* Updated Simulation script for LinearSum, updated dkg-evm-module package (#3215)

* Add support for BASE blockchain (#3216)

* Default config update

* Fix package path for base integration

* Add base-service implementation

* Add Hub contracts for devnet and testnet

* Version bump

* Fix baseTokenTicker in BaseService

* Update dkg.js version. Add typesrcipt dependecy for hardhat support

* Set version to 6.5.0

* OriginTrail Devnet prerelease v6.5.0  (#3218)

* Updated Simulation script for LinearSum, updated dkg-evm-module package (#3215)

* Add support for BASE blockchain (#3216)

* Default config update

* Fix package path for base integration

* Add base-service implementation

* Add Hub contracts for devnet and testnet

* Version bump

* Fix baseTokenTicker in BaseService

* Update dkg.js version. Add typesrcipt dependecy for hardhat support

* Set version to 6.5.0

---------

Co-authored-by: Uladzislau Hubar <71610423+u-hubar@users.noreply.github.com>

* Fix/get gas price in scripts (#3219)

* Update getGasPrice in set-stake

* Update set-ask getGasPrice

* Version update

* OriginTrail Devnet Release v6.5.0 (#3231)

* branch fix 2

* OriginTrail Devnet Release v6.5.1 (#3243)

* OriginTrail Devnet prerelease v6.5.0  (#3217)

* Updated Simulation script for LinearSum, updated dkg-evm-module package (#3215)

* Add support for BASE blockchain (#3216)

* Default config update

* Fix package path for base integration

* Add base-service implementation

* Add Hub contracts for devnet and testnet

* Version bump

* Fix baseTokenTicker in BaseService

* Update dkg.js version. Add typesrcipt dependecy for hardhat support

* Set version to 6.5.0

---------

Co-authored-by: Uladzislau Hubar <71610423+u-hubar@users.noreply.github.com>

* OriginTrail Devnet Preelease v6.5.0 (#3230)

* Update installer.sh (#3224)

- Added base blockchain integration.

Co-authored-by: Mihajlo Pavlovic <mihajlo.pavlovic@origin-trail.com>

* Base mainnet integration (#3229)

* Add hub contract

* Update set scripts

* Remove hotfix

* Update package-lock

---------

Co-authored-by: Samuel Wamala <35219064+swamala@users.noreply.github.com>

* OriginTrail Devnet Preelease v6.5.1 (#3242)

* Update installer.sh (#3224)

- Added base blockchain integration.

Co-authored-by: Mihajlo Pavlovic <mihajlo.pavlovic@origin-trail.com>

* Base mainnet integration (#3229)

* Add hub contract

* Update set scripts

* Remove hotfix

* Update package-lock

* Fixed removal of the AbortSignal event listener (#3227)

* Increasing number of service agreements considered in command and command executor  (#3241)

* Increase number of service agreements for commits fetched from DB

* Increase number of service agreements for commits fetched from DB

* Increse limit and command queue pararelism

* Add dynamic scaling factor when scheduling commits and proofs

* Migration to remove duplicate service agreements (#3240)

* Add findDuplicateServiceAgreement function

* Expand query in findDuplicateServiceAgreement function

* Add RemoveDuplicateServiceAgreementMigration

* Fix migration queries

* Migration tested and working

* version bump

* Add default connection pool to node (#3238)

* Prune corrupted service agreement (#3237)

* Add removeServiceAgreementsByBlockchainAndContract function

* Change removeServiceAgreementsByBlockchainAndContract to remove all service agreements except ones with  given contract

* Add service agreement pruning migration

* Fix epoch check scaling factor

---------

Co-authored-by: Samuel Wamala <35219064+swamala@users.noreply.github.com>
Co-authored-by: Uladzislau Hubar <71610423+u-hubar@users.noreply.github.com>

---------

Co-authored-by: Uladzislau Hubar <71610423+u-hubar@users.noreply.github.com>
Co-authored-by: Nikola Todorovic <nikolaztodorovic26@gmail.com>
Co-authored-by: Samuel Wamala <35219064+swamala@users.noreply.github.com>

* OriginTrail Devnet Release v6.5.1 Hotfix 1 (#3247)

* OriginTrail Devnet prerelease v6.5.0  (#3217)

* Updated Simulation script for LinearSum, updated dkg-evm-module package (#3215)

* Add support for BASE blockchain (#3216)

* Default config update

* Fix package path for base integration

* Add base-service implementation

* Add Hub contracts for devnet and testnet

* Version bump

* Fix baseTokenTicker in BaseService

* Update dkg.js version. Add typesrcipt dependecy for hardhat support

* Set version to 6.5.0

---------

Co-authored-by: Uladzislau Hubar <71610423+u-hubar@users.noreply.github.com>

* OriginTrail Devnet Preelease v6.5.0 (#3230)

* Update installer.sh (#3224)

- Added base blockchain integration.

Co-authored-by: Mihajlo Pavlovic <mihajlo.pavlovic@origin-trail.com>

* Base mainnet integration (#3229)

* Add hub contract

* Update set scripts

* Remove hotfix

* Update package-lock

---------

Co-authored-by: Samuel Wamala <35219064+swamala@users.noreply.github.com>

* OriginTrail Devnet Preelease v6.5.1 (#3242)

* Update installer.sh (#3224)

- Added base blockchain integration.

Co-authored-by: Mihajlo Pavlovic <mihajlo.pavlovic@origin-trail.com>

* Base mainnet integration (#3229)

* Add hub contract

* Update set scripts

* Remove hotfix

* Update package-lock

* Fixed removal of the AbortSignal event listener (#3227)

* Increasing number of service agreements considered in command and command executor  (#3241)

* Increase number of service agreements for commits fetched from DB

* Increase number of service agreements for commits fetched from DB

* Increse limit and command queue pararelism

* Add dynamic scaling factor when scheduling commits and proofs

* Migration to remove duplicate service agreements (#3240)

* Add findDuplicateServiceAgreement function

* Expand query in findDuplicateServiceAgreement function

* Add RemoveDuplicateServiceAgreementMigration

* Fix migration queries

* Migration tested and working

* version bump

* Add default connection pool to node (#3238)

* Prune corrupted service agreement (#3237)

* Add removeServiceAgreementsByBlockchainAndContract function

* Change removeServiceAgreementsByBlockchainAndContract to remove all service agreements except ones with  given contract

* Add service agreement pruning migration

* Fix epoch check scaling factor

---------

Co-authored-by: Samuel Wamala <35219064+swamala@users.noreply.github.com>
Co-authored-by: Uladzislau Hubar <71610423+u-hubar@users.noreply.github.com>

* OriginTrail Devnet prerelease v6.5.1 Hotfix 1 (#3246)

* Update installer.sh (#3224)

- Added base blockchain integration.

Co-authored-by: Mihajlo Pavlovic <mihajlo.pavlovic@origin-trail.com>

* Base mainnet integration (#3229)

* Add hub contract

* Update set scripts

* Remove hotfix

* Update package-lock

* Fixed removal of the AbortSignal event listener (#3227)

* Increasing number of service agreements considered in command and command executor  (#3241)

* Increase number of service agreements for commits fetched from DB

* Increase number of service agreements for commits fetched from DB

* Increse limit and command queue pararelism

* Add dynamic scaling factor when scheduling commits and proofs

* Migration to remove duplicate service agreements (#3240)

* Add findDuplicateServiceAgreement function

* Expand query in findDuplicateServiceAgreement function

* Add RemoveDuplicateServiceAgreementMigration

* Fix migration queries

* Migration tested and working

* version bump

* Add default connection pool to node (#3238)

* Prune corrupted service agreement (#3237)

* Add removeServiceAgreementsByBlockchainAndContract function

* Change removeServiceAgreementsByBlockchainAndContract to remove all service agreements except ones with  given contract

* Add service agreement pruning migration

* Fix epoch check scaling factor

* Migration fixes

---------

Co-authored-by: Samuel Wamala <35219064+swamala@users.noreply.github.com>
Co-authored-by: Uladzislau Hubar <71610423+u-hubar@users.noreply.github.com>

---------

Co-authored-by: Uladzislau Hubar <71610423+u-hubar@users.noreply.github.com>
Co-authored-by: Nikola Todorovic <nikolaztodorovic26@gmail.com>
Co-authored-by: Samuel Wamala <35219064+swamala@users.noreply.github.com>

---------

Co-authored-by: djordjekovac <djordje.kovacevic@origin-trail.com>
Co-authored-by: Nikola Todorovic <nikolaztodorovic26@gmail.com>
Co-authored-by: Uladzislau Hubar <71610423+u-hubar@users.noreply.github.com>
Co-authored-by: Samuel Wamala <35219064+swamala@users.noreply.github.com>

---------

Co-authored-by: djordjekovac <djordje.kovacevic@origin-trail.com>
Co-authored-by: Nikola Todorovic <nikolaztodorovic26@gmail.com>
Co-authored-by: Uladzislau Hubar <71610423+u-hubar@users.noreply.github.com>
Co-authored-by: Samuel Wamala <35219064+swamala@users.noreply.github.com>
  • Loading branch information
5 people authored Jul 18, 2024
1 parent 2841350 commit d698f12
Show file tree
Hide file tree
Showing 7 changed files with 49 additions and 20 deletions.
13 changes: 6 additions & 7 deletions ot-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,12 @@ class OTNode {
this.config,
);

await MigrationExecutor.executeServiceAgreementPruningMigration(
this.container,
this.logger,
this.config,
);

await this.initializeRouters();
await this.startNetworkModule();
this.startTelemetryModule();
Expand All @@ -90,13 +96,6 @@ class OTNode {
this.config,
);


MigrationExecutor.executeServiceAgreementPruningMigration(
this.container,
this.logger,
this.config,
);

MigrationExecutor.executeRemoveDuplicateServiceAgreementMigration(
this.container,
this.logger,
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "origintrail_node",
"version": "6.5.1",
"version": "6.5.1+hotfix.1",
"description": "OTNode V6",
"main": "index.js",
"type": "module",
Expand Down
2 changes: 1 addition & 1 deletion src/migration/migration-executor.js
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,7 @@ class MigrationExecutor {
await migration.migrate();
} catch (error) {
logger.error(
`Unable to execute service agreement pruning migration. Error: ${error.message}`,
`Unable to execute remove duplicate service agreement migration. Error: ${error.message}`,
);
}
}
Expand Down
21 changes: 16 additions & 5 deletions src/migration/service-agreement-pruning-migration.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,22 @@ class ServiceAgreementPruningMigration extends BaseMigration {
// eslint-disable-next-line no-await-in-loop
await this.blockchainModuleManager.getAssetStorageContractAddresses(blockchainId);

// eslint-disable-next-line no-await-in-loop
await this.repositoryModuleManager.removeServiceAgreementsByBlockchainAndContract(
blockchainId,
assetStorageContractAddresses[0],
);
const countOfServiceAgreementsToBeRemoved =
// eslint-disable-next-line no-await-in-loop
await this.repositoryModuleManager.getCountOfServiceAgreementsByBlockchainAndContract(
blockchainId,
assetStorageContractAddresses[0],
);

// removeServiceAgreementsByBlockchainAndContract deletes in batches od 100_000
const numberOfIteration = Math.ceil(countOfServiceAgreementsToBeRemoved / 100_000);
for (let i = 0; i < numberOfIteration; i += 1) {
// eslint-disable-next-line no-await-in-loop
await this.repositoryModuleManager.removeServiceAgreementsByBlockchainAndContract(
blockchainId,
assetStorageContractAddresses[0],
);
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -287,9 +287,8 @@ class ServiceAgreementRepository {
});
}


async removeServiceAgreementsByBlockchainAndContract(blockchainId, contract) {
await this.model.destroy({
async getCountOfServiceAgreementsByBlockchainAndContract(blockchainId, contract) {
await this.model.count({
where: {
blockchainId,
assetStorageContractAddress: {
Expand All @@ -298,7 +297,19 @@ class ServiceAgreementRepository {
},
});
}


async removeServiceAgreementsByBlockchainAndContract(blockchainId, contract) {
const query = `
DELETE FROM service_agreement
WHERE blockchain_id = '${blockchainId}'
AND asset_storage_contract_address = '${contract}'
LIMIT 100000;
`;
await this.model.query(query, {
type: Sequelize.QueryTypes.DELETE,
});
}

async findDuplicateServiceAgreements(blockchainId) {
return this.model.findAll({
attributes: ['token_id', [Sequelize.fn('COUNT', Sequelize.col('*')), 'count']],
Expand Down
8 changes: 8 additions & 0 deletions src/modules/repository/repository-module-manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -403,6 +403,14 @@ class RepositoryModuleManager extends BaseModuleManager {
}
}

async getCountOfServiceAgreementsByBlockchainAndContract(blockchainId, contract) {
if (this.initialized) {
return this.getRepository(
'service_agreement',
).getCountOfServiceAgreementsByBlockchainAndContract(blockchainId, contract);
}
}

async removeServiceAgreementsByBlockchainAndContract(blockchainId, contract) {
if (this.initialized) {
return this.getRepository(
Expand Down

0 comments on commit d698f12

Please sign in to comment.