Consensys / quorum-genesis-tool

The quorum genesis tool creates genesis configs, configuration files, and keys for Hyperledger Besu, GoQuorum and Tessera.
Apache License 2.0
20 stars 18 forks source link

Fix goquorum genesis.json #35

Closed tbondarchuk closed 2 years ago

tbondarchuk commented 2 years ago

As per docs:

istanbul | Network uses IBFT or QBFT. This option is being deprecated and will be removed in a future release. Use ibft or qbft instead.

But generated goquorum genesis still contains istanbul section, plus it's missing blockperiodseconds altogether.

Was able to track it to:

https://github.com/ConsenSys/quorum-genesis-tool/blob/25d88c3f89eab0243529c170df989ccc15f8a8aa/src/lib/genesisGenerate.ts#L161

    case Consensus.ibft: {
      goquorum.config.istanbul = {
        policy: 0,
        epoch: quorumConfig.epochLength,
        ceil2Nby3Block: 0,
      };
      break;
    }
    case Consensus.qbft: {
      goquorum.config.istanbul = {
        policy: 0,
        epoch: quorumConfig.epochLength,
        ceil2Nby3Block: 0,
        testQBFTBlock: 0,
      };

while besu section is fine: https://github.com/ConsenSys/quorum-genesis-tool/blob/25d88c3f89eab0243529c170df989ccc15f8a8aa/src/lib/genesisGenerate.ts#L98

    case Consensus.ibft2: {
      besu.config.ibft2 = {
        blockperiodseconds: quorumConfig.blockperiod,
        epochlength: quorumConfig.epochLength,
        requesttimeoutseconds: quorumConfig.requestTimeout,
      };
      break;
    }
    case Consensus.qbft: {
      besu.config.qbft = {
        blockperiodseconds: quorumConfig.blockperiod,
        epochlength: quorumConfig.epochLength,
        requesttimeoutseconds: quorumConfig.requestTimeout,
      };

P.S. Also would be nice to have a new goquorum feature emptyBlockPeriodSeconds added to questionary/cli args and to generated qbft config.

Ezzahhh commented 2 years ago

https://github.com/ConsenSys/quorum-genesis-tool/releases/tag/0.2.2

Version 0.2.2 has been release with these changes, thank you for reporting the issue