LiskArchive/lisk-migrator

Invalid v4 config.

Closed this issue · 0 comments

Expected behavior

Valid v4 config.
and lisk-migrator should include config.json.

Actual behavior

Invalid v4 config.

Steps to reproduce

  1. Add config/testnet/config.json to lisk-migrator.
  2. Then, after moving to lisk-migrator, run lisk-migrator v2.0.0-rc.0.

The following log was output.

Error: Migrated user configuration is invalid.
    at LiskMigrator.run (~/lisk-migrator/dist/index.js:98:27)
    at async LiskMigrator._run (~/lisk-migrator/node_modules/@oclif/command/lib/command.js:43:20)

Looking at the source, it seems that the following error occurs
https://github.com/LiskHQ/lisk-migrator/blob/v2.0.0-rc.0/src/utils/config.ts#L269

I used the following for config.json.
https://github.com/LiskHQ/lisk-core/blob/v4.0.0-rc.0/config/testnet/config.json

When validator.validate(applicationConfigSchema, config) is executed against the above config.json, the following error is output.

errors: [
  {
    schemaPath: '#/properties/system/required',
    keyword: 'required',
    params: [Object],
    message: "must have required property 'version'",
    dataPath: '.system'
  },
  {
    schemaPath: '#/properties/system/required',
    keyword: 'required',
    params: [Object],
    message: "must have required property 'backup'",
    dataPath: '.system'

  },
  {
    schemaPath: '#/properties/genesis/required',
    keyword: 'required',
    params: [Object],
    message: "must have required property 'bftBatchSize'",
    dataPath: '.genesis'
  }
]

The version is set to the default value and the backup is set from the v3 config.json, so there seems to be no problem, but the bftBatchSize is not set, so the error occurs.

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

Ubuntu 22.04
Node.js v18.17.1
lisk-migrator v2.0.0-rc.0