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

Update to using node lts #367

Merged
merged 2 commits into from
Feb 25, 2025
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
2 changes: 1 addition & 1 deletion .github/workflows/gh-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- name: Setup Node.js environment
uses: actions/setup-node@v4
with:
node-version: 18
node-version: lts/*

- run: yarn install

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/node-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ on:
workflow_dispatch:
inputs:
isLatest:
description: 'Add latest tag'
default: 'true'
description: "Add latest tag"
default: "true"
required: true

jobs:
Expand Down
90 changes: 45 additions & 45 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: PR
on:
pull_request:
paths-ignore:
- '.github/workflows/**'
- ".github/workflows/**"
jobs:
code-style:
name: code-style
Expand All @@ -12,53 +12,53 @@ jobs:
SUBQL_ACCESS_TOKEN_TEST: ${{ secrets.SUBQL_ACCESS_TOKEN_TEST }}
SUBQL_ORG_TEST: ${{ secrets.SUBQL_ORG_TEST }}
steps:
- uses: actions/checkout@v3
- name: Setup Node.js environment
uses: actions/setup-node@v4
with:
node-version: 18
- run: yarn
- name: build
run: yarn build
- name: code-style check
run: yarn pretty-quick --check --pattern 'packages/*/src/**/*' --branch origin/main
- name: lint
run: yarn lint
- uses: actions/checkout@v4
- name: Setup Node.js environment
uses: actions/setup-node@v4
with:
node-version: lts/*
- run: yarn
- name: build
run: yarn build
- name: code-style check
run: yarn pretty-quick --check --pattern 'packages/*/src/**/*' --branch origin/main
- name: lint
run: yarn lint

coverage:
name: Coverage report
runs-on: ubuntu-latest
services:
postgres:
image: postgres
env:
POSTGRES_PASSWORD: postgres
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
name: Coverage report
runs-on: ubuntu-latest
services:
postgres:
image: postgres
env:
DB_USER: postgres
DB_PASS: postgres
DB_DATABASE: postgres
DB_HOST: postgres
DB_PORT: 5432
steps:
- uses: actions/checkout@v4
POSTGRES_PASSWORD: postgres
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
env:
DB_USER: postgres
DB_PASS: postgres
DB_DATABASE: postgres
DB_HOST: postgres
DB_PORT: 5432
steps:
- uses: actions/checkout@v4

