From a37642e827d9ab8a8a136e626df0317482cd6a1d Mon Sep 17 00:00:00 2001 From: Mariano Goldman Date: Mon, 1 Jul 2024 14:26:09 -0300 Subject: [PATCH 1/2] use node 18 for local dev --- .nvmrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.nvmrc b/.nvmrc index 58a4133d9..3c032078a 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -16.13.0 +18 From a01a737f3f7b936e042594ad9c777fd15d2d1fca Mon Sep 17 00:00:00 2001 From: Mariano Goldman Date: Mon, 1 Jul 2024 14:27:39 -0300 Subject: [PATCH 2/2] bump content-validator and other libraries --- .eslintrc.json | 13 +++++++++- .github/workflows/build.yml | 4 +-- .github/workflows/combine-prs.yml | 2 +- content/blocks-cache-amoy.csv | 0 content/blocks-cache-sepolia.csv | 0 content/package.json | 6 ++--- ...1623671909421_delete_failed_deployments.ts | 2 +- .../1626373645256_move_wearables_to_failed.ts | 2 +- ...0999792_remove_invalid_failed_wearables.ts | 2 +- ...657560713689_drop_pointer_history_table.ts | 4 +-- ...12218_drop_last_deployed_pointers_table.ts | 4 +-- content/src/service/validations/validator.ts | 5 ++-- lambdas/package.json | 4 +-- lambdas/src/utils/SmartContentClient.ts | 13 +++------- yarn.lock | 26 +++++++++++++------ 15 files changed, 52 insertions(+), 35 deletions(-) create mode 100644 content/blocks-cache-amoy.csv create mode 100644 content/blocks-cache-sepolia.csv diff --git a/.eslintrc.json b/.eslintrc.json index 036d850e1..b36bbac6b 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -17,6 +17,17 @@ "@typescript-eslint/no-inferrable-types": 0, "@typescript-eslint/no-empty-function": "off", "@typescript-eslint/no-explicit-any": "off", - "@typescript-eslint/no-floating-promises": 2 + "@typescript-eslint/no-floating-promises": 2, + "@typescript-eslint/no-non-null-assertion": "off", + "@typescript-eslint/no-unused-vars": [ + "warn", + { + "ignoreRestSiblings": true, + "argsIgnorePattern": "^_", + "varsIgnorePattern": "^_", + "caughtErrorsIgnorePattern": "^_" + } + ] + } } diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6a1a96010..9933be3c4 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -56,9 +56,9 @@ jobs: test-lambdas: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Use Node.js 18.x - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: 18.x cache: yarn diff --git a/.github/workflows/combine-prs.yml b/.github/workflows/combine-prs.yml index 208058559..08c1e17b6 100644 --- a/.github/workflows/combine-prs.yml +++ b/.github/workflows/combine-prs.yml @@ -31,7 +31,7 @@ jobs: # Steps represent a sequence of tasks that will be executed as part of the job steps: - - uses: actions/github-script@v6 + - uses: actions/github-script@v7 id: create-combined-pr name: Create Combined PR with: diff --git a/content/blocks-cache-amoy.csv b/content/blocks-cache-amoy.csv new file mode 100644 index 000000000..e69de29bb diff --git a/content/blocks-cache-sepolia.csv b/content/blocks-cache-sepolia.csv new file mode 100644 index 000000000..e69de29bb diff --git a/content/package.json b/content/package.json index 770dcab9e..b36c2ffba 100644 --- a/content/package.json +++ b/content/package.json @@ -21,13 +21,13 @@ }, "dependencies": { "@dcl/block-indexer": "^1.1.2", - "@dcl/catalyst-api-specs": "^3.2.5", + "@dcl/catalyst-api-specs": "^3.2.6", "@dcl/catalyst-contracts": "^4.4.1", "@dcl/catalyst-storage": "^4.2.0", - "@dcl/content-validator": "^5.2.0", + "@dcl/content-validator": "^5.3.0", "@dcl/crypto": "^3.4.5", "@dcl/hashing": "^3.0.4", - "@dcl/schemas": "^11.5.0", + "@dcl/schemas": "^11.10.2", "@dcl/snapshots-fetcher": "^9.0.3", "@dcl/urn-resolver": "^3.4.0", "@well-known-components/env-config-provider": "^1.2.0", diff --git a/content/src/migrations/scripts/1623671909421_delete_failed_deployments.ts b/content/src/migrations/scripts/1623671909421_delete_failed_deployments.ts index 579091128..aa0c61bca 100644 --- a/content/src/migrations/scripts/1623671909421_delete_failed_deployments.ts +++ b/content/src/migrations/scripts/1623671909421_delete_failed_deployments.ts @@ -18,4 +18,4 @@ export async function up(pgm: MigrationBuilder): Promise { ) } -export async function down(pgm: MigrationBuilder): Promise {} +export async function down(_pgm: MigrationBuilder): Promise {} diff --git a/content/src/migrations/scripts/1626373645256_move_wearables_to_failed.ts b/content/src/migrations/scripts/1626373645256_move_wearables_to_failed.ts index 67856457f..d1b135d11 100644 --- a/content/src/migrations/scripts/1626373645256_move_wearables_to_failed.ts +++ b/content/src/migrations/scripts/1626373645256_move_wearables_to_failed.ts @@ -13,4 +13,4 @@ export async function up(pgm: MigrationBuilder): Promise { ) } -export async function down(pgm: MigrationBuilder): Promise {} +export async function down(_pgm: MigrationBuilder): Promise {} diff --git a/content/src/migrations/scripts/1627050999792_remove_invalid_failed_wearables.ts b/content/src/migrations/scripts/1627050999792_remove_invalid_failed_wearables.ts index 98f88b707..1426f622c 100644 --- a/content/src/migrations/scripts/1627050999792_remove_invalid_failed_wearables.ts +++ b/content/src/migrations/scripts/1627050999792_remove_invalid_failed_wearables.ts @@ -14,4 +14,4 @@ export async function up(pgm: MigrationBuilder): Promise { ) } -export async function down(pgm: MigrationBuilder): Promise {} +export async function down(_pgm: MigrationBuilder): Promise {} diff --git a/content/src/migrations/scripts/1657560713689_drop_pointer_history_table.ts b/content/src/migrations/scripts/1657560713689_drop_pointer_history_table.ts index 3b226c9ea..25fee868a 100644 --- a/content/src/migrations/scripts/1657560713689_drop_pointer_history_table.ts +++ b/content/src/migrations/scripts/1657560713689_drop_pointer_history_table.ts @@ -1,10 +1,10 @@ import { MigrationBuilder } from 'node-pg-migrate' -export async function up(pgm: MigrationBuilder): Promise { +export async function up(_pgm: MigrationBuilder): Promise { // pgm.dropTable('pointer_history') } -export async function down(pgm: MigrationBuilder): Promise { +export async function down(_pgm: MigrationBuilder): Promise { // pgm.createTable( // 'pointer_history', // { diff --git a/content/src/migrations/scripts/1657560812218_drop_last_deployed_pointers_table.ts b/content/src/migrations/scripts/1657560812218_drop_last_deployed_pointers_table.ts index a2af68768..29b497287 100644 --- a/content/src/migrations/scripts/1657560812218_drop_last_deployed_pointers_table.ts +++ b/content/src/migrations/scripts/1657560812218_drop_last_deployed_pointers_table.ts @@ -1,10 +1,10 @@ import { MigrationBuilder } from 'node-pg-migrate' -export async function up(pgm: MigrationBuilder): Promise { +export async function up(_pgm: MigrationBuilder): Promise { // pgm.dropTable('last_deployed_pointers') } -export async function down(pgm: MigrationBuilder): Promise { +export async function down(_pgm: MigrationBuilder): Promise { // pgm.createTable( // 'last_deployed_pointers', // { diff --git a/content/src/service/validations/validator.ts b/content/src/service/validations/validator.ts index c41c44b8d..4618b2810 100644 --- a/content/src/service/validations/validator.ts +++ b/content/src/service/validations/validator.ts @@ -80,6 +80,7 @@ export async function createOnChainValidator( l2Provider: HTTPProvider ): Promise { const { env, metrics, logs, externalCalls } = components + const logger = logs.getLogger('OnChainValidator') const l1Network: 'mainnet' | 'sepolia' = env.getConfig(EnvironmentConfig.ETH_NETWORK) const l2Network = l1Network === 'mainnet' ? 'polygon' : 'amoy' @@ -119,9 +120,9 @@ export async function createOnChainValidator( const file = `blocks-cache-${networkName}.csv` try { await loadTree(tree, file, converter) - console.log(`loading snapshot for ${networkName} took ${new Date().getTime() - start} ms.`) + logger.debug(`loading snapshot for ${networkName} took ${new Date().getTime() - start} ms.`) } catch (e) { - console.log(`failed to load cache file ${file}`, e.toString()) + logger.warn(`failed to load cache file ${file}`, e.toString()) } } await warmUpCache(l1BlockSearch.tree, l1Network) diff --git a/lambdas/package.json b/lambdas/package.json index 7089650e1..6d891e768 100644 --- a/lambdas/package.json +++ b/lambdas/package.json @@ -11,9 +11,9 @@ "test": "jest --runInBand --forceExit --coverage" }, "dependencies": { - "@dcl/catalyst-api-specs": "^3.2.5", + "@dcl/catalyst-api-specs": "^3.2.6", "@dcl/crypto": "^3.4.5", - "@dcl/schemas": "^11.5.0", + "@dcl/schemas": "^11.10.2", "@dcl/urn-resolver": "^3.4.0", "@well-known-components/env-config-provider": "^1.2.0", "@well-known-components/fetch-component": "^2.0.2", diff --git a/lambdas/src/utils/SmartContentClient.ts b/lambdas/src/utils/SmartContentClient.ts index 176a29f63..ae7139f45 100644 --- a/lambdas/src/utils/SmartContentClient.ts +++ b/lambdas/src/utils/SmartContentClient.ts @@ -123,23 +123,18 @@ export class SmartContentClient implements ContentClient { return this.onlyKnownHeaders(response.headers as any) } - deployEntity(deployData: DeploymentData, fix?: boolean, options?: RequestOptions): Promise { + deployEntity(_deployData: DeploymentData, _fix?: boolean, _options?: RequestOptions): Promise { throw new Error('New deployments are currently not supported') } - deploy(deployData: DeploymentData, options?: RequestOptions): Promise { + deploy(_deployData: DeploymentData, _options?: RequestOptions): Promise { throw new Error('New deployments are currently not supported') } - buildEntity({ type, pointers, files, metadata }: BuildEntityOptions): Promise { + buildEntity(_: BuildEntityOptions): Promise { throw new Error('New deployments are currently not supported') } - buildEntityWithoutNewFiles({ - type, - pointers, - hashesByKey, - metadata - }: BuildEntityWithoutFilesOptions): Promise { + buildEntityWithoutNewFiles(_: BuildEntityWithoutFilesOptions): Promise { throw new Error('New deployments are currently not supported') } diff --git a/yarn.lock b/yarn.lock index 6f7ce0755..54edf3ad0 100644 --- a/yarn.lock +++ b/yarn.lock @@ -321,10 +321,10 @@ "@well-known-components/metrics" "^2.0.1" lru-cache "^7.14.0" -"@dcl/catalyst-api-specs@^3.2.5": - version "3.2.5" - resolved "https://registry.yarnpkg.com/@dcl/catalyst-api-specs/-/catalyst-api-specs-3.2.5.tgz#ce5cdc0c90d38108d64d9b8ea147cb3a02b29124" - integrity sha512-x6zFbYLOpcwxm+LI20aa9EB+IuLF8QYxOx5D86XgZVVGvIjHlyUVpZrkE+C/VAtQsOK3Ry80jGu7G1n0BHXw9w== +"@dcl/catalyst-api-specs@^3.2.6": + version "3.2.6" + resolved "https://registry.yarnpkg.com/@dcl/catalyst-api-specs/-/catalyst-api-specs-3.2.6.tgz#1d0d7e7803b38ed3d1de0eef83394444a825bc33" + integrity sha512-bm8bfmIsZV3QqhY3tolxYm3ljA1vxhC+lRRQkwEnjZJiXHP0aeyvkCeVZp2ZmNTskXm29LDPGo3mcCGb/qiztA== dependencies: yaml "^2.3.4" @@ -355,10 +355,10 @@ dependencies: ethers "^5.6.8" -"@dcl/content-validator@^5.2.0": - version "5.2.0" - resolved "https://registry.yarnpkg.com/@dcl/content-validator/-/content-validator-5.2.0.tgz#08ee420ebd45d11674800224d2c66d6abd3078e1" - integrity sha512-N4pri8wfWEGObo0P/F8TXl2xOoNMbhZRtbqodOTiCYDiVaw18ncbt/hyzMjYPscJtQsmRYFRuveTnzbUTsRYsg== +"@dcl/content-validator@^5.3.0": + version "5.3.0" + resolved "https://registry.yarnpkg.com/@dcl/content-validator/-/content-validator-5.3.0.tgz#8d95c96de542e409a87c7747bf5193e0385b1e18" + integrity sha512-0FugkhIy4bzWnmt7ro6Gjp+PtHhitA9HxbbaA4247A1u0et5BWn7Kp6+/kWrqTsD3X++wgONlpwGlR+Kg8YfdA== dependencies: "@dcl/block-indexer" "^1.1.1" "@dcl/content-hash-tree" "^1.1.4" @@ -385,6 +385,16 @@ resolved "https://registry.yarnpkg.com/@dcl/hashing/-/hashing-3.0.4.tgz#4df2a4cb3a8114765aed34cb57b91c93bf33bfb3" integrity sha512-Cg+MoIOn+BYmQV2q8zSFnNYY+GldlnUazwBnfgrq3i66ZxOaZ65h01btd8OUtSAlfWG4VTNIOHDjtKqmuwJNBg== +"@dcl/schemas@^11.10.2": + version "11.10.2" + resolved "https://registry.yarnpkg.com/@dcl/schemas/-/schemas-11.10.2.tgz#9085c533e79d5b7a38da0345b80759e638bcee5e" + integrity sha512-BQlyueum4n8AFQZBu07mIpyEwSGjNaIJo3++1chuxrVSWRK9UpFHv5HX/2ClzF3fyKoc/FHOpSjUwn+T3qlLHQ== + dependencies: + ajv "^8.11.0" + ajv-errors "^3.0.0" + ajv-keywords "^5.1.0" + mitt "^3.0.1" + "@dcl/schemas@^11.5.0": version "11.5.0" resolved "https://registry.yarnpkg.com/@dcl/schemas/-/schemas-11.5.0.tgz#b07fe469523348eed4d4bfde1219123c38bdb3ee"