LiskArchive / lisk-sdk

🔩 Lisk software development kit
https://lisk.com
Apache License 2.0
2.72k stars 457 forks source link

blockchain:hash returns incorrect hash #9148

Closed sameersubudhi closed 7 months ago

sameersubudhi commented 7 months ago

Expected behavior

The resulting output should be correct.

Actual behavior

The resulting output is incorrect.

sameer@Sameers-MacBook-Pro logs-2023-11-22 % lisk-core blockchain:hash --data-path ~/.lisk/lisk-core/data 
e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855

sameer@Sameers-MacBook-Pro logs-2023-11-22 % lisk-core blockchain:hash --data-path ~/.lisk/lisk-core-mainnet-dryrun/data 
e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855

sameer@Sameers-MacBook-Pro logs-2023-11-22 % lisk-core blockchain:hash --data-path ~/.lisk/lisk-core-mainnet-dryrun/data/blockchain.db 
e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855

sameer@Sameers-MacBook-Pro logs-2023-11-22 % lisk-core blockchain:hash --data-path ~/.lisk/lisk-core-mainnet-dryrun                   
node:internal/process/promises:288
            triggerUncaughtException(err, true /* fromPromise */);
            ^

[Error: An exception occurred while executing a `neon::event::Channel::send` callback] {
  cause: TypeError [ERR_INVALID_ARG_TYPE]: The "data" argument must be of type string or an instance of Buffer, TypedArray, or DataView. Received an instance of Object
      at new NodeError (node:internal/errors:399:5)
      at Hash.update (node:internal/crypto/hash:109:11)
      at Iterator.<anonymous> (/Users/sameer/.nvm/versions/node/v18.16.1/lib/node_modules/lisk-core/node_modules/lisk-commander/dist/bootstrapping/commands/blockchain/hash.js:29:24)
      at Iterator.emit (node:events:513:28)
      at Iterator.emit (node:domain:489:12)
      at addChunk (node:internal/streams/readable:324:12)
      at readableAddChunk (node:internal/streams/readable:297:9)
      at Readable.push (node:internal/streams/readable:234:10)
      at /Users/sameer/.nvm/versions/node/v18.16.1/lib/node_modules/lisk-core/node_modules/@liskhq/lisk-db/iterator.js:34:22 {
    code: 'ERR_INVALID_ARG_TYPE'
  }
}

Steps to reproduce

Which version(s) does this affect? (Environment, OS, etc...)

v6.0.0