Skip to content
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: 5 additions & 0 deletions .changeset/node-24-cli.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@celo/celocli": patch
---

Update minimum Node.js version requirement to >=20 and test on Node 24
5 changes: 5 additions & 0 deletions .changeset/node-24-dev-utils.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@celo/dev-utils": patch
---

Update minimum Node.js version requirement to >=20
5 changes: 5 additions & 0 deletions .changeset/node-24-viem-account-ledger.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@celo/viem-account-ledger": patch
---

Update minimum Node.js version requirement from >=18 to >=20
5 changes: 5 additions & 0 deletions .changeset/sad-aliens-tap.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@celo/wallet-base': patch
---

fix access of rawvalues
4 changes: 2 additions & 2 deletions .github/actions/sync-workspace/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ runs:
steps:
- uses: actions/setup-node@v4
with:
node-version: '20'
node-version: '24'
- name: "enable corepack for yarn"
run : sudo corepack enable yarn
shell: bash
# must call twice because of chicken and egg problem with yarn and node
- uses: actions/setup-node@v4
with:
node-version: '20'
node-version: '24'
cache: 'yarn'
- uses: actions/cache/restore@v3
id: cache_node
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/changeset-for-renovate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
steps:
- uses: actions/setup-node@v4
with:
node-version: '20'
node-version: '24'
- uses: actions/checkout@v4
- name: "Run changesets-renovate"
# when on a renovate branch which modified the package.json for a workspace this will create a changeset for those changes
Expand Down
8 changes: 5 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,16 @@ jobs:
steps:
- uses: actions/setup-node@v4
with:
node-version: '20'
node-version: '24'
- name: 'enable corepack for yarn'
run: sudo corepack enable yarn
- name: Install native build dependencies
run: sudo apt-get update && sudo apt-get install -y build-essential pkg-config libusb-1.0-0-dev libudev-dev
- uses: actions/checkout@v4
# must call twice because of chicken and egg problem with yarn and node
- uses: actions/setup-node@v4
with:
node-version: '20'
node-version: '24'
cache: 'yarn'
- name: Restore node cache
uses: actions/cache@v4
Expand Down Expand Up @@ -452,7 +454,7 @@ jobs:
- name: "Setup Node"
uses: actions/setup-node@v4
with:
node-version: 20
node-version: 24
- name: Validate Team Config
uses: suzuki-shunsuke/github-action-renovate-config-validator@v1.0.1
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
needs: release
runs-on: ['self-hosted', 'org', 'ubuntu-22-04']
container:
image: node:20-bullseye
image: node:24-bookworm
outputs:
result: '${{ steps.map.outputs.output }}'
steps:
Expand All @@ -58,7 +58,7 @@ jobs:
if: needs.release.outputs.published == 'true' && needs.prepare.outputs.result
runs-on: ['self-hosted', 'org', 'ubuntu-22-04']
container:
image: node:20-bullseye
image: node:24-bookworm
strategy:
fail-fast: false
max-parallel: 12
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/upload-celocli-executables.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
node-version: 24

- name: 'enable corepack for yarn'
run: sudo corepack enable yarn
shell: bash
# must call twice because of chicken and egg problem with yarn and node
- uses: actions/setup-node@v4
with:
node-version: 20
node-version: 24
cache: 'yarn'

- name: Install Dependencies
Expand Down Expand Up @@ -111,17 +111,17 @@ jobs:
ref: ${{ inputs.ref }}
fetch-depth: 0
fetch-tags: true
- name: Setup Node.js 20.x
- name: Setup Node.js 24.x
uses: actions/setup-node@v4
with:
node-version: 20
node-version: 24
- name: 'enable corepack for yarn'
run: corepack enable yarn
shell: bash
# must call twice because of chicken and egg problem with yarn and node
- uses: actions/setup-node@v4
with:
node-version: '20'
node-version: '24'
cache: 'yarn'
- name: Install Dependencies
shell: bash
Expand Down Expand Up @@ -184,17 +184,17 @@ jobs:
ref: main
token: ${{ env.HOMEBREW_BREW_TOKEN }}

