-
Notifications
You must be signed in to change notification settings - Fork 72
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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>
- Loading branch information
1 parent
7b185ce
commit 05d2aba
Showing
12 changed files
with
264 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
src/migration/remove-duplicate-service-agreement-migration.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import BaseMigration from './base-migration.js'; | ||
|
||
class RemoveDuplicateServiceAgreementMigration extends BaseMigration { | ||
constructor(migrationName, logger, config, repositoryModuleManager, blockchainModuleManager) { | ||
super(migrationName, logger, config); | ||
this.repositoryModuleManager = repositoryModuleManager; | ||
this.blockchainModuleManager = blockchainModuleManager; | ||
} | ||
|
||
async executeMigration() { | ||
const blockchainIds = this.blockchainModuleManager.getImplementationNames(); | ||
|
||
for (const blockchainId of blockchainIds) { | ||
const incorrectServiceAgreementId = []; | ||
const duplicateTokenIdsRestult = | ||
// eslint-disable-next-line no-await-in-loop | ||
await this.repositoryModuleManager.findDuplicateServiceAgreements(blockchainId); | ||
const duplicateTokenIds = duplicateTokenIdsRestult.map((t) => t.dataValues.token_id); | ||
const findDuplicateServiceAgreements = | ||
// eslint-disable-next-line no-await-in-loop | ||
await this.repositoryModuleManager.findServiceAgreementsByTokenIds( | ||
duplicateTokenIds, | ||
blockchainId, | ||
); | ||
for (const serviceAgreement of findDuplicateServiceAgreements) { | ||
const blockchainAssertionId = | ||
// eslint-disable-next-line no-await-in-loop | ||
await this.blockchainModuleManager.getAssertionIdByIndex( | ||
blockchainId, | ||
serviceAgreement.assetStorageContractAddress, | ||
serviceAgreement.tokenId, | ||
serviceAgreement.stateIndex, | ||
); | ||
if (serviceAgreement.assertionId !== blockchainAssertionId) { | ||
incorrectServiceAgreementId.push(serviceAgreement.agreementId); | ||
} | ||
} | ||
// eslint-disable-next-line no-await-in-loop | ||
await this.repositoryModuleManager.removeServiceAgreements(incorrectServiceAgreementId); | ||
} | ||
} | ||
} | ||
export default RemoveDuplicateServiceAgreementMigration; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import BaseMigration from './base-migration.js'; | ||
|
||
class ServiceAgreementPruningMigration extends BaseMigration { | ||
constructor( | ||
migrationName, | ||
logger, | ||
config, | ||
repositoryModuleManager, | ||
blockchainModuleManager, | ||
serviceAgreementService, | ||
) { | ||
super(migrationName, logger, config); | ||
this.repositoryModuleManager = repositoryModuleManager; | ||
this.blockchainModuleManager = blockchainModuleManager; | ||
this.serviceAgreementService = serviceAgreementService; | ||
} | ||
|
||
async executeMigration() { | ||
const blockchainIds = this.blockchainModuleManager.getImplementationNames(); | ||
|
||
// eslint-disable-next-line no-await-in-loop | ||
for (const blockchainId of blockchainIds) { | ||
const assetStorageContractAddresses = | ||
// eslint-disable-next-line no-await-in-loop | ||
await this.blockchainModuleManager.getAssetStorageContractAddresses(blockchainId); | ||
|
||
// eslint-disable-next-line no-await-in-loop | ||
await this.repositoryModuleManager.removeServiceAgreementsByBlockchainAndContract( | ||
blockchainId, | ||
assetStorageContractAddresses[0], | ||
); | ||
} | ||
} | ||
} | ||
export default ServiceAgreementPruningMigration; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.