Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[release] 20231025 #2

Merged
merged 3 commits into from
Oct 26, 2023
Merged
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
5 changes: 1 addition & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,5 @@
"prettier --write"
]
},
"packageManager": "[email protected]",
"dependencies": {
"@concordium/node-sdk": "^9.1.1"
}
"packageManager": "[email protected]"
}
3 changes: 3 additions & 0 deletions packages/common-concordium/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,6 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

## [3.1.0]
[3.1.0]: https://github.com/subquery/subql-stellar/tag/v3.1.0
3 changes: 2 additions & 1 deletion packages/common-concordium/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@subql/common-concordium",
"version": "2.2.2",
"version": "3.1.0",
"description": "",
"scripts": {
"build": "rm -rf dist && tsc -b",
Expand All @@ -13,6 +13,7 @@
"main": "dist/index.js",
"license": "GPL-3.0",
"dependencies": {
"@concordium/node-sdk": "9.4.0",
"@subql/common": "latest",
"@subql/types-concordium": "workspace:*",
"js-yaml": "^4.1.0",
Expand Down
3 changes: 3 additions & 0 deletions packages/node/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,6 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

## [3.1.0]
[3.1.0]: https://github.com/subquery/subql-stellar/tag/v3.1.0
9 changes: 5 additions & 4 deletions packages/node/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@subql/node-concordium",
"version": "2.11.1-3",
"version": "3.1.0",
"description": "",
"author": "Ian He",
"license": "GPL-3.0",
Expand All @@ -19,15 +19,16 @@
},
"dependencies": {
"@apollo/client": "3.5.8",
"@concordium/node-sdk": "9.4.0",
"@nestjs/common": "^9.4.0",
"@nestjs/core": "^9.4.0",
"@nestjs/event-emitter": "^2.0.0",
"@nestjs/platform-express": "^9.4.0",
"@nestjs/schedule": "^3.0.1",
"@subql/common": "3.1.2",
"@subql/common": "3.2.0",
"@subql/common-concordium": "workspace:*",
"@subql/node-core": "6.0.2",
"@subql/testing": "2.0.3-0",
"@subql/node-core": "6.1.1",
"@subql/testing": "2.1.0",
"@subql/types-concordium": "workspace:*",
"cacheable-lookup": "6",
"cron-converter": "^1.0.2",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,15 @@ import {
connectionPoolStateHostFunctions,
baseWorkerFunctions,
storeHostFunctions,
cacheHostFunctions,
dynamicDsHostFunctions,
IProjectUpgradeService,
HostUnfinalizedBlocks,
PoiSyncService,
InMemoryCacheService,
} from '@subql/node-core';
import { ConcordiumBlock } from '@subql/types-concordium';
import { Store } from '@subql/types-core';
import { Store, Cache } from '@subql/types-core';
import { ConcordiumApiConnection } from '../../concordium/api.connection';

import {
Expand All @@ -44,6 +46,7 @@ type IndexerWorker = IIndexerWorker & {

async function createIndexerWorker(
store: Store,
cache: Cache,
dynamicDsService: IDynamicDsService<ConcordiumProjectDs>,
unfinalizedBlocksService: IUnfinalizedBlocksService<ConcordiumBlock>,
connectionPoolState: ConnectionPoolStateManager<ConcordiumApiConnection>,
Expand All @@ -57,6 +60,7 @@ async function createIndexerWorker(
path.resolve(__dirname, '../../../dist/indexer/worker/worker.js'),
[...baseWorkerFunctions, 'initWorker'],
{
...cacheHostFunctions(cache),
...storeHostFunctions(store),
...dynamicDsHostFunctions(dynamicDsService),
unfinalizedBlocksProcess:
Expand Down Expand Up @@ -86,6 +90,7 @@ export class WorkerBlockDispatcherService
@Inject('IProjectUpgradeService')
projectUpgadeService: IProjectUpgradeService,
smartBatchService: SmartBatchService,
cacheService: InMemoryCacheService,
storeService: StoreService,
storeCacheService: StoreCacheService,
poiService: PoiService,
Expand All @@ -110,6 +115,7 @@ export class WorkerBlockDispatcherService
() =>
createIndexerWorker(
storeService.getStore(),
cacheService.getCache(),
dynamicDsService,
unfinalizedBlocksSevice,
connectionPoolState,
Expand Down
5 changes: 5 additions & 0 deletions packages/node/src/indexer/fetch.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import {
StoreCacheService,
IProjectUpgradeService,
PoiSyncService,
InMemoryCacheService,
} from '@subql/node-core';
import { ConcordiumApiConnection } from '../concordium/api.connection';
import { ConcordiumApiService } from '../concordium/api.service.concordium';
Expand All @@ -35,6 +36,7 @@ import { UnfinalizedBlocksService } from './unfinalizedBlocks.service';

@Module({
providers: [
InMemoryCacheService,
StoreService,
StoreCacheService,
{
Expand Down Expand Up @@ -82,6 +84,7 @@ import { UnfinalizedBlocksService } from './unfinalizedBlocks.service';
apiService: ConcordiumApiService,
indexerManager: IndexerManager,
smartBatchService: SmartBatchService,
cacheService: InMemoryCacheService,
storeService: StoreService,
storeCacheService: StoreCacheService,
poiService: PoiService,
Expand All @@ -98,6 +101,7 @@ import { UnfinalizedBlocksService } from './unfinalizedBlocks.service';
projectService,
projectUpgradeService,
smartBatchService,
cacheService,
storeService,
storeCacheService,
poiService,
Expand Down Expand Up @@ -130,6 +134,7 @@ import { UnfinalizedBlocksService } from './unfinalizedBlocks.service';
ApiService,
IndexerManager,
SmartBatchService,
InMemoryCacheService,
StoreService,
StoreCacheService,
PoiService,
Expand Down
4 changes: 4 additions & 0 deletions packages/node/src/indexer/sandbox.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {
hostStoreToStore,
ISubqueryProject,
ApiService,
InMemoryCacheService,
} from '@subql/node-core';
import { Store, BaseDataSource } from '@subql/types-core';
import SafeEthProvider from '../concordium/safe-api';
Expand All @@ -23,6 +24,7 @@ export class SandboxService {
private readonly apiService: ApiService,
@Inject(isMainThread ? StoreService : 'Null')
private readonly storeService: StoreService,
private readonly cacheService: InMemoryCacheService,
private readonly nodeConfig: NodeConfig,
@Inject('ISubqueryProject') private readonly project: ISubqueryProject,
) {}
Expand All @@ -32,11 +34,13 @@ export class SandboxService {
? this.storeService.getStore()
: hostStoreToStore((global as any).host); // Provided in worker.ts

const cache = this.cacheService.getCache();
const entry = this.getDataSourceEntry(ds);
let processor = this.processorCache[entry];
if (!processor) {
processor = new IndexerSandbox(
{
cache,
store,
root: this.project.root,
entry,
Expand Down
20 changes: 20 additions & 0 deletions packages/node/src/indexer/worker/woker.inMemoryCache.service.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// Copyright 2020-2023 SubQuery Pte Ltd authors & contributors
// SPDX-License-Identifier: GPL-3.0

import { isMainThread } from 'worker_threads';
import { Injectable } from '@nestjs/common';
import { HostCache, hostCacheToCache } from '@subql/node-core';
import { Cache } from '@subql/types-core';

@Injectable()
export class WorkerInMemoryCacheService {
constructor(private host: HostCache) {
if (isMainThread) {
throw new Error('Expected to be worker thread');
}
}

getCache(): Cache {
return hostCacheToCache(this.host);
}
}
6 changes: 6 additions & 0 deletions packages/node/src/indexer/worker/worker-fetch.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {
WorkerConnectionPoolStateManager,
ConnectionPoolStateManager,
NodeConfig,
InMemoryCacheService,
} from '@subql/node-core';
import { ConcordiumApiService } from '../../concordium';
import { ConcordiumApiConnection } from '../../concordium/api.connection';
Expand All @@ -21,6 +22,7 @@ import { IndexerManager } from '../indexer.manager';
import { ProjectService } from '../project.service';
import { SandboxService } from '../sandbox.service';
import { UnfinalizedBlocksService } from '../unfinalizedBlocks.service';
import { WorkerInMemoryCacheService } from './woker.inMemoryCache.service';
import { WorkerService } from './worker.service';
import { WorkerUnfinalizedBlocksService } from './worker.unfinalizedBlocks.service';

Expand Down Expand Up @@ -73,6 +75,10 @@ import { WorkerUnfinalizedBlocksService } from './worker.unfinalizedBlocks.servi
useFactory: () =>
new WorkerUnfinalizedBlocksService((global as any).host),
},
{
provide: InMemoryCacheService,
useFactory: () => new WorkerInMemoryCacheService((global as any).host),
},
],
})
export class WorkerFetchModule {}
3 changes: 3 additions & 0 deletions packages/types/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,6 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

## [3.2.0]
[3.2.0]: https://github.com/subquery/subql-stellar/tag/v3.2.0
5 changes: 3 additions & 2 deletions packages/types/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@subql/types-concordium",
"version": "2.2.4",
"version": "3.2.0",
"description": "",
"homepage": "https://github.com/subquery/subql",
"repository": "github:subquery/subql",
Expand All @@ -12,7 +12,8 @@
"main": "dist/index.js",
"license": "GPL-3.0",
"dependencies": {
"@subql/types-core": "latest"
"@subql/types-core": "latest",
"@concordium/node-sdk": "9.4.0"
},
"files": [
"src/global.d.ts",
Expand Down
Loading
Loading