- name: Setup Node.js 20.x
- name: Setup Node.js 24.x
uses: actions/setup-node@v4
with:
node-version: 20
node-version: 24
- name: 'enable corepack for yarn'
run: sudo corepack enable yarn
shell: bash
# must call twice because of chicken and egg problem with yarn and node
- uses: actions/setup-node@v4
with:
node-version: '20'
node-version: '24'
cache: 'yarn'
- name: Install Dependencies
shell: bash
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
22
24
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"@biomejs/biome": "2.0.5",
"@celo/typescript": "workspace:^",
"@changesets/changelog-github": "^0.5.1",
"@types/node": "18.7.16",
"@types/node": "24.0.0",
"colors": "1.4.0",
"husky": "^8.0.0",
"jest": "^29.7.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/README.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"celo-cli"
],
"engines": {
"node": ">=18"
"node": ">=20"
},
"scripts": {
"clean": "rm -f tsconfig.tsbuildinfo && rm -rf lib/ && yarn run --top-level tsc -b . --clean",
Expand Down
11 changes: 10 additions & 1 deletion packages/cli/src/commands/validatorgroup/deregister.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,15 @@ testWithAnvilL2('validatorgroup:deregister cmd', (web3: Web3) => {
})
describe('when not enough time has passed', () => {
it('shows error that wait period is not over', async () => {
// Mock Date.now() to ensure we're before the wait period ends
// This prevents flakiness on CI where real time may have passed
const validators = await kit.contracts.getValidators()
const group = await validators.getValidatorGroup(groupAddress)
const groupRequirements = await validators.getGroupLockedGoldRequirements()
const waitPeriodEnd = group.membersUpdated + groupRequirements.duration.toNumber()
const mockNow = (waitPeriodEnd - 1000) * 1000
const timeSpy = jest.spyOn(global.Date, 'now').mockImplementation(() => mockNow)

const logMock = jest.spyOn(console, 'log').mockImplementation()
logMock.mockClear()
await expect(
Expand All @@ -105,8 +114,8 @@ testWithAnvilL2('validatorgroup:deregister cmd', (web3: Web3) => {
],
]
`)
const validators = await kit.contracts.getValidators()
await expect(validators.isValidatorGroup(groupAddress)).resolves.toBe(true)
timeSpy.mockRestore()
})
})
describe('when wait duration for unlocking is over', () => {
Expand Down
6 changes: 3 additions & 3 deletions packages/cli/src/utils/checks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -610,11 +610,11 @@ class CheckBuilder {
this.withValidators(async (validators, _signer, account) => {
const group = await getValidatorGroup(await this.getClient(), account)
const [_, duration] = await validators.read.getGroupLockedGoldRequirements()
const waitPeriodEnd = group.membersUpdated.plus(bigintToBigNumber(duration)).toNumber()
const isDeregisterable = waitPeriodEnd < Date.now() / 1000
const waitPeriodEnd = group.membersUpdated.plus(bigintToBigNumber(duration))
const isDeregisterable = waitPeriodEnd.isLessThan(Date.now() / 1000)
if (!isDeregisterable) {
console.warn(
`Group will be able to be deregistered: ${new Date(waitPeriodEnd * 1000).toUTCString()}`
`Group will be able to be deregistered: ${new Date(waitPeriodEnd.multipliedBy(1000).toNumber()).toUTCString()}`
)
}
return isDeregisterable
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/standalone.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Example build command (manual):
#
# VERSION=x.y.z; docker build . --build-arg VERSION=$VERSION -t celocli-standalone:$VERSION
FROM node:20-alpine
FROM node:24-alpine
LABEL org.opencontainers.image.authors="devops@clabs.co"

# Install cli install dependencies.
Expand Down
6 changes: 3 additions & 3 deletions packages/sdk/wallets/wallet-base/src/signing-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -442,9 +442,9 @@ export function extractSignature(rawTx: string) {

function extractSignatureFromDecoded(rawValues: Uint8Array[]) {
// signature is always (for the tx we support so far) the last three elements of the array in order v, r, s,
const v = rawValues.at(-3)
const r = rawValues.at(-2)
const s = rawValues.at(-1)
const v = rawValues[rawValues.length - 3]
const r = rawValues[rawValues.length - 2]
const s = rawValues[rawValues.length - 1]
// https://github.com/wagmi-dev/viem/blob/993321689b3e2220976504e7e170fe47731297ce/src/utils/transaction/parseTransaction.ts#L281
// Account.recover cannot handle canonicalized signatures
// A canonicalized signature may have the first byte removed if its value is 0
Expand Down
2 changes: 1 addition & 1 deletion packages/viem-account-ledger/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,6 @@
"vitest": "^3.1.3"
},
"engines": {
"node": ">=18"
"node": ">=20"
}
}
18 changes: 17 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6634,6 +6634,15 @@ __metadata:
languageName: node
linkType: hard

"@types/node@npm:24.0.0":
version: 24.0.0
resolution: "@types/node@npm:24.0.0"
dependencies:
undici-types: "npm:~7.8.0"
checksum: 5e7b5184c67964cb4fa74f9fcc1f936e101d9858c9559cea75ee50558ae100f37bd4eef807d2d7fbdc413f191f74a6066f57a4d2acbd4df64f4a76b933302b52
languageName: node
linkType: hard

"@types/node@npm:^12.12.6, @types/node@npm:^12.7.1":
version: 12.20.55
resolution: "@types/node@npm:12.20.55"
Expand Down Expand Up @@ -8181,7 +8190,7 @@ __metadata:
"@celo/typescript": "workspace:^"
"@changesets/changelog-github": "npm:^0.5.1"
"@changesets/cli": "npm:^2.29.5"
"@types/node": "npm:18.7.16"
"@types/node": "npm:24.0.0"
colors: "npm:1.4.0"
husky: "npm:^8.0.0"
jest: "npm:^29.7.0"
Expand Down Expand Up @@ -17338,6 +17347,13 @@ __metadata:
languageName: node
linkType: hard

"undici-types@npm:~7.8.0":
version: 7.8.0
resolution: "undici-types@npm:7.8.0"
checksum: fcff3fbab234f067fbd69e374ee2c198ba74c364ceaf6d93db7ca267e784457b5518cd01d0d2329b075f412574205ea3172a9a675facb49b4c9efb7141cd80b7
languageName: node
linkType: hard

"unique-filename@npm:^3.0.0":
version: 3.0.0
resolution: "unique-filename@npm:3.0.0"
Expand Down
Loading