Skip to content

Commit

Permalink
Sync @subql dependencies (#134)
Browse files Browse the repository at this point in the history
* Update @subql deps

* Add getBlockSize function

* Update changelog

---------

Co-authored-by: stwiname <[email protected]>
Co-authored-by: Scott Twiname <[email protected]>
  • Loading branch information
3 people authored Dec 16, 2024
1 parent db1b1a4 commit d4a98fc
Show file tree
Hide file tree
Showing 8 changed files with 50 additions and 22 deletions.
2 changes: 2 additions & 0 deletions packages/common-near/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ 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]
### Changed
- Update `@subql/common` dependency

## [4.1.5] - 2024-11-27
### Changed
Expand Down
2 changes: 1 addition & 1 deletion packages/common-near/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"main": "dist/index.js",
"license": "GPL-3.0",
"dependencies": {
"@subql/common": "^5.2.1",
"@subql/common": "^5.2.2",
"@subql/types-near": "workspace:*",
"js-yaml": "^4.1.0",
"reflect-metadata": "^0.1.13"
Expand Down
2 changes: 2 additions & 0 deletions packages/node/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ 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]
### Changed
- Update `@subql/node-core` and `@subql/common` dependencies

## [4.1.1] - 2024-12-06
### Fixed
Expand Down
4 changes: 2 additions & 2 deletions packages/node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@
"@nestjs/event-emitter": "^2.0.0",
"@nestjs/platform-express": "^9.4.0",
"@nestjs/schedule": "^3.0.1",
"@subql/common": "^5.2.1",
"@subql/common": "^5.2.2",
"@subql/common-near": "workspace:*",
"@subql/node-core": "^15.0.3",
"@subql/node-core": "^16.1.0",
"@subql/types-near": "workspace:*",
"lodash": "^4.17.21",
"near-api-js": "^2.1.4",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import { NearDatasource } from '@subql/types-near';
import { SubqueryProject } from '../../configure/SubqueryProject';
import { ApiService } from '../api.service';
import { IndexerManager } from '../indexer.manager';
import { BlockContent } from '../types';
import { BlockContent, getBlockSize } from '../types';