- name: Use Node 18
uses: actions/setup-node@v4
with:
node-version: 18
- name: Setup Node.js environment
uses: actions/setup-node@v4
with:
node-version: lts/*

- name: Installing dependencies
run: yarn install
- name: Installing dependencies
run: yarn install

- uses: artiomtr/jest-coverage-report-action@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
skip-step: install
working-directory: ${{ matrix.path }}
test-script: yarn test-jest
annotations: none
- uses: artiomtr/jest-coverage-report-action@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
skip-step: install
working-directory: ${{ matrix.path }}
test-script: yarn test-jest
annotations: none
6 changes: 3 additions & 3 deletions .github/workflows/prerelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
branches:
- main
paths-ignore:
- '.github/workflows/**'
- ".github/workflows/**"

concurrency:
group: publish
Expand All @@ -24,7 +24,7 @@ jobs:
- name: Setup Node.js environment
uses: actions/setup-node@v4
with:
node-version: 18
node-version: lts/*

- uses: marceloprado/has-changed-path@v1
id: changed-types-ethereum
Expand Down Expand Up @@ -71,6 +71,6 @@ jobs:
- name: Commit changes
uses: EndBug/add-and-commit@v5
with:
message: '[SKIP CI] Prerelease'
message: "[SKIP CI] Prerelease"
env:
GITHUB_TOKEN: ${{ secrets.REPO_TOKEN }}
7 changes: 3 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
branches:
- main
paths-ignore:
- '.github/workflows/**'
- ".github/workflows/**"
workflow_dispatch:

concurrency:
Expand All @@ -13,7 +13,6 @@ concurrency:
cancel-in-progress: false

jobs:

# This gets the commit message because workflow dispatch doesnt set: github.event.head_commit.message
pre-ci:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -50,9 +49,9 @@ jobs:
- name: Setup Node.js environment
uses: actions/setup-node@v4
with:
node-version: 18
node-version: lts/*

#Identify changes
#Identify changes
- uses: marceloprado/has-changed-path@v1
id: changed-types-ethereum
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/scripts/benchmark/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:18
FROM node:lts-alpine

# Define build-time arguments

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/sync-deps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- name: Setup Node.js environment
uses: actions/setup-node@v3
with:
node-version: 18
node-version: lts/*
- run: yarn

# Update deps
Expand Down
2 changes: 1 addition & 1 deletion deploy/k8s/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ spec:
initContainers:
- name: prepare
imagePullPolicy: IfNotPresent
image: node:14-alpine
image: node:lts-alpine
command:
- sh
- -c
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"@geut/chan": "^3.2.9",
"@octokit/request": "^8.4.1",
"@types/cron-converter": "^1",
"@types/node": "^14.18.10",
"@types/node": "^22.13.5",
"@types/node-fetch": "2.6.2",
"@typescript-eslint/eslint-plugin": "^5.10.2",
"@typescript-eslint/parser": "^5.10.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/node/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ 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]

### Fixed
- `timestamp` field missing on `Header`

### Changed
- Update header year to 2025 (#362)
- Update nestjs dependencies (#363)
- Update node core and implement blockchain service (#363)
- Upgrade to Node.js LTS (#367)

## [5.4.0] - 2025-01-28
### Changed
Expand Down
4 changes: 2 additions & 2 deletions packages/node/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Build stage
FROM node:18-alpine as builder
FROM node:lts-alpine as builder
# Set working directory
WORKDIR /app

Expand All @@ -16,7 +16,7 @@ COPY ./scripts/build.sh ./scripts/build.sh
RUN ./scripts/build.sh packages/node

# Production stage
FROM node:18-alpine
FROM node:lts-alpine

# Copy .tgz file from builder
COPY --from=builder /app/packages/node/app.tgz /app.tgz
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export class JsonRpcBatchProvider extends JsonRpcProvider {
private failedBatchCount = 0;
private batchSizeAdjustmentInterval = 10; // Adjust batch size after every 10 batches

_pendingBatchAggregator: NodeJS.Timer | null = null;
_pendingBatchAggregator: NodeJS.Timeout | null = null;
_pendingBatch: Array<{
request: { method: string; params: Array<any>; id: number; jsonrpc: '2.0' };
resolve: (result: any) => void;
Expand Down
4 changes: 2 additions & 2 deletions packages/node/src/ethereum/ethers/web/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ export function _fetchData<T = Uint8Array>(
options.headers = flatHeaders;

const runningTimeout = (function () {
let timer: NodeJS.Timer | null = null;
let timer: NodeJS.Timeout | null = null;
const promise: Promise<never> = new Promise(function (resolve, reject) {
if (timeout) {
timer = setTimeout(() => {
Expand Down Expand Up @@ -539,7 +539,7 @@ export function poll<T>(
}

return new Promise(function (resolve, reject) {
let timer: NodeJS.Timer | null = null;
let timer: NodeJS.Timeout | null = null;
let done: boolean = false;

// Returns true if cancel was successful. Unsuccessful cancel means we're already done.
Expand Down
19 changes: 14 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3617,10 +3617,12 @@ __metadata:
languageName: node
linkType: hard

"@types/node@npm:^14.18.10":
version: 14.18.51
resolution: "@types/node@npm:14.18.51"
checksum: 0960a31d2ac605763fe79c8edcee3cb48257d345ce417c019d84ff5d8cd92dd0937674814ab3f169346b4259c29f640556006bcb2c54cfb3e63fa0cf728d320e
"@types/node@npm:^22.13.5":
version: 22.13.5
resolution: "@types/node@npm:22.13.5"
dependencies:
undici-types: ~6.20.0
checksum: 8789d9bc3efd212819fd03f7bbd429901b076703e9852ccf4950c8c7cd300d5d5a05f273d0936cbaf28194485d2bd0c265a1a25390720e353a53359526c28fb3
languageName: node
linkType: hard

Expand Down Expand Up @@ -11974,7 +11976,7 @@ __metadata:
"@geut/chan": ^3.2.9
"@octokit/request": ^8.4.1
"@types/cron-converter": ^1
"@types/node": ^14.18.10
"@types/node": ^22.13.5
"@types/node-fetch": 2.6.2
"@typescript-eslint/eslint-plugin": ^5.10.2
"@typescript-eslint/parser": ^5.10.2
Expand Down Expand Up @@ -12588,6 +12590,13 @@ __metadata:
languageName: node
linkType: hard

"undici-types@npm:~6.20.0":
version: 6.20.0
resolution: "undici-types@npm:6.20.0"
checksum: b7bc50f012dc6afbcce56c9fd62d7e86b20a62ff21f12b7b5cbf1973b9578d90f22a9c7fe50e638e96905d33893bf2f9f16d98929c4673c2480de05c6c96ea8b
languageName: node
linkType: hard

"unicode-canonical-property-names-ecmascript@npm:^2.0.0":
version: 2.0.0
resolution: "unicode-canonical-property-names-ecmascript@npm:2.0.0"
Expand Down
Loading