hyperledger / caliper

A blockchain benchmark framework to measure performance of multiple blockchain solutions https://wiki.hyperledger.org/display/caliper
https://hyperledger.github.io/caliper/
Apache License 2.0
650 stars 403 forks source link

Support Node 18 & 20 #1457

Closed davidkel closed 4 months ago

davidkel commented 1 year ago

node 18 LTS is due on 25th October 2022, however the build fails with 2 issues

  1. Yo generator integration tests fail
    
    ${GENERATOR_METHOD} -- --workspace 'myWorkspace' --contractId 'mymarbles' --contractVersion 'v0' --contractFunction 'queryMarblesByOwner' --contractArguments '["Alice"]' --workers 'marbles' --benchmarkName 'A name for the marbles benchmark' --benchmarkDescription 'A description for the marbles benchmark' --label 'A label for the round' --rateController 'fixed-rate' --txType 'txDuration' --txDuration 'marbles'
    node:events:491
      throw er; // Unhandled 'error' event
      ^

Error: ENOENT: no such file or directory, scandir '/home/runner/work/caliper/caliper/node_modules/@hyperledger/generator-caliper/lib/generators' at Object.readdirSync (node:fs:1446:3) at exports.readdir (/opt/hostedtoolcache/node/18.10.0/x64/lib/node_modules/yo/node_modules/@mrmlnc/readdir-enhanced/lib/sync/fs.js:18:20) at Object.safeCall [as safe] (/opt/hostedtoolcache/node/18.10.0/x64/lib/node_modules/yo/node_modules/@mrmlnc/readdir-enhanced/lib/call.js:24:8) at DirectoryReader.readNextDirectory (/opt/hostedtoolcache/node/18.10.0/x64/lib/node_modules/yo/node_modules/@mrmlnc/readdir-enhanced/lib/directory-reader.js:78:10) at DirectoryReader.stream._read (/opt/hostedtoolcache/node/18.10.0/x64/lib/node_modules/yo/node_modules/@mrmlnc/readdir-enhanced/lib/directory-reader.js:57:18) at Readable.read (node:internal/streams/readable:496:12) at readdirSync (/opt/hostedtoolcache/node/18.10.0/x64/lib/node_modules/yo/node_modules/@mrmlnc/readdir-enhanced/lib/sync/index.js:27:21) at Function.readdirSyncStat (/opt/hostedtoolcache/node/18.10.0/x64/lib/node_modules/yo/node_modules/@mrmlnc/readdir-enhanced/lib/index.js:34:10) at ReaderSync.dynamicApi (/opt/hostedtoolcache/node/18.10.0/x64/lib/node_modules/yo/node_modules/fast-glob/out/providers/reader-sync.js:64:24) at ReaderSync.api (/opt/hostedtoolcache/node/18.10.0/x64/lib/node_modules/yo/node_modules/fast-glob/out/providers/reader-sync.js:56:25) Emitted 'error' event on Readable instance at: at emitErrorNT (node:internal/streams/destroy:151:8) at emitErrorCloseNT (node:internal/streams/destroy:116:3) at process.processTicksAndRejections (node:internal/process/task_queues:82:21) { errno: -2, syscall: 'scandir', code: 'ENOENT', path: '/home/runner/work/caliper/caliper/node_modules/@hyperledger/generator-caliper/lib/generators' }

It's possible that previous versions of node report an error which Yo handles but a change means perhaps Yo misses this and throws an error now. May need to move to a newer version of Yo.

2. fisco-bcos fails

Error: Error: C017C378007F0000:error:0A000127:SSL routines:tls_construct_ctos_supported_groups:no suitable groups:../deps/openssl/openssl/ssl/statem/extensions_clnt.c:246:No groups enabled for max supported SSL/TLS version

at TLSSocket.<anonymous> (/home/runner/work/caliper/caliper/packages/caliper-fisco-bcos/lib/channelPromise.js:105:15)
at TLSSocket.emit (node:events:513:28)
at emitErrorNT (node:internal/streams/destroy:151:8)
at emitErrorCloseNT (node:internal/streams/destroy:116:3)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21)


Looks like node has changed the version of openssl again and causes problems with fisco-bcos. If we can't fix fisco-bcos then we should consider deprecating it saying that it won't work on node 18 and that it will be dropped from caliper in the next .x release and exclude it from the node 18 integration test

We will need documentation updates to confirm node 18 is supported and also the state of fisco-bcos
davidkel commented 6 months ago

see #1517 for code changes, still need doc changes

davidkel commented 4 months ago

doc updates complete see #1551