LiskArchive / lisk-sdk

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

Changing genesisConfig before running the app does not reflect #5152

Closed nazarhussain closed 10 months ago

nazarhussain commented 4 years ago

Expected behavior

If we change any configuration before running the application, it must reflect the behavior.

const {
    Application,
    genesisBlockDevnet,
} = require('lisk-sdk');

const app = new Application(genesisBlockDevnet);

app.config.genesisConfig.blockTime = 5; 

await app.run();

The above code should reflect the changed block time and forged block every 5 seconds.

Actual behavior

If we make any change to app.config.genesisConfig before running the application but after creating an application object, it does not reflect the changes. Note, this issue is only for genesisConfig not for any other configuration option.

Probable cause is the mixing of genesisConfig with constants.

https://github.com/LiskHQ/lisk-sdk/blob/5a7ec214a8c08d7c9868997a35cb895d3c668e8f/framework/src/application/application.js#L130

https://github.com/LiskHQ/lisk-sdk/blob/11806eb95f4c1c974b92d574909d90b1455062db/framework/src/application/node/node.js#L348

Since we had refactored a lot of configuration already we should also extract genesisConfig from constants.

Steps to reproduce

Runt he above given script.

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

4.0.0

shuse2 commented 10 months ago

Closing this issue since this is no longer valid