/**
* @description Intended to behave the same as WorkerBlockDispatcherService but doesn't use worker threads or any parallel processing
Expand Down Expand Up @@ -71,4 +71,8 @@ export class BlockDispatcherService
await this.projectService.getDataSources(block.getHeader().blockHeight),
);
}

getBlockSize(block: IBlock<BlockContent>): number {
return getBlockSize(block.block);
}
}
4 changes: 4 additions & 0 deletions packages/node/src/indexer/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,7 @@ export interface BlockContent {
}

export type BestBlocks = Record<number, HexString>;

export function getBlockSize(block: BlockContent): number {
return block.block.chunks.reduce((acc, c) => acc + c.encoded_length, 0);
}
6 changes: 5 additions & 1 deletion packages/node/src/indexer/worker/worker.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import { NearDatasource } from '@subql/types-near';
import { nearHeaderToHeader } from '../../utils/near';
import { ApiService } from '../api.service';
import { IndexerManager } from '../indexer.manager';
import { BlockContent } from '../types';
import { BlockContent, getBlockSize } from '../types';

export type FetchBlockResponse = Header;

Expand Down Expand Up @@ -61,4 +61,8 @@ export class WorkerService extends BaseWorkerService<
}
return this.indexerManager.indexBlock(block, dataSources);
}

getBlockSize(block: IBlock<BlockContent>): number {
return getBlockSize(block.block);
}
}
46 changes: 29 additions & 17 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2637,7 +2637,7 @@ __metadata:
version: 0.0.0-use.local
resolution: "@subql/common-near@workspace:packages/common-near"
dependencies:
"@subql/common": ^5.2.1
"@subql/common": ^5.2.2
"@subql/types-near": "workspace:*"
"@types/bn.js": 5.1.5
"@types/js-yaml": ^4.0.4
Expand All @@ -2650,34 +2650,35 @@ __metadata:
languageName: unknown
linkType: soft

"@subql/common@npm:5.2.1, @subql/common@npm:^5.2.1":
version: 5.2.1
resolution: "@subql/common@npm:5.2.1"
"@subql/common@npm:5.2.2, @subql/common@npm:^5.2.2":
version: 5.2.2
resolution: "@subql/common@npm:5.2.2"
dependencies:
"@subql/types-core": 2.0.0
axios: ^0.28.0
class-transformer: ^0.5.1
class-validator: ^0.14.1
form-data: ^4.0.1
js-yaml: ^4.1.0
reflect-metadata: ^0.1.14
semver: ^7.6.3
update-notifier: ^5.1.0
checksum: 362ba1409b2bd7d2bfb8aed3e2496d6a87ba4f1969a33626c323e4483329dcbb11d866186c2f6794121e2ffc9c796c977f81d3f877a53aa9c6cb88228a945f92
checksum: 91db322edee27860ef82a6a3a16413662543ed5f951720ddf9eb1617d9a172878cf0d5c89933edad03c6d3c22eee25c31799cd054fae934a4afbf606ac5ba3bd
languageName: node
linkType: hard

"@subql/node-core@npm:^15.0.3":
version: 15.0.3
resolution: "@subql/node-core@npm:15.0.3"
"@subql/node-core@npm:^16.1.0":
version: 16.1.0
resolution: "@subql/node-core@npm:16.1.0"
dependencies:
"@apollo/client": ^3.11.2
"@nestjs/common": ^9.4.0
"@nestjs/event-emitter": ^2.0.0
"@nestjs/schedule": ^3.0.1
"@subql/common": 5.2.1
"@subql/common": 5.2.2
"@subql/testing": 2.2.2
"@subql/types": 3.11.4
"@subql/utils": 2.16.0
"@subql/utils": 2.17.0
"@willsoto/nestjs-prometheus": ^5.4.0
async-mutex: ^0.5.0
cron-converter: ^2.0.1
Expand All @@ -2694,7 +2695,7 @@ __metadata:
toposort-class: ^1.0.1
vm2: ^3.9.19
yargs: ^16.2.0
checksum: 22749eb41145348720df46acb9ed18c186292b357c4989e9f97870ece848431db6cc492016dfdc698b38679f077add496a63e7928570253ec785583495f29853
checksum: 470bd98966674d7102815a4c8595f35b3e8c1351a3f52cce0e49469b3f1f49ea6d98dcc0898e491b239bf14864e50b54a79c97ba843af65f052340dc8e098a60
languageName: node
linkType: hard

Expand All @@ -2709,9 +2710,9 @@ __metadata:
"@nestjs/schedule": ^3.0.1
"@nestjs/schematics": ^9.2.0
"@nestjs/testing": ^9.4.0
"@subql/common": ^5.2.1
"@subql/common": ^5.2.2
"@subql/common-near": "workspace:*"
"@subql/node-core": ^15.0.3
"@subql/node-core": ^16.1.0
"@subql/types-near": "workspace:*"
"@types/express": ^4.17.13
"@types/jest": ^27.4.0
Expand Down Expand Up @@ -2769,9 +2770,9 @@ __metadata:
languageName: node
linkType: hard

"@subql/utils@npm:2.16.0":
version: 2.16.0
resolution: "@subql/utils@npm:2.16.0"
"@subql/utils@npm:2.17.0":
version: 2.17.0
resolution: "@subql/utils@npm:2.17.0"
dependencies:
"@polkadot/util": ^13.2.3
"@polkadot/util-crypto": ^13.2.3
Expand All @@ -2784,7 +2785,7 @@ __metadata:
lodash: ^4.17.21
pino: ^6.13.3
rotating-file-stream: ^3.2.3
checksum: eac50f5dc72f07ea13eba2d34bae157f8b608eb1ca884b0890b6c57a08c1b51e49974028b27a5ec3109f707e6f2ea6656426ff4feed84596170c7bd4a40177cf
checksum: 3993ff46b8789201a64904089ddf512bf3f22a7eb126e5a36b750fef756c33a34a8dca2c751be3137024157dff2b012d49bbb79df85ef5d7eca5dec6c5118bcc
languageName: node
linkType: hard

Expand Down Expand Up @@ -5920,6 +5921,17 @@ __metadata:
languageName: node
linkType: hard

"form-data@npm:^4.0.1":
version: 4.0.1
resolution: "form-data@npm:4.0.1"
dependencies:
asynckit: ^0.4.0
combined-stream: ^1.0.8
mime-types: ^2.1.12
checksum: ccee458cd5baf234d6b57f349fe9cc5f9a2ea8fd1af5ecda501a18fd1572a6dd3bf08a49f00568afd995b6a65af34cb8dec083cf9d582c4e621836499498dd84
languageName: node
linkType: hard

"forwarded@npm:0.2.0":
version: 0.2.0
resolution: "forwarded@npm:0.2.0"
Expand Down

0 comments on commit d4a98fc

Please sign in to comment.