js-libp2p: TypeError: uint8ArrayFromString is not a function

Lodestar broke in the docker nightly build image https://hub.docker.com/layers/chainsafe/lodestar/next/images/sha256-7b89deddd5395a3baad61aed305b5fb67e3b6ffb3fe01579b2fcb1e4d7bd821e?context=explore on start with

Aug-19 10:12:21.586 []                 info: Lodestar version=v0.28.1/master/+7/eba8c7ed (git), network=pyrmont
Aug-19 10:12:21.786 [DB]               info: Connected to LevelDB database name=/data/chain-db
Aug-19 10:12:27.765 []                 info: Initializing beacon state from anchor state slot=0, epoch=0, stateRoot=0x2bb257ca66d05a047a65fe43a5f457b674de445d917cca029efb09b3ba4758c4
TypeError: uint8ArrayFromString is not a function
    at new IdentifyService (/usr/app/node_modules/libp2p/src/identify/index.js:59:66)
    at new Libp2p (/usr/app/node_modules/libp2p/src/index.js:257:30)
    at new NodejsNode (/usr/app/node_modules/@chainsafe/lodestar/src/network/nodejs/bundle.ts:93:5)
    at Object.createNodeJsLibp2p (/usr/app/node_modules/@chainsafe/lodestar/src/network/nodejs/util.ts:62:10)
    at Object.beaconHandler [as handler] (/usr/app/node_modules/@chainsafe/lodestar-cli/src/cmds/beacon/handler.ts:78:15)

You can recreate by just running that image with the command beacon

In a dockerized build this import is incorrect, adding a console log after the import it prints that

uint8ArrayFromString = { fromString: [Function: fromString] }

https://github.com/libp2p/js-libp2p/blob/9f0582f372be9c61460bad591fdb400982716be9/src/identify/index.js#L11

CC: @wemeetagain

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 21 (21 by maintainers)

Most upvoted comments

I added hot fix for 0.30.x line to get this fixed there. Not for 0.31.x as we talked about updating to all the new stuff aka 0.32.x.

Anyway, I just added also a hot fix for in libp2p@0.31.8 that fixes this by putting uint8arrays as a dependency, as it should be