Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions config/config.devnet-old.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ flags:
processNfts: true
collectionPropertiesFromGateway: false
features:
sovereign:
enabled: false
eventsNotifier:
enabled: false
port: 5674
Expand Down
2 changes: 2 additions & 0 deletions config/config.devnet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ flags:
processNfts: true
collectionPropertiesFromGateway: false
features:
sovereign:
enabled: false
eventsNotifier:
enabled: false
port: 5674
Expand Down
2 changes: 2 additions & 0 deletions config/config.e2e-mocked.mainnet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ api:
private: true
graphql: true
features:
sovereign:
enabled: false
dataApi:
enabled: false
serviceUrl: 'https://data-api.multiversx.com'
Expand Down
2 changes: 2 additions & 0 deletions config/config.e2e.mainnet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ api:
private: true
graphql: true
features:
sovereign:
enabled: false
dataApi:
enabled: false
serviceUrl: 'https://data-api.multiversx.com'
Expand Down
2 changes: 2 additions & 0 deletions config/config.mainnet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ flags:
processNfts: true
collectionPropertiesFromGateway: false
features:
sovereign:
enabled: false
eventsNotifier:
enabled: false
port: 5674
Expand Down
2 changes: 2 additions & 0 deletions config/config.testnet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ flags:
processNfts: true
collectionPropertiesFromGateway: false
features:
sovereign:
enabled: false
eventsNotifier:
enabled: false
port: 5674
Expand Down
9 changes: 9 additions & 0 deletions src/common/api-config/api.config.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,15 @@ export class ApiConfigService {
return isCronActive;
}

isSovereignActive(): boolean {
const isSovereignActiveFlag = this.configService.get<boolean>('features.sovereign.enabled');
if (isSovereignActiveFlag === undefined) {
return false;
}

return isSovereignActiveFlag;
}

isEventsNotifierFeatureActive(): boolean {
const isEventsNotifierActive = this.configService.get<boolean>('features.eventsNotifier.enabled');
if (isEventsNotifierActive === undefined) {
Expand Down
5 changes: 4 additions & 1 deletion src/common/protocol/protocol.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,10 @@ export class ProtocolService {
result.push(i);
}

result.push(metaChainShardId);
if (!this.apiConfigService.isSovereignActive()) {
result.push(metaChainShardId);
}

return result;
}

Expand Down
5 changes: 4 additions & 1 deletion src/crons/tps/tps-warmer.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)));
}
Expand Down
5 changes: 4 additions & 1 deletion src/endpoints/tps/tps.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,10 @@ export class TpsService {

async getTransactionCount(): Promise<number> {
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;

Expand Down