diff --git a/config/config.devnet-old.yaml b/config/config.devnet-old.yaml index b066116c1..64b35c54f 100644 --- a/config/config.devnet-old.yaml +++ b/config/config.devnet-old.yaml @@ -24,6 +24,8 @@ flags: processNfts: true collectionPropertiesFromGateway: false features: + sovereign: + enabled: false eventsNotifier: enabled: false port: 5674 diff --git a/config/config.devnet.yaml b/config/config.devnet.yaml index 48ee28c9e..d317aa722 100644 --- a/config/config.devnet.yaml +++ b/config/config.devnet.yaml @@ -20,6 +20,8 @@ flags: processNfts: true collectionPropertiesFromGateway: false features: + sovereign: + enabled: false eventsNotifier: enabled: false port: 5674 diff --git a/config/config.e2e-mocked.mainnet.yaml b/config/config.e2e-mocked.mainnet.yaml index f2ffbd055..d1a133681 100644 --- a/config/config.e2e-mocked.mainnet.yaml +++ b/config/config.e2e-mocked.mainnet.yaml @@ -5,6 +5,8 @@ api: private: true graphql: true features: + sovereign: + enabled: false dataApi: enabled: false serviceUrl: 'https://data-api.multiversx.com' diff --git a/config/config.e2e.mainnet.yaml b/config/config.e2e.mainnet.yaml index 558ff31af..a214adb53 100644 --- a/config/config.e2e.mainnet.yaml +++ b/config/config.e2e.mainnet.yaml @@ -5,6 +5,8 @@ api: private: true graphql: true features: + sovereign: + enabled: false dataApi: enabled: false serviceUrl: 'https://data-api.multiversx.com' diff --git a/config/config.mainnet.yaml b/config/config.mainnet.yaml index 0cd7f9202..ebf09434d 100644 --- a/config/config.mainnet.yaml +++ b/config/config.mainnet.yaml @@ -20,6 +20,8 @@ flags: processNfts: true collectionPropertiesFromGateway: false features: + sovereign: + enabled: false eventsNotifier: enabled: false port: 5674 diff --git a/config/config.testnet.yaml b/config/config.testnet.yaml index 13f244dc4..1c427745a 100644 --- a/config/config.testnet.yaml +++ b/config/config.testnet.yaml @@ -20,6 +20,8 @@ flags: processNfts: true collectionPropertiesFromGateway: false features: + sovereign: + enabled: false eventsNotifier: enabled: false port: 5674 diff --git a/src/common/api-config/api.config.service.ts b/src/common/api-config/api.config.service.ts index caa42d10b..75c9d7b88 100644 --- a/src/common/api-config/api.config.service.ts +++ b/src/common/api-config/api.config.service.ts @@ -327,6 +327,15 @@ export class ApiConfigService { return isCronActive; } + isSovereignActive(): boolean { + const isSovereignActiveFlag = this.configService.get('features.sovereign.enabled'); + if (isSovereignActiveFlag === undefined) { + return false; + } + + return isSovereignActiveFlag; + } + isEventsNotifierFeatureActive(): boolean { const isEventsNotifierActive = this.configService.get('features.eventsNotifier.enabled'); if (isEventsNotifierActive === undefined) { diff --git a/src/common/protocol/protocol.service.ts b/src/common/protocol/protocol.service.ts index 0a4079228..32fcca115 100644 --- a/src/common/protocol/protocol.service.ts +++ b/src/common/protocol/protocol.service.ts @@ -52,7 +52,10 @@ export class ProtocolService { result.push(i); } - result.push(metaChainShardId); + if (!this.apiConfigService.isSovereignActive()) { + result.push(metaChainShardId); + } + return result; } diff --git a/src/crons/tps/tps-warmer.service.ts b/src/crons/tps/tps-warmer.service.ts index 1994399a1..60614e5ac 100644 --- a/src/crons/tps/tps-warmer.service.ts +++ b/src/crons/tps/tps-warmer.service.ts @@ -47,7 +47,10 @@ export class TpsWarmerService { const shardCount = await this.protocolService.getShardCount(); const metaChainShardId = this.apiConfigService.getMetaChainShardId(); - const shards = [...Array.from({ length: shardCount }, (_, i) => i), metaChainShardId]; + const shards = [...Array.from({ length: shardCount }, (_, i) => i)]; + if (!this.apiConfigService.isSovereignActive()) { + shards.push(metaChainShardId); + } await Promise.all(shards.map(shardId => this.processTpsForShard(shardId))); } diff --git a/src/endpoints/tps/tps.service.ts b/src/endpoints/tps/tps.service.ts index 7e55c3dad..aca903f77 100644 --- a/src/endpoints/tps/tps.service.ts +++ b/src/endpoints/tps/tps.service.ts @@ -63,7 +63,10 @@ export class TpsService { async getTransactionCount(): Promise { const totalShards = await this.protocolService.getShardCount(); - const shardIds = [...Array.from({ length: totalShards }, (_, i) => i), this.apiConfigService.getMetaChainShardId()]; + const shardIds = [...Array.from({ length: totalShards }, (_, i) => i)]; + if (!this.apiConfigService.isSovereignActive()) { + shardIds.push(this.apiConfigService.getMetaChainShardId()); + } let totalTransactions = 0;